// File: /workspace/github_c_makefile_star2_O0/codeniko[P]CS214-Malloc-Free/main.c
// Function: main
void main()
{
        printf("mallocing p 25000\n");
        void *p = malloc(25000);
        printf("p 25000 '%p'\n", p);
        printf("mallocing p2 1000\n");
        void *p2 = malloc(1000);
        printf("p2 1000 '%p'\n", p2);
        printf("mallocing p4 should be success 20000\n");
        void *p4 = malloc(20000);
        printf("p4 20000 '%p'\n", p4);
        printf("Freeing p4\n");
        free(p4);

        printf("mallocing p3 6000\n");
        void *p3 = malloc(6000);
        printf("p3 6000 '%p'\n", p3);
        printf("mallocing p4 20000\n");
        p4 = malloc(20000);
        printf("p4 20000 '%p'\n", p4);

        printf("Freeing p\n");
        free(p);
        printf("Freeing p2\n");
        free(p2);
        printf("Freeing p3\n");
        free(p3);
        printf("Freeing p4\n");
        free(p4);
        printf("Freeing p3\n");
        free(p3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0xea5(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1030
movl $0x61a8, %edi           # imm = 0x61A8
leaq 0xea5(%rip), %rsi       # 0x2017
movl $0x7, %edx
callq 0x1360
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rsi
leaq 0xe93(%rip), %rdi       # 0x201e
movb $0x0, %al
callq 0x1030
leaq 0xe93(%rip), %rdi       # 0x202c
movb $0x0, %al
callq 0x1030
movl $0x3e8, %edi            # imm = 0x3E8
leaq 0xe6b(%rip), %rsi       # 0x2017
movl $0xa, %edx
callq 0x1360
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq 0xe7a(%rip), %rdi       # 0x203f
movb $0x0, %al
callq 0x1030
leaq 0xe7a(%rip), %rdi       # 0x204d
movb $0x0, %al
callq 0x1030
movl $0x4e20, %edi           # imm = 0x4E20
leaq 0xe31(%rip), %rsi       # 0x2017
movl $0xd, %edx
callq 0x1360
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0xe74(%rip), %rdi       # 0x2073
movb $0x0, %al
callq 0x1030
leaq 0xe75(%rip), %rdi       # 0x2082
movb $0x0, %al
callq 0x1030
movq -0x18(%rbp), %rdi
leaq 0xdf8(%rip), %rsi       # 0x2017
movl $0x10, %edx
callq 0x1560
leaq 0xe5e(%rip), %rdi       # 0x208e
movb $0x0, %al
callq 0x1030
movl $0x1770, %edi           # imm = 0x1770
leaq 0xdd4(%rip), %rsi       # 0x2017
movl $0x13, %edx
callq 0x1360
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rsi
leaq 0xe45(%rip), %rdi       # 0x20a1
movb $0x0, %al
callq 0x1030
leaq 0xe45(%rip), %rdi       # 0x20af
movb $0x0, %al
callq 0x1030
movl $0x4e20, %edi           # imm = 0x4E20
leaq 0xd9a(%rip), %rsi       # 0x2017
movl $0x16, %edx
callq 0x1360
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0xddd(%rip), %rdi       # 0x2073
movb $0x0, %al
callq 0x1030
leaq 0xe1f(%rip), %rdi       # 0x20c3
movb $0x0, %al
callq 0x1030
movq -0x8(%rbp), %rdi
leaq 0xd61(%rip), %rsi       # 0x2017
movl $0x1a, %edx
callq 0x1560
leaq 0xe07(%rip), %rdi       # 0x20ce
movb $0x0, %al
callq 0x1030
movq -0x10(%rbp), %rdi
leaq 0xd3e(%rip), %rsi       # 0x2017
movl $0x1c, %edx
callq 0x1560
leaq 0xdf0(%rip), %rdi       # 0x20da
movb $0x0, %al
callq 0x1030
movq -0x20(%rbp), %rdi
leaq 0xd1b(%rip), %rsi       # 0x2017
movl $0x1e, %edx
callq 0x1560
leaq 0xd75(%rip), %rdi       # 0x2082
movb $0x0, %al
callq 0x1030
movq -0x18(%rbp), %rdi
leaq 0xcf8(%rip), %rsi       # 0x2017
movl $0x20, %edx
callq 0x1560
leaq 0xdaa(%rip), %rdi       # 0x20da
movb $0x0, %al
callq 0x1030
movq -0x20(%rbp), %rdi
leaq 0xcd5(%rip), %rsi       # 0x2017
movl $0x22, %edx
callq 0x1560
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)