// File: /workspace/github_c_makefile_star2_O2/lh3[P]miniprot/nasw-tab.c
// Function: ns_make_tables
int ns_make_tables(int codon_type)
{
	const char *trans_tab;
	char *p;
	int i;
	if (codon_type < 0 || codon_type > NS_MAX_TRANS_CODE) return -1; // out of range
	trans_tab = ns_tab_codon_all[codon_type];
	if (trans_tab == 0) return -2; // not defined
	memset(ns_tab_nt4, 4, 256);
	for (p = ns_tab_nt_i2c; *p; ++p)
		ns_tab_nt4[p - ns_tab_nt_i2c] = ns_tab_nt4[(uint8_t)toupper(*p)] = ns_tab_nt4[(uint8_t)tolower(*p)] = p - ns_tab_nt_i2c;
	memset(ns_tab_aa20, 21, 256);
	for (p = ns_tab_aa_i2c; *p; ++p)
		ns_tab_aa20[p - ns_tab_aa_i2c] = ns_tab_aa20[(uint8_t)toupper(*p)] = ns_tab_aa20[(uint8_t)tolower(*p)] = p - ns_tab_aa_i2c;
	memset(ns_tab_aa13, 15, 256);
	for (p = ns_tab_aa_i2c; *p; ++p)
		ns_tab_aa13[p - ns_tab_aa_i2c] = ns_tab_aa13[(uint8_t)toupper(*p)] = ns_tab_aa13[(uint8_t)tolower(*p)] = ns_tab_a2r[p - ns_tab_aa_i2c];
	for (i = 0; i < 64; ++i) {
		ns_tab_codon[i] = ns_tab_aa20[(uint8_t)trans_tab[i]];
		ns_tab_codon13[i] = ns_tab_a2r[ns_tab_codon[i]];
	}
	return 0;
}

// Assembly:
cmpl $0x21, %edi
jbe 0x3518
pushq $-0x1
jmp 0x359b
movl $0x1e0181, %eax         # imm = 0x1E0181
btq %rdi, %rax
jb 0x3599
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %eax
leaq 0x14769(%rip), %rcx     # 0x17ca0
movq (%rcx,%rax,8), %rax
movq %rax, (%rsp)
leaq 0x14eca(%rip), %rbx     # 0x18410
pushq $0x4
popq %rsi
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
callq 0x2160
xorl %r14d, %r14d
movq 0x14c70(%rip), %r12     # 0x181d0
movsbq (%r12,%r14), %r15
testq %r15, %r15
je 0x359d
callq 0x2350
movq (%rax), %rax
movzbl (%rax,%r15,4), %eax
movb %r14b, (%rax,%rbx)
callq 0x2030
movq (%rax), %rax
movsbq (%r12,%r14), %rcx
movzbl (%rax,%rcx,4), %eax
movb %r14b, (%rax,%rbx)
movb %r14b, (%r14,%rbx)
incq %r14
jmp 0x3560
pushq $-0x2
popq %rax
retq
leaq 0x14f6c(%rip), %rbx     # 0x18510
pushq $0x15
popq %rsi
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
callq 0x2160
xorl %r14d, %r14d
movq 0x14c1a(%rip), %r12     # 0x181d8
movsbq (%r12,%r14), %r15
testq %r15, %r15
je 0x35f7
callq 0x2350
movq (%rax), %rax
movzbl (%rax,%r15,4), %eax
movb %r14b, (%rax,%rbx)
callq 0x2030
movq (%rax), %rax
movsbq (%r12,%r14), %rcx
movzbl (%rax,%rcx,4), %eax
movb %r14b, (%rax,%rbx)
movb %r14b, (%r14,%rbx)
incq %r14
jmp 0x35be
leaq 0x15012(%rip), %r14     # 0x18610
pushq $0xf
popq %rsi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
callq 0x2160
xorl %ebp, %ebp
movsbq (%r12,%rbp), %r15
testq %r15, %r15
je 0x3656
leaq 0x14bbf(%rip), %rax     # 0x181e0
movb (%rbp,%rax), %r13b
callq 0x2350
movq (%rax), %rax
movzbl (%rax,%r15,4), %eax
movb %r13b, (%rax,%r14)
callq 0x2030
movq (%rax), %rax
movsbq (%r12,%rbp), %rcx
movzbl (%rax,%rcx,4), %eax
movb %r13b, (%rax,%r14)
movb %r13b, (%rbp,%r14)
incq %rbp
jmp 0x3610
xorl %eax, %eax
leaq 0x150b1(%rip), %rcx     # 0x18710
leaq 0x150ea(%rip), %rdx     # 0x18750
xorl %esi, %esi
movq (%rsp), %r8
leaq 0x14b6d(%rip), %r9      # 0x181e0
cmpq $0x40, %rsi
je 0x3693
movzbl (%r8,%rsi), %edi
movzbl (%rdi,%rbx), %edi
movb %dil, (%rsi,%rcx)
movb (%rdi,%r9), %dil
movb %dil, (%rsi,%rdx)
incq %rsi
jmp 0x3673
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq