#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() {
  printf("2 + 2 ist: %i\n", 2 + 2);
  printf("3 - 2 ist: %i\n", 3 - 2);
  printf("10 * 2 ist: %i\n", 10 * 2);
  printf("3.0 / 2.0 ist: %f\n", 3.0 / 2.0);
  printf("4.1 / 1.22 ist: %.2f (rounded on two digits)\n", 4.1 / 1.22);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf02(%rip),%rdi
movsd  0xef2(%rip),%xmm0
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
movsd  0xed6(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
movsd  0xeba(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
movsd  0xe82(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf10(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
movsd  0xed4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
movsd  0xec8(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
movsd  0xebc(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
movsd  0xeb0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"2 + 2 ist: %i\0A\00"
@.str.1 = [15 x i8] c"3 - 2 ist: %i\0A\00"
@.str.2 = [16 x i8] c"10 * 2 ist: %i\0A\00"
@.str.3 = [19 x i8] c"3.0 / 2.0 ist: %f\0A\00"
@.str.4 = [46 x i8] c"4.1 / 1.22 ist: %.2f (rounded on two digits)\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double 4.000000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double 1.000000e+00)
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 2.000000e+01)
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double 1.500000e+00)
%6 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), double 0x400AE29F79B47582)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"2 + 2 ist: %i\0A\00"
@.str.1 = [15 x i8] c"3 - 2 ist: %i\0A\00"
@.str.2 = [16 x i8] c"10 * 2 ist: %i\0A\00"
@.str.3 = [19 x i8] c"3.0 / 2.0 ist: %f\0A\00"
@.str.4 = [46 x i8] c"4.1 / 1.22 ist: %.2f (rounded on two digits)\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double 4.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double 1.000000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 2.000000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double 1.500000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), double 0x400AE29F79B47582)
ret i32 0
}