#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 */
int /*<<< orphan*/ printf(char *, int, char);
void f3(char *string1) {
  int i = 0;
  for (i = 0; i < 5; i++) {
    printf("string1 [ %d ] = %c;\n", i, string1[i]);
    string1[i] = string1[i] + 2;
    printf("after string1 [ %d ] = %c;\n", i, string1[i]);
  }
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1194 <f3+0x84>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xec0(%rip),%rdi
movsbl (%rax,%rcx,1),%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x2,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xe83(%rip),%rdi
movsbl (%rax,%rcx,1),%edx
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <f3+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edx
lea    0xee4(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    (%rbx),%al
add    $0x2,%al
mov    %al,(%rbx)
movsbl %al,%edx
lea    0xec4(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movsbl 0x1(%rbx),%edx
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    0x1(%rbx),%al
add    $0x2,%al
mov    %al,0x1(%rbx)
movsbl %al,%edx
mov    %r15,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
movsbl 0x2(%rbx),%edx
mov    %r14,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    0x2(%rbx),%al
add    $0x2,%al
mov    %al,0x2(%rbx)
movsbl %al,%edx
mov    %r15,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
movsbl 0x3(%rbx),%edx
mov    %r14,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    0x3(%rbx),%al
add    $0x2,%al
mov    %al,0x3(%rbx)
movsbl %al,%edx
mov    %r15,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
movsbl 0x4(%rbx),%edx
mov    %r14,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    0x4(%rbx),%al
add    $0x2,%al
mov    %al,0x4(%rbx)
movsbl %al,%edx
mov    %r15,%rdi
mov    $0x4,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"string1 [ %d ] = %c;\0A\00"
@.str.1 = [28 x i8] c"after string1 [ %d ] = %c;\0A\00"
define void @f3(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %34, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %37
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %8, i8 signext %13)
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = add nsw i32 %20, 2
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %2
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
%27 = load i32, i32* %3
%28 = load i8*, i8** %2
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = load i8, i8* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %27, i8 signext %32)
br label %34
34: ; preds = %7
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %4
37: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"string1 [ %d ] = %c;\0A\00"
@.str.1 = [28 x i8] c"after string1 [ %d ] = %c;\0A\00"
define void @f3(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 0, i8 signext %2)
%4 = load i8, i8* %0
%5 = add i8 %4, 2
store i8 %5, i8* %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 0, i8 signext %5)
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1, i8 signext %8)
%10 = load i8, i8* %7
%11 = add i8 %10, 2
store i8 %11, i8* %7
%12 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 1, i8 signext %11)
%13 = getelementptr inbounds i8, i8* %0, i64 2
%14 = load i8, i8* %13
%15 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 2, i8 signext %14)
%16 = load i8, i8* %13
%17 = add i8 %16, 2
store i8 %17, i8* %13
%18 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 2, i8 signext %17)
%19 = getelementptr inbounds i8, i8* %0, i64 3
%20 = load i8, i8* %19
%21 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 3, i8 signext %20)
%22 = load i8, i8* %19
%23 = add i8 %22, 2
store i8 %23, i8* %19
%24 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 3, i8 signext %23)
%25 = getelementptr inbounds i8, i8* %0, i64 4
%26 = load i8, i8* %25
%27 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 4, i8 signext %26)
%28 = load i8, i8* %25
%29 = add i8 %28, 2
store i8 %29, i8* %25
%30 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 4, i8 signext %29)
ret void
}