#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 *);
void ex3() {
  float phora, horas;
  printf("Informe o valor recebido por hora de trabalho: ");
  scanf("%f", &phora);
  printf("Informe a quantidade de horas trabalhadas da semana: ");
  scanf("%f", &horas);
  float snormal = phora * horas, sextra = 0;
  if (horas > 40)
    sextra = phora * (horas - 40) * 0.5;
  float sbruto = snormal + sextra;
  float inss = 0.11 * sbruto;
  float is = 0.008 * sbruto;
  float aliquota = 0;
  if (sbruto > 1787.77)
    aliquota += 7.5;
  if (sbruto > 2679.29)
    aliquota += 7.5;
  if (sbruto > 3572.43)
    aliquota += 7.5;
  if (sbruto > 4463.81)
    aliquota += 5;
  float ir = aliquota * sbruto;
  float sliq = sbruto - inss - is - ir;
  printf("Salario:\n");
  printf("\tNormal:\t\tR$%.2f\n", snormal);
  printf("\tExtra:\t\tR$%.2f\n", sextra);
  printf("\tBruto:\t\tR$%.2f\n", sbruto);
  printf("\tINSS:\t\t-R$%.2f\n", inss);
  printf("\tImposto Sindical:\t-R$%.2f\n", is);
  printf("\tImposto de Renda:\t-R$%.2f\n", ir);
  printf("\tLiquido:\t\tR$%.2f\n", sliq);
}


