#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 *, int *);
void main(void) {
  int numPlaca, horaEnt, horaSai, totalmin;
  float valPagar, totFatur;
  totFatur = 0;
  printf("Insira o numero da placa: ");
  scanf("%i", &numPlaca);
  while (numPlaca > 0) {
    printf("Insira a hora de entrada: ");
    scanf("%i", &horaEnt);
    printf("Insira a hora de saida: ");
    scanf("%i", &horaSai);
    totalmin = (horaSai / 100) * 60 + (horaSai % 100) -
               ((horaEnt / 100) * 60 + (horaEnt % 100));
    valPagar = (totalmin / 15) * 1.5;
    totFatur += valPagar;
    printf("Insira o numero da placa: ");
    scanf("%i", &numPlaca);
  }
  printf("R$%.2f", totFatur);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1231 <main+0x111>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0x3c,%eax,%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0x3c,%eax,%ecx
mov    -0x8(%rbp),%eax
mov    $0x64,%esi
cltd
idiv   %esi
mov    -0x1c(%rbp),%eax
add    %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  0xe0e(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe00(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
jmp    114e <main+0x2e>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe19(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    127b <main+0x15b>
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
lea    0xebb(%rip),%rbx
lea    0xed2(%rip),%r12
lea    0x10(%rsp),%r13
lea    0xe8d(%rip),%r15
lea    0xc(%rsp),%r14
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
movslq 0x10(%rsp),%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%edx
sub    %edx,%eax
movslq 0x14(%rsp),%rdx
imul   $0xffffffffae147ae1,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
shr    $0x20,%rsi
sar    $0x5,%esi
add    %edi,%esi
imul   $0x51eb851f,%rdx,%rdi
mov    %rdi,%rbp
shr    $0x3f,%rbp
shr    $0x20,%rdi
sar    $0x5,%edi
add    %ebp,%edi
imul   $0x64,%edi,%edi
add    %ecx,%esi
imul   $0x3c,%esi,%ecx
sub    %edx,%edi
add    %eax,%edi
add    %ecx,%edi
movslq %edi,%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x3,%eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xdc5(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jg     1180 <main+0x60>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
jmp    127e <main+0x15e>
xorps  %xmm0,%xmm0
lea    0xdd5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Insira o numero da placa: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [27 x i8] c"Insira a hora de entrada: \00"
@.str.3 = [25 x i8] c"Insira a hora de saida: \00"
@.str.4 = [7 x i8] c"R$%.2f\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store float 0.000000e+00, float* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %9
9: ; preds = %12, %0
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %40
12: ; preds = %9
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %3
%18 = sdiv i32 %17, 100
%19 = mul nsw i32 %18, 60
%20 = load i32, i32* %3
%21 = srem i32 %20, 100
%22 = add nsw i32 %19, %21
%23 = load i32, i32* %2
%24 = sdiv i32 %23, 100
%25 = mul nsw i32 %24, 60
%26 = load i32, i32* %2
%27 = srem i32 %26, 100
%28 = add nsw i32 %25, %27
%29 = sub nsw i32 %22, %28
store i32 %29, i32* %4
%30 = load i32, i32* %4
%31 = sdiv i32 %30, 15
%32 = sitofp i32 %31 to double
%33 = fmul double %32, 1.500000e+00
%34 = fptrunc double %33 to float
store float %34, float* %5
%35 = load float, float* %5
%36 = load float, float* %6
%37 = fadd float %36, %35
store float %37, float* %6
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %9
40: ; preds = %9
%41 = load float, float* %6
%42 = fpext float %41 to double
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %42)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Insira o numero da placa: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [27 x i8] c"Insira a hora de entrada: \00"
@.str.3 = [25 x i8] c"Insira a hora de saida: \00"
@.str.4 = [7 x i8] c"R$%.2f\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %38
11: ; preds = %0, %11
%12 = phi float [ %31, %11 ], [ 0.000000e+00, %0 ]
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %3
%18 = sdiv i32 %17, 100
%19 = srem i32 %17, 100
%20 = load i32, i32* %2
%21 = sdiv i32 %20, -100
%22 = srem i32 %20, 100
%23 = add nsw i32 %21, %18
%24 = mul i32 %23, 60
%25 = sub nsw i32 %19, %22
%26 = add i32 %25, %24
%27 = sdiv i32 %26, 15
%28 = sitofp i32 %27 to double
%29 = fmul double %28, 1.500000e+00
%30 = fptrunc double %29 to float
%31 = fadd float %12, %30
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%34 = load i32, i32* %1
%35 = icmp sgt i32 %34, 0
br i1 %35, label %11, label %36
36: ; preds = %11
%37 = fpext float %31 to double
br label %38
38: ; preds = %36, %0
%39 = phi double [ 0.000000e+00, %0 ], [ %37, %36 ]
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %39)
ret void
}