#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 */
typedef int /*<<< orphan*/ word;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  char word[] = "hello";
  char space[] = " ";
  int i;
  int ascii;
  int ascii_new;
  int ascii_space;
  for (i = 0; i < sizeof(word); i++) {
    ascii = (int)word[i];
    ascii_space = (int)space[0];
    ascii_new = ascii ^ ascii_space;
    printf("%c", ascii_new);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
cmp    $0x6,%rax
jae    118c <main+0x7c>
movslq -0x10(%rbp),%rax
movsbl -0xa(%rbp,%rax,1),%eax
mov    %eax,-0x14(%rbp)
movsbl -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1145 <main+0x35>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x48,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x45,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4c,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4c,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4f,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.word = [6 x i8] c"hello\00"
@__const.main.space = [2 x i8] c" \00"
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [2 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [6 x i8]* %2 to i8*
%9 = bitcast [2 x i8]* %3 to i8*
store i32 0, i32* %4
br label %10
10: ; preds = %28, %0
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = icmp ult i64 %12, 6
br i1 %13, label %14, label %31
14: ; preds = %10
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
store i32 %19, i32* %5
%20 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = xor i32 %23, %24
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %14
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %10
31: ; preds = %10
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 72)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 69)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 76)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 76)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 79)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 32)
ret i32 0
}