#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 */
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
double strtod(char *, int /*<<< orphan*/ *);
int validar_es_flotante(char *);
double Suma(double a, double b) {
  char buffer[9];
  bool band = false;
  int enteroDummy = 0;
  do {
    printf(gettext("Enter a number: "));
    scanf("%s", buffer);
    if ((band = validar_es_flotante(buffer)) == false)
      printf(gettext("Please only integer or floating.\n"));
  } while (band == false);
  a = strtod(buffer, NULL);
  do {
    printf(gettext("Enter a number: "));
    scanf("%s", buffer);
    if ((band = validar_es_flotante(buffer)) == false)
      printf(gettext("Please only integer or floating.\n"));
  } while (band == false);
  b = strtod(buffer, NULL);
  return (a + b);
}


x86 assembly (clang, -O0):
<Suma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe89(%rip),%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
lea    -0x19(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x19(%rbp),%rdi
call   1070 <validar_es_flotante@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jne    11bd <Suma+0x6d>
lea    0xe64(%rip),%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
jmp    11c2 <Suma+0x72>
cmpl   $0x0,-0x20(%rbp)
je     1170 <Suma+0x20>
lea    -0x19(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x8(%rbp)
lea    0xe1b(%rip),%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
lea    -0x19(%rbp),%rsi
lea    0xe14(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x19(%rbp),%rdi
call   1070 <validar_es_flotante@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jne    122b <Suma+0xdb>
lea    0xdf6(%rip),%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
jmp    1230 <Suma+0xe0>
cmpl   $0x0,-0x20(%rbp)
je     11de <Suma+0x8e>
lea    -0x19(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Suma>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe9e(%rip),%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
lea    0xe9b(%rip),%rdi
lea    0x7(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1070 <validar_es_flotante@plt>
test   %eax,%eax
jne    11e7 <Suma+0x97>
lea    0xe7e(%rip),%r14
lea    0xe63(%rip),%r15
lea    0xe6d(%rip),%r12
lea    0x7(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1070 <validar_es_flotante@plt>
test   %eax,%eax
je     11b0 <Suma+0x60>
lea    0x7(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <strtod@plt>
movsd  %xmm0,0x10(%rsp)
lea    0xdfd(%rip),%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
lea    0xdfa(%rip),%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1070 <validar_es_flotante@plt>
test   %eax,%eax
jne    1287 <Suma+0x137>
lea    0xde2(%rip),%r14
lea    0xdc7(%rip),%r15
lea    0xdd1(%rip),%r12
lea    0x7(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1070 <validar_es_flotante@plt>
test   %eax,%eax
je     1250 <Suma+0x100>
lea    0x7(%rsp),%rdi
xor    %esi,%esi
call   1030 <strtod@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [34 x i8] c"Please only integer or floating.\0A\00"
define double @Suma(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca [9 x i8]
%6 = alloca i32
%7 = alloca i32
store double %0, double* %3
store double %1, double* %4
store i32 0, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %2
%9 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* %9)
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%14 = call i32 @validar_es_flotante(i8* %13)
store i32 %14, i32* %6
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %8
%17 = call i8* @gettext(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 @printf(i8* %17)
br label %19
19: ; preds = %16, %8
br label %20
20: ; preds = %19
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 0
br i1 %22, label %8, label %23
23: ; preds = %20
%24 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%25 = call double @strtod(i8* %24, i32* null)
store double %25, double* %3
br label %26
26: ; preds = %38, %23
%27 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%28 = call i32 @printf(i8* %27)
%29 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%32 = call i32 @validar_es_flotante(i8* %31)
store i32 %32, i32* %6
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %26
%35 = call i8* @gettext(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%36 = call i32 @printf(i8* %35)
br label %37
37: ; preds = %34, %26
br label %38
38: ; preds = %37
%39 = load i32, i32* %6
%40 = icmp eq i32 %39, 0
br i1 %40, label %26, label %41
41: ; preds = %38
%42 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%43 = call double @strtod(i8* %42, i32* null)
store double %43, double* %4
%44 = load double, double* %3
%45 = load double, double* %4
%46 = fadd double %44, %45
ret double %46
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [34 x i8] c"Please only integer or floating.\0A\00"
define double @Suma(double %0, double %1) {
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* dereferenceable(1) %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%8 = call i32 @validar_es_flotante(i8* %4)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %2, %10
%11 = call i8* @gettext(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @printf(i8* dereferenceable(1) %11)
%13 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @printf(i8* dereferenceable(1) %13)
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%16 = call i32 @validar_es_flotante(i8* %4)
%17 = icmp eq i32 %16, 0
br i1 %17, label %10, label %18
18: ; preds = %10, %2
%19 = call double @strtod(i8* nocapture %4, i32* null)
%20 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @printf(i8* dereferenceable(1) %20)
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%23 = call i32 @validar_es_flotante(i8* %4)
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %18, %25
%26 = call i8* @gettext(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 @printf(i8* dereferenceable(1) %26)
%28 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%29 = call i32 @printf(i8* dereferenceable(1) %28)
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%31 = call i32 @validar_es_flotante(i8* %4)
%32 = icmp eq i32 %31, 0
br i1 %32, label %25, label %33
33: ; preds = %25, %18
%34 = call double @strtod(i8* nocapture %4, i32* null)
%35 = fadd double %19, %34
ret double %35
}