// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/view.c
// Function: parse_tbk_from_tbf
void parse_tbk_from_tbf(tbf_t *tbf, tbk_t **tbks, int *n_tbks) {
  tbk_t *tbk;
  int n = 0;
  while (1) {
    (*tbks) = realloc((*tbks), (++(*n_tbks))*sizeof(tbk_t));
    tbk = &(*tbks)[(*n_tbks)-1];
    tbf_next(tbf, tbk);
    n++;
    if (tbf->sname_first != NULL) tbk->sname = strdup(tbf->sname_first);
    if (tbk->version < 100) break;
    tbf_skip_data(tbk);
  }

  if (n==1 && tbk->sname == NULL) {
    tbk_set_sname_by_fname(&(*tbks)[(*n_tbks)-1]);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, 0x10(%rsp)
movq %rdi, %r15
movl $0x0, 0xc(%rsp)
movq 0x10(%rsp), %r14
movq (%r14), %rdi
movslq (%rbx), %rax
incq %rax
movl %eax, (%rbx)
imulq $0x2028, %rax, %rsi     # imm = 0x2028
callq 0x37b0
movq %rax, %r13
movq %rax, (%r14)
movslq (%rbx), %rax
imulq $0x2028, %rax, %r14     # imm = 0x2028
leaq (%r14,%r13), %rbp
addq $-0x2028, %rbp          # imm = 0xDFD8
movl $0x2028, %edx           # imm = 0x2028
movq %rbp, %rdi
xorl %esi, %esi
callq 0x3090
movq 0x8(%r15), %rax
movq %rax, 0x20(%rbp)
movq %r15, 0x8(%rbp)
movq (%r15), %rcx
movl $0x3, %esi
movl $0x1, %edx
leaq 0x9(%rsp), %rdi
callq 0x35b0
addq $0x3, 0x8(%r15)
cmpb $0x74, 0x9(%rsp)
jne 0x641f
cmpb $0x62, 0xa(%rsp)
jne 0x641f
cmpb $0x6b, 0xb(%rsp)
jne 0x641f
addq %r14, %r13
leaq -0x2018(%r13), %r12
movq (%r15), %rcx
movl $0x4, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x35b0
addq $0x4, 0x8(%r15)
leaq -0x10(%r13), %rdi
movq (%r15), %rcx
movl $0x8, %esi
movl $0x1, %edx
callq 0x35b0
addq $0x8, 0x8(%r15)
leaq -0x2010(%r13), %rdi
movq (%r15), %rcx
movl $0x8, %esi
movl $0x1, %edx
callq 0x35b0
addq $0x8, 0x8(%r15)
leaq -0x2000(%r13), %r14
movq (%r15), %rcx
movl $0x1fe9, %esi           # imm = 0x1FE9
movl $0x1, %edx
movq %r14, %rdi
callq 0x35b0
addq $0x1fe9, 0x8(%r15)      # imm = 0x1FE9
movq -0x2028(%r13), %rax
testq %rax, %rax
jne 0x62b7
movq %r14, %rdi
callq 0x3380
cmpb $0x0, 0x2(%rax,%r14)
je 0x62b5
leaq (%rax,%r14), %rdi
addq $0x2, %rdi
callq 0x35f0
movq %rax, (%rbp)
jmp 0x62b7
xorl %eax, %eax
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0x62c9
callq 0x35f0
movq %rax, (%rbp)
cmpl $0x64, (%r12)
jl 0x635c
movq -0x2020(%r13), %rax
movq -0x10(%r13), %rcx
movq %rcx, %rdx
movl $0xff, %r12d
andq %r12, %rdx
movl %edx, %esi
shrq $0x8, %rcx
cmpq $0x7, %rdx
movl $0x0, %r14d
cmovnel %r14d, %ecx
leaq 0x46d0a(%rip), %rbp     # 0x4d010
addl (%rbp,%rsi,4), %ecx
movq (%rax), %rdi
movslq %ecx, %rsi
imulq -0x2010(%r13), %rsi
movl $0x1, %edx
callq 0x3120
movq -0x10(%r13), %rax
movq %rax, %rcx
andq %r12, %rcx
movl %ecx, %edx
shrq $0x8, %rax
cmpq $0x7, %rcx
cmovnel %r14d, %eax
addl (%rbp,%rdx,4), %eax
cltq
imulq -0x2010(%r13), %rax
movq -0x2020(%r13), %rcx
addq %rax, 0x8(%rcx)
decl 0xc(%rsp)
jmp 0x6176
cmpl $0x0, 0xc(%rsp)
jne 0x6410
testq %rax, %rax
jne 0x6410
movq 0x10(%rsp), %rax
movq (%rax), %rax
movslq (%rbx), %rcx
imulq $0x2028, %rcx, %rcx     # imm = 0x2028
leaq (%rax,%rcx), %r15
movq -0x2020(%rax,%rcx), %rax
movq 0x10(%rax), %rdi
callq 0x35f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x33f0
movq %rax, %r14
movq %rax, %rdi
callq 0x3380
cmpl $0x5, %eax
jl 0x63eb
movl $0xfffffffc, %edx       # imm = 0xFFFFFFFC
leal (%rax,%rdx), %ecx
cmpb $0x2e, (%r14,%rcx)
jne 0x63eb
leal (%rdx,%rax), %esi
incl %esi
cmpb $0x74, (%r14,%rsi)
jne 0x63eb
leal (%rdx,%rax), %esi
addl $0x2, %esi
cmpb $0x62, (%r14,%rsi)
jne 0x63eb
addl %edx, %eax
addl $0x3, %eax
cmpb $0x6b, (%r14,%rax)
jne 0x63eb
movb $0x0, (%r14,%rcx)
movq %r14, %rdi
callq 0x35f0
movq %rax, -0x2028(%r15)
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3370
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r15), %rsi
leaq 0x46fa3(%rip), %rdi     # 0x4d3cd
xorl %eax, %eax
callq 0x60b2