// File: /workspace/github_c_makefile_star2_O0/lengjingzju[P]json/json.c
// Function: json_sax_parse_common
int json_sax_parse_common(json_sax_parse_choice_t *choice)
{
    int ret = -1;
    json_parse_t parse_val = {0};

    parse_val.read_size = parse_val.read_size ? parse_val.read_size : JSON_PARSE_READ_SIZE_DEF;
    parse_val.mem = &s_invalid_json_mem;
    parse_val.fd = -1;
    if (choice->path) {
        if ((parse_val.fd = open(choice->path, O_RDONLY|O_BINARY)) < 0) {
            JsonErr("open(%s) failed!\n", choice->path);
            return -1;
        }
        parse_val.skip_blank = _skip_blank;
    } else {
        parse_val.str = choice->str;
        parse_val.size = choice->str_len ? choice->str_len : strlen(choice->str);
        parse_val.skip_blank = _skip_blank_rapid;
    }
    parse_val.parse_string = _json_sax_parse_string;
    parse_val.cb = choice->cb;

#if !JSON_PARSE_SINGLE_VALUE
    parse_val.skip_blank(&parse_val);
    if (parse_val.str[parse_val.offset] != '{' && parse_val.str[parse_val.offset] != '[') {
        JsonErr("The first object isn't object or array!\n");
        goto end;
    }
#endif

    ret = _json_sax_parse_value(&parse_val);
#if !JSON_PARSE_FINISHED_CHAR
    if (ret == 0) {
        parse_val.skip_blank(&parse_val);
        if (parse_val.str[parse_val.offset]) {
            JsonErr("Extra trailing characters!\n%s\n", parse_val.str + parse_val.offset);
            ret = -1;
        }
    }
#endif

#if !JSON_PARSE_SINGLE_VALUE
end:
#endif
    if (choice->path) {
        if (parse_val.str)
            json_free(parse_val.str);
        if (parse_val.fd >= 0)
            close(parse_val.fd);
    }

    return ret;
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xa8(%rsp)
movl $0xffffffff, 0xa4(%rsp) # imm = 0xFFFFFFFF
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
movl $0x88, %edx
callq 0x10f0
cmpq $0x0, 0x38(%rsp)
je 0x934f
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x935b
movl $0x2000, %eax           # imm = 0x2000
movq %rax, 0x10(%rsp)
jmp 0x935b
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0xcf6c(%rip), %rax      # 0x162d8
movq %rax, 0x50(%rsp)
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
movq 0xa8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x93fa
movq 0xa8(%rsp), %rax
movq 0x18(%rax), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x11a0
movl %eax, 0x18(%rsp)
cmpl $0x0, %eax
jge 0x93ec
jmp 0x93a8
leaq 0x7645(%rip), %rdi      # 0x109f4
leaq 0x78b6(%rip), %rsi      # 0x10c6c
movl $0xf7b, %edx            # imm = 0xF7B
movb $0x0, %al
callq 0x10c0
movq 0xa8(%rsp), %rax
movq 0x18(%rax), %rsi
leaq 0x7866(%rip), %rdi      # 0x10c3b
movb $0x0, %al
callq 0x10c0
movl $0xffffffff, 0xb4(%rsp) # imm = 0xFFFFFFFF
jmp 0x952f
leaq -0x2dc3(%rip), %rax     # 0x6630
movq %rax, 0x58(%rsp)
jmp 0x9459
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0xa8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x942d
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0x9443
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x10b0
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq -0x21f4(%rip), %rax     # 0x7260
movq %rax, 0x58(%rsp)
leaq 0xe0(%rip), %rax        # 0x9540
movq %rax, 0x60(%rsp)
movq 0xa8(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x90(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x9960
movl %eax, 0xa4(%rsp)
cmpl $0x0, 0xa4(%rsp)
jne 0x94ee
leaq 0x18(%rsp), %rdi
callq *0x58(%rsp)
movq 0x48(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x94ec
jmp 0x94af
leaq 0x753e(%rip), %rdi      # 0x109f4
leaq 0x77af(%rip), %rsi      # 0x10c6c
movl $0xf94, %edx            # imm = 0xF94
movb $0x0, %al
callq 0x10c0
movq 0x48(%rsp), %rsi
addq 0x28(%rsp), %rsi
leaq 0x7773(%rip), %rdi      # 0x10c4d
movb $0x0, %al
callq 0x10c0
movl $0xffffffff, 0xa4(%rsp) # imm = 0xFFFFFFFF
jmp 0x94ee
movq 0xa8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x9521
cmpq $0x0, 0x48(%rsp)
je 0x950f
movq 0x48(%rsp), %rdi
callq 0x1030
cmpl $0x0, 0x18(%rsp)
jl 0x951f
movl 0x18(%rsp), %edi
callq 0x1100
jmp 0x9521
movl 0xa4(%rsp), %eax
movl %eax, 0xb4(%rsp)
movl 0xb4(%rsp), %eax
addq $0xb8, %rsp
retq
nop