#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 a, b, s, r, p, d;
  printf("\n\t\t---------------------------		\n\t\tSUMA RESTA "
         "PRODUCTE DIVISIO		\n\t\t---------------------------\n\n");
  printf("Entra els dos numeros amb els que vulgui operar.\n1>");
  scanf("%f", &a);
  printf("2>");
  scanf("%f", &b);
  s = a + b;
  r = a - b;
  p = a * b;
  d = a / b;
  printf("\nLa SUMA de %.2f + %.2f es igual a %.2f", a, b, s);
  printf("\nLa RESTA de %.2f - %.2f es igual a %.2f", a, b, r);
  printf("\nLa PRODUCTE de %.2f * %.2f es igual a %.2f", a, b, p);
  printf("\nLa DIVISIO de %.2f / %.2f es igual a %.2f\n", a, b, d);
  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    0xf1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf43(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf25(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xec4(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xec3(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x18(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xec3(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x1c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xec6(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xfa7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xede(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x10(%rsp),%xmm3
movss  0xc(%rsp),%xmm1
movaps %xmm3,%xmm2
addss  %xmm1,%xmm2
movaps %xmm3,%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x14(%rsp)
movaps %xmm3,%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,0x18(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
divss  %xmm1,%xmm3
movss  %xmm3,0x1c(%rsp)
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
lea    0xe6f(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x14(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe6b(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x18(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe68(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x1c(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe68(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [97 x i8] c"\0A\09\09---------------------------\09\09\0A\09\09SUMA RESTA PRODUCTE DIVISIO\09\09\0A\09\09---------------------------\0A\0A\00"
@.str.1 = [52 x i8] c"Entra els dos numeros amb els que vulgui operar.\0A1>\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [3 x i8] c"2>\00"
@.str.4 = [40 x i8] c"\0ALa SUMA de %.2f + %.2f es igual a %.2f\00"
@.str.5 = [41 x i8] c"\0ALa RESTA de %.2f - %.2f es igual a %.2f\00"
@.str.6 = [44 x i8] c"\0ALa PRODUCTE de %.2f * %.2f es igual a %.2f\00"
@.str.7 = [44 x i8] c"\0ALa DIVISIO de %.2f / %.2f es igual a %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%13 = load float, float* %2
%14 = load float, float* %3
%15 = fadd float %13, %14
store float %15, float* %4
%16 = load float, float* %2
%17 = load float, float* %3
%18 = fsub float %16, %17
store float %18, float* %5
%19 = load float, float* %2
%20 = load float, float* %3
%21 = fmul float %19, %20
store float %21, float* %6
%22 = load float, float* %2
%23 = load float, float* %3
%24 = fdiv float %22, %23
store float %24, float* %7
%25 = load float, float* %2
%26 = fpext float %25 to double
%27 = load float, float* %3
%28 = fpext float %27 to double
%29 = load float, float* %4
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), double %26, double %28, double %30)
%32 = load float, float* %2
%33 = fpext float %32 to double
%34 = load float, float* %3
%35 = fpext float %34 to double
%36 = load float, float* %5
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), double %33, double %35, double %37)
%39 = load float, float* %2
%40 = fpext float %39 to double
%41 = load float, float* %3
%42 = fpext float %41 to double
%43 = load float, float* %6
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), double %40, double %42, double %44)
%46 = load float, float* %2
%47 = fpext float %46 to double
%48 = load float, float* %3
%49 = fpext float %48 to double
%50 = load float, float* %7
%51 = fpext float %50 to double
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), double %47, double %49, double %51)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [52 x i8] c"Entra els dos numeros amb els que vulgui operar.\0A1>\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [3 x i8] c"2>\00"
@.str.4 = [40 x i8] c"\0ALa SUMA de %.2f + %.2f es igual a %.2f\00"
@.str.5 = [41 x i8] c"\0ALa RESTA de %.2f - %.2f es igual a %.2f\00"
@.str.6 = [44 x i8] c"\0ALa PRODUCTE de %.2f * %.2f es igual a %.2f\00"
@.str.7 = [44 x i8] c"\0ALa DIVISIO de %.2f / %.2f es igual a %.2f\0A\00"
@str = [96 x i8] c"\0A\09\09---------------------------\09\09\0A\09\09SUMA RESTA PRODUCTE DIVISIO\09\09\0A\09\09---------------------------\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%10 = load float, float* %1
%11 = load float, float* %2
%12 = fadd float %10, %11
%13 = fsub float %10, %11
%14 = fmul float %10, %11
%15 = fdiv float %10, %11
%16 = fpext float %10 to double
%17 = fpext float %11 to double
%18 = fpext float %12 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), double %16, double %17, double %18)
%20 = load float, float* %1
%21 = fpext float %20 to double
%22 = load float, float* %2
%23 = fpext float %22 to double
%24 = fpext float %13 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), double %21, double %23, double %24)
%26 = load float, float* %1
%27 = fpext float %26 to double
%28 = load float, float* %2
%29 = fpext float %28 to double
%30 = fpext float %14 to double
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), double %27, double %29, double %30)
%32 = load float, float* %1
%33 = fpext float %32 to double
%34 = load float, float* %2
%35 = fpext float %34 to double
%36 = fpext float %15 to double
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), double %33, double %35, double %36)
ret i32 0
}