#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 *);
int /*<<< orphan*/ system(char *);
int main() {
  int fab, dist, imp;
  printf("Qual o custo de fabrica do carro? ");
  scanf("%d", &fab);
  dist = 0.28 * fab;
  imp = 0.45 * fab;
  printf("\nO custo final ao consumidor é de %d\n", fab + dist + imp);
  system("pause");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe9e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe7e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
add    -0x10(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb2(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeed(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xea0(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%esi
mulsd  0xe98(%rip),%xmm0
cvttsd2si %xmm0,%ecx
add    %eax,%esi
add    %ecx,%esi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Qual o custo de fabrica do carro? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [39 x i8] c"\0AO custo final ao consumidor \C3\A9 de %d\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to double
%9 = fmul double 2.800000e-01, %8
%10 = fptosi double %9 to i32
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = sitofp i32 %11 to double
%13 = fmul double 4.500000e-01, %12
%14 = fptosi double %13 to i32
store i32 %14, i32* %4
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %4
%19 = add nsw i32 %17, %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = 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 = [35 x i8] c"Qual o custo de fabrica do carro? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [39 x i8] c"\0AO custo final ao consumidor \C3\A9 de %d\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 2.800000e-01
%8 = fptosi double %7 to i32
%9 = fmul double %6, 4.500000e-01
%10 = fptosi double %9 to i32
%11 = add nsw i32 %5, %8
%12 = add nsw i32 %11, %10
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}