// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/vcf.c
// Function: vcf_parse_format_dict2
static int vcf_parse_format_dict2(kstring_t *s, const bcf_hdr_t *h, bcf1_t *v,
                                  const char *p, const char *q, fmt_aux_t *fmt) {
    const vdict_t *d = (vdict_t*)h->dict[BCF_DT_ID];
    char *t;
    int j;
    ks_tokaux_t aux1;

    for (j = 0, t = kstrtok(p, ":", &aux1); t; t = kstrtok(0, 0, &aux1), ++j) {
        if (j >= MAX_N_FMT) {
            v->errcode |= BCF_ERR_LIMITS;
            hts_log_error("FORMAT column at %s:%"PRIhts_pos" lists more identifiers than htslib can handle",
                bcf_seqname_safe(h,v), v->pos+1);
            return -1;
        }

        *(char*)aux1.p = 0;
        khint_t k = kh_get(vdict, d, t);
        if (k == kh_end(d) || kh_val(d, k).info[BCF_HL_FMT] == 15) {
            if ( t[0]=='.' && t[1]==0 )
            {
                hts_log_error("Invalid FORMAT tag name '.' at %s:%"PRIhts_pos, bcf_seqname_safe(h,v), v->pos+1);
                v->errcode |= BCF_ERR_TAG_INVALID;
                return -1;
            }
            hts_log_warning("FORMAT '%s' at %s:%"PRIhts_pos" is not defined in the header, assuming Type=String", t, bcf_seqname_safe(h,v), v->pos+1);
            kstring_t tmp = {0,0,0};
            int l;
            ksprintf(&tmp, "##FORMAT=<ID=%s,Number=1,Type=String,Description=\"Dummy\">", t);
            bcf_hrec_t *hrec = bcf_hdr_parse_line(h,tmp.s,&l);
            free(tmp.s);
            int res = hrec ? bcf_hdr_add_hrec((bcf_hdr_t*)h, hrec) : -1;
            if (res < 0) bcf_hrec_destroy(hrec);
            if (res > 0) res = bcf_hdr_sync((bcf_hdr_t*)h);

            k = kh_get(vdict, d, t);
            v->errcode |= BCF_ERR_TAG_UNDEF;
            if (res || k == kh_end(d)) {
                hts_log_error("Could not add dummy header for FORMAT '%s' at %s:%"PRIhts_pos, t, bcf_seqname_safe(h,v), v->pos+1);
                v->errcode |= BCF_ERR_TAG_INVALID;
                return -1;
            }
        }
        fmt[j].max_l = fmt[j].max_m = fmt[j].max_g = 0;
        fmt[j].key = kh_val(d, k).id;
        fmt[j].is_gt = (t[0] == 'G' && t[1] == 'T' && !t[2]);
        fmt[j].y = h->id[0][fmt[j].key].val->info[BCF_HL_FMT];
        v->n_fmt++;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x28(%rbp), %rdi
leaq 0xb0d3e(%rip), %rsi     # 0x103a7f
leaq -0x80(%rbp), %rdx
callq 0xd6380
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x53185
cmpl $0xff, -0x4c(%rbp)
jl 0x52db6
movq -0x20(%rbp), %rax
movl 0xcc(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0xcc(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x43520
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq (%rax), %r8
addq $0x1, %r8
movl $0x1, %edi
leaq 0xb5e96(%rip), %rsi     # 0x108c32
leaq 0xb5ea6(%rip), %rdx     # 0x108c49
movb $0x0, %al
callq 0x9d90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5318c
movq -0x58(%rbp), %rax
movb $0x0, (%rax)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x3e520
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl (%rcx), %eax
je 0x52dfe
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x84(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
cmpq $0xf, 0x10(%rax)
jne 0x53015
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x52e6b
movq -0x48(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x52e6b
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x43520
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq (%rax), %r8
addq $0x1, %r8
movl $0x1, %edi
leaq 0xb5df4(%rip), %rsi     # 0x108c32
leaq 0xb5e4a(%rip), %rdx     # 0x108c8f
movb $0x0, %al
callq 0x9d90
movq -0x20(%rbp), %rax
movl 0xcc(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0xcc(%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5318c
movq -0x48(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x43520
movq -0xc0(%rbp), %rcx
movq %rax, %r8
movq -0x20(%rbp), %rax
movq (%rax), %r9
addq $0x1, %r9
movl $0x3, %edi
leaq 0xb5d8e(%rip), %rsi     # 0x108c32
leaq 0xb5e0a(%rip), %rdx     # 0x108cb5
movb $0x0, %al
callq 0x9d90
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x4240
movq -0x48(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
leaq 0xb5e27(%rip), %rsi     # 0x108cfe
movb $0x0, %al
callq 0xd62e0
movq -0x18(%rbp), %rdi
movq -0x90(%rbp), %rsi
leaq -0xa4(%rbp), %rdx
callq 0x3bbb0
movq %rax, -0xb0(%rbp)
movq -0x90(%rbp), %rdi
callq 0x45a0
cmpq $0x0, -0xb0(%rbp)
je 0x52f2a
movq -0x18(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x3ce30
movl %eax, -0xc4(%rbp)
jmp 0x52f37
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xc4(%rbp)
jmp 0x52f37
movl -0xc4(%rbp), %eax
movl %eax, -0xb4(%rbp)
cmpl $0x0, -0xb4(%rbp)
jge 0x52f58
movq -0xb0(%rbp), %rdi
callq 0x3b040
cmpl $0x0, -0xb4(%rbp)
jle 0x52f70
movq -0x18(%rbp), %rdi
callq 0x3ae50
movl %eax, -0xb4(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x3e520
movl %eax, -0x84(%rbp)
movq -0x20(%rbp), %rax
movl 0xcc(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0xcc(%rax)
cmpl $0x0, -0xb4(%rbp)
jne 0x52fad
movl -0x84(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x53013
movq -0x48(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x43520
movq -0xd0(%rbp), %rcx
movq %rax, %r8
movq -0x20(%rbp), %rax
movq (%rax), %r9
addq $0x1, %r9
movl $0x1, %edi
leaq 0xb5c4c(%rip), %rsi     # 0x108c32
leaq 0xb5d4b(%rip), %rdx     # 0x108d38
movb $0x0, %al
callq 0x9d90
movq -0x20(%rbp), %rax
movl 0xcc(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0xcc(%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5318c
jmp 0x53015
movq -0x38(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
andl $0x1, %ecx
orl $0x0, %ecx
movl %ecx, 0x10(%rax)
movq -0x38(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x4(%rax)
movq -0x38(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x14(%rax)
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x84(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x30(%rax), %ecx
movq -0x38(%rbp), %rax
movslq -0x4c(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x47, %ecx
movb %al, -0xd1(%rbp)
jne 0x530c1
movq -0x48(%rbp), %rax
movsbl 0x1(%rax), %ecx
xorl %eax, %eax
cmpl $0x54, %ecx
movb %al, -0xd1(%rbp)
jne 0x530c1
movq -0x48(%rbp), %rax
cmpb $0x0, 0x2(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0xd1(%rbp)
movb -0xd1(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
movq -0x38(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
andl $0x1, %edx
andl $-0x2, %ecx
orl %edx, %ecx
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movslq -0x4c(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movslq -0x4c(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
shrq $0x20, %rcx
andq $0xff, %rcx
addl $0x1, %ecx
movl %ecx, %ecx
movl %ecx, %edx
movq 0x18(%rax), %rcx
andq $0xff, %rdx
shlq $0x20, %rdx
movabsq $-0xff00000001, %rsi    # imm = 0xFFFFFF00FFFFFFFF
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
xorl %eax, %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdx
movq %rsi, %rdi
callq 0xd6380
movq %rax, -0x48(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x52d4e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax,%rax)