#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 *, float *);
int /*<<< orphan*/ system(char *);
int main() {
  float litros, distancia, tempo, vel;
  printf(
      "Qual a velocidade média(em km/h) e o tempo gasto na viagem(em horas)?");
  scanf("%f %f", &vel, &tempo);
  distancia = (tempo * vel);
  litros = (distancia / 16);
  printf("\nA distância percorrida é de %.2f km.\nForam gastos %.2f litros de "
         "combustível.\n",
         distancia, litros);
  system("pause");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef7(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <scanf@plt>
movss  -0x10(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe83(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xeb2(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xef7(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf05(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  (%rsp),%xmm0
movss  0xe9a(%rip),%xmm1
mulss  %xmm0,%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
lea    0xed8(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xf1d(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [71 x i8] c"Qual a velocidade m\C3\A9dia(em km/h) e o tempo gasto na viagem(em horas)?\00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [83 x i8] c"\0AA dist\C3\A2ncia percorrida \C3\A9 de %.2f km.\0AForam gastos %.2f litros de combust\C3\ADvel.\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %5, float* %4)
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fmul float %8, %9
store float %10, float* %3
%11 = load float, float* %3
%12 = fdiv float %11, 1.600000e+01
store float %12, float* %2
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = load float, float* %2
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.2, i64 0, i64 0), double %14, double %16)
%18 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [71 x i8] c"Qual a velocidade m\C3\A9dia(em km/h) e o tempo gasto na viagem(em horas)?\00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [83 x i8] c"\0AA dist\C3\A2ncia percorrida \C3\A9 de %.2f km.\0AForam gastos %.2f litros de combust\C3\ADvel.\0A\00"
@.str.3 = [6 x i8] c"pause\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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %1)
%7 = load float, float* %1
%8 = load float, float* %2
%9 = fmul float %7, %8
%10 = fmul float %9, 6.250000e-02
%11 = fpext float %9 to double
%12 = fpext float %10 to double
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @.str.2, i64 0, i64 0), double %11, double %12)
%14 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}