// File: /workspace/github_c_makefile_star2_O0/jsh58[P]Genrich/Genrich.c
// Function: getBAMscore
float getBAMscore(char* extra, int len) {
  if (extra == NULL)
    return NOSCORE;

  // check auxiliary field
  char tag[3], val;
  tag[2] = '\0';
  int i = 0;
  while (i < len - 4) {

    // load tag and value
    for (int j = 0; j < 3; j++) {
      if (j < 2)
        tag[j] = extra[i];
      else
        val = extra[i];
      i++;
    }

    if (! strcmp(tag, SCORE)) {

      // return alignment score (cast to float)
      extra += i;
      switch (val) {
        case 'c':
          return (float) (int8_t) loadInt(extra, sizeof(int8_t));
        case 'C':
          return (float) (uint8_t) loadInt(extra, sizeof(uint8_t));
        case 's':
          return (float) (int16_t) loadInt(extra, sizeof(int16_t));
        case 'S':
          return (float) (uint16_t) loadInt(extra, sizeof(uint16_t));
        case 'i':
          return (float) (int32_t) loadInt(extra, sizeof(int32_t));
        case 'I':
          return (float) (uint32_t) loadInt(extra, sizeof(uint32_t));
        default: ;
          char msg[4] = "' '";
          msg[1] = val;
          exit(error(msg, ERRTYPE));
      }

    } else {

      // skip to next auxiliary field
      switch (val) {
        case 'A': i++; break;
        case 'c': i += sizeof(int8_t); break;
        case 'C': i += sizeof(uint8_t); break;
        case 's': i += sizeof(int16_t); break;
        case 'S': i += sizeof(uint16_t); break;
        case 'i': i += sizeof(int32_t); break;
        case 'I': i += sizeof(uint32_t); break;
        case 'f': i += sizeof(float); break;
        case 'Z': for (; extra[i] != '\0'; i++) ; i++; break;
        case 'H': for (; extra[i] != '\0'; i += 2) ; i++; break;
        case 'B': i += arrayLen(extra + i); break;
        default: ;
          char msg[4] = "' '";
          msg[1] = val;
          exit(error(msg, ERRTYPE));
      }
    }

    // check if field has gone past end of block
    if (i > len)
      exit(error("", ERRAUX));
  }

  return NOSCORE;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x167e8
movss 0x79d7(%rip), %xmm0     # 0x1e1b4
movss %xmm0, 0x34(%rsp)
jmp 0x16b37
movb $0x0, 0x23(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl 0x24(%rsp), %ecx
subl $0x4, %ecx
cmpl %ecx, %eax
jge 0x16b29
movl $0x0, 0x18(%rsp)
cmpl $0x3, 0x18(%rsp)
jge 0x1685f
cmpl $0x2, 0x18(%rsp)
jge 0x16836
movq 0x28(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb (%rax,%rcx), %cl
movslq 0x18(%rsp), %rax
movb %cl, 0x21(%rsp,%rax)
jmp 0x16847
movq 0x28(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x20(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x16810
leaq 0x21(%rsp), %rdi
leaq 0x94b9(%rip), %rsi      # 0x1fd24
callq 0x21a0
cmpl $0x0, %eax
jne 0x169a1
movslq 0x1c(%rsp), %rcx
movq 0x28(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movsbl 0x20(%rsp), %eax
addl $-0x43, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x30, %eax
ja 0x16979
movq 0x8(%rsp), %rax
leaq 0x7af5(%rip), %rcx      # 0x1e3a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x16750
movsbl %al, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x34(%rsp)
jmp 0x16b37
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x16750
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x34(%rsp)
jmp 0x16b37
movq 0x28(%rsp), %rdi
movl $0x2, %esi
callq 0x16750
cwtl
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x34(%rsp)
jmp 0x16b37
movq 0x28(%rsp), %rdi
movl $0x2, %esi
callq 0x16750
movzwl %ax, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x34(%rsp)
jmp 0x16b37
movq 0x28(%rsp), %rdi
movl $0x4, %esi
callq 0x16750
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x34(%rsp)
jmp 0x16b37
movq 0x28(%rsp), %rdi
movl $0x4, %esi
callq 0x16750
movl %eax, %eax
cvtsi2ss %rax, %xmm0
movss %xmm0, 0x34(%rsp)
jmp 0x16b37
movl 0x93a8(%rip), %eax      # 0x1fd27
movl %eax, 0x14(%rsp)
movb 0x20(%rsp), %al
movb %al, 0x15(%rsp)
leaq 0x14(%rsp), %rdi
movl $0x1a, %esi
callq 0x2840
movl %eax, %edi
callq 0x22b0
movsbl 0x20(%rsp), %eax
addl $-0x41, %eax
movl %eax, %ecx
movq %rcx, (%rsp)
subl $0x32, %eax
ja 0x16ad8
movq (%rsp), %rax
leaq 0x7aa5(%rip), %rcx      # 0x1e468
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x16b00
movslq 0x1c(%rsp), %rax
addq $0x1, %rax
movl %eax, 0x1c(%rsp)
jmp 0x16b00
movslq 0x1c(%rsp), %rax
addq $0x1, %rax
movl %eax, 0x1c(%rsp)
jmp 0x16b00
movslq 0x1c(%rsp), %rax
addq $0x2, %rax
movl %eax, 0x1c(%rsp)
jmp 0x16b00
movslq 0x1c(%rsp), %rax
addq $0x2, %rax
movl %eax, 0x1c(%rsp)
jmp 0x16b00
movslq 0x1c(%rsp), %rax
addq $0x4, %rax
movl %eax, 0x1c(%rsp)
jmp 0x16b00
movslq 0x1c(%rsp), %rax
addq $0x4, %rax
movl %eax, 0x1c(%rsp)
jmp 0x16b00
movslq 0x1c(%rsp), %rax
addq $0x4, %rax
movl %eax, 0x1c(%rsp)
jmp 0x16b00
jmp 0x16a5c
movq 0x28(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x16a7e
jmp 0x16a71
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x16a5c
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x16b00
jmp 0x16a8d
movq 0x28(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x16aaf
jmp 0x16aa2
movl 0x1c(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x1c(%rsp)
jmp 0x16a8d
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x16b00
movq 0x28(%rsp), %rdi
movslq 0x1c(%rsp), %rax
addq %rax, %rdi
callq 0x16670
addl 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
jmp 0x16b00
movl 0x9249(%rip), %eax      # 0x1fd27
movl %eax, 0x10(%rsp)
movb 0x20(%rsp), %al
movb %al, 0x11(%rsp)
leaq 0x10(%rsp), %rdi
movl $0x1a, %esi
callq 0x2840
movl %eax, %edi
callq 0x22b0
jmp 0x16b02
movl 0x1c(%rsp), %eax
cmpl 0x24(%rsp), %eax
jle 0x16b24
leaq 0x925f(%rip), %rdi      # 0x1fd72
movl $0x1b, %esi
callq 0x2840
movl %eax, %edi
callq 0x22b0
jmp 0x167f5
movss 0x7683(%rip), %xmm0     # 0x1e1b4
movss %xmm0, 0x34(%rsp)
movss 0x34(%rsp), %xmm0
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)