#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 *, float);
int main(int argc, const char *argv[]) {
  char c = 'A';
  printf("Character as char: %c\n", c);
  printf("Character as int: %d\n", c);
  printf("Character as float: %f\n", c);
  printf("Character as double: %lf\n", c);
  int i = 42;
  printf("Integer as int: %d\n", i);
  printf("Integer as char: %c\n", i);
  printf("Integer as float: %f\n", i);
  printf("Integer as double: %lf\n", i);
  float f = 3.14;
  printf("Float as int: %d\n", f);
  printf("Float as char: %c\n", f);
  printf("Float as float: %f\n", f);
  printf("Float as double: %lf\n", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x41,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cvtsi2ss %eax,%xmm0
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x11(%rbp),%eax
cvtsi2ss %eax,%xmm0
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x11(%rbp),%eax
cvtsi2ss %eax,%xmm0
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x11(%rbp),%eax
cvtsi2ss %eax,%xmm0
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2a,-0x18(%rbp)
cvtsi2ssl -0x18(%rbp),%xmm0
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x18(%rbp),%xmm0
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x18(%rbp),%xmm0
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x18(%rbp),%xmm0
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
movss  0xe33(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef4(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
movss  0xecc(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
movss  0xeb8(%rip),%xmm0
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
movss  0xea4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
movss  0xe94(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
movss  0xe80(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
movss  0xe6c(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
movss  0xe58(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
movss  0xe48(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
movss  0xe34(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
movss  0xe20(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
movss  0xe0c(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Character as char: %c\0A\00"
@.str.1 = [22 x i8] c"Character as int: %d\0A\00"
@.str.2 = [24 x i8] c"Character as float: %f\0A\00"
@.str.3 = [26 x i8] c"Character as double: %lf\0A\00"
@.str.4 = [20 x i8] c"Integer as int: %d\0A\00"
@.str.5 = [21 x i8] c"Integer as char: %c\0A\00"
@.str.6 = [22 x i8] c"Integer as float: %f\0A\00"
@.str.7 = [24 x i8] c"Integer as double: %lf\0A\00"
@.str.8 = [18 x i8] c"Float as int: %d\0A\00"
@.str.9 = [19 x i8] c"Float as char: %c\0A\00"
@.str.10 = [20 x i8] c"Float as float: %f\0A\00"
@.str.11 = [22 x i8] c"Float as double: %lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 65, i8* %6
%9 = load i8, i8* %6
%10 = sitofp i8 %9 to float
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float %10)
%12 = load i8, i8* %6
%13 = sitofp i8 %12 to float
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), float %13)
%15 = load i8, i8* %6
%16 = sitofp i8 %15 to float
%17 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), float %16)
%18 = load i8, i8* %6
%19 = sitofp i8 %18 to float
%20 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), float %19)
store i32 42, i32* %7
%21 = load i32, i32* %7
%22 = sitofp i32 %21 to float
%23 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), float %22)
%24 = load i32, i32* %7
%25 = sitofp i32 %24 to float
%26 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), float %25)
%27 = load i32, i32* %7
%28 = sitofp i32 %27 to float
%29 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), float %28)
%30 = load i32, i32* %7
%31 = sitofp i32 %30 to float
%32 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), float %31)
store float 0x40091EB860000000, float* %8
%33 = load float, float* %8
%34 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), float %33)
%35 = load float, float* %8
%36 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), float %35)
%37 = load float, float* %8
%38 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), float %37)
%39 = load float, float* %8
%40 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), float %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Character as char: %c\0A\00"
@.str.1 = [22 x i8] c"Character as int: %d\0A\00"
@.str.2 = [24 x i8] c"Character as float: %f\0A\00"
@.str.3 = [26 x i8] c"Character as double: %lf\0A\00"
@.str.4 = [20 x i8] c"Integer as int: %d\0A\00"
@.str.5 = [21 x i8] c"Integer as char: %c\0A\00"
@.str.6 = [22 x i8] c"Integer as float: %f\0A\00"
@.str.7 = [24 x i8] c"Integer as double: %lf\0A\00"
@.str.8 = [18 x i8] c"Float as int: %d\0A\00"
@.str.9 = [19 x i8] c"Float as char: %c\0A\00"
@.str.10 = [20 x i8] c"Float as float: %f\0A\00"
@.str.11 = [22 x i8] c"Float as double: %lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 6.500000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), float 6.500000e+01)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), float 6.500000e+01)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), float 6.500000e+01)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), float 4.200000e+01)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), float 4.200000e+01)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), float 4.200000e+01)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), float 4.200000e+01)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), float 0x40091EB860000000)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), float 0x40091EB860000000)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), float 0x40091EB860000000)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), float 0x40091EB860000000)
ret i32 0
}