#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
size_t nt2int_rc_indel(char);
int strlen(char *);
void get_rc_dna_indel(char *dna, char *dna1) {
  char codon[11] = {'A', 'C', 'G', 'T', 'N', 'a', 'c', 'g', 't', 'n', 'x'};
  int i;
  int dna_len = strlen(dna);
  for (i = 0; i < dna_len; i++) {
    dna1[dna_len - i - 1] = codon[nt2int_rc_indel(dna[i])];
  }
}


x86 assembly (clang, -O0):
<get_rc_dna_indel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec9(%rip),%rax
mov    %rax,-0x1b(%rbp)
mov    0xec6(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xebe(%rip),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    11a4 <get_rc_dna_indel+0x84>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <nt2int_rc_indel@plt>
mov    -0x1b(%rbp,%rax,1),%dl
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1162 <get_rc_dna_indel+0x42>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rc_dna_indel>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %eax,%eax
jle    1171 <get_rc_dna_indel+0x51>
mov    %eax,%ebx
mov    %eax,%r12d
add    $0xffffffff,%ebx
xor    %r13d,%r13d
lea    0xeb4(%rip),%rbp
nopl   0x0(%rax)
movsbl (%r15,%r13,1),%edi
call   1030 <nt2int_rc_indel@plt>
movzbl (%rax,%rbp,1),%eax
movslq %ebx,%rbx
mov    %al,(%r14,%rbx,1)
add    $0x1,%r13
add    $0xffffffff,%ebx
cmp    %r13,%r12
jne    1150 <get_rc_dna_indel+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.get_rc_dna_indel.codon = [11 x i8] c"ACGTNacgtnx"
define void @get_rc_dna_indel(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [11 x i8]
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = bitcast [11 x i8]* %5 to i8*
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %7
store i32 0, i32* %6
br label %11
11: ; preds = %31, %2
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %34
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = call i64 @nt2int_rc_indel(i8 signext %20)
%22 = getelementptr inbounds [11 x i8], [11 x i8]* %5, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = load i8*, i8** %4
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = sub nsw i32 %25, %26
%28 = sub nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %24, i64 %29
store i8 %23, i8* %30
br label %31
31: ; preds = %15
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %11
34: ; preds = %11
ret void
}

LLVM IR (-O2):
@__const.get_rc_dna_indel.codon = [11 x i8] c"ACGTNacgtnx"
define void @get_rc_dna_indel(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %21
5: ; preds = %2
%6 = zext i32 %3 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %19, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i64 @nt2int_rc_indel(i8 signext %10)
%12 = getelementptr inbounds [11 x i8], [11 x i8]* @__const.get_rc_dna_indel.codon, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = trunc i64 %8 to i32
%15 = xor i32 %14, -1
%16 = add i32 %3, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %1, i64 %17
store i8 %13, i8* %18
%19 = add nuw nsw i64 %8, 1
%20 = icmp eq i64 %19, %6
br i1 %20, label %21, label %7
21: ; preds = %7, %2
ret void
}