// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Test.c
// Function: TestMemory
static void TestMemory(void)
{
    printf("\nMEMORY TESTS ------------------------------------------\n\n");

    try
    {
        void *  p;

        printf("-->%2d: Out of memory?\n", testNum++);
        p = malloc(INT_MAX);    /* calloc() and realloc() are similar */
    }
    catch (OutOfMemoryError, e)
    {
        printf("%s\n", e->getMessage());
    }
    finally;
    printf("\n");

    try
    {
        void *  p;

        printf("-->%2d: Out of memory?\n", testNum++);
        p = new(int[INT_MAX/4]);
    }
    catch (OutOfMemoryError, e)
    {
        printf("%s\n", e->getMessage());
    }
    finally;
    printf("\n");

    try
    {
        void *  p;

        printf("-->%2d: Not out of memory?\n", testNum++);
        p = new(int);
    }
    catch (OutOfMemoryError, e)
    {
        printf("%s\n", e->getMessage());
    }
    finally
    {
        printf("Enough memory left.\n");
    }
    printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x55f4(%rip), %rdi      # 0xa8f9
callq 0x1070
leaq 0x8f5f(%rip), %rbp      # 0xe270
movq (%rbp), %rdi
leaq 0x50fc(%rip), %rbx      # 0xa418
movl $0x188, %edx            # imm = 0x188
movq %rbx, %rsi
callq 0x14e8
leaq 0x9004(%rip), %r14      # 0xe334
leaq 0x8dc9(%rip), %r15      # 0xe100
pushq $0x1
popq %r13
movq (%rbp), %rdi
callq 0x1290
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x188, %ecx            # imm = 0x188
callq 0x1b23
testl %eax, %eax
je 0x537b
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
je 0x537b
addq $0x8, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
je 0x53e1
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x18f, %r8d            # imm = 0x18F
callq 0x1bb7
testl %eax, %eax
je 0x5422
movq (%r12), %rax
cmpl $0x0, 0x1b4(%rax)
je 0x5422
movq %r12, %rdi
movq %r15, %rsi
callq 0x1867
testl %eax, %eax
je 0x5422
movq 0x8(%r12), %rdi
movl %r13d, %esi
callq 0x1f02
movq (%r12), %rcx
movl $0x2, 0x1b8(%rcx)
callq *0x1e0(%rax)
movq %rax, %rdi
callq 0x1070
jmp 0x5422
movq (%r12), %rax
movl $0x1, 0x1b8(%rax)
movl 0x8e6b(%rip), %esi      # 0xe260
movl %esi, %eax
incl %eax
movl %eax, 0x8e61(%rip)      # 0xe260
xorl %eax, %eax
leaq 0x5158(%rip), %rdi      # 0xa560
callq 0x1080
movq %r12, %rdi
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %rbx, %rdx
movl $0x18d, %ecx            # imm = 0x18D
callq 0x2112
cmpl $0x0, 0x8f0b(%rip)      # 0xe334
je 0x533b
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
jne 0x5462
addq $0xd0, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
jne 0x5462
movq (%r12), %rax
movl $0x1, 0x1b4(%rax)
jmp 0x533b
movq (%rbp), %rdi
callq 0x1290
movq (%rax), %rax
movl $0x3, 0x1b8(%rax)
movq (%rbp), %rdi
callq 0x1290
movq (%rax), %rax
cmpl $0x0, 0x1b4(%rax)
jg 0x549a
movq (%rbp), %rdi
callq 0x18d5
testl %eax, %eax
je 0x54bc
movq (%rbp), %rdi
callq 0x1290
movq (%rax), %rax
movl 0x1b4(%rax), %ecx
movl %ecx, %edx
decl %edx
movl %edx, 0x1b4(%rax)
testl %ecx, %ecx
jg 0x549a
jmp 0x5478
pushq $0xa
popq %rdi
callq 0x1050
movq (%rbp), %rdi
leaq 0x4f49(%rip), %rbx      # 0xa418
movl $0x196, %edx            # imm = 0x196
movq %rbx, %rsi
callq 0x14e8
leaq 0x8e55(%rip), %r14      # 0xe338
leaq 0x8c16(%rip), %r15      # 0xe100
pushq $0x1
popq %r13
movq (%rbp), %rdi
callq 0x1290
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x196, %ecx            # imm = 0x196
callq 0x1b23
testl %eax, %eax
je 0x552e
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
je 0x552e
addq $0x8, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
je 0x5594
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x19d, %r8d            # imm = 0x19D
callq 0x1bb7
testl %eax, %eax
je 0x55d9
movq (%r12), %rax
cmpl $0x0, 0x1b4(%rax)
je 0x55d9
movq %r12, %rdi
movq %r15, %rsi
callq 0x1867
testl %eax, %eax
je 0x55d9
movq 0x8(%r12), %rdi
movl %r13d, %esi
callq 0x1f02
movq (%r12), %rcx
movl $0x2, 0x1b8(%rcx)
callq *0x1e0(%rax)
movq %rax, %rdi
callq 0x1070
jmp 0x55d9
movq (%r12), %rax
movl $0x1, 0x1b8(%rax)
movl 0x8cb8(%rip), %esi      # 0xe260
movl %esi, %eax
incl %eax
movl %eax, 0x8cae(%rip)      # 0xe260
xorl %eax, %eax
leaq 0x4fa5(%rip), %rdi      # 0xa560
callq 0x1080
movq %r12, %rdi
movl %r13d, %esi
movl $0x7ffffffc, %edx       # imm = 0x7FFFFFFC
movq %rbx, %rcx
movl $0x19b, %r8d            # imm = 0x19B
callq 0x20c8
cmpl $0x0, 0x8d58(%rip)      # 0xe338
je 0x54ee
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
jne 0x5619
addq $0xd0, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
jne 0x5619
movq (%r12), %rax
movl $0x1, 0x1b4(%rax)
jmp 0x54ee
movq (%rbp), %rdi
callq 0x1290
movq (%rax), %rax
movl $0x3, 0x1b8(%rax)
movq (%rbp), %rdi
callq 0x1290
movq (%rax), %rax
cmpl $0x0, 0x1b4(%rax)
jg 0x5651
movq (%rbp), %rdi
callq 0x18d5
testl %eax, %eax
je 0x5673
movq (%rbp), %rdi
callq 0x1290
movq (%rax), %rax
movl 0x1b4(%rax), %ecx
movl %ecx, %edx
decl %edx
movl %edx, 0x1b4(%rax)
testl %ecx, %ecx
jg 0x5651
jmp 0x562f
pushq $0xa
popq %rdi
callq 0x1050
movq (%rbp), %rdi
leaq 0x4d92(%rip), %rbx      # 0xa418
movl $0x1a4, %edx            # imm = 0x1A4
movq %rbx, %rsi
callq 0x14e8
leaq 0x8ca2(%rip), %r14      # 0xe33c
leaq 0x8a5f(%rip), %r15      # 0xe100
pushq $0x1
popq %r13
movq (%rbp), %rdi
callq 0x1290
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x1a4, %ecx            # imm = 0x1A4
callq 0x1b23
testl %eax, %eax
je 0x56e5
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
je 0x56e5
addq $0x8, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
je 0x574b
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x1ab, %r8d            # imm = 0x1AB
callq 0x1bb7
testl %eax, %eax
je 0x578e
movq (%r12), %rax
cmpl $0x0, 0x1b4(%rax)
je 0x578e
movq %r12, %rdi
movq %r15, %rsi
callq 0x1867
testl %eax, %eax
je 0x578e
movq 0x8(%r12), %rdi
movl %r13d, %esi
callq 0x1f02
movq (%r12), %rcx
movl $0x2, 0x1b8(%rcx)
callq *0x1e0(%rax)
movq %rax, %rdi
callq 0x1070
jmp 0x578e
movq (%r12), %rax
movl $0x1, 0x1b8(%rax)
movl 0x8b01(%rip), %esi      # 0xe260
movl %esi, %eax
incl %eax
movl %eax, 0x8af7(%rip)      # 0xe260
xorl %eax, %eax
leaq 0x4e06(%rip), %rdi      # 0xa578
callq 0x1080
movq %r12, %rdi
movl %r13d, %esi
pushq $0x4
popq %rdx
movq %rbx, %rcx
movl $0x1a9, %r8d            # imm = 0x1A9
callq 0x20c8
cmpl $0x0, 0x8ba7(%rip)      # 0xe33c
je 0x56a5
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
jne 0x57ce
addq $0xd0, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
jne 0x57ce
movq (%r12), %rax
movl $0x1, 0x1b4(%rax)
jmp 0x56a5
movq (%rbp), %rdi
callq 0x1290
movq (%rax), %rax
movl $0x3, 0x1b8(%rax)
leaq 0x5148(%rip), %rbx      # 0xa933
movq (%rbp), %rdi
callq 0x1290
movq (%rax), %rax
cmpl $0x0, 0x1b4(%rax)
jg 0x5817
movq (%rbp), %rdi
callq 0x18d5
testl %eax, %eax
jne 0x5817
jmp 0x5839
movq %rbx, %rdi
callq 0x1070
movq (%rbp), %rdi
callq 0x1290
movq (%rax), %rax
movl 0x1b4(%rax), %ecx
movl %ecx, %edx
decl %edx
movl %edx, 0x1b4(%rax)
testl %ecx, %ecx
jg 0x580f
jmp 0x57eb
pushq $0xa
popq %rdi
callq 0x1050
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq