// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_json.c
// Function: obj_parse
static bool _obj_parse(ParsePos_t* pos, CeJsonObj_t* obj, bool verbose){
     ObjParseState_t state = {};
     while(*pos->str){
          switch(state.stage){
          case OBJ_PARSE_STAGE_START:
               _eat_whitespace(pos);
               if(*pos->str == TOKEN_OPEN_BRACE){
                    _transition_obj_stage(&state.stage, OBJ_PARSE_STAGE_FIELD, 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 OBJ_PARSE_STAGE_FIELD:
               _eat_whitespace(pos);
               if(*pos->str == TOKEN_QUOTE){
                    _transition_obj_stage(&state.stage, OBJ_PARSE_STAGE_FIELD_NAME_BEGIN, pos, verbose);
               }else if(*pos->str == TOKEN_CLOSE_BRACE){
                    if(verbose) printf("Done parsing obj.\n");
                    return true;
               }else{
                    printf("Error: %" PRId64 ", %" PRId64 " expected field declaration.\n",
                           pos->x, pos->y);
                    return false;
               }
               break;
          case OBJ_PARSE_STAGE_FIELD_NAME_BEGIN:
          {
               _parse_string(pos, &state.field_name);
               if(*pos->str == TOKEN_QUOTE){
                    _transition_obj_stage(&state.stage, OBJ_PARSE_STAGE_FIELD_NAME_END, pos, verbose);
               }else{
                    printf("Error: %" PRId64 ", %" PRId64 " expected \" to start string.\n", pos->x, pos->y);
                    return false;
               }
          } break;
          case OBJ_PARSE_STAGE_FIELD_NAME_END:
               _eat_whitespace(pos);
               if(*pos->str == TOKEN_COLON){
                    _transition_obj_stage(&state.stage, OBJ_PARSE_STAGE_FIELD_VALUE_BEGIN, pos, verbose);
               }else{
                    printf("Error: %" PRId64 ", %" PRId64 " expected \" to start string.\n", pos->x, pos->y);
                    return false;
               }
               break;
          case OBJ_PARSE_STAGE_FIELD_VALUE_BEGIN:
          {
               bool boolean = false;
               _eat_whitespace(pos);
               if(*pos->str == TOKEN_OPEN_BRACE){
                    CeJsonObj_t member_obj = {};
                    if(!_obj_parse(pos, &member_obj, verbose)){
                         return false;
                    }
                    if(verbose) printf("adding obj obj field %s\n", state.field_name);
                    ce_json_obj_set_obj(obj, state.field_name, &member_obj);
                    ce_json_obj_free(&member_obj);
                    _transition_obj_stage(&state.stage, OBJ_PARSE_STAGE_FIELD_VALUE_END, pos, verbose);
               }else if(_starts_number(*pos->str)){
                    double number = 0;
                    bool success = _parse_number(pos, &number);
                    if(success){
                         _transition_obj_stage(&state.stage, OBJ_PARSE_STAGE_FIELD_VALUE_END, pos, verbose);
                         if(verbose) printf("adding obj number field %s\n", state.field_name);
                         ce_json_obj_set_number(obj, state.field_name, number);
                    }else{
                         printf("Error: %" PRId64 ", %" PRId64 " failed to parse expected number.\n",
                                pos->x, pos->y);
                         return false;
                    }
               }else if(*pos->str == TOKEN_OPEN_BRACKET){
                    CeJsonArray_t array = {};
                    bool success = _array_parse(pos, &array, verbose);
                    if(success){
                         _transition_obj_stage(&state.stage, OBJ_PARSE_STAGE_FIELD_VALUE_END, pos, verbose);
                         if(verbose) printf("adding obj array field %s\n", state.field_name);
                         ce_json_obj_set_array(obj, state.field_name, &array);
                         ce_json_array_free(&array);
                    }else{
                         printf("Error: %" PRId64 ", %" PRId64 " failed to parse array.\n", 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_obj_stage(&state.stage, OBJ_PARSE_STAGE_FIELD_VALUE_END, pos, verbose);
                         if(verbose) printf("adding obj string field %s\n", state.field_name);
                         ce_json_obj_set_string(obj, state.field_name, field_string);
                         free(field_string);
                    }else{
                         printf("Error: %" PRId64 ", %" PRId64 " failed to parse string.", pos->x, pos->y);
                    }
               }else if(_parse_boolean(pos, &boolean)){
                    _transition_obj_stage(&state.stage, OBJ_PARSE_STAGE_FIELD_VALUE_END, pos, verbose);
                    if(verbose) printf("adding obj boolean field %s\n", state.field_name);
                    ce_json_obj_set_boolean(obj, state.field_name, boolean);
               }else if(_parse_null(pos)){
                    _transition_obj_stage(&state.stage, OBJ_PARSE_STAGE_FIELD_VALUE_END, pos, verbose);
                    if(verbose) printf("adding obj null field %s\n", state.field_name);
                    ce_json_obj_set_null(obj, state.field_name);
               }else{
                    printf("Error: %" PRId64 ", %" PRId64 " failed to detect value.\n", pos->x, pos->y);
                    return false;
               }
          } break;
          case OBJ_PARSE_STAGE_FIELD_VALUE_END:
               _eat_whitespace(pos);
               if(*pos->str == TOKEN_CLOSE_BRACE){
                    if(verbose) printf("done parsing obj.\n");
                    return true;
               }else if(*pos->str == TOKEN_COMMA){
                    _transition_obj_stage(&state.stage, OBJ_PARSE_STAGE_FIELD, pos, verbose);
               }else{
                    printf("Error: %" PRId64 ", %" PRId64 " failed to parse next element or end of object with %c.\n",
                           pos->x, pos->y, *pos->str);
                    return false;
               }
               break;
          default:
               printf("Error: reached unknown state %d\n", state.stage);
               return false;
          }

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %r15d
movq %rsi, 0x28(%rsp)
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x38(%rsp), %rax
movaps %xmm0, -0x8(%rax)
movq (%rdi), %rax
leaq 0x1164f(%rip), %rbp     # 0x2c6c8
movzbl %r15b, %r12d
leaq 0x30(%rsp), %r13
movb $0x1, %r14b
cmpb $0x0, (%rax)
je 0x1b7d0
movl 0x30(%rsp), %esi
cmpq $0x5, %rsi
ja 0x1b6e7
movslq (%rbp,%rsi,4), %rax
addq %rbp, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1bae6
movq (%rbx), %rax
cmpb $0x7b, (%rax)
je 0x1b1aa
jmp 0x1b6fd
movb $0x0, 0xa(%rsp)
movq %rbx, %rdi
callq 0x1bae6
movq (%rbx), %rax
movzbl (%rax), %ecx
cmpl $0x7b, %ecx
jne 0x1b1ea
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
movl %r12d, %edx
callq 0x1b04a
testb %al, %al
je 0x1b7cd
movq 0x38(%rsp), %r14
testb %r15b, %r15b
je 0x1b116
leaq 0x1172d(%rip), %rdi     # 0x2c839
movq %r14, %rsi
xorl %eax, %eax
callq 0xd240
movq 0x28(%rsp), %rdi
movq %r14, %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdx
callq 0x1a949
movq %r14, %rdi
callq 0x1ad0d
movq %r13, %rdi
pushq $0x5
jmp 0x1b1af
movq %rbx, %rdi
leaq 0x38(%rsp), %rsi
callq 0x1bb5e
movq (%rbx), %rax
cmpb $0x22, (%rax)
jne 0x1b6a0
movq %r13, %rdi
pushq $0x3
jmp 0x1b1af
movq %rbx, %rdi
callq 0x1bae6
movq (%rbx), %rax
cmpb $0x3a, (%rax)
jne 0x1b6a0
movq %r13, %rdi
pushq $0x4
jmp 0x1b1af
movq %rbx, %rdi
callq 0x1bae6
movq (%rbx), %rax
movzbl (%rax), %eax
cmpl $0x22, %eax
jne 0x1b6b1
movq %r13, %rdi
pushq $0x2
jmp 0x1b1af
movq %rbx, %rdi
callq 0x1bae6
movq (%rbx), %rax
movzbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x1b6c8
movq %r13, %rdi
pushq $0x1
popq %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x1bb24
movq (%rbx), %rax
movzbl (%rax), %ecx
cmpl $0xd, %ecx
je 0x1b1cb
cmpl $0xa, %ecx
jne 0x1b1d4
incq 0x10(%rbx)
pushq $0x1
popq %rcx
jmp 0x1b1db
movq 0x8(%rbx), %rcx
incq %rcx
movq %rcx, 0x8(%rbx)
incq %rax
movq %rax, (%rbx)
jmp 0x1b082
cmpl $0x2d, %ecx
setne %dl
leal -0x30(%rcx), %esi
cmpb $0xa, %sil
setae %sil
testb %sil, %dl
jne 0x1b25f
andq $0x0, 0x10(%rsp)
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x1bc1c
testb %al, %al
je 0x1b76e
movq %r13, %rdi
pushq $0x5
popq %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x1bb24
movq 0x38(%rsp), %r14
testb %r15b, %r15b
je 0x1b247
leaq 0x11615(%rip), %rdi     # 0x2c852
movq %r14, %rsi
xorl %eax, %eax
callq 0xd240
movsd 0x10(%rsp), %xmm0
movq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x1aba5
jmp 0x1b1bb
cmpl $0x22, %ecx
je 0x1b4fb
cmpl $0x5b, %ecx
jne 0x1b578
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
andl $0x0, 0xc(%rsp)
movb $0x5b, %al
testb %al, %al
je 0x1b652
movl 0xc(%rsp), %esi
cmpl $0x2, %esi
je 0x1b340
cmpl $0x1, %esi
je 0x1b2bb
testl %esi, %esi
jne 0x1b74d
movq %rbx, %rdi
callq 0x1bae6
movq (%rbx), %rax
cmpb $0x5b, (%rax)
je 0x1b35d
jmp 0x1b75d
movb $0x0, 0xb(%rsp)
movq %rbx, %rdi
callq 0x1bae6
movq (%rbx), %rcx
movzbl (%rcx), %eax
cmpl $0x22, %eax
je 0x1b3a3
cmpl $0x7b, %eax
jne 0x1b40b
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
movl %r12d, %edx
callq 0x1b04a
testb %al, %al
je 0x1b790
leaq 0xc(%rsp), %rdi
pushq $0x2
popq %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x1bd13
testb %r15b, %r15b
je 0x1b324
leaq 0x11830(%rip), %rdi     # 0x2cb4f
callq 0xd120
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x1a6bc
movq %r14, %rdi
callq 0x1ad0d
jmp 0x1b370
movq %rbx, %rdi
callq 0x1bae6
movq (%rbx), %rax
movzbl (%rax), %eax
cmpl $0x2c, %eax
je 0x1b35d
cmpl $0x5d, %eax
jne 0x1b370
jmp 0x1b641
leaq 0xc(%rsp), %rdi
pushq $0x1
popq %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x1bd13
movq (%rbx), %rax
movzbl (%rax), %ecx
cmpl $0xd, %ecx
je 0x1b380
cmpl $0xa, %ecx
jne 0x1b389
incq 0x10(%rbx)
pushq $0x1
popq %rcx
jmp 0x1b390
movq 0x8(%rbx), %rcx
incq %rcx
movq %rcx, 0x8(%rbx)
leaq 0x1(%rax), %rcx
movq %rcx, (%rbx)
movb 0x1(%rax), %al
jmp 0x1b280
incq 0x8(%rbx)
incq %rcx
movq %rcx, (%rbx)
andq $0x0, 0x10(%rsp)
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x1bb5e
testb %al, %al
je 0x1b77f
leaq 0xc(%rsp), %rdi
pushq $0x2
popq %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x1bd13
testb %r15b, %r15b
je 0x1b3ec
leaq 0x1174c(%rip), %rdi     # 0x2cb33
callq 0xd120
movq 0x10(%rsp), %r14
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
callq 0x1a7d7
movq %r14, %rdi
callq 0xd090
jmp 0x1b370
cmpb $0x2d, %al
setne %cl
addb $-0x30, %al
cmpb $0xa, %al
setae %al
testb %al, %cl
jne 0x1b46f
andq $0x0, 0x10(%rsp)
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x1bc1c
testb %al, %al
je 0x1b7a1
leaq 0xc(%rsp), %rdi
pushq $0x2
popq %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x1bd13
testb %r15b, %r15b
je 0x1b45a
leaq 0x116c2(%rip), %rdi     # 0x2cb17
callq 0xd120
movsd 0x10(%rsp), %xmm0
leaq 0x50(%rsp), %rdi
callq 0x1a835
jmp 0x1b370
movq %rbx, %rdi
leaq 0xb(%rsp), %rsi
callq 0x1bc72
testb %al, %al
je 0x1b4b8
leaq 0xc(%rsp), %rdi
pushq $0x2
popq %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x1bd13
testb %r15b, %r15b
je 0x1b4a4
leaq 0x1165e(%rip), %rdi     # 0x2cafd
callq 0xd120
movzbl 0xb(%rsp), %esi
leaq 0x50(%rsp), %rdi
callq 0x1a887
jmp 0x1b370
movq %rbx, %rdi
callq 0x1bcda
testb %al, %al
je 0x1b635
leaq 0xc(%rsp), %rdi
pushq $0x2
popq %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x1bd13
testb %r15b, %r15b
je 0x1b4ec
leaq 0x115fc(%rip), %rdi     # 0x2cae3
callq 0xd120
leaq 0x50(%rsp), %rdi
callq 0x1a8ce
jmp 0x1b370
incq 0x8(%rbx)
incq %rax
movq %rax, (%rbx)
andq $0x0, 0x10(%rsp)
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x1bb5e
testb %al, %al
je 0x1b5cc
movq %r13, %rdi
pushq $0x5
popq %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x1bb24
movq 0x38(%rsp), %r14
movl %r15d, 0x4c(%rsp)
testb %r15b, %r15b
je 0x1b551
leaq 0x1139c(%rip), %rdi     # 0x2c8e3
movq %r14, %rsi
xorl %eax, %eax
callq 0xd240
movq 0x10(%rsp), %r15
movq 0x28(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1ab25
movq %r15, %rdi
callq 0xd090
movl 0x4c(%rsp), %r15d
jmp 0x1b1bb
movq %rbx, %rdi
leaq 0xa(%rsp), %rsi
callq 0x1bc72
testb %al, %al
je 0x1b5e7
movq %r13, %rdi
pushq $0x5
popq %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x1bb24
movq 0x38(%rsp), %r14
testb %r15b, %r15b
je 0x1b5b5
leaq 0x1137c(%rip), %rdi     # 0x2c927
movq %r14, %rsi
xorl %eax, %eax
callq 0xd240
movzbl 0xa(%rsp), %edx
movq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x1ac2a
jmp 0x1b1bb
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x11324(%rip), %rdi     # 0x2c8ff
xorl %eax, %eax
callq 0xd240
jmp 0x1b1bb
movq %rbx, %rdi
callq 0x1bcda
testb %al, %al
je 0x1b7e2
movq %r13, %rdi
pushq $0x5
popq %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x1bb24
movq 0x38(%rsp), %r14
testb %r15b, %r15b
je 0x1b623
leaq 0x1132b(%rip), %rdi     # 0x2c944
movq %r14, %rsi
xorl %eax, %eax
callq 0xd240
movq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x1aca1
jmp 0x1b1bb
movq (%rbx), %rax
cmpb $0x5d, (%rax)
jne 0x1b7f3
testb %r15b, %r15b
je 0x1b652
leaq 0x11483(%rip), %rdi     # 0x2cad0
callq 0xd120
movq %r13, %rdi
pushq $0x5
popq %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x1bb24
movq 0x38(%rsp), %r14
testb %r15b, %r15b
je 0x1b67e
leaq 0x1122c(%rip), %rdi     # 0x2c8a0
movq %r14, %rsi
xorl %eax, %eax
callq 0xd240
movq 0x28(%rsp), %rdi
movq %r14, %rsi
leaq 0x50(%rsp), %r14
movq %r14, %rdx
callq 0x1aa13
movq %r14, %rdi
callq 0x1a912
jmp 0x1b1bb
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x1115d(%rip), %rdi     # 0x2c80c
jmp 0x1b71d
cmpl $0x7d, %eax
jne 0x1b70e
testb %r15b, %r15b
je 0x1b7d0
leaq 0x113f8(%rip), %rdi     # 0x2cabe
jmp 0x1b6dd
cmpl $0x7d, %eax
jne 0x1b72c
testb %r15b, %r15b
je 0x1b7d0
leaq 0x113cf(%rip), %rdi     # 0x2caac
callq 0xd120
jmp 0x1b7d0
leaq 0x112e1(%rip), %rdi     # 0x2c9cf
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xd240
jmp 0x1b7d0
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x11084(%rip), %rdi     # 0x2c790
jmp 0x1b71d
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x110c2(%rip), %rdi     # 0x2c7df
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xd240
jmp 0x1b7d0
movsbl %al, %ecx
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x11249(%rip), %rdi     # 0x2c987
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xd240
jmp 0x1b7d0
leaq 0x1127b(%rip), %rdi     # 0x2c9cf
xorl %eax, %eax
callq 0xd240
jmp 0x1b7b7
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x11024(%rip), %rdi     # 0x2c790
jmp 0x1b7b0
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x110f1(%rip), %rdi     # 0x2c86e
jmp 0x1b7c6
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x11171(%rip), %rdi     # 0x2c8ff
jmp 0x1b7b0
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x11285(%rip), %rdi     # 0x2ca24
jmp 0x1b7b0
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x110be(%rip), %rdi     # 0x2c86e
xorl %eax, %eax
callq 0xd240
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x110f5(%rip), %rdi     # 0x2c8bb
xorl %eax, %eax
callq 0xd240
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x1116d(%rip), %rdi     # 0x2c95e
jmp 0x1b7c6
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x1124a(%rip), %rdi     # 0x2ca4c
jmp 0x1b7b0