#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 /*<<< orphan*/ scanf(char *, float *);
int main() {
  float myfloat[2], sum_myfloat, diff_myfloat, prod_myfloat, quot_myfloat;
  printf("Give me an integer\n");
  scanf("%f", &myfloat[0]);
  printf("Ya got another one?\n");
  scanf("%f", &myfloat[1]);
  sum_myfloat = myfloat[0] + myfloat[1];
  diff_myfloat = myfloat[0] - myfloat[1];
  prod_myfloat = myfloat[0] * myfloat[1];
  quot_myfloat = myfloat[0] / myfloat[1];
  printf("the sume %.2f\nThe difference %.2f\n", sum_myfloat, diff_myfloat);
  printf("It multiplied %.2f\nIt division %.2f\n", prod_myfloat, quot_myfloat);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xc(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xc(%rbp),%rsi
add    $0x4,%rsi
lea    0xeaa(%rip),%rdi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe68(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe6b(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm3
movss  0xc(%rsp),%xmm0
movaps %xmm3,%xmm1
addss  %xmm0,%xmm1
movaps %xmm3,%xmm2
subss  %xmm0,%xmm2
movaps %xmm3,%xmm4
mulss  %xmm0,%xmm4
movss  %xmm4,0x4(%rsp)
divss  %xmm0,%xmm3
movss  %xmm3,(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
lea    0xe50(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe52(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Give me an integer\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [21 x i8] c"Ya got another one?\0A\00"
@.str.3 = [35 x i8] c"the sume %.2f\0AThe difference %.2f\0A\00"
@.str.4 = [37 x i8] c"It multiplied %.2f\0AIt division %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x float]
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %11)
%13 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%14 = load float, float* %13
%15 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
%16 = load float, float* %15
%17 = fadd float %14, %16
store float %17, float* %3
%18 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%19 = load float, float* %18
%20 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
%21 = load float, float* %20
%22 = fsub float %19, %21
store float %22, float* %4
%23 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%24 = load float, float* %23
%25 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
%26 = load float, float* %25
%27 = fmul float %24, %26
store float %27, float* %5
%28 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%29 = load float, float* %28
%30 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
%31 = load float, float* %30
%32 = fdiv float %29, %31
store float %32, float* %6
%33 = load float, float* %3
%34 = fpext float %33 to double
%35 = load float, float* %4
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %34, double %36)
%38 = load float, float* %5
%39 = fpext float %38 to double
%40 = load float, float* %6
%41 = fpext float %40 to double
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), double %39, double %41)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [35 x i8] c"the sume %.2f\0AThe difference %.2f\0A\00"
@.str.4 = [37 x i8] c"It multiplied %.2f\0AIt division %.2f\0A\00"
@str = [19 x i8] c"Give me an integer\00"
@str.5 = [20 x i8] c"Ya got another one?\00"
define i32 @main() {
%1 = alloca [2 x float]
%2 = bitcast [2 x float]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [2 x float], [2 x float]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.5, i64 0, i64 0))
%7 = getelementptr inbounds [2 x float], [2 x float]* %1, i64 0, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%9 = load float, float* %4
%10 = load float, float* %7
%11 = fadd float %9, %10
%12 = fsub float %9, %10
%13 = fmul float %9, %10
%14 = fdiv float %9, %10
%15 = fpext float %11 to double
%16 = fpext float %12 to double
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %15, double %16)
%18 = fpext float %13 to double
%19 = fpext float %14 to double
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), double %18, double %19)
ret i32 0
}