#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 *, int *);
main() {
  int tp, v1, v2;
  float lc;
  printf("\n**LOCADORA DE CHARRETES - CALCULO DE ALUGUEL**\n");
  printf("\nQual o tempo em horas? ");
  scanf("%i", &tp);
  v1 = tp / 3;
  v2 = tp % 3;
  lc = v1 * 8.50 + v2 * 3.50;
  printf("\nO valor a pagar e: R$ %f .\n", lc);
  printf("\n<< Marco_Tulio >>\n");
  getchar(), getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe76(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe62(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xead(%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    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
sub    %edx,%eax
cvtsi2sd %ecx,%xmm0
cvtsi2sd %eax,%xmm1
mulsd  0xe66(%rip),%xmm1
mulsd  0xe66(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe77(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"\0A**LOCADORA DE CHARRETES - CALCULO DE ALUGUEL**\0A\00"
@.str.1 = [25 x i8] c"\0AQual o tempo em horas? \00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [29 x i8] c"\0AO valor a pagar e: R$ %f .\0A\00"
@.str.4 = [20 x i8] c"\0A<< Marco_Tulio >>\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = sdiv i32 %8, 3
store i32 %9, i32* %2
%10 = load i32, i32* %1
%11 = srem i32 %10, 3
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to double
%14 = load i32, i32* %3
%15 = sitofp i32 %14 to double
%16 = fmul double %15, 3.500000e+00
%17 = call double @llvm.fmuladd.f64(double %13, double 8.500000e+00, double %16)
%18 = fptrunc double %17 to float
store float %18, float* %4
%19 = load float, float* %4
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), double %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%23 = call i32 (...) @getchar()
%24 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"\0AQual o tempo em horas? \00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [29 x i8] c"\0AO valor a pagar e: R$ %f .\0A\00"
@str = [48 x i8] c"\0A**LOCADORA DE CHARRETES - CALCULO DE ALUGUEL**\00"
@str.5 = [19 x i8] c"\0A<< Marco_Tulio >>\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = sdiv i32 %6, 3
%8 = srem i32 %6, 3
%9 = sitofp i32 %7 to double
%10 = sitofp i32 %8 to double
%11 = fmul double %10, 3.500000e+00
%12 = call double @llvm.fmuladd.f64(double %9, double 8.500000e+00, double %11)
%13 = fptrunc double %12 to float
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), double %14)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
%17 = call i32 (...) @getchar()
%18 = call i32 (...) @getchar()
ret i32 0
}