; generated by PBXA64
global main
global __pb_print_long
global __pb_print_cstr
global __pb_sleep_millis
global pb_veh_handler
global __pb_routine_PBMAIN
extern __imp_ExitProcess
extern __imp_GetStdHandle
extern __imp_WriteFile
extern __imp_wsprintfA
extern __imp_lstrlenA
extern __imp_Sleep
extern __imp_AddVectoredExceptionHandler
extern __imp_TlsAlloc

section .text
main:
    sub rsp, 40
    xor ecx, ecx
    lea rdx, qword ptr [rip + pb_veh_handler]
    call qword ptr [rip + __imp_AddVectoredExceptionHandler]
    call __pb_routine_PBMAIN
    mov rcx, rax
    call qword ptr [rip + __imp_ExitProcess]
    xor eax, eax
    add rsp, 40
    ret
pb_veh_handler:
    xor eax, eax
    ret
__pb_print_long:
    push rbx
    push rbp
    mov rbp, rsp
    sub rsp, 80
    mov r8, rcx
    lea rcx, qword ptr [rsp + 48]
    lea rdx, qword ptr [rip + __pb_fmt_i64_nl]
    call qword ptr [rip + __imp_wsprintfA]
    mov rbx, rax
    mov rcx, -11
    call qword ptr [rip + __imp_GetStdHandle]
    mov rcx, rax
    lea rdx, qword ptr [rsp + 48]
    mov r8, rbx
    lea r9, qword ptr [rsp + 40]
    mov dword ptr [rsp + 40], 0
    mov qword ptr [rsp + 32], 0
    call qword ptr [rip + __imp_WriteFile]
    mov rsp, rbp
    pop rbp
    pop rbx
    ret
__pb_print_cstr:
    push rbx
    sub rsp, 48
    mov rbx, rcx
    mov rcx, rbx
    call qword ptr [rip + __imp_lstrlenA]
    mov r8, rax
    mov rcx, -11
    call qword ptr [rip + __imp_GetStdHandle]
    mov rcx, rax
    mov rdx, rbx
    lea r9, qword ptr [rsp + 40]
    mov dword ptr [rsp + 40], 0
    mov qword ptr [rsp + 32], 0
    call qword ptr [rip + __imp_WriteFile]
    mov rcx, -11
    call qword ptr [rip + __imp_GetStdHandle]
    mov rcx, rax
    lea rdx, qword ptr [rip + __pb_crlf]
    mov r8, 2
    lea r9, qword ptr [rsp + 40]
    mov dword ptr [rsp + 40], 0
    mov qword ptr [rsp + 32], 0
    call qword ptr [rip + __imp_WriteFile]
    add rsp, 48
    pop rbx
    ret
__pb_sleep_millis:
    sub rsp, 40
    call qword ptr [rip + __imp_Sleep]
    xor eax, eax
    add rsp, 40
    ret
__pb_routine_PBMAIN:
L0:
    push rbp
    mov rbp, rsp
    push rbx
    push rsi
    sub rsp, 32
    lea r9, dword ptr [rbp + -24]
    xor rax, rax
    mov qword ptr [r9 + 0], rax
    lea rsi, dword ptr [rbp + -32]
    xor rcx, rcx
    mov qword ptr [rsi + 0], rcx
    mov rax, 24
    mov rcx, 4
    cqo
    idiv rcx
    mov rax, rdx
    mov qword ptr [rsi + 0], rax
    mov rax, qword ptr [rsi + 0]
    xor r8, r8
    cmp rax, r8
    sete rcx
    movzx rcx, rcx
    test rcx, rcx
    jne L2
    jmp L3
L1:
    xor rbx, rbx
    mov qword ptr [r9 + 0], rbx
    mov rcx, qword ptr [r9 + 0]
    mov rax, rcx
    add rsp, 32
    pop rsi
    pop rbx
    pop rbp
    ret
L2:
    mov rcx, 1
    mov qword ptr [rsi + 0], rcx
    jmp L1
L3:
    mov rcx, 1
    cmp rax, rcx
    sete rcx
    movzx rcx, rcx
    test rcx, rcx
    jne L4
    jmp L5
L4:
    mov rcx, 2
    mov qword ptr [rsi + 0], rcx
    jmp L1
L5:
    mov rcx, 2
    cmp rax, rcx
    sete rax
    movzx rax, rax
    test rax, rax
    jne L6
    jmp L7
L6:
    mov rax, 3
    mov qword ptr [rsi + 0], rax
    jmp L1
L7:
    jmp L8
L8:
    mov rax, 4
    mov qword ptr [rsi + 0], rax
    jmp L1

section .rdata
__pb_fmt_i64_nl:
    db 37, 73, 54, 52, 100, 13, 10, 0
__pb_crlf:
    db 13, 10
