#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 main() {
  int i = 42;
  char hello[6] = "Hello";
  char c = 'A';
  int exit_status;
  printf("Integer (i): %i\n", i);
  printf("String (hello): %s\n", hello);
  printf("Char (c): %c\n", c);
  printf("Integer (c): %i\n", c);
  c = 66;
  printf("Char (c): %c\n", c);
  exit_status = 0;
  return exit_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0xe(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0xa(%rbp)
movb   $0x41,-0xf(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0xf(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0xf(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x42,-0xf(%rbp)
movsbl -0xf(%rbp),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x6f,0xc(%rsp)
movl   $0x6c6c6548,0x8(%rsp)
6c
lea    0xedb(%rip),%rdi
mov    $0x2a,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rbx
mov    %rbx,%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x42,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.hello = [6 x i8] c"Hello\00"
@.str = [17 x i8] c"Integer (i): %i\0A\00"
@.str.1 = [20 x i8] c"String (hello): %s\0A\00"
@.str.2 = [14 x i8] c"Char (c): %c\0A\00"
@.str.3 = [17 x i8] c"Integer (c): %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [6 x i8]
%4 = alloca i8
%5 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
%6 = bitcast [6 x i8]* %3 to i8*
store i8 65, i8* %4
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %15)
store i8 66, i8* %4
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %18)
store i32 0, i32* %5
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@__const.main.hello = [6 x i8] c"Hello\00"
@.str = [17 x i8] c"Integer (i): %i\0A\00"
@.str.1 = [20 x i8] c"String (hello): %s\0A\00"
@.str.2 = [14 x i8] c"Char (c): %c\0A\00"
@.str.3 = [17 x i8] c"Integer (c): %i\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 42)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 65)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 65)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 66)
ret i32 0
}