// File: /workspace/github_c_makefile_star2_O0/OhYee[P]computer_application_programming_experiment/utils/free/test/test_free.c
// Function: main
int  main() {
    boolean pass = T;

    mp_init(16 * sizeof(int), &err);

    int *array_1 = (int *)mp_new(sizeof(int) * 8);
    for (int i = 0; i < 8; ++i) {
        array_1[i] = i;
    }

    int *array_2 = (int *)mp_new(sizeof(int) * 8);
    for (int i = 0; i < 8; ++i) {
        array_2[i] = 10 + i;
    }

    int *array_3 = (int *)mp_new(sizeof(int) * 8);
    if (array_3 != NULL) {
        pass = F;
        print_err("want error, but it seems works good.\n");
    }

    for (int i = 0; i < 8; ++i) {
        if (array_1[i] != i) {
            pass = F;
            print_err("array_1[%d] = %d, excepted %d\n", i, array_1[i], i);
        }
    }
    for (int i = 0; i < 8; ++i) {
        if (array_2[i] != 10 + i) {
            pass = F;
            print_err("array_2[%d] = %d, excepted %d\n", i, array_2[i], 10 + i);
        }
    }

    if (pass) {
        print_ok("All testcase passed\n");
        return 0;
    } else {
        print_err("Some error\n");
        return 1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl $0x0, -0x4(%rbp)
leaq 0x75e(%rip), %rax       # 0x2004
movl (%rax), %eax
movl %eax, -0x8(%rbp)
movl $0x40, %edi
leaq -0x37(%rip), %rsi       # 0x1880
callq 0x14a0
movl $0x20, %edi
callq 0x17b0
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jge 0x18f0
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x18d1
movl $0x20, %edi
callq 0x17b0
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x8, -0x24(%rbp)
jge 0x1927
movl -0x24(%rbp), %edx
addl $0xa, %edx
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1905
movl $0x20, %edi
callq 0x17b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1956
leaq 0x6c5(%rip), %rax       # 0x2008
movl (%rax), %eax
movl %eax, -0x8(%rbp)
leaq 0x806(%rip), %rdi       # 0x2155
movb $0x0, %al
callq 0x1310
movl $0x0, -0x34(%rbp)
cmpl $0x8, -0x34(%rbp)
jge 0x19ab
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x34(%rbp), %eax
je 0x199e
leaq 0x68e(%rip), %rax       # 0x2008
movl (%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x34(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movl -0x34(%rbp), %ecx
leaq 0x7e4(%rip), %rdi       # 0x217b
movb $0x0, %al
callq 0x1310
jmp 0x19a0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x195d
movl $0x0, -0x38(%rbp)
cmpl $0x8, -0x38(%rbp)
jge 0x1a08
movq -0x20(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl -0x38(%rbp), %ecx
addl $0xa, %ecx
cmpl %ecx, %eax
je 0x19fb
leaq 0x634(%rip), %rax       # 0x2008
movl (%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x38(%rbp), %esi
movq -0x20(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movl -0x38(%rbp), %ecx
addl $0xa, %ecx
leaq 0x7a6(%rip), %rdi       # 0x219a
movb $0x0, %al
callq 0x1310
jmp 0x19fd
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x19b2
cmpl $0x0, -0x8(%rbp)
je 0x1a25
leaq 0x7a4(%rip), %rdi       # 0x21b9
movb $0x0, %al
callq 0x13d0
movl $0x0, -0x4(%rbp)
jmp 0x1a3a
leaq 0x7a2(%rip), %rdi       # 0x21ce
movb $0x0, %al
callq 0x1310
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq