// File: /workspace/github_c_makefile_star2_O2/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 0x84b9a
movq %r14, %rdi
callq 0xc103
testb %al, %al
jne 0x85109
testq %r12, %r12
je 0x85081
cmpq $0x0, (%r12)
je 0x85081
leaq 0x53250(%rip), %rsi     # 0xd7e05
movq %r15, %rdi
callq 0x8443c
movq %rax, %rdi
callq 0x8659c
movq %rax, %rbx
pushq $0x1
popq %rdi
callq 0x4b380
movq %rax, %r13
movq %rbx, %rdi
callq 0x865f5
leaq 0x40(%rsp), %rdi
movl $0xff, %edx
xorl %esi, %esi
callq 0xb2f0
testq %r14, %r14
je 0x84c01
movq %r14, %rdi
callq 0xc103
testb %al, %al
jne 0x85137
testq %rbx, %rbx
je 0x850b2
testq %r13, %r13
je 0x850b2
movq %r12, 0x30(%rsp)
movq %r15, 0x38(%rsp)
movq %r14, 0x10(%rsp)
movq %r13, %rdi
callq 0x4b988
testq %rax, %rax
jne 0x850df
pushq $0x1
popq %rbp
movq %rbx, %rdi
callq 0x86636
movq %rax, %r12
testq %rax, %rax
je 0x84cba
movq %r12, %rdi
callq 0x14461
movq %rax, %r15
movq %r12, %rdi
callq 0x143d2
movq %rax, %r14
cmpq $0x3, %r15
jae 0x84fa3
movsbq (%r14), %r15
movb %r15b, 0xf(%rsp)
cmpb $0x0, 0x40(%rsp,%r15)
jne 0x84cd4
movb $0x7f, 0x40(%rsp,%r15)
cmpb $0xa, %r15b
je 0x84d13
movq %r13, %rdi
leaq 0xf(%rsp), %rsi
movq %rbp, %rdx
callq 0x4b801
movq %r12, %rdi
callq 0x14461
cmpq $0x2, %rax
je 0x84d08
movq %r12, %rdi
callq 0x152db
movq %rbx, %rdi
callq 0x868a0
jmp 0x84c36
movq %r13, %rdi
callq 0x4b988
testq %rax, %rax
je 0x84fd4
xorl %edi, %edi
callq 0x152db
jmp 0x84d23
movq %rbx, %rdi
callq 0x868f1
movq %rax, %r14
movq %rbx, %rdi
callq 0x86937
leaq 0x5edeb(%rip), %rsi     # 0xe3ad9
movq 0x10(%rsp), %rdi
movl %r15d, %edx
movq %r14, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc007
jmp 0x84ff2
cmpb $0xa, 0x1(%r14)
jne 0x84f98
movq %r12, %rdi
callq 0x152db
movq %rbx, %rdi
callq 0x868a0
pushq $-0x1
popq %r15
xorl %ebp, %ebp
movq 0x10(%rsp), %r12
movq %rbx, %rdi
callq 0x86803
testb %al, %al
je 0x84f64
movl %ebp, 0x2c(%rsp)
testq %r12, %r12
je 0x84d57
movq %r12, %rdi
callq 0xc103
testb %al, %al
jne 0x85054
movq %rbx, %rdi
callq 0x86636
testq %rax, %rax
je 0x85023
movq %rax, %r14
movq %rax, %rdi
callq 0x14461
xorl %ebp, %ebp
cmpq $0x1, %rax
je 0x84dc1
movq %r14, %rdi
callq 0x143d2
movq %rax, %r15
movq %rbx, %rdi
callq 0x868f1
movq %rax, %r12
movq %rbx, %rdi
callq 0x86937
movq 0x10(%rsp), %rdi
leaq 0x5ecfe(%rip), %rsi     # 0xe3aa3
movq %r15, %rdx
pushq $-0x1
popq %r15
movq %r12, %rcx
movq 0x10(%rsp), %r12
movq %rax, %r8
xorl %eax, %eax
callq 0xc007
movl %r15d, %ebp
movq %r14, %rdi
callq 0x143d2
movsbq (%rax), %rax
cmpb $0x0, 0x140(%rsp,%rax)
movq %rax, 0x20(%rsp)
je 0x84e17
movq %rbx, %rdi
callq 0x868f1
movq %rax, %r15
movq %rbx, %rdi
callq 0x86937
movq %r12, %rdi
leaq 0x5ed88(%rip), %rsi     # 0xe3b81
movq 0x20(%rsp), %rdx
movq %r15, %rcx
pushq $-0x1
popq %r15
movq %rax, %r8
xorl %eax, %eax
callq 0xc007
movq 0x20(%rsp), %rax
movl %r15d, %ebp
movb $0x7f, 0x140(%rsp,%rax)
movq %r14, %rdi
callq 0x152db
testl %ebp, %ebp
jne 0x84ffe
movq 0x30(%rsp), %rax
movq (%rax), %rdi
callq 0x9b59a
movl %eax, 0x28(%rsp)
movq %rbx, %rdi
callq 0x868a0
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x86636
testq %rax, %rax
je 0x84f59
movq %rax, %r14
movq %rax, %rdi
callq 0x143d2
cmpb $0xa, (%rax)
jne 0x84e92
cmpb $0x0, 0x1(%rax)
jne 0x84e92
movq %r14, %rdi
callq 0x152db
movq %rbx, %rdi
callq 0x868a0
movq %rbx, %rdi
callq 0x8685c
testb %al, %al
je 0x84e4a
jmp 0x84f59
movq %r14, %rdi
callq 0x143d2
movq %rax, %r15
movq %rbx, %rdi
callq 0x868f1
movq %rax, %r12
movq %rbx, %rdi
callq 0x86937
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
movl %r12d, %edx
movq %rax, %rcx
movq 0x10(%rsp), %r8
callq 0x11f9e
testl %eax, %eax
jne 0x84f93
movl %ebp, 0x1c(%rsp)
movq 0x30(%rsp), %rbp
movq (%rbp), %rdi
movq 0x20(%rsp), %rsi
callq 0x9be5e
movzbl %al, %r15d
movq (%rbp), %r12
movl 0x1c(%rsp), %esi
movq %r13, %rdi
callq 0x4b48e
movsbl (%rax), %esi
movq %r12, %rdi
movq 0x10(%rsp), %r12
callq 0x9be5e
movzbl %al, %edx
cmpb $-0x2, %r15b
movl 0x28(%rsp), %eax
cmovel %eax, %r15d
cmpb $-0x2, %dl
cmovel %eax, %edx
movl 0x40(%rsp), %ecx
movq %rbp, %rdi
movl 0x1c(%rsp), %ebp
movl %r15d, %esi
callq 0x85368
incl %ebp
movq %r14, %rdi
callq 0x152db
movq %rbx, %rdi
callq 0x868a0
movq %rbx, %rdi
callq 0x8685c
testb %al, %al
pushq $-0x1
popq %r15
je 0x84e4a
movl 0x2c(%rsp), %ebp
incl %ebp
jmp 0x84d2e
movl %ebp, %r14d
movq %r13, %rdi
callq 0x4b988
xorl %r15d, %r15d
cmpq %r14, %rax
je 0x84ffe
leaq 0x5ea8f(%rip), %rsi     # 0xe3a11
movq %r12, %rdi
movq 0x38(%rsp), %rdx
xorl %eax, %eax
callq 0xc007
jmp 0x84ffa
movl %eax, %r15d
jmp 0x84ffe
movq %r12, %rdi
callq 0x143d2
movq %rax, %r14
movq %rbx, %rdi
callq 0x868f1
movq %rax, %r15
movq %rbx, %rdi
callq 0x86937
leaq 0x5eae6(%rip), %rsi     # 0xe3aa3
movq 0x10(%rsp), %rdi
movq %r14, %rdx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc007
jmp 0x84ff2
movq %rbx, %rdi
callq 0x86937
leaq 0x5eb39(%rip), %rsi     # 0xe3b1c
movq 0x10(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xc007
movq %r12, %rdi
callq 0x152db
pushq $-0x1
popq %r15
movq %r13, %rdi
callq 0x4c19d
movq %rbx, %rdi
callq 0x86da2
movl %r15d, %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa8f8e(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x45032(%rip), %rsi     # 0xca066
leaq 0x5f210(%rip), %rdx     # 0xe424b
leaq 0x5eb2e(%rip), %rcx     # 0xe3b70
leaq 0x5e875(%rip), %r8      # 0xe38be
movl $0x81, %r9d
jmp 0x85161
movq 0xa8f5d(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x45001(%rip), %rsi     # 0xca066
leaq 0x455ed(%rip), %rdx     # 0xca659
leaq 0x5eafd(%rip), %rcx     # 0xe3b70
leaq 0x5e844(%rip), %r8      # 0xe38be
pushq $0x7f
jmp 0x8515f
movq 0xa8f30(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x44fd4(%rip), %rsi     # 0xca066
leaq 0x5e95d(%rip), %rdx     # 0xe39f6
leaq 0x5e943(%rip), %rcx     # 0xe39e3
leaq 0x5e817(%rip), %r8      # 0xe38be
movl $0xc2, %r9d
jmp 0x85161
movq 0xa8eff(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x44fa3(%rip), %rsi     # 0xca066
leaq 0x5e98b(%rip), %rdx     # 0xe3a55
leaq 0x5e970(%rip), %rcx     # 0xe3a41
leaq 0x5e7e6(%rip), %r8      # 0xe38be
pushq $0x3b
jmp 0x8515f
movq 0xa8ed2(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x44f76(%rip), %rsi     # 0xca066
leaq 0x5e980(%rip), %rdx     # 0xe3a77
leaq 0x5e943(%rip), %rcx     # 0xe3a41
leaq 0x5e7b9(%rip), %r8      # 0xe38be
pushq $0x3c
jmp 0x8515f
movq 0xa8ea8(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x44f4c(%rip), %rsi     # 0xca066
leaq 0x45538(%rip), %rdx     # 0xca659
leaq 0x5e8bb(%rip), %rcx     # 0xe39e3
leaq 0x5e78f(%rip), %r8      # 0xe38be
movl $0xc1, %r9d
jmp 0x85161
movq 0xa8e7a(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x44f1e(%rip), %rsi     # 0xca066
leaq 0x4550a(%rip), %rdx     # 0xca659
leaq 0x5e8eb(%rip), %rcx     # 0xe3a41
leaq 0x5e761(%rip), %r8      # 0xe38be
pushq $0x3a
popq %r9
xorl %eax, %eax
callq 0xb8c0
callq 0xb300