// File: /workspace/github_c_makefile_star2_O1/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 0x424c
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
movl $0x1e0181, %ecx         # imm = 0x1E0181
btq %rdi, %rcx
jb 0x424c
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %eax
leaq 0x13be6(%rip), %rcx     # 0x17ca0
movq (%rcx,%rax,8), %rax
movq %rax, (%rsp)
leaq 0x14337(%rip), %rbx     # 0x18400
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movl $0x4, %esi
callq 0x2160
movq 0x140de(%rip), %r15     # 0x181c0
movb (%r15), %bpl
testb %bpl, %bpl
je 0x412a
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 0x40fa
leaq 0x143cf(%rip), %rbx     # 0x18500
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movl $0x15, %esi
callq 0x2160
movq 0x1407e(%rip), %r13     # 0x181c8
movb (%r13), %bpl
testb %bpl, %bpl
je 0x4194
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 0x4163
leaq 0x14465(%rip), %r14     # 0x18600
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
movl $0xf, %esi
callq 0x2160
movb (%r13), %bpl
testb %bpl, %bpl
je 0x4202
callq 0x2330
movq %rax, %r15
xorl %r12d, %r12d
callq 0x2030
leaq 0x14003(%rip), %rcx     # 0x181d0
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 0x41cd
xorl %eax, %eax
leaq 0x144f5(%rip), %rcx     # 0x18700
leaq 0x13fbe(%rip), %rdx     # 0x181d0
leaq 0x14527(%rip), %rsi     # 0x18740
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 0x421f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq