#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 */
double calculaCargo(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf_s(char *, float *);
int /*<<< orphan*/ system(char *);
int main() {
  int i = 0;
  float tiempo = 1;
  while (tiempo != 0) {
    printf("Pon el tiempo de estacionamiento: ");
    scanf_s("%f", &tiempo);
    if (tiempo <= 24)
      printf("El coste total de %.2f h. estacionado es %.2f\n", tiempo,
             calculaCargo(tiempo));
    else
      printf("El coche no puede estar más de 24h\n");
    ++i;
  }
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movss  0xea2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    117f <main+0x3f>
jp     117f <main+0x3f>
jmp    11fe <main+0xbe>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf_s@plt>
movss  0xe5f(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     11e2 <main+0xa2>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
call   1050 <calculaCargo@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
lea    0xe58(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    11f0 <main+0xb0>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1163 <main+0x23>
lea    0xe7d(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x3f800000,0x4(%rsp)
3f
lea    0xe9c(%rip),%r14
lea    0xeb8(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xee4(%rip),%r12
lea    0xea8(%rip),%r13
jmp    11a9 <main+0x59>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <puts@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xe5f(%rip),%xmm0
jne    11a9 <main+0x59>
jnp    11f8 <main+0xa8>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf_s@plt>
movss  0x4(%rsp),%xmm0
movss  0xe34(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     1190 <main+0x40>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
call   1060 <calculaCargo@plt>
movaps %xmm0,%xmm1
mov    %r13,%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x2,%al
call   1050 <printf@plt>
jmp    1198 <main+0x48>
lea    0xe5e(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Pon el tiempo de estacionamiento: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [47 x i8] c"El coste total de %.2f h. estacionado es %.2f\0A\00"
@.str.3 = [37 x i8] c"El coche no puede estar m\C3\A1s de 24h\0A\00"
@.str.4 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
store float 1.000000e+00, float* %3
br label %4
4: ; preds = %20, %0
%5 = load float, float* %3
%6 = fcmp une float %5, 0.000000e+00
br i1 %6, label %7, label %23
7: ; preds = %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%10 = load float, float* %3
%11 = fcmp ole float %10, 2.400000e+01
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = load float, float* %3
%16 = call double @calculaCargo(float %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), double %14, double %16)
br label %20
18: ; preds = %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %18, %12
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %4
23: ; preds = %4
%24 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Pon el tiempo de estacionamiento: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [47 x i8] c"El coste total de %.2f h. estacionado es %.2f\0A\00"
@.str.4 = [6 x i8] c"pause\00"
@str = [36 x i8] c"El coche no puede estar m\C3\A1s de 24h\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 1.000000e+00, float* %1
br label %3
3: ; preds = %0, %14
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%6 = load float, float* %1
%7 = fcmp ugt float %6, 2.400000e+01
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = fpext float %6 to double
%10 = call double @calculaCargo(float %6)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), double %9, double %10)
br label %14
12: ; preds = %3
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
%15 = load float, float* %1
%16 = fcmp une float %15, 0.000000e+00
br i1 %16, label %3, label %17
17: ; preds = %14
%18 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}