#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, ...);
void main() {
  int m = 3.141592654;
  float f = 3.141592654;
  printf("int m = %d\n", m);
  printf("float f= %f, f*2 = %f\n", f, f * 2);
  printf("float PI = %f, PI*2 = %f\n", 3.141592654, 3.141592654 * 2);
  int z = 2 * 2;
  printf("\nint z = %d", z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
movss  0xee5(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvttss2si -0x8(%rbp),%esi
movss  0xebe(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x3,%esi
movsd  0xe8b(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x4,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
movsd  0xecd(%rip),%xmm0
mov    $0x3,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
movsd  0xeba(%rip),%xmm0
mov    $0x3,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"int m = %d\0A\00"
@.str.1 = [23 x i8] c"float f= %f, f*2 = %f\0A\00"
@.str.2 = [26 x i8] c"float PI = %f, PI*2 = %f\0A\00"
@.str.3 = [12 x i8] c"\0Aint z = %d\00"
define void @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 3, i32* %1
store float 0x400921FB60000000, float* %2
%4 = load i32, i32* %1
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load float, float* %2
%7 = fptosi float %6 to i32
%8 = load float, float* %2
%9 = fmul float %8, 2.000000e+00
%10 = fpext float %9 to double
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %7, double %10)
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 3, double 0x401921FB54524550)
store i32 4, i32* %3
%13 = load i32, i32* %3
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"int m = %d\0A\00"
@.str.1 = [23 x i8] c"float f= %f, f*2 = %f\0A\00"
@.str.2 = [26 x i8] c"float PI = %f, PI*2 = %f\0A\00"
@.str.3 = [12 x i8] c"\0Aint z = %d\00"
define void @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 3, double 0x401921FB60000000)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 3, double 0x401921FB54524550)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 4)
ret void
}