// File: /workspace/github_c_makefile_star2_O1/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 0x146a0
movq %rax, %rbx
xorl %edi, %edi
callq 0x146a0
movq %rax, %r14
leaq 0x1bded(%rip), %rdi     # 0x6b9c8
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148b3
leaq 0x1d334(%rip), %rdi     # 0x6cf31
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148b3
leaq 0x1d316(%rip), %rdi     # 0x6cf35
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148b3
leaq 0x1d2fa(%rip), %rdi     # 0x6cf3b
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148b3
leaq 0x1d2dd(%rip), %rdi     # 0x6cf40
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148b3
leaq 0x1d2c0(%rip), %rdi     # 0x6cf45
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148b3
leaq 0x1d2a2(%rip), %rdi     # 0x6cf49
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %rbx, %rdi
movq %rax, %rsi
callq 0x148b3
cmpl $0x7, 0x10(%rbx)
jne 0x4fe66
cmpl $0x6, 0x14(%rbx)
jle 0x4fe85
movq 0x18(%rbx), %r12
leaq 0x1bce7(%rip), %rdi     # 0x6b9c8
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq (%r12), %rdi
movq %rax, %rsi
callq 0x4acce
testl %eax, %eax
je 0x4fea4
leaq 0x1bcbc(%rip), %rdi     # 0x6b9c8
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %r14, %rdi
movq %rax, %rsi
callq 0x148b3
leaq 0x1d203(%rip), %rdi     # 0x6cf31
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %r14, %rdi
movq %rax, %rsi
callq 0x148b3
leaq 0x1d1e5(%rip), %rdi     # 0x6cf35
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %r14, %rdi
movq %rax, %rsi
callq 0x148b3
leaq 0x1d1c9(%rip), %rdi     # 0x6cf3b
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %r14, %rdi
movq %rax, %rsi
callq 0x148b3
leaq 0x1d1ac(%rip), %rdi     # 0x6cf40
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %r14, %rdi
movq %rax, %rsi
callq 0x148b3
leaq 0x1d18f(%rip), %rdi     # 0x6cf45
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %r14, %rdi
movq %rax, %rsi
callq 0x148b3
leaq 0x1d171(%rip), %rdi     # 0x6cf49
callq 0x4516c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f9ad
movq %r14, %rdi
movq %rax, %rsi
callq 0x148b3
cmpl $0x0, 0x10(%r14)
jle 0x4fe22
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq 0x18(%r14), %rcx
movq (%rax,%r15,8), %rdi
movq (%rcx,%r15,8), %rsi
callq 0x4acce
testl %eax, %eax
je 0x4fe47
incq %r15
movslq 0x10(%r14), %rax
cmpq %rax, %r15
jl 0x4fdfd
movq %rbx, %rdi
callq 0x14907
movq %rbx, %rdi
callq 0x14907
cmpl $0x5, 0x10(%rbx)
jne 0x4fec3
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d186(%rip), %rdi     # 0x6cfd4
leaq 0x1d10d(%rip), %rsi     # 0x6cf62
leaq 0x1d11c(%rip), %rcx     # 0x6cf78
movl $0x39, %edx
callq 0x123f0
leaq 0x1d0e2(%rip), %rdi     # 0x6cf4f
leaq 0x1d0ee(%rip), %rsi     # 0x6cf62
leaq 0x1d0fd(%rip), %rcx     # 0x6cf78
movl $0x2c, %edx
callq 0x123f0
leaq 0x1d0fd(%rip), %rdi     # 0x6cf89
leaq 0x1d0cf(%rip), %rsi     # 0x6cf62
leaq 0x1d0de(%rip), %rcx     # 0x6cf78
movl $0x2d, %edx
callq 0x123f0
leaq 0x1d0f4(%rip), %rdi     # 0x6cf9f
leaq 0x1d0b0(%rip), %rsi     # 0x6cf62
leaq 0x1d0bf(%rip), %rcx     # 0x6cf78
movl $0x2e, %edx
callq 0x123f0
leaq 0x1d139(%rip), %rdi     # 0x6d003
leaq 0x1d091(%rip), %rsi     # 0x6cf62
leaq 0x1d0a0(%rip), %rcx     # 0x6cf78
movl $0x3f, %edx
callq 0x123f0
nop