section .text

.globl Touch
Touch:
entry:
    push rbp
    mov rbp, rsp
    push rbx
    push rsi
    sub rsp, 32
    mov r10, 0
    mov rbx, 0
    mov [rbp+1], rbx
    mov r10, 0
    mov rbx, 0
    mov [rbp+2], rbx
    mov [rbp+2], rcx
    mov r10, 0
    mov rbx, 0
    mov [rbp+3], rbx
    mov r10, [rbp+2]
    mov rbx, [rbp+2]
    add rbx, 1
    mov rsi, rbx
    mov [rbp+3], rsi
    mov r10, [rbp+1]
    mov rbx, [rbp+1]
    mov rax, [rbp+1]
    add rsp, 32
    pop rsi
    pop rbx
    pop rbp
    ret _

.globl main
main:
entry:
    push rbp
    mov rbp, rsp
    push rbx
    sub rsp, 8
    mov r10, 0
    mov rbx, 0
    mov [rbp+1], rbx
    mov rcx, 41
    sub rsp, 32
    call Touch
    add rsp, 32
    mov rbx, rax
    lea rcx, .pb.str.0
    sub rsp, 32
    call bestof_console_write_cstr
    add rsp, 32
    sub rsp, 32
    call bestof_console_writeln
    add rsp, 32
    mov rcx, 1
    sub rsp, 32
    call bestof_sleep_ms
    add rsp, 32
    sub rsp, 32
    call bestof_waitkey
    add rsp, 32
    mov rbx, rax
    mov r10, 42
    mov rbx, 42
    mov [rbp+1], rbx
    mov r10, [rbp+1]
    mov rbx, [rbp+1]
    mov rax, [rbp+1]
    add rsp, 8
    pop rbx
    pop rbp
    ret _

