// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/chunk.c
// Function: tbk_print1
void tbk_print1(tbk_data_t *d, int i, view_conf_t *conf, kstring_t *ks) {

  switch(DATA_TYPE(d->dtype)) {
  case DT_INT1: {
    ksprintf(ks, "\t%d", ((uint8_t*)(d->data))[i]);
    break;
  }
  case DT_INT2: {
    ksprintf(ks, "\t%d", ((uint8_t*)(d->data))[i]);
    break;
  }
  case DT_INT32: {
    int data = ((int32_t*) (d->data))[i];
    if (conf->na_for_negative && data < 0) { kputc('\t', ks); kputs(conf->na_token, ks); }
    else ksprintf(ks, "\t%d", data);
    break;
  }
  case DT_FLOAT: {
    float data = ((float*) (d->data))[i];
    if (conf->na_for_negative && data < 0) { kputc('\t', ks); kputs(conf->na_token, ks); }
    else ksprintf(ks, "\t%f", data);
    break;
  }
  case DT_DOUBLE: {
    double data = ((double*) (d->data))[i];
    if (conf->na_for_negative && data < 0) { kputc('\t', ks); kputs(conf->na_token, ks); }
    else ksprintf(ks, "\t%f", data);
    break;
  }
  case DT_STRINGF: {
    char *data = ((char*) (d->data)) + i*STRING_MAX(d->dtype);
    kputc('\t', ks); kputs(data, ks);
    break;
  }
  case DT_STRINGD: {
    char *data = ((char**) (d->data))[i];
    kputc('\t', ks); kputs(data, ks);
    free(data);
    break;
  }
  case DT_ONES: {
    float data = ((float*) (d->data))[i];
    if (conf->na_for_negative && data < 0) { kputc('\t', ks); kputs(conf->na_token, ks); }
    else ksprintf(ks, "\t%.*f", conf->precision, data);
    break;
  }
  case DT_FLOAT_INT: {
    float data = ((float*) (d->data))[i*2];
    int data2 = ((int32_t*) (d->data))[i*2+1];
    if (conf->na_for_negative && data < 0) {
      kputc('\t', ks); kputs(conf->na_token, ks);
    } else {
      if (conf->min_coverage >= 0 && data2 < conf->min_coverage) {
        kputc('\t', ks); kputs(conf->na_token, ks);
      } else {
        ksprintf(ks, "\t%f", data);
      }
    }
    if (conf->print_all_units) ksprintf(ks, "\t%d", data2);
    break;
  }
  case DT_FLOAT_FLOAT: {
    float data = ((float*) (d->data))[i*2];
    float data2 = ((float*) (d->data))[i*2+1];
    if (conf->na_for_negative && data < 0) {
      kputc('\t', ks); kputs(conf->na_token, ks);
    } else {
      if (conf->max_pval >= 0 && data2 > conf->max_pval) {
        kputc('\t', ks); kputs(conf->na_token, ks);
      } else {
        ksprintf(ks, "\t%f", data);
      }
    }
    if (conf->print_all_units) ksprintf(ks, "\t%f", data2);
    break;
  }
  default: wzfatal("Unrecognized data type: %d.\n", DATA_TYPE(d->dtype));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq (%rdi), %r15
movzbl %r15b, %eax
leal -0x1(%rax), %ecx
cmpl $0x6, %ecx
ja 0x5bae
leaq 0x39e55(%rip), %rax     # 0x3f9d4
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x8(%rdi), %rax
movslq %esi, %rcx
movzbl (%rax,%rcx), %edx
leaq 0x39798(%rip), %rsi     # 0x3f332
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8c8a
cmpl $0x1e, %eax
je 0x5cdc
cmpl $0x1f, %eax
je 0x5c5d
cmpl $0x20, %eax
jne 0x5e28
movq 0x8(%rdi), %rax
leal (%rsi,%rsi), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
leal 0x1(,%rsi,2), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm3
cmpl $0x0, 0x10(%r14)
movss %xmm3, 0x4(%rsp)
je 0x5bfc
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
ja 0x5c17
movss 0x30(%r14), %xmm1
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm1
jb 0x5ddc
ucomiss %xmm1, %xmm3
jbe 0x5ddc
pushq $0x9
popq %rdi
movq %rbx, %rsi
callq 0x5e3a
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x5ebf
jmp 0x5df1
movq 0x8(%rdi), %rax
movslq %esi, %rcx
movsd (%rax,%rcx,8), %xmm0
cmpl $0x0, 0x10(%r14)
je 0x5e02
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x5d3c
jmp 0x5e02
movq 0x8(%rdi), %rax
leal (%rsi,%rsi), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
leal 0x1(,%rsi,2), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %ebp
cmpl $0x0, 0x10(%r14)
je 0x5c88
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
ja 0x5c9c
movl 0x34(%r14), %eax
testl %eax, %eax
js 0x5daf
cmpl %eax, %ebp
jge 0x5daf
pushq $0x9
popq %rdi
movq %rbx, %rsi
callq 0x5e3a
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x5ebf
jmp 0x5dc4
movq 0x8(%rdi), %rax
movslq %esi, %rcx
movl (%rax,%rcx,4), %edx
cmpl $0x0, 0x10(%r14)
setne %al
testl %edx, %edx
sets %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x5b93
jmp 0x5d3c
movq 0x8(%rdi), %rax
movslq %esi, %rcx
movss (%rax,%rcx,4), %xmm0
cmpl $0x0, 0x10(%r14)
je 0x5cf7
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
ja 0x5d3c
movl (%r14), %edx
cvtss2sd %xmm0, %xmm0
leaq 0x39635(%rip), %rsi     # 0x3f33a
movq %rbx, %rdi
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8c8a
movq 0x8(%rdi), %rax
movslq %esi, %rcx
movss (%rax,%rcx,4), %xmm0
cmpl $0x0, 0x10(%r14)
je 0x5dfe
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x5dfe
pushq $0x9
popq %rdi
movq %rbx, %rsi
callq 0x5e3a
movq 0x18(%r14), %rdi
jmp 0x5d9d
movq 0x8(%rdi), %rax
movslq %esi, %rcx
movq (%rax,%rcx,8), %r14
pushq $0x9
popq %rdi
movq %rbx, %rsi
callq 0x5e3a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5ebf
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3370
movslq %esi, %rax
shrq $0x8, %r15
imulq %rax, %r15
addq 0x8(%rdi), %r15
pushq $0x9
popq %rdi
movq %rbx, %rsi
callq 0x5e3a
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5ebf
cvtss2sd %xmm0, %xmm0
leaq 0x3957c(%rip), %rsi     # 0x3f336
movq %rbx, %rdi
movb $0x1, %al
callq 0x8c8a
cmpl $0x0, 0xc(%r14)
je 0x5e1d
leaq 0x39560(%rip), %rsi     # 0x3f332
movq %rbx, %rdi
movl %ebp, %edx
jmp 0x5b9d
cvtss2sd %xmm0, %xmm0
leaq 0x3954f(%rip), %rsi     # 0x3f336
movq %rbx, %rdi
movb $0x1, %al
callq 0x8c8a
cmpl $0x0, 0xc(%r14)
movss 0x4(%rsp), %xmm0
je 0x5e1d
cvtss2sd %xmm0, %xmm0
leaq 0x3952d(%rip), %rsi     # 0x3f336
movq %rbx, %rdi
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8c8a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movzbl %r15b, %esi
leaq 0x3950d(%rip), %rdi     # 0x3f340
xorl %eax, %eax
callq 0x5f58