// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/core/score_matrix.c
// Function: parse_score_matrix
static int parse_score_matrix(GtScoreMatrix *sm, const char *path,
                              GtError *err)
{
  GtTokenizer *tz;
  GtArray *index_to_alpha_char_mapping;
  unsigned int parsed_score_lines = 0;
  char parsed_characters[UCHAR_MAX] = { 0 };
  int had_err = 0;
  gt_error_check(err);
  gt_assert(sm && path && sm->alphabet);
  tz = gt_tokenizer_new(gt_io_new(path, "r"));
  index_to_alpha_char_mapping = gt_array_new(sizeof (char));
  gt_tokenizer_skip_comment_lines(tz);
  had_err = parse_alphabet_line(index_to_alpha_char_mapping, tz, err);
  if (!had_err) {
    while (gt_tokenizer_has_token(tz)) {
      had_err = parse_score_line(sm, tz, index_to_alpha_char_mapping,
                                 parsed_characters, err);
      if (had_err)
        break;
      parsed_score_lines++;
    }
  }

  /* check the number of parsed score lines */
  if (!had_err &&
      parsed_score_lines != gt_array_size(index_to_alpha_char_mapping)) {
    gt_error_set(err, "the score matrix given in '%s' is not symmetric", path);
    had_err = -1;
  }

  gt_array_delete(index_to_alpha_char_mapping);
  gt_tokenizer_delete(tz);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x140(%rsp), %rdi
movl $0xff, %edx
xorl %esi, %esi
callq 0xb2f0
testq %r14, %r14
je 0xa49dd
movq %r14, %rdi
callq 0x34fea
testb %al, %al
jne 0xa4ec4
testq %r12, %r12
je 0xa4eb0
cmpq $0x0, (%r12)
je 0xa4eb0
leaq 0x4a465(%rip), %rsi     # 0xeee5d
movq %r15, %rdi
callq 0xa4530
movq %rax, %rdi
callq 0xa5e2c
movq %rax, %rbx
movl $0x1, %edi
callq 0x6ef7c
movq %rax, %r13
movq %rbx, %rdi
callq 0xa5e5a
leaq 0x40(%rsp), %rdi
movl $0xff, %edx
xorl %esi, %esi
callq 0xb2f0
testq %r14, %r14
je 0xa4a46
movq %r14, %rdi
callq 0x34fea
testb %al, %al
jne 0xa4ec9
testq %rbx, %rbx
je 0xa4eba
testq %r13, %r13
je 0xa4eba
movq %r12, 0x28(%rsp)
movq %r15, 0x30(%rsp)
movq %r14, 0x10(%rsp)
movq %r13, %rdi
callq 0x6f310
testq %rax, %rax
jne 0xa4ebf
movq %rbx, %rdi
callq 0xa5e6a
testq %rax, %rax
je 0xa4b1d
movq %rax, %r12
leaq 0xf(%rsp), %r14
movq %r12, %rdi
callq 0x3bb86
movq %rax, %r15
movq %r12, %rdi
callq 0x3bb5d
movq %rax, %rbp
cmpq $0x3, %r15
jae 0xa4b5c
movsbq (%rbp), %r15
movb %r15b, 0xf(%rsp)
cmpb $0x0, 0x40(%rsp,%r15)
jne 0xa4b86
movb $0x7f, 0x40(%rsp,%r15)
cmpb $0xa, %r15b
je 0xa4bc4
movl $0x1, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x6f240
movq %r12, %rdi
callq 0x3bb86
cmpq $0x2, %rax
je 0xa4bba
movq %r12, %rdi
callq 0x3c87b
movq %rbx, %rdi
callq 0xa5ff9
movq %rbx, %rdi
callq 0xa5e6a
movq %rax, %r12
testq %rax, %rax
jne 0xa4a91
movq %r13, %rdi
callq 0x6f310
testq %rax, %rax
je 0xa4b36
xorl %edi, %edi
callq 0x3c87b
jmp 0xa4bd4
movq %rbx, %rdi
callq 0xa602d
leaq 0x55cc7(%rip), %rsi     # 0xfa80c
xorl %r12d, %r12d
movq 0x10(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x34f1f
jmp 0xa4e73
movq %rbx, %rdi
callq 0xa601a
movq %rax, %r14
movq %rbx, %rdi
callq 0xa602d
leaq 0x55c1d(%rip), %rsi     # 0xfa793
movq 0x10(%rsp), %rdi
movq %rbp, %rdx
movq %r14, %rcx
jmp 0xa4e69
movq %rbx, %rdi
callq 0xa601a
movq %rax, %r14
movq %rbx, %rdi
callq 0xa602d
leaq 0x55c29(%rip), %rsi     # 0xfa7c9
movq 0x10(%rsp), %rdi
movl %r15d, %edx
movq %r14, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x34f1f
jmp 0xa4e73
cmpb $0xa, 0x1(%rbp)
jne 0xa4e39
movq %r12, %rdi
callq 0x3c87b
movq %rbx, %rdi
callq 0xa5ff9
movq 0x10(%rsp), %r15
movq %rbx, %rdi
callq 0xa5fbe
testb %al, %al
je 0xa4dca
xorl %ebp, %ebp
movl %ebp, 0x24(%rsp)
testq %r15, %r15
je 0xa4c04
movq %r15, %rdi
callq 0x34fea
testb %al, %al
jne 0xa4eb5
movq %rbx, %rdi
callq 0xa5e6a
testq %rax, %rax
je 0xa4eab
movq %rax, %r14
movq %rax, %rdi
callq 0x3bb86
movq %rax, %rbp
cmpq $0x1, %rax
je 0xa4c63
movq %r14, %rdi
callq 0x3bb5d
movq %rax, %r15
movq %rbx, %rdi
callq 0xa601a
movq %rax, %r12
movq %rbx, %rdi
callq 0xa602d
movq 0x10(%rsp), %rdi
leaq 0x55b40(%rip), %rsi     # 0xfa793
movq %r15, %rdx
movq %r12, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x34f1f
movq %r14, %rdi
callq 0x3bb5d
movsbq (%rax), %r12
cmpb $0x0, 0x140(%rsp,%r12)
jne 0xa4dfc
movq %r12, 0x38(%rsp)
movb $0x7f, 0x140(%rsp,%r12)
movq %r14, %rdi
callq 0x3c87b
cmpq $0x1, %rbp
jne 0xa4e7b
movq 0x28(%rsp), %rax
movq (%rax), %rdi
callq 0xba7a2
movl %eax, %r12d
movq %rbx, %rdi
callq 0xa5ff9
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0xa5e6a
testq %rax, %rax
je 0xa4daa
movq %rax, %r14
movq %rax, %rdi
callq 0x3bb5d
cmpb $0xa, (%rax)
jne 0xa4d00
cmpb $0x0, 0x1(%rax)
jne 0xa4d00
movq %r14, %rdi
callq 0x3c87b
movq %rbx, %rdi
callq 0xa5ff9
movq %rbx, %rdi
callq 0xa5fe6
testb %al, %al
je 0xa4cb8
jmp 0xa4daa
movl %r12d, 0x20(%rsp)
movq %r14, %rdi
callq 0x3bb5d
movq %rax, %r15
movq %rbx, %rdi
callq 0xa601a
movq %rax, %r12
movq %rbx, %rdi
callq 0xa602d
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
movl %r12d, %edx
movq %rax, %rcx
movq 0x10(%rsp), %r8
callq 0x39bd7
testl %eax, %eax
jne 0xa4ea6
movl %ebp, 0x1c(%rsp)
movq 0x28(%rsp), %rbp
movq (%rbp), %rdi
movq 0x38(%rsp), %rsi
callq 0xbae41
movzbl %al, %r15d
movq (%rbp), %r12
movl 0x1c(%rsp), %esi
movq %r13, %rdi
callq 0x6f037
movsbl (%rax), %esi
movq %r12, %rdi
callq 0xbae41
movzbl %al, %edx
cmpb $-0x2, %r15b
movl 0x20(%rsp), %r12d
cmovel %r12d, %r15d
cmpb $-0x2, %dl
cmovel %r12d, %edx
movl 0x40(%rsp), %ecx
movq %rbp, %rdi
movl 0x1c(%rsp), %ebp
movl %r15d, %esi
callq 0xa4fde
incl %ebp
jmp 0xa4cdf
movl 0x24(%rsp), %ebp
incl %ebp
movq %rbx, %rdi
callq 0xa5fbe
testb %al, %al
movq 0x10(%rsp), %r15
jne 0xa4beb
movl %ebp, %r14d
jmp 0xa4dcd
xorl %r14d, %r14d
movq %r13, %rdi
callq 0x6f310
cmpq %r14, %rax
movl $0x0, %r14d
je 0xa4e81
leaq 0x55916(%rip), %rsi     # 0xfa701
movq %r15, %rdi
movq 0x30(%rsp), %rdx
xorl %eax, %eax
callq 0x34f1f
jmp 0xa4e7b
movq %rbx, %rdi
callq 0xa601a
movq %rax, %r15
movq %rbx, %rdi
callq 0xa602d
leaq 0x55a5b(%rip), %rsi     # 0xfa871
movq 0x10(%rsp), %rdi
movl %r12d, %edx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x34f1f
movb $0x7f, 0x140(%rsp,%r12)
movq %r14, %rdi
jmp 0xa4e76
movq %r12, %rdi
callq 0x3bb5d
movq %rax, %r14
movq %rbx, %rdi
callq 0xa601a
movq %rax, %r15
movq %rbx, %rdi
callq 0xa602d
leaq 0x55935(%rip), %rsi     # 0xfa793
movq 0x10(%rsp), %rdi
movq %r14, %rdx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x34f1f
movq %r12, %rdi
callq 0x3c87b
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq %r13, %rdi
callq 0x6f768
movq %rbx, %rdi
callq 0xa643c
movl %r14d, %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %r14d
jmp 0xa4e81
callq 0x227f6
callq 0x2282f
callq 0x227bf
callq 0x22751
callq 0x22788
callq 0x226e1
callq 0x2271a