#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int i = 0;
  float f = 8.9;
  printf("%d\n", i);
  printf("%f\n", f);
  char c = 'f';
  char s[] = "This is a test";
  printf("%c\n", c);
  printf("%s\n", s);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movss  0xecb(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xead(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movb   $0x66,-0x19(%rbp)
mov    0xe9f(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe9d(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xe97(%rip),%ax
mov    %ax,-0x1c(%rbp)
mov    0xe8f(%rip),%al
mov    %al,-0x1a(%rbp)
movsbl -0x19(%rbp),%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x28(%rbp),%rsi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
movsd  0xebd(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movabs $0x74736574206120,%rax
mov    %rax,0xf(%rsp)
movabs $0x2073692073696854,%rax
69 73 20
mov    %rax,0x8(%rsp)
lea    0xeb0(%rip),%rdi
mov    $0x66,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rdi
call   1030 <puts@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@__const.main.s = [15 x i8] c"This is a test\00"
@.str.2 = [4 x i8] c"%c\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca i8
%9 = alloca [15 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store float 0x4021CCCCC0000000, float* %7
%10 = load i32, i32* %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load float, float* %7
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %13)
store i8 102, i8* %8
%15 = bitcast [15 x i8]* %9 to i8*
%16 = load i8, i8* %8
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [15 x i8], [15 x i8]* %9, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %19)
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@__const.main.s = [15 x i8] c"This is a test\00"
@.str.2 = [4 x i8] c"%c\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [15 x i8]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double 0x4021CCCCC0000000)
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 102)
%8 = call i32 @puts(i8* %6)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}