// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movq %rdi, %r13
leaq 0x140(%rsp), %rdi
movl $0xff, %edx
xorl %esi, %esi
callq 0xb2f0
testq %r14, %r14
je 0xa5215
movq %r14, %rdi
callq 0x3566a
testb %al, %al
jne 0xa5733
testq %r13, %r13
je 0xa571f
cmpq $0x0, (%r13)
je 0xa571f
leaq 0x49c78(%rip), %rsi     # 0xeeea8
movq %rbx, %rdi
callq 0xa4d64
movq %rax, %rdi
callq 0xa6700
movq %rax, %r15
movl $0x1, %edi
callq 0x6e93c
movq %rax, %r12
movq %r15, %rdi
callq 0xa672e
leaq 0x40(%rsp), %rdi
movl $0xff, %edx
xorl %esi, %esi
callq 0xb2f0
testq %r14, %r14
je 0xa527e
movq %r14, %rdi
callq 0x3566a
testb %al, %al
jne 0xa5738
testq %r15, %r15
je 0xa5729
testq %r12, %r12
je 0xa5729
movq %r12, %rdi
callq 0x6ecda
testq %rax, %rax
jne 0xa572e
movq %r13, 0x28(%rsp)
movq %r12, 0x8(%rsp)
movq %rbx, 0x30(%rsp)
movq %r15, %rdi
callq 0xa673e
movq %rax, %rbx
testq %rax, %rax
je 0xa5355
leaq 0x7(%rsp), %r12
movq %rbx, %rdi
callq 0x3c434
movq %rax, %rbp
movq %rbx, %rdi
callq 0x3c40b
movq %rax, %r13
cmpq $0x3, %rbp
jae 0xa538c
movsbq (%r13), %rbp
movb %bpl, 0x7(%rsp)
cmpb $0x0, 0x40(%rsp,%rbp)
jne 0xa53b1
movb $0x7f, 0x40(%rsp,%rbp)
cmpb $0xa, %bpl
je 0xa53e6
movl $0x1, %edx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x6ec0e
movq %rbx, %rdi
callq 0x3c434
cmpq $0x2, %rax
je 0xa53df
movq %rbx, %rdi
callq 0x3d1eb
movq %r15, %rdi
callq 0xa68c6
movq %r15, %rdi
callq 0xa673e
movq %rax, %rbx
testq %rax, %rax
jne 0xa52c9
movq 0x8(%rsp), %rdi
callq 0x6ecda
xorl %r12d, %r12d
testq %rax, %rax
jne 0xa5439
movq %r15, %rdi
callq 0xa68fa
leaq 0x55522(%rip), %rsi     # 0xfa89c
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3559f
jmp 0xa5433
movq %r15, %rdi
callq 0xa68e7
movq %rax, %r12
movq %r15, %rdi
callq 0xa68fa
leaq 0x5547d(%rip), %rsi     # 0xfa823
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
jmp 0xa5429
movq %r15, %rdi
callq 0xa68e7
movq %rax, %r12
movq %r15, %rdi
callq 0xa68fa
leaq 0x5548e(%rip), %rsi     # 0xfa859
movq %r14, %rdi
movl %ebp, %edx
movq %r12, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x3559f
jmp 0xa5433
cmpb $0xa, 0x1(%r13)
jne 0xa53fb
movq %rbx, %rdi
callq 0x3d1eb
movq %r15, %rdi
callq 0xa68c6
xorl %r12d, %r12d
jmp 0xa5441
movq %rbx, %rdi
callq 0x3c40b
movq %rax, %r12
movq %r15, %rdi
callq 0xa68e7
movq %rax, %r13
movq %r15, %rdi
callq 0xa68fa
leaq 0x55403(%rip), %rsi     # 0xfa823
movq %r14, %rdi
movq %r12, %rdx
movq %r13, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x3d1eb
xorl %ebx, %ebx
testl %r12d, %r12d
jne 0xa56c0
movq %r15, %rdi
callq 0xa688b
testb %al, %al
je 0xa56b5
leaq 0x52446(%rip), %r13     # 0xf78a9
xorl %ebx, %ebx
movq %r15, 0x38(%rsp)
testq %r14, %r14
je 0xa547f
movq %r14, %rdi
callq 0x3566a
testb %al, %al
jne 0xa5724
movl %ebx, 0x10(%rsp)
movq %r15, %rdi
callq 0xa673e
testq %rax, %rax
je 0xa571a
movq %rax, %r12
movq %rax, %rdi
callq 0x3c434
xorl %ebp, %ebp
cmpq $0x1, %rax
je 0xa54eb
movq %r12, %rdi
callq 0x3c40b
movq %rax, %rbx
movq %r15, %rdi
callq 0xa68e7
movq %rax, %r13
movq %r15, %rdi
callq 0xa68fa
movq %r14, %rdi
leaq 0x55354(%rip), %rsi     # 0xfa823
movq %rbx, %rdx
movq %r13, %rcx
leaq 0x523cd(%rip), %r13     # 0xf78a9
movq %rax, %r8
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %r12, %rdi
callq 0x3c40b
movsbq (%rax), %rax
cmpb $0x0, 0x140(%rsp,%rax)
movq %rax, 0x18(%rsp)
je 0xa5546
movq %r15, %rdi
callq 0xa68e7
movq %rax, %r13
movq %r15, %rdi
callq 0xa68fa
movq %r14, %rdi
leaq 0x553de(%rip), %rsi     # 0xfa901
movq 0x18(%rsp), %rdx
movq %r13, %rcx
leaq 0x52377(%rip), %r13     # 0xf78a9
movq %rax, %r8
xorl %eax, %eax
callq 0x3559f
movq 0x18(%rsp), %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movb $0x7f, 0x140(%rsp,%rax)
movq %r12, %rdi
callq 0x3d1eb
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testl %ebp, %ebp
jne 0xa5695
movq 0x28(%rsp), %rax
movq (%rax), %rdi
callq 0xb96b7
movl %eax, 0x24(%rsp)
movq %r15, %rdi
callq 0xa68c6
xorl %r12d, %r12d
movl $0x0, 0x14(%rsp)
movq %r15, %rdi
callq 0xa673e
testq %rax, %rax
je 0xa5695
movq %rax, %rbp
movq %rax, %rdi
callq 0x3c40b
movq %rax, %rdi
movq %r13, %rsi
callq 0xb890
testl %eax, %eax
je 0xa5675
movq %rbp, %rdi
callq 0x3c40b
movq %rax, %r12
movq %r15, %rdi
callq 0xa68e7
movq %r14, %rbx
movq %rax, %r14
movq %r15, %rdi
callq 0xa68fa
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
movl %r14d, %edx
movq %rbx, %r14
movq %rax, %rcx
movq %rbx, %r8
callq 0x3a443
testl %eax, %eax
je 0xa55ff
movl %eax, %r12d
movb $0x1, %al
jmp 0xa568d
movq 0x28(%rsp), %r13
movq (%r13), %rdi
movq 0x18(%rsp), %rsi
callq 0xb9d2d
movzbl %al, %r14d
movq (%r13), %r12
movl 0x14(%rsp), %r15d
movl %r15d, %esi
movq 0x8(%rsp), %rdi
callq 0x6e9fa
movsbl (%rax), %esi
movq %r12, %rdi
callq 0xb9d2d
movzbl %al, %edx
cmpb $-0x2, %r14b
movl 0x24(%rsp), %eax
cmovel %eax, %r14d
cmpb $-0x2, %dl
cmovel %eax, %edx
movl 0x40(%rsp), %ecx
movq %r13, %rdi
leaq 0x5224f(%rip), %r13     # 0xf78a9
movl %r14d, %esi
movq %rbx, %r14
callq 0xa584e
incl %r15d
movl %r15d, 0x14(%rsp)
movq 0x38(%rsp), %r15
xorl %r12d, %r12d
movq %rbp, %rdi
callq 0x3d1eb
movq %r15, %rdi
callq 0xa68c6
movq %r15, %rdi
callq 0xa68b3
testb %al, %al
je 0xa5588
testl %r12d, %r12d
jne 0xa56ba
movl 0x10(%rsp), %ebx
incl %ebx
movq %r15, %rdi
callq 0xa688b
testb %al, %al
jne 0xa546a
xorl %r12d, %r12d
jmp 0xa56be
xorl %r12d, %r12d
jmp 0xa56c0
movl 0x10(%rsp), %ebx
movl %ebx, %ebx
testl %r12d, %r12d
jne 0xa56f3
movq 0x8(%rsp), %rdi
callq 0x6ecda
xorl %r12d, %r12d
cmpq %rbx, %rax
je 0xa56f3
leaq 0x550b3(%rip), %rsi     # 0xfa791
movq %r14, %rdi
movq 0x30(%rsp), %rdx
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rdi
callq 0x6f134
movq %r15, %rdi
callq 0xa6d03
movl %r12d, %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x228ce
callq 0x22907
callq 0x22897
callq 0x22829
callq 0x22860
callq 0x227b9
callq 0x227f2