// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/boot/array_test.c
// Function: array_test
int array_test() {

    int i;
    JanetArray *array1, *array2;

    array1 = janet_array(10);
    array2 = janet_array(0);

    janet_array_push(array1, janet_cstringv("one"));
    janet_array_push(array1, janet_cstringv("two"));
    janet_array_push(array1, janet_cstringv("three"));
    janet_array_push(array1, janet_cstringv("four"));
    janet_array_push(array1, janet_cstringv("five"));
    janet_array_push(array1, janet_cstringv("six"));
    janet_array_push(array1, janet_cstringv("seven"));

    assert(array1->count == 7);
    assert(array1->capacity >= 7);
    assert(janet_equals(array1->data[0], janet_cstringv("one")));

    janet_array_push(array2, janet_cstringv("one"));
    janet_array_push(array2, janet_cstringv("two"));
    janet_array_push(array2, janet_cstringv("three"));
    janet_array_push(array2, janet_cstringv("four"));
    janet_array_push(array2, janet_cstringv("five"));
    janet_array_push(array2, janet_cstringv("six"));
    janet_array_push(array2, janet_cstringv("seven"));

    for (i = 0; i < array2->count; i++) {
        assert(janet_equals(array1->data[i], array2->data[i]));
    }

    janet_array_pop(array1);
    janet_array_pop(array1);

    assert(array1->count == 5);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movabsq $-0x6000000000000, %r15 # imm = 0xFFFA000000000000
pushq $0xa
popq %rdi
callq 0x12f68
movq %rax, %rbx
xorl %edi, %edi
callq 0x12f68
movq %rax, %r14
leaq 0x1b40f(%rip), %rdi     # 0x669c8
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %rbx, %rdi
movq %rax, %rsi
callq 0x131d2
leaq 0x1c956(%rip), %rdi     # 0x67f31
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %rbx, %rdi
movq %rax, %rsi
callq 0x131d2
leaq 0x1c938(%rip), %rdi     # 0x67f35
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %rbx, %rdi
movq %rax, %rsi
callq 0x131d2
leaq 0x1c91c(%rip), %rdi     # 0x67f3b
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %rbx, %rdi
movq %rax, %rsi
callq 0x131d2
leaq 0x1c8ff(%rip), %rdi     # 0x67f40
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %rbx, %rdi
movq %rax, %rsi
callq 0x131d2
leaq 0x1c8e2(%rip), %rdi     # 0x67f45
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %rbx, %rdi
movq %rax, %rsi
callq 0x131d2
leaq 0x1c8c4(%rip), %rdi     # 0x67f49
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %rbx, %rdi
movq %rax, %rsi
callq 0x131d2
cmpl $0x7, 0x10(%rbx)
jne 0x4b837
cmpl $0x6, 0x14(%rbx)
jle 0x4b850
movq 0x18(%rbx), %r12
leaq 0x1b309(%rip), %rdi     # 0x669c8
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq (%r12), %rdi
movq %rax, %rsi
callq 0x466c8
testl %eax, %eax
je 0x4b869
leaq 0x1b2de(%rip), %rdi     # 0x669c8
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %r14, %rdi
movq %rax, %rsi
callq 0x131d2
leaq 0x1c825(%rip), %rdi     # 0x67f31
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %r14, %rdi
movq %rax, %rsi
callq 0x131d2
leaq 0x1c807(%rip), %rdi     # 0x67f35
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %r14, %rdi
movq %rax, %rsi
callq 0x131d2
leaq 0x1c7eb(%rip), %rdi     # 0x67f3b
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %r14, %rdi
movq %rax, %rsi
callq 0x131d2
leaq 0x1c7ce(%rip), %rdi     # 0x67f40
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %r14, %rdi
movq %rax, %rsi
callq 0x131d2
leaq 0x1c7b1(%rip), %rdi     # 0x67f45
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %r14, %rdi
movq %rax, %rsi
callq 0x131d2
leaq 0x1c793(%rip), %rdi     # 0x67f49
callq 0x411ea
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b366
movq %r14, %rdi
movq %rax, %rsi
callq 0x131d2
xorl %r15d, %r15d
movslq 0x10(%r14), %rax
cmpq %rax, %r15
jge 0x4b816
movq 0x18(%rbx), %rax
movq 0x18(%r14), %rcx
movq (%rax,%r15,8), %rdi
movq (%rcx,%r15,8), %rsi
callq 0x466c8
incq %r15
testl %eax, %eax
jne 0x4b7d4
leaq 0x1c7d4(%rip), %rdi     # 0x67fd4
leaq 0x1c75b(%rip), %rsi     # 0x67f62
leaq 0x1c76a(%rip), %rcx     # 0x67f78
pushq $0x39
popq %rdx
callq 0x123f0
movq %rbx, %rdi
callq 0x13224
movq %rbx, %rdi
callq 0x13224
cmpl $0x5, 0x10(%rbx)
jne 0x4b882
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c711(%rip), %rdi     # 0x67f4f
leaq 0x1c71d(%rip), %rsi     # 0x67f62
leaq 0x1c72c(%rip), %rcx     # 0x67f78
pushq $0x2c
jmp 0x4b810
leaq 0x1c732(%rip), %rdi     # 0x67f89
leaq 0x1c704(%rip), %rsi     # 0x67f62
leaq 0x1c713(%rip), %rcx     # 0x67f78
pushq $0x2d
jmp 0x4b810
leaq 0x1c72f(%rip), %rdi     # 0x67f9f
leaq 0x1c6eb(%rip), %rsi     # 0x67f62
leaq 0x1c6fa(%rip), %rcx     # 0x67f78
pushq $0x2e
jmp 0x4b810
leaq 0x1c77a(%rip), %rdi     # 0x68003
leaq 0x1c6d2(%rip), %rsi     # 0x67f62
leaq 0x1c6e1(%rip), %rcx     # 0x67f78
pushq $0x3f
jmp 0x4b810
nop