memcmp32:
        mov    %rbp, %rcx
        mov    %rdi, %rdx
        sub    $16, %rdx
        mov    %rdx, %rbp
        add    $40, %rdi
        add    $32, %rdx
        mov    %rcx, (%rdx)

        mov    12(%rbp), %ecx # ecx = size

        mov    4(%rbp), %eax # offset1
        mov    (%rbp), %ebx # mem
        add    %ebx, %eax
        add    %ecx, %eax
        shl    $2, %eax # eax = eax * 4
        mov    %rax, %rdi # edi = &(mem + offset1 + size)
        add    %rsi, %rdi

        mov    8(%rbp), %edx # offset2
        add    %edx, %ebx # mem
        add    %ecx, %ebx
        shl    $2, %ebx # ebx = ebx * 4
        mov    %rbx, %rdx # edx = &(mem + offset2 + size)
        add    %rsi, %rdx

memcmp32_loop:
        mov    (%rdi), %eax
        mov    (%rdx), %ebx
        cmp    %ebx, %eax
        jg     memcmp32_negone
        jl     memcmp32_one
        sub    $4, %rdi
        sub    $4, %rdx
        dec    %ecx
        jge    memcmp32_loop

        # the memory is equal

        xor    %eax, %eax
        jmp    memcmp32_return

memcmp32_negone:
        mov    $1, %eax
        neg    %eax
        jmp    memcmp32_return

memcmp32_one:
        mov    $1, %eax

memcmp32_return:
# memcmp32 RETURN 1
# (stack-set-n 0)
        mov    %eax, (%rbp)
# = OPERATOR 0

# (function-end 8)
        mov    %rbp, %rdi
        add    $4, %rdi
        add    $32, %rbp
        mov    (%rbp), %rbp
# (return)
        ret   
