// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_json.c
// Function: array_parse
static bool _array_parse(ParsePos_t* pos, CeJsonArray_t* array, bool verbose){
     ArrayParseStage_t stage = ARR_PARSE_STAGE_START;
     while(*pos->str){
          switch(stage){
          case ARR_PARSE_STAGE_START:
               _eat_whitespace(pos);
               if(*pos->str == TOKEN_OPEN_BRACKET){
                    _transition_array_stage(&stage, ARR_PARSE_STAGE_VALUE_BEGIN, pos, verbose);
               }else{
                    printf("Error: %" PRId64 ", %" PRId64 " expected first non-whitespace character is not an open brace.\n",
                           pos->x, pos->y);
                    return false;
               }
               break;
          case ARR_PARSE_STAGE_VALUE_BEGIN:
          {
               bool boolean = false;
               _eat_whitespace(pos);
               if(*pos->str == TOKEN_OPEN_BRACE){
                    CeJsonObj_t obj = {};
                    bool success = _obj_parse(pos, &obj, verbose);
                    if(success){
                         _transition_array_stage(&stage, ARR_PARSE_STAGE_CHECK_NEXT_VALUE, pos, verbose);
                         if(verbose) printf("adding array obj element\n");
                         ce_json_array_add_obj(array, &obj);
                         ce_json_obj_free(&obj);
                    }else{
                         printf("Error: %" PRId64 ", %" PRId64 " failed to parse object.", pos->x, pos->y);
                         return false;
                    }
               }else if(*pos->str == TOKEN_QUOTE){
                    advance_parse_pos(pos);
                    char* field_string = NULL;
                    bool success = _parse_string(pos, &field_string);
                    if(success){
                         _transition_array_stage(&stage, ARR_PARSE_STAGE_CHECK_NEXT_VALUE, pos, verbose);
                         if(verbose) printf("adding array string element\n");
                         ce_json_array_add_string(array, field_string);
                         free(field_string);
                    }else{
                         printf("Error: %" PRId64 ", %" PRId64 " failed to parse string.", pos->x, pos->y);
                         return false;
                    }
               }else if(_starts_number(*pos->str)){
                    double number = 0;
                    bool success = _parse_number(pos, &number);
                    if(success){
                         _transition_array_stage(&stage, ARR_PARSE_STAGE_CHECK_NEXT_VALUE, pos, verbose);
                         if(verbose) printf("adding array number element\n");
                         ce_json_array_add_number(array, number);
                    }else{
                         printf("Error: %" PRId64 ", %" PRId64 " failed to parse expected number.\n",
                                pos->x, pos->y);
                         return false;
                    }
               }else if(_parse_boolean(pos, &boolean)){
                    _transition_array_stage(&stage, ARR_PARSE_STAGE_CHECK_NEXT_VALUE, pos, verbose);
                    if(verbose) printf("adding array bool element\n");
                    ce_json_array_add_boolean(array, boolean);
               }else if(_parse_null(pos)){
                    _transition_array_stage(&stage, ARR_PARSE_STAGE_CHECK_NEXT_VALUE, pos, verbose);
                    if(verbose) printf("adding array null element\n");
                    ce_json_array_add_null(array);
               }else if(*pos->str == TOKEN_CLOSE_BRACKET){
                    if(verbose) printf("done parsing array\n");
                    return true;
               }else{
                    printf("Error: %" PRId64 ", %" PRId64 " expected value in array.\n",
                           pos->x, pos->y);
                    return false;
               }
          } break;
          case ARR_PARSE_STAGE_CHECK_NEXT_VALUE:
               _eat_whitespace(pos);
               if(*pos->str == TOKEN_COMMA){
                    _transition_array_stage(&stage, ARR_PARSE_STAGE_VALUE_BEGIN, pos, verbose);
               }else if(*pos->str == TOKEN_CLOSE_BRACKET){
                    if(verbose) printf("done parsing array\n");
                    return true;
               }
               break;
          default:
               printf("Error: reached unknown state %d\n", stage);
               return false;
          }

          if(_is_newline(*pos->str)){
               advance_newline_parse_pos(pos);
          }else{
               advance_parse_pos(pos);
          }
     }
     return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpb $0x0, (%rax)
je 0x274f9
movl -0x20(%rbp), %eax
movl %eax, -0x60(%rbp)
testl %eax, %eax
je 0x270e5
jmp 0x270ca
movl -0x60(%rbp), %eax
subl $0x1, %eax
je 0x27145
jmp 0x270d4
movl -0x60(%rbp), %eax
subl $0x2, %eax
je 0x27453
jmp 0x274b4
movq -0x10(%rbp), %rdi
callq 0x26da0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
jne 0x27119
movq -0x10(%rbp), %rdx
movb -0x19(%rbp), %al
leaq -0x20(%rbp), %rdi
movl $0x1, %esi
andb $0x1, %al
movzbl %al, %ecx
callq 0x276f0
jmp 0x27140
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x1d5cc(%rip), %rdi     # 0x446fc
movb $0x0, %al
callq 0xd230
movb $0x0, -0x1(%rbp)
jmp 0x274fd
jmp 0x274cb
movb $0x0, -0x21(%rbp)
movq -0x10(%rbp), %rdi
callq 0x26da0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x7b, %eax
jne 0x27207
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
leaq -0x38(%rbp), %rsi
andb $0x1, %al
movzbl %al, %edx
callq 0x26120
andb $0x1, %al
movb %al, -0x39(%rbp)
testb $0x1, -0x39(%rbp)
je 0x271db
movq -0x10(%rbp), %rdx
movb -0x19(%rbp), %al
leaq -0x20(%rbp), %rdi
movl $0x2, %esi
andb $0x1, %al
movzbl %al, %ecx
callq 0x276f0
testb $0x1, -0x19(%rbp)
je 0x271c3
leaq 0x1d7fa(%rip), %rdi     # 0x449b6
movb $0x0, %al
callq 0xd230
movq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x250c0
leaq -0x38(%rbp), %rdi
callq 0x25b50
jmp 0x27202
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x1d7de(%rip), %rdi     # 0x449d0
movb $0x0, %al
callq 0xd230
movb $0x0, -0x1(%rbp)
jmp 0x274fd
jmp 0x27451
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x272b5
movq -0x10(%rbp), %rdi
callq 0x27510
movq $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x26e70
andb $0x1, %al
movb %al, -0x49(%rbp)
testb $0x1, -0x49(%rbp)
je 0x27289
movq -0x10(%rbp), %rdx
movb -0x19(%rbp), %al
leaq -0x20(%rbp), %rdi
movl $0x2, %esi
andb $0x1, %al
movzbl %al, %ecx
callq 0x276f0
testb $0x1, -0x19(%rbp)
je 0x27271
leaq 0x1d78e(%rip), %rdi     # 0x449f8
movb $0x0, %al
callq 0xd230
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x25290
movq -0x48(%rbp), %rdi
callq 0xd090
jmp 0x272b0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x1d5de(%rip), %rdi     # 0x4487e
movb $0x0, %al
callq 0xd230
movb $0x0, -0x1(%rbp)
jmp 0x274fd
jmp 0x2744f
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %edi
callq 0x26fd0
testb $0x1, %al
jne 0x272cd
jmp 0x27357
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x27010
andb $0x1, %al
movb %al, -0x59(%rbp)
testb $0x1, -0x59(%rbp)
je 0x2732b
movq -0x10(%rbp), %rdx
movb -0x19(%rbp), %al
leaq -0x20(%rbp), %rdi
movl $0x2, %esi
andb $0x1, %al
movzbl %al, %ecx
callq 0x276f0
testb $0x1, -0x19(%rbp)
je 0x2731b
leaq 0x1d701(%rip), %rdi     # 0x44a15
movb $0x0, %al
callq 0xd230
movq -0x18(%rbp), %rdi
movsd -0x58(%rbp), %xmm0
callq 0x25330
jmp 0x27352
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x1d4ab(%rip), %rdi     # 0x447ed
movb $0x0, %al
callq 0xd230
movb $0x0, -0x1(%rbp)
jmp 0x274fd
jmp 0x2744d
movq -0x10(%rbp), %rdi
leaq -0x21(%rbp), %rsi
callq 0x27540
testb $0x1, %al
jne 0x2736a
jmp 0x273ae
movq -0x10(%rbp), %rdx
movb -0x19(%rbp), %al
leaq -0x20(%rbp), %rdi
movl $0x2, %esi
andb $0x1, %al
movzbl %al, %ecx
callq 0x276f0
testb $0x1, -0x19(%rbp)
je 0x27398
leaq 0x1d6a1(%rip), %rdi     # 0x44a32
movb $0x0, %al
callq 0xd230
movq -0x18(%rbp), %rdi
movb -0x21(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x253c0
jmp 0x2744b
movq -0x10(%rbp), %rdi
callq 0x275d0
testb $0x1, %al
jne 0x273bd
jmp 0x273f6
movq -0x10(%rbp), %rdx
movb -0x19(%rbp), %al
leaq -0x20(%rbp), %rdi
movl $0x2, %esi
andb $0x1, %al
movzbl %al, %ecx
callq 0x276f0
testb $0x1, -0x19(%rbp)
je 0x273eb
leaq 0x1d669(%rip), %rdi     # 0x44a4d
movb $0x0, %al
callq 0xd230
movq -0x18(%rbp), %rdi
callq 0x25450
jmp 0x27449
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0x27422
testb $0x1, -0x19(%rbp)
je 0x27419
leaq 0x1d656(%rip), %rdi     # 0x44a68
movb $0x0, %al
callq 0xd230
movb $0x1, -0x1(%rbp)
jmp 0x274fd
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x1d643(%rip), %rdi     # 0x44a7c
movb $0x0, %al
callq 0xd230
movb $0x0, -0x1(%rbp)
jmp 0x274fd
jmp 0x2744b
jmp 0x2744d
jmp 0x2744f
jmp 0x27451
jmp 0x274cb
movq -0x10(%rbp), %rdi
callq 0x26da0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x27487
movq -0x10(%rbp), %rdx
movb -0x19(%rbp), %al
leaq -0x20(%rbp), %rdi
movl $0x1, %esi
andb $0x1, %al
movzbl %al, %ecx
callq 0x276f0
jmp 0x274b2
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0x274b0
testb $0x1, -0x19(%rbp)
je 0x274aa
leaq 0x1d5c5(%rip), %rdi     # 0x44a68
movb $0x0, %al
callq 0xd230
movb $0x1, -0x1(%rbp)
jmp 0x274fd
jmp 0x274b2
jmp 0x274cb
movl -0x20(%rbp), %esi
leaq 0x1d4a3(%rip), %rdi     # 0x44961
movb $0x0, %al
callq 0xd230
movb $0x0, -0x1(%rbp)
jmp 0x274fd
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %edi
callq 0x27620
testb $0x1, %al
jne 0x274e0
jmp 0x274eb
movq -0x10(%rbp), %rdi
callq 0x27650
jmp 0x274f4
movq -0x10(%rbp), %rdi
callq 0x27510
jmp 0x270ae
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)