#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 *, char);
int main12() {
  char str[] = "Hello";
  char *str1 = "Hello";
  for (int i = 0; str[i] != '\0'; i++) {
    printf("%c", str[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xedc(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
movsbl -0x6(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1173 <main12+0x63>
movslq -0x14(%rbp),%rax
lea    0xeab(%rip),%rdi
movsbl -0x6(%rbp,%rax,1),%esi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <main12+0x2e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main12>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x48,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x65,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6c,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6c,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6f,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main12.str = [6 x i8] c"Hello\00"
@.str = [6 x i8] c"Hello\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main12() {
%1 = alloca [6 x i8]
%2 = alloca i8*
%3 = alloca i32
%4 = bitcast [6 x i8]* %1 to i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %18, %0
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %5
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %16)
br label %18
18: ; preds = %12
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %5
21: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
define i32 @main12() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 72)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 101)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 108)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 108)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 111)
ret i32 0
}