// File: /workspace/github_c_makefile_star2_O1/mahrr[P]raven/src/compiler.c
// Function: array
static void array(Parser *parser) {
    Debug_Log(parser);

    if (consume_if(parser, TOKEN_RIGHT_BRACKET)) {
        emit_bytes(parser, OP_ARRAY_8, 0);
        Debug_Exit(parser);
        return;
    }

    size_t count = 0;
    do {
        expression(parser);

        if (count == ARRAY_LIMIT) {
            error_limit(parser, "array literal elements", ARRAY_LIMIT);
            break;
        }

        count++;
    } while (consume_if(parser, TOKEN_COMMA));

    if (count > UINT8_MAX) {
        emit_byte(parser, OP_ARRAY_16);
        emit_bytes(parser, (count >> 8) & 0xff, count & 0xff);
    } else {
        emit_bytes(parser, OP_ARRAY_8, (uint8_t)count);
    }

    consume(parser, TOKEN_RIGHT_BRACKET, "expect ']' after array elements");

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
movl 0x18(%rdi), %ebp
cmpl $0x2d, %ebp
jne 0x81c7
movq 0x10(%r14), %rax
movq %rax, 0x40(%rbx)
movups (%r14), %xmm0
movups %xmm0, 0x30(%rbx)
movq %rsp, %r15
movq (%rbx), %rsi
movq %r15, %rdi
callq 0x97fb
movq 0x10(%rsp), %rax
movq %rax, 0x10(%r14)
movups (%rsp), %xmm0
movups %xmm0, (%r14)
cmpl $0x35, 0x18(%rbx)
je 0x816c
cmpl $0x2d, %ebp
jne 0x81c7
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
addq $0x20, %rdi
movl 0x44(%rbx), %edx
movl $0x26, %esi
callq 0x4d19
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
addq $0x20, %rdi
movl 0x44(%rbx), %edx
xorl %esi, %esi
callq 0x4d19
jmp 0x830f
leaq 0x30(%rbx), %r12
xorl %r13d, %r13d
movq %rsp, %r15
movq %rbx, %rdi
movl $0x1, %esi
callq 0x6ab6
cmpq $0x10000, %r13          # imm = 0x10000
je 0x822d
incq %r13
movl (%r14), %ebp
cmpl $0x25, %ebp
jne 0x8247
movq 0x10(%r14), %rax
movq %rax, 0x10(%r12)
movups (%r14), %xmm0
movups %xmm0, (%r12)
movq (%rbx), %rsi
movq %r15, %rdi
callq 0x97fb
movq 0x10(%rsp), %rax
movq %rax, 0x10(%r14)
movups (%rsp), %xmm0
movups %xmm0, (%r14)
cmpl $0x35, 0x18(%rbx)
je 0x8204
cmpl $0x25, %ebp
je 0x81d1
jmp 0x8247
leaq 0x3a85(%rip), %rsi      # 0xbcb9
movq %rbx, %rdi
movl $0x10000, %edx          # imm = 0x10000
callq 0x6518
movl $0x10000, %r13d         # imm = 0x10000
movq %r13, %rbp
leaq 0x8(%rbx), %r15
cmpq $0x100, %r13            # imm = 0x100
jb 0x828b
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
addq $0x20, %rdi
leaq 0x44(%rbx), %r12
movl 0x44(%rbx), %edx
movl $0x27, %esi
callq 0x4d19
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
addq $0x20, %rdi
movl 0x44(%rbx), %edx
movq %rbp, %rax
movzbl %ah, %esi
jmp 0x82a3
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
addq $0x20, %rdi
leaq 0x44(%rbx), %r12
movl 0x44(%rbx), %edx
movl $0x26, %esi
callq 0x4d19
movq (%r15), %rax
movq 0x8(%rax), %rdi
addq $0x20, %rdi
movl (%r12), %edx
movzbl %bpl, %esi
callq 0x4d19
cmpl $0x2d, (%r14)
jne 0x82fd
movq 0x10(%r14), %rax
movq %rax, 0x40(%rbx)
movups (%r14), %xmm0
movups %xmm0, 0x30(%rbx)
movq %rsp, %r15
movq (%rbx), %rsi
movq %r15, %rdi
callq 0x97fb
movq 0x10(%rsp), %rax
movq %rax, 0x10(%r14)
movups (%rsp), %xmm0
movups %xmm0, (%r14)
cmpl $0x35, 0x18(%rbx)
je 0x82d9
jmp 0x830f
leaq 0x39cc(%rip), %rdx      # 0xbcd0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x64ec
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq