#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 ** Calculadora da renda total de um jogo **\n\n");
  float PT, PP, GL, AQ, CD, TP;
  printf("Informe o publico total do jogo: ");
  scanf("%f", &PT);
  PP = 0.10 * PT * 1.00;
  GL = 0.50 * PT * 5.00;
  AQ = 0.30 * PT * 10.00;
  CD = 0.10 * PT * 20.00;
  TP = PP + GL + AQ + CD;
  printf("A renda total do jogo é %.2f Reais.\n", TP);
  printf("\n<<Marco Tulio>>\n");
  getchar(), getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2f(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe93(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe89(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe75(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe4f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe3b(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe15(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe01(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe58(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe70(%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   %rax
lea    0xf33(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe82(%rip),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm1,%xmm2
mulpd  0xe8e(%rip),%xmm2
cvtpd2ps %xmm2,%xmm1
mulsd  0xe6a(%rip),%xmm0
mulsd  0xe6a(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mulsd  0xe66(%rip),%xmm2
cvtsd2ss %xmm2,%xmm2
movapd %xmm1,%xmm3
shufps $0x55,%xmm1,%xmm3
addss  %xmm1,%xmm3
addss  %xmm0,%xmm3
addss  %xmm2,%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
lea    0xe7d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xec4(%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 = [48 x i8] c"\0A ** Calculadora da renda total de um jogo **\0A\0A\00"
@.str.1 = [34 x i8] c"Informe o publico total do jogo: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [38 x i8] c"A renda total do jogo \C3\A9 %.2f Reais.\0A\00"
@.str.4 = [18 x i8] c"\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 ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 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 = load float, float* %1
%11 = fpext float %10 to double
%12 = fmul double 1.000000e-01, %11
%13 = fmul double %12, 1.000000e+00
%14 = fptrunc double %13 to float
store float %14, float* %2
%15 = load float, float* %1
%16 = fpext float %15 to double
%17 = fmul double 5.000000e-01, %16
%18 = fmul double %17, 5.000000e+00
%19 = fptrunc double %18 to float
store float %19, float* %3
%20 = load float, float* %1
%21 = fpext float %20 to double
%22 = fmul double 3.000000e-01, %21
%23 = fmul double %22, 1.000000e+01
%24 = fptrunc double %23 to float
store float %24, float* %4
%25 = load float, float* %1
%26 = fpext float %25 to double
%27 = fmul double 1.000000e-01, %26
%28 = fmul double %27, 2.000000e+01
%29 = fptrunc double %28 to float
store float %29, float* %5
%30 = load float, float* %2
%31 = load float, float* %3
%32 = fadd float %30, %31
%33 = load float, float* %4
%34 = fadd float %32, %33
%35 = load float, float* %5
%36 = fadd float %34, %35
store float %36, float* %6
%37 = load float, float* %6
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %38)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%41 = call i32 (...) @getchar()
%42 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"Informe o publico total do jogo: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [38 x i8] c"A renda total do jogo \C3\A9 %.2f Reais.\0A\00"
@str = [47 x i8] c"\0A ** Calculadora da renda total de um jogo **\0A\00"
@str.5 = [17 x i8] c"\0A<<Marco Tulio>>\00"
define i32 @main() {
%1 = alloca float
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%3 = bitcast float* %1 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 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), float* %1)
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = fmul double %7, 5.000000e-01
%9 = insertelement <2 x double> poison, double %7, i64 0
%10 = insertelement <2 x double> %9, double %8, i64 1
%11 = fmul <2 x double> %10, <double 1.000000e-01, double 5.000000e+00>
%12 = fptrunc <2 x double> %11 to <2 x float>
%13 = fmul double %7, 3.000000e-01
%14 = fmul double %13, 1.000000e+01
%15 = fptrunc double %14 to float
%16 = extractelement <2 x double> %11, i64 0
%17 = fmul double %16, 2.000000e+01
%18 = fptrunc double %17 to float
%19 = shufflevector <2 x float> %12, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%20 = fadd <2 x float> %19, %12
%21 = extractelement <2 x float> %20, i64 0
%22 = fadd float %21, %15
%23 = fadd float %22, %18
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %24)
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.5, i64 0, i64 0))
%27 = call i32 (...) @getchar()
%28 = call i32 (...) @getchar()
ret i32 0
}