#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 */
unsigned int strlen(char *);
void str_DNA2RNA(char *sequence) {
  unsigned int l, i;
  if (sequence != NULL) {
    l = strlen(sequence);
    for (i = 0; i < l; i++) {
      if (sequence[i] == 'T')
        sequence[i] = 'U';
      if (sequence[i] == 't')
        sequence[i] = 'u';
    }
  }
}


x86 assembly (clang, -O0):
<str_DNA2RNA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     119c <str_DNA2RNA+0x8c>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1197 <str_DNA2RNA+0x87>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x54,%eax
jne    1165 <str_DNA2RNA+0x55>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movb   $0x55,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x74,%eax
jne    1184 <str_DNA2RNA+0x74>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movb   $0x75,(%rax,%rcx,1)
jmp    1189 <str_DNA2RNA+0x79>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113a <str_DNA2RNA+0x2a>
jmp    119c <str_DNA2RNA+0x8c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_DNA2RNA>:
push   %rbx
test   %rdi,%rdi
je     119d <str_DNA2RNA+0x8d>
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     119d <str_DNA2RNA+0x8d>
mov    %eax,%esi
cmp    $0x1,%eax
jne    1146 <str_DNA2RNA+0x36>
xor    %eax,%eax
test   $0x1,%sil
je     119d <str_DNA2RNA+0x8d>
mov    (%rbx,%rax,1),%cl
cmp    $0x54,%cl
je     1198 <str_DNA2RNA+0x88>
cmp    $0x74,%cl
jne    119d <str_DNA2RNA+0x8d>
mov    $0x75,%cl
jmp    119a <str_DNA2RNA+0x8a>
mov    %esi,%edx
and    $0xfffffffe,%edx
xor    %eax,%eax
jmp    115f <str_DNA2RNA+0x4f>
nop
mov    $0x55,%cl
mov    %cl,0x1(%rbx,%rax,1)
add    $0x2,%rax
cmp    %rax,%rdx
je     112f <str_DNA2RNA+0x1f>
movzbl (%rbx,%rax,1),%ecx
cmp    $0x54,%cl
je     1180 <str_DNA2RNA+0x70>
cmp    $0x74,%cl
jne    1185 <str_DNA2RNA+0x75>
mov    $0x75,%cl
jmp    1182 <str_DNA2RNA+0x72>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x55,%cl
mov    %cl,(%rbx,%rax,1)
movzbl 0x1(%rbx,%rax,1),%ecx
cmp    $0x54,%cl
je     1150 <str_DNA2RNA+0x40>
cmp    $0x74,%cl
jne    1156 <str_DNA2RNA+0x46>
mov    $0x75,%cl
jmp    1152 <str_DNA2RNA+0x42>
mov    $0x55,%cl
mov    %cl,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @str_DNA2RNA(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %45
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %3
store i32 0, i32* %4
br label %10
10: ; preds = %41, %7
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = icmp ult i32 %11, %12
br i1 %13, label %14, label %44
14: ; preds = %10
%15 = load i8*, i8** %2
%16 = load i32, i32* %4
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 84
br i1 %21, label %22, label %27
22: ; preds = %14
%23 = load i8*, i8** %2
%24 = load i32, i32* %4
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 85, i8* %26
br label %27
27: ; preds = %22, %14
%28 = load i8*, i8** %2
%29 = load i32, i32* %4
%30 = zext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 116
br i1 %34, label %35, label %40
35: ; preds = %27
%36 = load i8*, i8** %2
%37 = load i32, i32* %4
%38 = zext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
store i8 117, i8* %39
br label %40
40: ; preds = %35, %27
br label %41
41: ; preds = %40
%42 = load i32, i32* %4
%43 = add i32 %42, 1
store i32 %43, i32* %4
br label %10
44: ; preds = %10
br label %45
45: ; preds = %44, %1
ret void
}

LLVM IR (-O2):
define void @str_DNA2RNA(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %40, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %40, label %6
6: ; preds = %3
%7 = zext i32 %4 to i64
%8 = and i64 %7, 1
%9 = icmp eq i32 %4, 1
br i1 %9, label %31, label %10
10: ; preds = %6
%11 = and i64 %7, 4294967294
br label %12
12: ; preds = %27, %10
%13 = phi i64 [ 0, %10 ], [ %28, %27 ]
%14 = phi i64 [ 0, %10 ], [ %29, %27 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %13
%16 = load i8, i8* %15
switch i8 %16, label %20 [
i8 84, label %18
i8 116, label %17
]
17: ; preds = %12
br label %18
18: ; preds = %12, %17
%19 = phi i8 [ 117, %17 ], [ 85, %12 ]
store i8 %19, i8* %15
br label %20
20: ; preds = %18, %12
%21 = or i64 %13, 1
%22 = getelementptr inbounds i8, i8* %0, i64 %21
%23 = load i8, i8* %22
switch i8 %23, label %27 [
i8 84, label %25
i8 116, label %24
]
24: ; preds = %20
br label %25
25: ; preds = %24, %20
%26 = phi i8 [ 117, %24 ], [ 85, %20 ]
store i8 %26, i8* %22
br label %27
27: ; preds = %25, %20
%28 = add nuw nsw i64 %13, 2
%29 = add i64 %14, 2
%30 = icmp eq i64 %29, %11
br i1 %30, label %31, label %12
31: ; preds = %27, %6
%32 = phi i64 [ 0, %6 ], [ %28, %27 ]
%33 = icmp eq i64 %8, 0
br i1 %33, label %40, label %34
34: ; preds = %31
%35 = getelementptr inbounds i8, i8* %0, i64 %32
%36 = load i8, i8* %35
switch i8 %36, label %40 [
i8 84, label %38
i8 116, label %37
]
37: ; preds = %34
br label %38
38: ; preds = %37, %34
%39 = phi i8 [ 117, %37 ], [ 85, %34 ]
store i8 %39, i8* %35
br label %40
40: ; preds = %31, %38, %34, %3, %1
ret void
}