#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  printf("\n ** Calculo de aluguel de carros ** \n");
  float td, tk, nd, nkr, tp, vd;
  printf("\nInforme a taxa diaria de aluguel: ");
  scanf("%f", &td);
  printf("Informe a taxa por Kilometro rodado: ");
  scanf("%f", &tk);
  printf("Informe o numero de dias alugados: ");
  scanf("%f", &nd);
  printf("Informe o numero de Kilometros rodados: ");
  scanf("%f", &nkr);
  tp = td * nd + tk * nkr - (td * nd) * 0.10;
  vd = (td * nd) * 0.10;
  printf("\nO valor total do  aluguel é: %.2f Reais.\n", tp);
  printf("O valor   do   desconto   é: %.2f Reais.\n", vd);
  printf("O numero de dias alugados é: %.0f Dias.\n", nd);
  printf("A quilometragem  rodada   é: %.2f Km.\n", nkr);
  printf("\n\n<<Marco Tulio>>\n");
  getchar(), getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xdf5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdce(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xfff(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec6(%rip),%rbx
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
mulss  0xc(%rsp),%xmm1
mulss  0x10(%rsp),%xmm0
addss  %xmm0,%xmm1
cvtss2sd %xmm0,%xmm0
mulsd  0xe14(%rip),%xmm0
cvtss2sd %xmm1,%xmm1
subsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe92(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea6(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xecb(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"\0A ** Calculo de aluguel de carros ** \0A\00"
@.str.1 = [36 x i8] c"\0AInforme a taxa diaria de aluguel: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [38 x i8] c"Informe a taxa por Kilometro rodado: \00"
@.str.4 = [36 x i8] c"Informe o numero de dias alugados: \00"
@.str.5 = [41 x i8] c"Informe o numero de Kilometros rodados: \00"
@.str.6 = [44 x i8] c"\0AO valor total do aluguel \C3\A9: %.2f Reais.\0A\00"
@.str.7 = [43 x i8] c"O valor do desconto \C3\A9: %.2f Reais.\0A\00"
@.str.8 = [42 x i8] c"O numero de dias alugados \C3\A9: %.0f Dias.\0A\00"
@.str.9 = [40 x i8] c"A quilometragem rodada \C3\A9: %.2f Km.\0A\00"
@.str.10 = [19 x i8] c"\0A\0A<<Marco Tulio>>\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
%16 = load float, float* %1
%17 = load float, float* %3
%18 = load float, float* %2
%19 = load float, float* %4
%20 = fmul float %18, %19
%21 = call float @llvm.fmuladd.f32(float %16, float %17, float %20)
%22 = fpext float %21 to double
%23 = load float, float* %1
%24 = load float, float* %3
%25 = fmul float %23, %24
%26 = fpext float %25 to double
%27 = fneg double %26
%28 = call double @llvm.fmuladd.f64(double %27, double 1.000000e-01, double %22)
%29 = fptrunc double %28 to float
store float %29, float* %5
%30 = load float, float* %1
%31 = load float, float* %3
%32 = fmul float %30, %31
%33 = fpext float %32 to double
%34 = fmul double %33, 1.000000e-01
%35 = fptrunc double %34 to float
store float %35, float* %6
%36 = load float, float* %5
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), double %37)
%39 = load float, float* %6
%40 = fpext float %39 to double
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), double %40)
%42 = load float, float* %3
%43 = fpext float %42 to double
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), double %43)
%45 = load float, float* %4
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), double %46)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
%49 = call i32 (...) @getchar()
%50 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"\0AInforme a taxa diaria de aluguel: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [38 x i8] c"Informe a taxa por Kilometro rodado: \00"
@.str.4 = [36 x i8] c"Informe o numero de dias alugados: \00"
@.str.5 = [41 x i8] c"Informe o numero de Kilometros rodados: \00"
@.str.6 = [44 x i8] c"\0AO valor total do aluguel \C3\A9: %.2f Reais.\0A\00"
@.str.7 = [43 x i8] c"O valor do desconto \C3\A9: %.2f Reais.\0A\00"
@.str.8 = [42 x i8] c"O numero de dias alugados \C3\A9: %.0f Dias.\0A\00"
@.str.9 = [40 x i8] c"A quilometragem rodada \C3\A9: %.2f Km.\0A\00"
@str = [38 x i8] c"\0A ** Calculo de aluguel de carros ** \00"
@str.11 = [18 x i8] c"\0A\0A<<Marco Tulio>>\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%6 = bitcast float* %1 to i8*
%7 = bitcast float* %2 to i8*
%8 = bitcast float* %3 to i8*
%9 = bitcast float* %4 to i8*
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
%18 = load float, float* %1
%19 = load float, float* %3
%20 = load float, float* %2
%21 = load float, float* %4
%22 = fmul float %20, %21
%23 = call float @llvm.fmuladd.f32(float %18, float %19, float %22)
%24 = fpext float %23 to double
%25 = fmul float %18, %19
%26 = fpext float %25 to double
%27 = fneg double %26
%28 = call double @llvm.fmuladd.f64(double %27, double 1.000000e-01, double %24)
%29 = fptrunc double %28 to float
%30 = fmul double %26, 1.000000e-01
%31 = fptrunc double %30 to float
%32 = fpext float %29 to double
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), double %32)
%34 = fpext float %31 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), double %34)
%36 = load float, float* %3
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), double %37)
%39 = load float, float* %4
%40 = fpext float %39 to double
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), double %40)
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.11, i64 0, i64 0))
%43 = call i32 (...) @getchar()
%44 = call i32 (...) @getchar()
ret i32 0
}