// File: /workspace/github_c_makefile_star2_O3/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 0x543e(%rip), %rdi      # 0xa8f9
callq 0x1070
leaq 0x8da9(%rip), %rbp      # 0xe270
movq (%rbp), %rdi
leaq 0x4f46(%rip), %rbx      # 0xa418
movl $0x188, %edx            # imm = 0x188
movq %rbx, %rsi
callq 0x157c
leaq 0x8e4e(%rip), %r14      # 0xe334
leaq 0x8c13(%rip), %r15      # 0xe100
movl $0x1, %r13d
movq (%rbp), %rdi
callq 0x1334
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x188, %ecx            # imm = 0x188
callq 0x1bb0
testl %eax, %eax
je 0x5533
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
je 0x5533
addq $0x8, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
je 0x5599
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x18f, %r8d            # imm = 0x18F
callq 0x1c49
testl %eax, %eax
je 0x55da
movq (%r12), %rax
cmpl $0x0, 0x1b4(%rax)
je 0x55da
movq %r12, %rdi
movq %r15, %rsi
callq 0x1904
testl %eax, %eax
je 0x55da
movq 0x8(%r12), %rdi
movl %r13d, %esi
callq 0x1f9d
movq (%r12), %rcx
movl $0x2, 0x1b8(%rcx)
callq *0x1e0(%rax)
movq %rax, %rdi
callq 0x1070
jmp 0x55da
movq (%r12), %rax
movl $0x1, 0x1b8(%rax)
movl 0x8cb3(%rip), %esi      # 0xe260
movl %esi, %eax
incl %eax
movl %eax, 0x8ca9(%rip)      # 0xe260
xorl %eax, %eax
leaq 0x4fa0(%rip), %rdi      # 0xa560
callq 0x1080
movq %r12, %rdi
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %rbx, %rdx
movl $0x18d, %ecx            # imm = 0x18D
callq 0x21ae
cmpl $0x0, 0x8d53(%rip)      # 0xe334
je 0x54f3
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
jne 0x561a
addq $0xd0, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
jne 0x561a
movq (%r12), %rax
movl $0x1, 0x1b4(%rax)
jmp 0x54f3
movq (%rbp), %rdi
callq 0x1334
movq (%rax), %rax
movl $0x3, 0x1b8(%rax)
movq (%rbp), %rdi
callq 0x1334
movq (%rax), %rax
cmpl $0x0, 0x1b4(%rax)
jg 0x5652
movq (%rbp), %rdi
callq 0x195a
testl %eax, %eax
je 0x5674
movq (%rbp), %rdi
callq 0x1334
movq (%rax), %rax
movl 0x1b4(%rax), %ecx
movl %ecx, %edx
decl %edx
movl %edx, 0x1b4(%rax)
testl %ecx, %ecx
jg 0x5652
jmp 0x5630
movl $0xa, %edi
callq 0x1050
movq (%rbp), %rdi
leaq 0x4d8f(%rip), %rbx      # 0xa418
movl $0x196, %edx            # imm = 0x196
movq %rbx, %rsi
callq 0x157c
leaq 0x8c9b(%rip), %r14      # 0xe338
leaq 0x8a5c(%rip), %r15      # 0xe100
movl $0x1, %r13d
movq (%rbp), %rdi
callq 0x1334
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x196, %ecx            # imm = 0x196
callq 0x1bb0
testl %eax, %eax
je 0x56ea
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
je 0x56ea
addq $0x8, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
je 0x5750
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x19d, %r8d            # imm = 0x19D
callq 0x1c49
testl %eax, %eax
je 0x5795
movq (%r12), %rax
cmpl $0x0, 0x1b4(%rax)
je 0x5795
movq %r12, %rdi
movq %r15, %rsi
callq 0x1904
testl %eax, %eax
je 0x5795
movq 0x8(%r12), %rdi
movl %r13d, %esi
callq 0x1f9d
movq (%r12), %rcx
movl $0x2, 0x1b8(%rcx)
callq *0x1e0(%rax)
movq %rax, %rdi
callq 0x1070
jmp 0x5795
movq (%r12), %rax
movl $0x1, 0x1b8(%rax)
movl 0x8afc(%rip), %esi      # 0xe260
movl %esi, %eax
incl %eax
movl %eax, 0x8af2(%rip)      # 0xe260
xorl %eax, %eax
leaq 0x4de9(%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 0x2164
cmpl $0x0, 0x8b9c(%rip)      # 0xe338
je 0x56aa
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
jne 0x57d5
addq $0xd0, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
jne 0x57d5
movq (%r12), %rax
movl $0x1, 0x1b4(%rax)
jmp 0x56aa
movq (%rbp), %rdi
callq 0x1334
movq (%rax), %rax
movl $0x3, 0x1b8(%rax)
movq (%rbp), %rdi
callq 0x1334
movq (%rax), %rax
cmpl $0x0, 0x1b4(%rax)
jg 0x580d
movq (%rbp), %rdi
callq 0x195a
testl %eax, %eax
je 0x582f
movq (%rbp), %rdi
callq 0x1334
movq (%rax), %rax
movl 0x1b4(%rax), %ecx
movl %ecx, %edx
decl %edx
movl %edx, 0x1b4(%rax)
testl %ecx, %ecx
jg 0x580d
jmp 0x57eb
movl $0xa, %edi
callq 0x1050
movq (%rbp), %rdi
leaq 0x4bd4(%rip), %rbx      # 0xa418
movl $0x1a4, %edx            # imm = 0x1A4
movq %rbx, %rsi
callq 0x157c
leaq 0x8ae4(%rip), %r14      # 0xe33c
leaq 0x88a1(%rip), %r15      # 0xe100
movl $0x1, %r13d
movq (%rbp), %rdi
callq 0x1334
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x1a4, %ecx            # imm = 0x1A4
callq 0x1bb0
testl %eax, %eax
je 0x58a5
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
je 0x58a5
addq $0x8, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
je 0x590b
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x1ab, %r8d            # imm = 0x1AB
callq 0x1c49
testl %eax, %eax
je 0x5950
movq (%r12), %rax
cmpl $0x0, 0x1b4(%rax)
je 0x5950
movq %r12, %rdi
movq %r15, %rsi
callq 0x1904
testl %eax, %eax
je 0x5950
movq 0x8(%r12), %rdi
movl %r13d, %esi
callq 0x1f9d
movq (%r12), %rcx
movl $0x2, 0x1b8(%rcx)
callq *0x1e0(%rax)
movq %rax, %rdi
callq 0x1070
jmp 0x5950
movq (%r12), %rax
movl $0x1, 0x1b8(%rax)
movl 0x8941(%rip), %esi      # 0xe260
movl %esi, %eax
incl %eax
movl %eax, 0x8937(%rip)      # 0xe260
xorl %eax, %eax
leaq 0x4c46(%rip), %rdi      # 0xa578
callq 0x1080
movq %r12, %rdi
movl %r13d, %esi
movl $0x4, %edx
movq %rbx, %rcx
movl $0x1a9, %r8d            # imm = 0x1A9
callq 0x2164
cmpl $0x0, 0x89e5(%rip)      # 0xe33c
je 0x5865
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
jne 0x5990
addq $0xd0, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
jne 0x5990
movq (%r12), %rax
movl $0x1, 0x1b4(%rax)
jmp 0x5865
movq (%rbp), %rdi
callq 0x1334
movq (%rax), %rax
movl $0x3, 0x1b8(%rax)
leaq 0x4f86(%rip), %rbx      # 0xa933
movq (%rbp), %rdi
callq 0x1334
movq (%rax), %rax
cmpl $0x0, 0x1b4(%rax)
jg 0x59d9
movq (%rbp), %rdi
callq 0x195a
testl %eax, %eax
jne 0x59d9
jmp 0x59fb
movq %rbx, %rdi
callq 0x1070
movq (%rbp), %rdi
callq 0x1334
movq (%rax), %rax
movl 0x1b4(%rax), %ecx
movl %ecx, %edx
decl %edx
movl %edx, 0x1b4(%rax)
testl %ecx, %ecx
jg 0x59d1
jmp 0x59ad
movl $0xa, %edi
callq 0x1050
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq