// File: /workspace/github_c_makefile_star2_O3/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:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x21, %edi
ja 0x45e4
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
movl $0x1e0181, %ecx         # imm = 0x1E0181
btq %rdi, %rcx
jb 0x45e4
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %eax
leaq 0x1484e(%rip), %rcx     # 0x18ca0
movq (%rcx,%rax,8), %rax
movq %rax, (%rsp)
leaq 0x14f9f(%rip), %rbx     # 0x19400
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movl $0x4, %esi
callq 0x2160
movq 0x14d46(%rip), %r15     # 0x191c0
movb (%r15), %bpl
testb %bpl, %bpl
je 0x44c2
callq 0x2330
movq %rax, %r14
xorl %r12d, %r12d
callq 0x2030
movq (%r14), %rcx
movsbq %bpl, %rdx
movzbl (%rcx,%rdx,4), %ecx
movb %r12b, (%rcx,%rbx)
movq (%rax), %rcx
movsbq (%r15,%r12), %rdx
movzbl (%rcx,%rdx,4), %ecx
movb %r12b, (%rcx,%rbx)
movb %r12b, (%r12,%rbx)
movb 0x1(%r15,%r12), %bpl
incq %r12
testb %bpl, %bpl
jne 0x4492
leaq 0x15037(%rip), %rbx     # 0x19500
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movl $0x15, %esi
callq 0x2160
movq 0x14ce6(%rip), %r13     # 0x191c8
movb (%r13), %bpl
testb %bpl, %bpl
je 0x452c
callq 0x2330
movq %rax, %r14
xorl %r15d, %r15d
callq 0x2030
movq (%r14), %rcx
movsbq %bpl, %rdx
movzbl (%rcx,%rdx,4), %ecx
movb %r15b, (%rcx,%rbx)
movq (%rax), %rcx
movsbq (%r13,%r15), %rdx
movzbl (%rcx,%rdx,4), %ecx
movb %r15b, (%rcx,%rbx)
movb %r15b, (%r15,%rbx)
movb 0x1(%r13,%r15), %bpl
incq %r15
testb %bpl, %bpl
jne 0x44fb
leaq 0x150cd(%rip), %r14     # 0x19600
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
movl $0xf, %esi
callq 0x2160
movb (%r13), %bpl
testb %bpl, %bpl
je 0x459a
callq 0x2330
movq %rax, %r15
xorl %r12d, %r12d
callq 0x2030
leaq 0x14c6b(%rip), %rcx     # 0x191d0
movb (%r12,%rcx), %dl
movq (%r15), %rsi
movsbq %bpl, %rdi
movzbl (%rsi,%rdi,4), %esi
movb %dl, (%rsi,%r14)
movq (%rax), %rsi
movsbq (%r13,%r12), %rdi
movzbl (%rsi,%rdi,4), %esi
movb %dl, (%rsi,%r14)
movb %dl, (%r12,%r14)
movb 0x1(%r13,%r12), %bpl
incq %r12
testb %bpl, %bpl
jne 0x4565
xorl %eax, %eax
leaq 0x1515d(%rip), %rcx     # 0x19700
leaq 0x14c26(%rip), %rdx     # 0x191d0
leaq 0x1518f(%rip), %rsi     # 0x19740
xorl %edi, %edi
movq (%rsp), %r9
movzbl (%r9,%rdi), %r8d
movzbl (%r8,%rbx), %r8d
movb %r8b, (%rdi,%rcx)
movb (%r8,%rdx), %r8b
movb %r8b, (%rdi,%rsi)
incq %rdi
cmpq $0x40, %rdi
jne 0x45b7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq