#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);
int main() {
  float a = 1.72;
  float b = 2.73;
  float c = 0.0;
  int d = 2;
  int e = 3;
  int f = 0;
  c = a + b;
  printf("a + b = %.3f\n", c);
  c = a - b;
  printf("a - b = %.3f\n", c);
  c = a * b;
  printf("a * b = %.3f\n", c);
  f = d + e;
  printf("d + e = %d\n", f);
  f = d - e;
  printf("d - e = %d\n", f);
  f = d * e;
  printf("d * e = %d\n", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x10(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x10(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x10(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"a + b = %.3f\0A\00"
@.str.1 = [14 x i8] c"a - b = %.3f\0A\00"
@.str.2 = [14 x i8] c"a * b = %.3f\0A\00"
@.str.3 = [12 x i8] c"d + e = %d\0A\00"
@.str.4 = [12 x i8] c"d - e = %d\0A\00"
@.str.5 = [12 x i8] c"d * e = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store float 0x3FFB851EC0000000, float* %2
store float 0x4005D70A40000000, float* %3
store float 0.000000e+00, float* %4
store i32 2, i32* %5
store i32 3, i32* %6
store i32 0, i32* %7
%8 = load float, float* %2
%9 = load float, float* %3
%10 = fadd float %8, %9
store float %10, float* %4
%11 = load float, float* %4
%12 = fptosi float %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load float, float* %2
%15 = load float, float* %3
%16 = fsub float %14, %15
store float %16, float* %4
%17 = load float, float* %4
%18 = fptosi float %17 to i32
%19 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = load float, float* %2
%21 = load float, float* %3
%22 = fmul float %20, %21
store float %22, float* %4
%23 = load float, float* %4
%24 = fptosi float %23 to i32
%25 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = add nsw i32 %26, %27
store i32 %28, i32* %7
%29 = load i32, i32* %7
%30 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = sub nsw i32 %31, %32
store i32 %33, i32* %7
%34 = load i32, i32* %7
%35 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = mul nsw i32 %36, %37
store i32 %38, i32* %7
%39 = load i32, i32* %7
%40 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"a + b = %.3f\0A\00"
@.str.1 = [14 x i8] c"a - b = %.3f\0A\00"
@.str.2 = [14 x i8] c"a * b = %.3f\0A\00"
@.str.3 = [12 x i8] c"d + e = %d\0A\00"
@.str.4 = [12 x i8] c"d - e = %d\0A\00"
@.str.5 = [12 x i8] c"d * e = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 -1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 5)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 -1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 6)
ret i32 0
}