#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 *, double *);
void main() {
  double salario;
  printf("Digite o valor do salario (somente numeros, use ponto ao inves de "
         "virgula): ");
  scanf("%lf", &salario);
  if (salario <= 0)
    printf("Valor invalido\n");
  else if (salario > 1000)
    printf("Imposto a ser recolhido: R$%.2lf\n", salario * 0.1);
  else
    printf("Imposto a ser recolhido: R$%.2lf\n", salario * 0.05);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf28(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     1167 <main+0x47>
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11be <main+0x9e>
movsd  -0x8(%rbp),%xmm0
movsd  0xe8c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    119e <main+0x7e>
movsd  0xe8a(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
lea    0xee7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11b9 <main+0x99>
movsd  0xe62(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
lea    0xec7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11be <main+0x9e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf1f(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    1171 <main+0x41>
ucomisd 0xe9b(%rip),%xmm0
jbe    117f <main+0x4f>
mulsd  0xea1(%rip),%xmm0
jmp    1187 <main+0x57>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret
mulsd  0xe81(%rip),%xmm0
lea    0xedb(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [77 x i8] c"Digite o valor do salario (somente numeros, use ponto ao inves de virgula): \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [16 x i8] c"Valor invalido\0A\00"
@.str.3 = [34 x i8] c"Imposto a ser recolhido: R$%.2lf\0A\00"
define void @main() {
%1 = alloca double
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fcmp ole double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %20
8: ; preds = %0
%9 = load double, double* %1
%10 = fcmp ogt double %9, 1.000000e+03
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load double, double* %1
%13 = fmul double %12, 1.000000e-01
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), double %13)
br label %19
15: ; preds = %8
%16 = load double, double* %1
%17 = fmul double %16, 5.000000e-02
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), double %17)
br label %19
19: ; preds = %15, %11
br label %20
20: ; preds = %19, %6
ret void
}

LLVM IR (-O2):
@.str = [77 x i8] c"Digite o valor do salario (somente numeros, use ponto ao inves de virgula): \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.3 = [34 x i8] c"Imposto a ser recolhido: R$%.2lf\0A\00"
@str = [15 x i8] c"Valor invalido\00"
define void @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fcmp ugt double %5, 0.000000e+00
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %17
9: ; preds = %0
%10 = fcmp ogt double %5, 1.000000e+03
br i1 %10, label %11, label %14
11: ; preds = %9
%12 = fmul double %5, 1.000000e-01
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), double %12)
br label %17
14: ; preds = %9
%15 = fmul double %5, 5.000000e-02
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), double %15)
br label %17
17: ; preds = %11, %14, %7
ret void
}