// File: /workspace/github_c_makefile_star2_O3/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
movl $0xa, %edi
callq 0x14690
movq %rax, %rbx
xorl %edi, %edi
callq 0x14690
movq %rax, %r14
leaq 0x1ba41(%rip), %rdi     # 0x6a9a8
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148a3
leaq 0x1cf88(%rip), %rdi     # 0x6bf11
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148a3
leaq 0x1cf6a(%rip), %rdi     # 0x6bf15
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148a3
leaq 0x1cf4e(%rip), %rdi     # 0x6bf1b
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148a3
leaq 0x1cf31(%rip), %rdi     # 0x6bf20
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148a3
leaq 0x1cf14(%rip), %rdi     # 0x6bf25
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148a3
leaq 0x1cef6(%rip), %rdi     # 0x6bf29
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148a3
cmpl $0x7, 0x10(%rbx)
jne 0x4f1f2
cmpl $0x6, 0x14(%rbx)
jle 0x4f211
movq 0x18(%rbx), %r12
leaq 0x1b93b(%rip), %rdi     # 0x6a9a8
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq (%r12), %rdi
movq %rax, %rsi
callq 0x4a1bd
testl %eax, %eax
je 0x4f230
leaq 0x1b910(%rip), %rdi     # 0x6a9a8
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %r14, %rdi
movq %rax, %rsi
callq 0x148a3
leaq 0x1ce57(%rip), %rdi     # 0x6bf11
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %r14, %rdi
movq %rax, %rsi
callq 0x148a3
leaq 0x1ce39(%rip), %rdi     # 0x6bf15
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %r14, %rdi
movq %rax, %rsi
callq 0x148a3
leaq 0x1ce1d(%rip), %rdi     # 0x6bf1b
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %r14, %rdi
movq %rax, %rsi
callq 0x148a3
leaq 0x1ce00(%rip), %rdi     # 0x6bf20
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %r14, %rdi
movq %rax, %rsi
callq 0x148a3
leaq 0x1cde3(%rip), %rdi     # 0x6bf25
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %r14, %rdi
movq %rax, %rsi
callq 0x148a3
leaq 0x1cdc5(%rip), %rdi     # 0x6bf29
callq 0x4482c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4ed39
movq %r14, %rdi
movq %rax, %rsi
callq 0x148a3
cmpl $0x0, 0x10(%r14)
jle 0x4f1ae
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq 0x18(%r14), %rcx
movq (%rax,%r15,8), %rdi
movq (%rcx,%r15,8), %rsi
callq 0x4a1bd
testl %eax, %eax
je 0x4f1d3
incq %r15
movslq 0x10(%r14), %rax
cmpq %rax, %r15
jl 0x4f189
movq %rbx, %rdi
callq 0x148f7
movq %rbx, %rdi
callq 0x148f7
cmpl $0x5, 0x10(%rbx)
jne 0x4f24f
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1cdda(%rip), %rdi     # 0x6bfb4
leaq 0x1cd61(%rip), %rsi     # 0x6bf42
leaq 0x1cd70(%rip), %rcx     # 0x6bf58
movl $0x39, %edx
callq 0x123f0
leaq 0x1cd36(%rip), %rdi     # 0x6bf2f
leaq 0x1cd42(%rip), %rsi     # 0x6bf42
leaq 0x1cd51(%rip), %rcx     # 0x6bf58
movl $0x2c, %edx
callq 0x123f0
leaq 0x1cd51(%rip), %rdi     # 0x6bf69
leaq 0x1cd23(%rip), %rsi     # 0x6bf42
leaq 0x1cd32(%rip), %rcx     # 0x6bf58
movl $0x2d, %edx
callq 0x123f0
leaq 0x1cd48(%rip), %rdi     # 0x6bf7f
leaq 0x1cd04(%rip), %rsi     # 0x6bf42
leaq 0x1cd13(%rip), %rcx     # 0x6bf58
movl $0x2e, %edx
callq 0x123f0
leaq 0x1cd8d(%rip), %rdi     # 0x6bfe3
leaq 0x1cce5(%rip), %rsi     # 0x6bf42
leaq 0x1ccf4(%rip), %rcx     # 0x6bf58
movl $0x3f, %edx
callq 0x123f0
nop