// File: /workspace/github_c_makefile_star2_O1/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 0x522b(%rip), %rdi      # 0xa979
callq 0x1070
leaq 0x7b16(%rip), %rbp      # 0xd270
movq (%rbp), %rdi
leaq 0x4d33(%rip), %rbx      # 0xa498
movl $0x188, %edx            # imm = 0x188
movq %rbx, %rsi
callq 0x151a
leaq 0x7bbb(%rip), %r14      # 0xd334
leaq 0x7980(%rip), %r15      # 0xd100
movl $0x1, %r13d
movq (%rbp), %rdi
callq 0x12d2
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x188, %ecx            # imm = 0x188
callq 0x1b4a
testl %eax, %eax
je 0x57c6
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
je 0x57c6
addq $0x8, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
je 0x582c
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x18f, %r8d            # imm = 0x18F
callq 0x1bde
testl %eax, %eax
je 0x586d
movq (%r12), %rax
cmpl $0x0, 0x1b4(%rax)
je 0x586d
movq %r12, %rdi
movq %r15, %rsi
callq 0x18a9
testl %eax, %eax
je 0x586d
movq 0x8(%r12), %rdi
movl %r13d, %esi
callq 0x1f2b
movq (%r12), %rcx
movl $0x2, 0x1b8(%rcx)
callq *0x1e0(%rax)
movq %rax, %rdi
callq 0x1070
jmp 0x586d
movq (%r12), %rax
movl $0x1, 0x1b8(%rax)
movl 0x7a20(%rip), %esi      # 0xd260
movl %esi, %eax
incl %eax
movl %eax, 0x7a16(%rip)      # 0xd260
xorl %eax, %eax
leaq 0x4d8d(%rip), %rdi      # 0xa5e0
callq 0x1080
movq %r12, %rdi
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %rbx, %rdx
movl $0x18d, %ecx            # imm = 0x18D
callq 0x216e
cmpl $0x0, 0x7ac0(%rip)      # 0xd334
je 0x5786
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
jne 0x58ad
addq $0xd0, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
jne 0x58ad
movq (%r12), %rax
movl $0x1, 0x1b4(%rax)
jmp 0x5786
movq (%rbp), %rdi
callq 0x12d2
movq (%rax), %rax
movl $0x3, 0x1b8(%rax)
movq (%rbp), %rdi
callq 0x12d2
movq (%rax), %rax
cmpl $0x0, 0x1b4(%rax)
jg 0x58e5
movq (%rbp), %rdi
callq 0x18f4
testl %eax, %eax
je 0x5907
movq (%rbp), %rdi
callq 0x12d2
movq (%rax), %rax
movl 0x1b4(%rax), %ecx
movl %ecx, %edx
decl %edx
movl %edx, 0x1b4(%rax)
testl %ecx, %ecx
jg 0x58e5
jmp 0x58c3
movl $0xa, %edi
callq 0x1050
movq (%rbp), %rdi
leaq 0x4b7c(%rip), %rbx      # 0xa498
movl $0x196, %edx            # imm = 0x196
movq %rbx, %rsi
callq 0x151a
leaq 0x7a08(%rip), %r14      # 0xd338
leaq 0x77c9(%rip), %r15      # 0xd100
movl $0x1, %r13d
movq (%rbp), %rdi
callq 0x12d2
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x196, %ecx            # imm = 0x196
callq 0x1b4a
testl %eax, %eax
je 0x597d
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
je 0x597d
addq $0x8, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
je 0x59e3
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x19d, %r8d            # imm = 0x19D
callq 0x1bde
testl %eax, %eax
je 0x5a28
movq (%r12), %rax
cmpl $0x0, 0x1b4(%rax)
je 0x5a28
movq %r12, %rdi
movq %r15, %rsi
callq 0x18a9
testl %eax, %eax
je 0x5a28
movq 0x8(%r12), %rdi
movl %r13d, %esi
callq 0x1f2b
movq (%r12), %rcx
movl $0x2, 0x1b8(%rcx)
callq *0x1e0(%rax)
movq %rax, %rdi
callq 0x1070
jmp 0x5a28
movq (%r12), %rax
movl $0x1, 0x1b8(%rax)
movl 0x7869(%rip), %esi      # 0xd260
movl %esi, %eax
incl %eax
movl %eax, 0x785f(%rip)      # 0xd260
xorl %eax, %eax
leaq 0x4bd6(%rip), %rdi      # 0xa5e0
callq 0x1080
movq %r12, %rdi
movl %r13d, %esi
movl $0x7ffffffc, %edx       # imm = 0x7FFFFFFC
movq %rbx, %rcx
movl $0x19b, %r8d            # imm = 0x19B
callq 0x2124
cmpl $0x0, 0x7909(%rip)      # 0xd338
je 0x593d
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
jne 0x5a68
addq $0xd0, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
jne 0x5a68
movq (%r12), %rax
movl $0x1, 0x1b4(%rax)
jmp 0x593d
movq (%rbp), %rdi
callq 0x12d2
movq (%rax), %rax
movl $0x3, 0x1b8(%rax)
movq (%rbp), %rdi
callq 0x12d2
movq (%rax), %rax
cmpl $0x0, 0x1b4(%rax)
jg 0x5aa0
movq (%rbp), %rdi
callq 0x18f4
testl %eax, %eax
je 0x5ac2
movq (%rbp), %rdi
callq 0x12d2
movq (%rax), %rax
movl 0x1b4(%rax), %ecx
movl %ecx, %edx
decl %edx
movl %edx, 0x1b4(%rax)
testl %ecx, %ecx
jg 0x5aa0
jmp 0x5a7e
movl $0xa, %edi
callq 0x1050
movq (%rbp), %rdi
leaq 0x49c1(%rip), %rbx      # 0xa498
movl $0x1a4, %edx            # imm = 0x1A4
movq %rbx, %rsi
callq 0x151a
leaq 0x7851(%rip), %r14      # 0xd33c
leaq 0x760e(%rip), %r15      # 0xd100
movl $0x1, %r13d
movq (%rbp), %rdi
callq 0x12d2
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x1a4, %ecx            # imm = 0x1A4
callq 0x1b4a
testl %eax, %eax
je 0x5b38
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
je 0x5b38
addq $0x8, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
je 0x5b9e
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x1ab, %r8d            # imm = 0x1AB
callq 0x1bde
testl %eax, %eax
je 0x5be3
movq (%r12), %rax
cmpl $0x0, 0x1b4(%rax)
je 0x5be3
movq %r12, %rdi
movq %r15, %rsi
callq 0x18a9
testl %eax, %eax
je 0x5be3
movq 0x8(%r12), %rdi
movl %r13d, %esi
callq 0x1f2b
movq (%r12), %rcx
movl $0x2, 0x1b8(%rcx)
callq *0x1e0(%rax)
movq %rax, %rdi
callq 0x1070
jmp 0x5be3
movq (%r12), %rax
movl $0x1, 0x1b8(%rax)
movl 0x76ae(%rip), %esi      # 0xd260
movl %esi, %eax
incl %eax
movl %eax, 0x76a4(%rip)      # 0xd260
xorl %eax, %eax
leaq 0x4a33(%rip), %rdi      # 0xa5f8
callq 0x1080
movq %r12, %rdi
movl %r13d, %esi
movl $0x4, %edx
movq %rbx, %rcx
movl $0x1a9, %r8d            # imm = 0x1A9
callq 0x2124
cmpl $0x0, 0x7752(%rip)      # 0xd33c
je 0x5af8
movq (%r12), %rdi
cmpl $0x0, 0x1b4(%rdi)
jne 0x5c23
addq $0xd0, %rdi
movl %r13d, %esi
callq 0x1130
testl %eax, %eax
jne 0x5c23
movq (%r12), %rax
movl $0x1, 0x1b4(%rax)
jmp 0x5af8
movq (%rbp), %rdi
callq 0x12d2
movq (%rax), %rax
movl $0x3, 0x1b8(%rax)
leaq 0x4d73(%rip), %rbx      # 0xa9b3
movq (%rbp), %rdi
callq 0x12d2
movq (%rax), %rax
cmpl $0x0, 0x1b4(%rax)
jg 0x5c6c
movq (%rbp), %rdi
callq 0x18f4
testl %eax, %eax
jne 0x5c6c
jmp 0x5c8e
movq %rbx, %rdi
callq 0x1070
movq (%rbp), %rdi
callq 0x12d2
movq (%rax), %rax
movl 0x1b4(%rax), %ecx
movl %ecx, %edx
decl %edx
movl %edx, 0x1b4(%rax)
testl %ecx, %ecx
jg 0x5c64
jmp 0x5c40
movl $0xa, %edi
callq 0x1050
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq