// File: /workspace/github_c_makefile_star2_O0/jsh58[P]Genrich/Genrich.c
// Function: checkHeader
void checkHeader(char* line, int* chromLen, Chrom** chrom,
    int xcount, char** xchrList, int xBedLen, Bed* xBed,
    bool ctrl, bool sortOpt, bool verbose) {

  // load tag from SAM header line
  char* tag = strtok(line, TAB);
  if (tag == NULL)
    return;

  if (! strcmp(tag, "@HD")) {
    // first header line: check sort order
    char* order = NULL;
    char* field = strtok(NULL, TAB);
    while (field != NULL) {
      if (!strncmp(field, "SO:", 3))
        order = field + 3;
      field = strtok(NULL, TAB);
    }
    if (order != NULL) {
      // removing trailing '\n'
      int i;
      for (i = 0; order[i] != '\n' && order[i] != '\0'; i++) ;
      order[i] = '\0';
    }

    // sort order must be queryname
    if (sortOpt && (order == NULL
        || strcmp(order, "queryname")))
      exit(error("", ERRSORT));

  } else if (! strcmp(tag, "@SQ"))
    // load chrom lengths from header line
    loadChrom(line, chromLen, chrom, xcount, xchrList,
      xBedLen, xBed, ctrl, verbose);

}

// Assembly:
pushq %rbx
subq $0x80, %rsp
movl %ecx, 0x24(%rsp)
movq %rdx, 0x28(%rsp)
movq %rsi, %r10
movl 0x24(%rsp), %esi
movq %rdi, %r11
movq 0x28(%rsp), %rdi
movb 0xa8(%rsp), %al
movb 0xa0(%rsp), %cl
movb 0x98(%rsp), %dl
movq 0x90(%rsp), %rbx
movq %r11, 0x78(%rsp)
movq %r10, 0x70(%rsp)
movq %rdi, 0x68(%rsp)
movl %esi, 0x64(%rsp)
movq %r8, 0x58(%rsp)
movl %r9d, 0x54(%rsp)
andb $0x1, %dl
movb %dl, 0x53(%rsp)
andb $0x1, %cl
movb %cl, 0x52(%rsp)
andb $0x1, %al
movb %al, 0x51(%rsp)
movq 0x78(%rsp), %rdi
leaq 0xba8a(%rip), %rsi      # 0x1fd04
callq 0x2280
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0x14291
jmp 0x1441d
movq 0x48(%rsp), %rdi
leaq 0xba71(%rip), %rsi      # 0x1fd0e
callq 0x21a0
cmpl $0x0, %eax
jne 0x143b8
movq $0x0, 0x40(%rsp)
xorl %eax, %eax
movl %eax, %edi
leaq 0xba45(%rip), %rsi      # 0x1fd04
callq 0x2280
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x14311
movq 0x38(%rsp), %rdi
leaq 0xba35(%rip), %rsi      # 0x1fd12
movl $0x3, %edx
callq 0x2060
cmpl $0x0, %eax
jne 0x142fa
movq 0x38(%rsp), %rax
addq $0x3, %rax
movq %rax, 0x40(%rsp)
xorl %eax, %eax
movl %eax, %edi
leaq 0xb9ff(%rip), %rsi      # 0x1fd04
callq 0x2280
movq %rax, 0x38(%rsp)
jmp 0x142c9
cmpq $0x0, 0x40(%rsp)
je 0x14379
movl $0x0, 0x34(%rsp)
movq 0x40(%rsp), %rax
movslq 0x34(%rsp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, 0x23(%rsp)
je 0x14352
movq 0x40(%rsp), %rax
movslq 0x34(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x23(%rsp)
movb 0x23(%rsp), %al
testb $0x1, %al
jne 0x1435c
jmp 0x1436b
jmp 0x1435e
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x14321
movq 0x40(%rsp), %rax
movslq 0x34(%rsp), %rcx
movb $0x0, (%rax,%rcx)
testb $0x1, 0x52(%rsp)
je 0x143b6
cmpq $0x0, 0x40(%rsp)
je 0x1439e
movq 0x40(%rsp), %rdi
leaq 0xb982(%rip), %rsi      # 0x1fd16
callq 0x21a0
cmpl $0x0, %eax
je 0x143b6
leaq 0xb9cd(%rip), %rdi      # 0x1fd72
movl $0x19, %esi
callq 0x2840
movl %eax, %edi
callq 0x22b0
jmp 0x1441d
movq 0x48(%rsp), %rdi
leaq 0xb95c(%rip), %rsi      # 0x1fd20
callq 0x21a0
cmpl $0x0, %eax
jne 0x1441b
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdx
movl 0x64(%rsp), %ecx
movq 0x58(%rsp), %r8
movl 0x54(%rsp), %r9d
movq 0x90(%rsp), %r11
movb 0x53(%rsp), %r10b
movb 0x51(%rsp), %al
andb $0x1, %r10b
andb $0x1, %al
movq %r11, (%rsp)
movzbl %r10b, %r10d
movl %r10d, 0x8(%rsp)
movzbl %al, %eax
movl %eax, 0x10(%rsp)
callq 0x13fa0
jmp 0x1441d
addq $0x80, %rsp
popq %rbx
retq
nopw %cs:(%rax,%rax)