void biosal_dna_helper_set_lower_case(char *sequence, int start, int end) {
  char old_character;
  char new_character;
  int i;
  for (i = start; i <= end; ++i) {
    old_character = sequence[i];
    new_character = old_character;
    if (old_character == 'A')
      new_character = 'a';
    else if (old_character == 'T')
      new_character = 't';
    else if (old_character == 'C')
      new_character = 'c';
    else if (old_character == 'G')
      new_character = 'g';
    sequence[i] = new_character;
  }
}


x86 assembly (clang, -O0):
<biosal_dna_helper_set_lower_case>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11b2 <biosal_dna_helper_set_lower_case+0xb2>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x41,%eax
jne    114a <biosal_dna_helper_set_lower_case+0x4a>
movb   $0x61,-0x12(%rbp)
jmp    1196 <biosal_dna_helper_set_lower_case+0x96>
movsbl -0x11(%rbp),%eax
cmp    $0x54,%eax
jne    1160 <biosal_dna_helper_set_lower_case+0x60>
movb   $0x74,-0x12(%rbp)
jmp    1191 <biosal_dna_helper_set_lower_case+0x91>
movsbl -0x11(%rbp),%eax
cmp    $0x43,%eax
jne    1176 <biosal_dna_helper_set_lower_case+0x76>
movb   $0x63,-0x12(%rbp)
jmp    118c <biosal_dna_helper_set_lower_case+0x8c>
movsbl -0x11(%rbp),%eax
cmp    $0x47,%eax
jne    1187 <biosal_dna_helper_set_lower_case+0x87>
movb   $0x67,-0x12(%rbp)
jmp    118c <biosal_dna_helper_set_lower_case+0x8c>
jmp    1191 <biosal_dna_helper_set_lower_case+0x91>
jmp    1196 <biosal_dna_helper_set_lower_case+0x96>
mov    -0x12(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1114 <biosal_dna_helper_set_lower_case+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<biosal_dna_helper_set_lower_case>:
cmp    %esi,%edx
jl     1156 <biosal_dna_helper_set_lower_case+0x56>
movslq %esi,%rax
lea    0x1(%rdx),%r10d
mov    %r10d,%ecx
sub    %esi,%ecx
test   $0x1,%cl
je     1152 <biosal_dna_helper_set_lower_case+0x52>
mov    (%rdi,%rax,1),%r9b
lea    -0x41(%r9),%ecx
cmp    $0x13,%cl
ja     1147 <biosal_dna_helper_set_lower_case+0x47>
mov    $0x61,%r8b
movzbl %cl,%ecx
lea    0xed1(%rip),%r11
movslq (%r11,%rcx,4),%rcx
add    %r11,%rcx
jmp    *%rcx
mov    $0x63,%r8b
jmp    114a <biosal_dna_helper_set_lower_case+0x4a>
mov    $0x67,%r8b
jmp    114a <biosal_dna_helper_set_lower_case+0x4a>
mov    $0x74,%r8b
jmp    114a <biosal_dna_helper_set_lower_case+0x4a>
mov    %r9d,%r8d
mov    %r8b,(%rdi,%rax,1)
add    $0x1,%rax
cmp    %esi,%edx
jne    1157 <biosal_dna_helper_set_lower_case+0x57>
ret
mov    %r10d,%r10d
lea    0xf3f(%rip),%r8
lea    0xee8(%rip),%r9
jmp    118d <biosal_dna_helper_set_lower_case+0x8d>
nopw   0x0(%rax,%rax,1)
mov    $0x67,%dl
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %dl,0x1(%rdi,%rax,1)
add    $0x2,%rax
cmp    %eax,%r10d
je     1156 <biosal_dna_helper_set_lower_case+0x56>
movzbl (%rdi,%rax,1),%esi
lea    -0x41(%rsi),%ecx
cmp    $0x13,%cl
ja     11c4 <biosal_dna_helper_set_lower_case+0xc4>
mov    $0x61,%dl
movzbl %cl,%ecx
movslq (%r9,%rcx,4),%rcx
add    %r9,%rcx
jmp    *%rcx
mov    $0x63,%dl
jmp    11d0 <biosal_dna_helper_set_lower_case+0xd0>
nopl   0x0(%rax,%rax,1)
mov    $0x67,%dl
jmp    11d0 <biosal_dna_helper_set_lower_case+0xd0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x74,%dl
jmp    11d0 <biosal_dna_helper_set_lower_case+0xd0>
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
mov    %dl,(%rdi,%rax,1)
movzbl 0x1(%rdi,%rax,1),%esi
lea    -0x41(%rsi),%ecx
cmp    $0x13,%cl
ja     1207 <biosal_dna_helper_set_lower_case+0x107>
mov    $0x61,%dl
movzbl %cl,%ecx
movslq (%r8,%rcx,4),%rcx
add    %r8,%rcx
jmp    *%rcx
mov    $0x63,%dl
jmp    1180 <biosal_dna_helper_set_lower_case+0x80>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x74,%dl
jmp    1180 <biosal_dna_helper_set_lower_case+0x80>
mov    %esi,%edx
jmp    1180 <biosal_dna_helper_set_lower_case+0x80>

LLVM IR (-O0):
define void @biosal_dna_helper_set_lower_case(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
store i32 %10, i32* %9
br label %11
11: ; preds = %50, %3
%12 = load i32, i32* %9
%13 = load i32, i32* %6
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %53
15: ; preds = %11
%16 = load i8*, i8** %4
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
store i8 %20, i8* %7
%21 = load i8, i8* %7
store i8 %21, i8* %8
%22 = load i8, i8* %7
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 65
br i1 %24, label %25, label %26
25: ; preds = %15
store i8 97, i8* %8
br label %44
26: ; preds = %15
%27 = load i8, i8* %7
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 84
br i1 %29, label %30, label %31
30: ; preds = %26
store i8 116, i8* %8
br label %43
31: ; preds = %26
%32 = load i8, i8* %7
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 67
br i1 %34, label %35, label %36
35: ; preds = %31
store i8 99, i8* %8
br label %42
36: ; preds = %31
%37 = load i8, i8* %7
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 71
br i1 %39, label %40, label %41
40: ; preds = %36
store i8 103, i8* %8
br label %41
41: ; preds = %40, %36
br label %42
42: ; preds = %41, %35
br label %43
43: ; preds = %42, %30
br label %44
44: ; preds = %43, %25
%45 = load i8, i8* %8
%46 = load i8*, i8** %4
%47 = load i32, i32* %9
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %46, i64 %48
store i8 %45, i8* %49
br label %50
50: ; preds = %44
%51 = load i32, i32* %9
%52 = add nsw i32 %51, 1
store i32 %52, i32* %9
br label %11
53: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @biosal_dna_helper_set_lower_case(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %46, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = add i32 %2, 1
%8 = sub i32 %7, %1
%9 = and i32 %8, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %21, label %11
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %0, i64 %6
%13 = load i8, i8* %12
switch i8 %13, label %17 [
i8 65, label %18
i8 84, label %16
i8 67, label %15
i8 71, label %14
]
14: ; preds = %11
br label %18
15: ; preds = %11
br label %18
16: ; preds = %11
br label %18
17: ; preds = %11
br label %18
18: ; preds = %17, %16, %15, %14, %11
%19 = phi i8 [ 116, %16 ], [ 99, %15 ], [ 103, %14 ], [ 97, %11 ], [ %13, %17 ]
store i8 %19, i8* %12
%20 = add nsw i64 %6, 1
br label %21
21: ; preds = %18, %5
%22 = phi i64 [ %6, %5 ], [ %20, %18 ]
%23 = icmp eq i32 %2, %1
br i1 %23, label %46, label %24
24: ; preds = %21, %41
%25 = phi i64 [ %43, %41 ], [ %22, %21 ]
%26 = getelementptr inbounds i8, i8* %0, i64 %25
%27 = load i8, i8* %26
switch i8 %27, label %31 [
i8 65, label %32
i8 84, label %28
i8 67, label %29
i8 71, label %30
]
28: ; preds = %24
br label %32
29: ; preds = %24
br label %32
30: ; preds = %24
br label %32
31: ; preds = %24
br label %32
32: ; preds = %24, %31, %28, %30, %29
%33 = phi i8 [ 116, %28 ], [ 99, %29 ], [ 103, %30 ], [ 97, %24 ], [ %27, %31 ]
store i8 %33, i8* %26
%34 = add nsw i64 %25, 1
%35 = getelementptr inbounds i8, i8* %0, i64 %34
%36 = load i8, i8* %35
switch i8 %36, label %40 [
i8 65, label %41
i8 84, label %39
i8 67, label %38
i8 71, label %37
]
37: ; preds = %32
br label %41
38: ; preds = %32
br label %41
39: ; preds = %32
br label %41
40: ; preds = %32
br label %41
41: ; preds = %40, %39, %38, %37, %32
%42 = phi i8 [ 116, %39 ], [ 99, %38 ], [ 103, %37 ], [ 97, %32 ], [ %36, %40 ]
store i8 %42, i8* %35
%43 = add nsw i64 %25, 2
%44 = trunc i64 %43 to i32
%45 = icmp eq i32 %7, %44
br i1 %45, label %46, label %24
46: ; preds = %21, %41, %3
ret void
}