// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/textutils.c
// Function: fscan_string
static int fscan_string(hFILE *fp, kstring_t *d)
{
    int c, d1, d2, d3, d4;
    uint32_t e = 0;

    while ((c = hgetc(fp)) != EOF) switch (c) {
    case '\\':
        if ((c = hgetc(fp)) == EOF) return e == 0 ? 0 : -1;
        switch (c) {
        case 'b': e |= kputc('\b', d) < 0; break;
        case 'f': e |= kputc('\f', d) < 0; break;
        case 'n': e |= kputc('\n', d) < 0; break;
        case 'r': e |= kputc('\r', d) < 0; break;
        case 't': e |= kputc('\t', d) < 0; break;
        default:  e |= kputc(c,    d) < 0; break;
        case 'u':
            if ((c = hgetc(fp)) != EOF && (d1 = dehex(c)) >= 0 &&
                (c = hgetc(fp)) != EOF && (d2 = dehex(c)) >= 0 &&
                (c = hgetc(fp)) != EOF && (d3 = dehex(c)) >= 0 &&
                (c = hgetc(fp)) != EOF && (d4 = dehex(c)) >= 0) {
                char buf[8];
                char *lim = encode_utf8(buf, d1 << 12 | d2 << 8 | d3 << 4 | d4);
                e |= kputsn(buf, lim - buf, d) < 0;
            }
            break;
        }
        break;

    case '"':
        return e == 0 ? 0 : -1;

    default:
        e |= kputc(c, d) < 0;
        break;
    }
    return e == 0 ? 0 : -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4c090
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0x4c381
movl -0x1c(%rbp), %eax
movl %eax, -0x44(%rbp)
subl $0x22, %eax
je 0x4c34a
jmp 0x4c11d
movl -0x44(%rbp), %eax
subl $0x5c, %eax
jne 0x4c35f
jmp 0x4c12b
movq -0x10(%rbp), %rdi
callq 0x4c090
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
jne 0x4c154
movl -0x30(%rbp), %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x4c394
movl -0x1c(%rbp), %eax
addl $-0x62, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x13, %eax
ja 0x4c231
movq -0x50(%rbp), %rax
leaq 0xa722c(%rip), %rcx     # 0xf33a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rsi
movl $0x8, %edi
callq 0x4c450
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x4c348
movq -0x18(%rbp), %rsi
movl $0xc, %edi
callq 0x4c450
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x4c348
movq -0x18(%rbp), %rsi
movl $0xa, %edi
callq 0x4c450
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x4c348
movq -0x18(%rbp), %rsi
movl $0xd, %edi
callq 0x4c450
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x4c348
movq -0x18(%rbp), %rsi
movl $0x9, %edi
callq 0x4c450
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x4c348
movl -0x1c(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x4c450
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x4c348
movq -0x10(%rbp), %rdi
callq 0x4c090
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0x4c346
movl -0x1c(%rbp), %eax
movsbl %al, %edi
callq 0x4b5f0
movl %eax, -0x20(%rbp)
cmpl $0x0, %eax
jl 0x4c346
movq -0x10(%rbp), %rdi
callq 0x4c090
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0x4c346
movl -0x1c(%rbp), %eax
movsbl %al, %edi
callq 0x4b5f0
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
jl 0x4c346
movq -0x10(%rbp), %rdi
callq 0x4c090
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0x4c346
movl -0x1c(%rbp), %eax
movsbl %al, %edi
callq 0x4b5f0
movl %eax, -0x28(%rbp)
cmpl $0x0, %eax
jl 0x4c346
movq -0x10(%rbp), %rdi
callq 0x4c090
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0x4c346
movl -0x1c(%rbp), %eax
movsbl %al, %edi
callq 0x4b5f0
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
jl 0x4c346
leaq -0x38(%rbp), %rdi
movl -0x20(%rbp), %esi
shll $0xc, %esi
movl -0x24(%rbp), %eax
shll $0x8, %eax
orl %eax, %esi
movl -0x28(%rbp), %eax
shll $0x4, %eax
orl %eax, %esi
orl -0x2c(%rbp), %esi
callq 0x4cb40
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq -0x38(%rbp), %rax
subq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x4c3a0
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x4c348
jmp 0x4c37c
movl -0x30(%rbp), %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x4c394
movl -0x1c(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x4c450
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x4c0f7
movl -0x30(%rbp), %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)