#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 main() {
  if (0.1 + 0.2 != 0.3) {
    printf("0.1 + 0.2 NO és igual a 0.3!!\n");
  } else {
    printf("0.1 + 0.2 és igual a 0.3\n");
  }
  float cerocoma1 = 0.1;
  float cerocoma2 = 0.2;
  if (cerocoma1 + cerocoma2 != 0.3) {
    printf("Utilitzan float, 0.1 + 0.2 NO és igual a 0.3!!\n");
  } else {
    printf("Utilitzan float, 0.1 + 0.2 és igual a 0.3\n");
  }
  float cerocoma3 = 0.3;
  if (cerocoma1 + cerocoma2 != cerocoma3) {
    printf("Utilitzan float en 0.3, 0.1 + 0.2 NO és igual a 0.3!!\n");
  } else {
    printf("Utilitzan float en 0.3, 0.1 + 0.2 és igual a 0.3\n");
  }
  double cerocoma1d = 0.1;
  double cerocoma2d = 0.2;
  double cerocoma3d = 0.3;
  if (cerocoma1d + cerocoma2d != cerocoma3d) {
    printf("Utilitzan double en 0.3, 0.1 + 0.2 NO és igual a 0.3!!\n");
  } else {
    printf("Utilitzan double en 0.3, 0.1 + 0.2 és igual a 0.3\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xfdf(%rip),%rdi
call   1030 <printf@plt>
movss  0xee9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed8(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1170 <main+0x60>
jp     1170 <main+0x60>
jmp    1181 <main+0x71>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    118d <main+0x7d>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movss  0xe8b(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    11b9 <main+0xa9>
jp     11b9 <main+0xa9>
jmp    11ca <main+0xba>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    11d6 <main+0xc6>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe32(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe1d(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe08(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    121d <main+0x10d>
jp     121d <main+0x10d>
jmp    122e <main+0x11e>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
jmp    123a <main+0x12a>
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf63(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xf26(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"0.1 + 0.2 NO \C3\A9s igual a 0.3!!\0A\00"
@.str.1 = [49 x i8] c"Utilitzan float, 0.1 + 0.2 NO \C3\A9s igual a 0.3!!\0A\00"
@.str.2 = [44 x i8] c"Utilitzan float, 0.1 + 0.2 \C3\A9s igual a 0.3\0A\00"
@.str.3 = [56 x i8] c"Utilitzan float en 0.3, 0.1 + 0.2 NO \C3\A9s igual a 0.3!!\0A\00"
@.str.4 = [51 x i8] c"Utilitzan float en 0.3, 0.1 + 0.2 \C3\A9s igual a 0.3\0A\00"
@.str.5 = [57 x i8] c"Utilitzan double en 0.3, 0.1 + 0.2 NO \C3\A9s igual a 0.3!!\0A\00"
@.str.6 = [52 x i8] c"Utilitzan double en 0.3, 0.1 + 0.2 \C3\A9s igual a 0.3\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store float 0x3FB99999A0000000, float* %2
store float 0x3FC99999A0000000, float* %3
%9 = load float, float* %2
%10 = load float, float* %3
%11 = fadd float %9, %10
%12 = fpext float %11 to double
%13 = fcmp une double %12, 3.000000e-01
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
br label %18
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
store float 0x3FD3333340000000, float* %4
%19 = load float, float* %2
%20 = load float, float* %3
%21 = fadd float %19, %20
%22 = load float, float* %4
%23 = fcmp une float %21, %22
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
br label %28
26: ; preds = %18
%27 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
br label %28
28: ; preds = %26, %24
store double 1.000000e-01, double* %5
store double 2.000000e-01, double* %6
store double 3.000000e-01, double* %7
%29 = load double, double* %5
%30 = load double, double* %6
%31 = fadd double %29, %30
%32 = load double, double* %7
%33 = fcmp une double %31, %32
br i1 %33, label %34, label %36
34: ; preds = %28
%35 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0))
br label %38
36: ; preds = %28
%37 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0))
br label %38
38: ; preds = %36, %34
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"0.1 + 0.2 NO \C3\A9s igual a 0.3!!\00"
@str.7 = [48 x i8] c"Utilitzan float, 0.1 + 0.2 NO \C3\A9s igual a 0.3!!\00"
@str.8 = [50 x i8] c"Utilitzan float en 0.3, 0.1 + 0.2 \C3\A9s igual a 0.3\00"
@str.9 = [56 x i8] c"Utilitzan double en 0.3, 0.1 + 0.2 NO \C3\A9s igual a 0.3!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.7, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.8, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.9, i64 0, i64 0))
ret i32 0
}