#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 *, double);
int main(int argc, char **argv) {
  printf("Printing floating point as decimal: %d\n", 3.14);
  printf("Printing decimal as float: %f\n", 3);
  printf("Printing floating point as decimal: %d\n", (int)3.14);
  printf("Printing decimal as float: %f\n", (double)3);
  printf("Printing decimal as float: %f\n", 3.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xee3(%rip),%rdi
movsd  0xed3(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
movsd  0xeb7(%rip),%xmm0
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
movsd  0xea3(%rip),%xmm0
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
movsd  0xe8f(%rip),%xmm0
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
movsd  0xe7b(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xef5(%rip),%r14
movsd  0xedd(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0xf06(%rip),%rbx
movsd  0xece(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
movsd  0xebb(%rip),%xmm0
call   1030 <printf@plt>
mov    %rbx,%rdi
movsd  0xeab(%rip),%xmm0
call   1030 <printf@plt>
mov    %rbx,%rdi
movsd  0xe9b(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Printing floating point as decimal: %d\0A\00"
@.str.1 = [31 x i8] c"Printing decimal as float: %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), double 3.140000e+00)
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), double 3.000000e+00)
%8 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), double 3.000000e+00)
%9 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), double 3.000000e+00)
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), double 3.000000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Printing floating point as decimal: %d\0A\00"
@.str.1 = [31 x i8] c"Printing decimal as float: %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), double 3.140000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), double 3.000000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), double 3.000000e+00)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), double 3.000000e+00)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), double 3.000000e+00)
ret i32 0
}