x86 assembly (clang, -O0):
<ex3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xf19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3b(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe78(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11c4 <ex3+0xa4>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe5d(%rip),%xmm2
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe51(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe3c(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe16(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1250 <ex3+0x130>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde5(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdcf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1289 <ex3+0x169>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdac(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd9e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12c2 <ex3+0x1a2>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd73(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd6d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12ef <ex3+0x1cf>
movss  0xd1f(%rip),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x14(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd86(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd81(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd7b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd75(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd6f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd74(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd79(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex3>:
push   %rbx
sub    $0x40,%rsp
lea    0xf0c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf2e(%rip),%rbx
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf1d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x24(%rsp),%xmm0
movss  0x20(%rsp),%xmm1
movss  0xe7a(%rip),%xmm2
addss  %xmm1,%xmm2
mulss  %xmm0,%xmm2
movaps %xmm0,%xmm3
mulss  %xmm1,%xmm3
mulss  0xe67(%rip),%xmm2
movss  0xe63(%rip),%xmm0
cmpltss %xmm1,%xmm0
andps  %xmm2,%xmm0
movss  %xmm3,0x1c(%rsp)
movaps %xmm0,0x30(%rsp)
addss  %xmm0,%xmm3
cvtss2sd %xmm3,%xmm5
ucomisd 0xe60(%rip),%xmm5
movss  0xe3c(%rip),%xmm0
movaps %xmm0,%xmm4
ja     11d8 <ex3+0xa8>
xorps  %xmm4,%xmm4
ucomisd 0xe50(%rip),%xmm5
jbe    11e6 <ex3+0xb6>
addss  %xmm0,%xmm4
movsd  0xe2a(%rip),%xmm1
mulsd  %xmm5,%xmm1
movsd  0xe26(%rip),%xmm2
mulsd  %xmm5,%xmm2
ucomisd 0xe32(%rip),%xmm5
jbe    120c <ex3+0xdc>
addss  %xmm0,%xmm4
cvtsd2ss %xmm1,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ucomisd 0xe21(%rip),%xmm5
movsd  %xmm5,0x28(%rsp)
jbe    122f <ex3+0xff>
addss  0xde1(%rip),%xmm4
mulss  %xmm3,%xmm4
movss  %xmm4,0x14(%rsp)
subss  %xmm1,%xmm3
subss  %xmm0,%xmm3
subss  %xmm4,%xmm3
movss  %xmm3,0x18(%rsp)
lea    0xeef(%rip),%rdi
movss  %xmm0,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
call   1030 <puts@plt>
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movaps 0x30(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe38(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe3b(%rip),%rdi
movsd  0x28(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe2e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe27(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe2b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe2f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Informe o valor recebido por hora de trabalho: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [54 x i8] c"Informe a quantidade de horas trabalhadas da semana: \00"
@.str.3 = [10 x i8] c"Salario:\0A\00"
@.str.4 = [18 x i8] c"\09Normal:\09\09R$%.2f\0A\00"
@.str.5 = [17 x i8] c"\09Extra:\09\09R$%.2f\0A\00"
@.str.6 = [17 x i8] c"\09Bruto:\09\09R$%.2f\0A\00"
@.str.7 = [17 x i8] c"\09INSS:\09\09-R$%.2f\0A\00"
@.str.8 = [28 x i8] c"\09Imposto Sindical:\09-R$%.2f\0A\00"
@.str.9 = [28 x i8] c"\09Imposto de Renda:\09-R$%.2f\0A\00"
@.str.10 = [19 x i8] c"\09Liquido:\09\09R$%.2f\0A\00"
define void @ex3() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 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), float* %2)
%15 = load float, float* %1
%16 = load float, float* %2
%17 = fmul float %15, %16
store float %17, float* %3
store float 0.000000e+00, float* %4
%18 = load float, float* %2
%19 = fcmp ogt float %18, 4.000000e+01
br i1 %19, label %20, label %28
20: ; preds = %0
%21 = load float, float* %1
%22 = load float, float* %2
%23 = fsub float %22, 4.000000e+01
%24 = fmul float %21, %23
%25 = fpext float %24 to double
%26 = fmul double %25, 5.000000e-01
%27 = fptrunc double %26 to float
store float %27, float* %4
br label %28
28: ; preds = %20, %0
%29 = load float, float* %3
%30 = load float, float* %4
%31 = fadd float %29, %30
store float %31, float* %5
%32 = load float, float* %5
%33 = fpext float %32 to double
%34 = fmul double 1.100000e-01, %33
%35 = fptrunc double %34 to float
store float %35, float* %6
%36 = load float, float* %5
%37 = fpext float %36 to double
%38 = fmul double 8.000000e-03, %37
%39 = fptrunc double %38 to float
store float %39, float* %7
store float 0.000000e+00, float* %8
%40 = load float, float* %5
%41 = fpext float %40 to double
%42 = fcmp ogt double %41, 1.787770e+03
br i1 %42, label %43, label %48
43: ; preds = %28
%44 = load float, float* %8
%45 = fpext float %44 to double
%46 = fadd double %45, 7.500000e+00
%47 = fptrunc double %46 to float
store float %47, float* %8
br label %48
48: ; preds = %43, %28
%49 = load float, float* %5
%50 = fpext float %49 to double
%51 = fcmp ogt double %50, 2.679290e+03
br i1 %51, label %52, label %57
52: ; preds = %48
%53 = load float, float* %8
%54 = fpext float %53 to double
%55 = fadd double %54, 7.500000e+00
%56 = fptrunc double %55 to float
store float %56, float* %8
br label %57
57: ; preds = %52, %48
%58 = load float, float* %5
%59 = fpext float %58 to double
%60 = fcmp ogt double %59, 3.572430e+03
br i1 %60, label %61, label %66
61: ; preds = %57
%62 = load float, float* %8
%63 = fpext float %62 to double
%64 = fadd double %63, 7.500000e+00
%65 = fptrunc double %64 to float
store float %65, float* %8
br label %66
66: ; preds = %61, %57
%67 = load float, float* %5
%68 = fpext float %67 to double
%69 = fcmp ogt double %68, 4.463810e+03
br i1 %69, label %70, label %73
70: ; preds = %66
%71 = load float, float* %8
%72 = fadd float %71, 5.000000e+00
store float %72, float* %8
br label %73
73: ; preds = %70, %66
%74 = load float, float* %8
%75 = load float, float* %5
%76 = fmul float %74, %75
store float %76, float* %9
%77 = load float, float* %5
%78 = load float, float* %6
%79 = fsub float %77, %78
%80 = load float, float* %7
%81 = fsub float %79, %80
%82 = load float, float* %9
%83 = fsub float %81, %82
store float %83, float* %10
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%85 = load float, float* %3
%86 = fpext float %85 to double
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), double %86)
%88 = load float, float* %4
%89 = fpext float %88 to double
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %89)
%91 = load float, float* %5
%92 = fpext float %91 to double
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), double %92)
%94 = load float, float* %6
%95 = fpext float %94 to double
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), double %95)
%97 = load float, float* %7
%98 = fpext float %97 to double
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), double %98)
%100 = load float, float* %9
%101 = fpext float %100 to double
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), double %101)
%103 = load float, float* %10
%104 = fpext float %103 to double
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), double %104)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Informe o valor recebido por hora de trabalho: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [54 x i8] c"Informe a quantidade de horas trabalhadas da semana: \00"
@.str.4 = [18 x i8] c"\09Normal:\09\09R$%.2f\0A\00"
@.str.5 = [17 x i8] c"\09Extra:\09\09R$%.2f\0A\00"
@.str.6 = [17 x i8] c"\09Bruto:\09\09R$%.2f\0A\00"
@.str.7 = [17 x i8] c"\09INSS:\09\09-R$%.2f\0A\00"
@.str.8 = [28 x i8] c"\09Imposto Sindical:\09-R$%.2f\0A\00"
@.str.9 = [28 x i8] c"\09Imposto de Renda:\09-R$%.2f\0A\00"
@.str.10 = [19 x i8] c"\09Liquido:\09\09R$%.2f\0A\00"
@str = [9 x i8] c"Salario:\00"
define void @ex3() {
%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 ([48 x i8], [48 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), float* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = load float, float* %1
%10 = load float, float* %2
%11 = fmul float %9, %10
%12 = fcmp ogt float %10, 4.000000e+01
%13 = fadd float %10, -4.000000e+01
%14 = fmul float %9, %13
%15 = fmul float %14, 5.000000e-01
%16 = select i1 %12, float %15, float 0.000000e+00
%17 = fadd float %11, %16
%18 = fpext float %17 to double
%19 = fmul double %18, 1.100000e-01
%20 = fptrunc double %19 to float
%21 = fmul double %18, 8.000000e-03
%22 = fptrunc double %21 to float
%23 = fcmp ogt double %18, 1.787770e+03
%24 = select i1 %23, float 7.500000e+00, float 0.000000e+00
%25 = fcmp ogt double %18, 2.679290e+03
%26 = fadd float %24, 7.500000e+00
%27 = select i1 %25, float %26, float %24
%28 = fcmp ogt double %18, 3.572430e+03
%29 = fadd float %27, 7.500000e+00
%30 = select i1 %28, float %29, float %27
%31 = fcmp ogt double %18, 4.463810e+03
%32 = fadd float %30, 5.000000e+00
%33 = select i1 %31, float %32, float %30
%34 = fmul float %17, %33
%35 = fsub float %17, %20
%36 = fsub float %35, %22
%37 = fsub float %36, %34
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%39 = fpext float %11 to double
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), double %39)
%41 = fpext float %16 to double
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %41)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), double %18)
%44 = fpext float %20 to double
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), double %44)
%46 = fpext float %22 to double
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), double %46)
%48 = fpext float %34 to double
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), double %48)
%50 = fpext float %37 to double
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), double %50)
ret void
}