#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*/ print(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void ex4() {
  print("\n------------------------------\n");
  int salario;
  print("Informe seu salario atual: ");
  scanf("%d", &salario);
  if (salario > 2000)
    print("Voce nao recebera aumento.\n");
  else
    printf("Seu novo salario e: R$%.2f\n", salario * 1.3);
  print("\n------------------------------\n");
}


x86 assembly (clang, -O0):
<ex4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
call   1040 <print@plt>
lea    0xede(%rip),%rdi
call   1040 <print@plt>
lea    0xeee(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x7d0,-0x4(%rbp)
jle    117e <ex4+0x4e>
lea    0xed4(%rip),%rdi
call   1040 <print@plt>
jmp    119f <ex4+0x6f>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xe75(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xe62(%rip),%rdi
call   1040 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex4>:
push   %rax
lea    0xed0(%rip),%rdi
call   1040 <print@plt>
lea    0xee5(%rip),%rdi
call   1040 <print@plt>
lea    0xef5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x7d1,%eax
jl     1173 <ex4+0x43>
lea    0xedc(%rip),%rdi
call   1040 <print@plt>
jmp    118f <ex4+0x5f>
cvtsi2sd %eax,%xmm0
mulsd  0xe81(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xe72(%rip),%rdi
call   1040 <print@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0A------------------------------\0A\00"
@.str.1 = [28 x i8] c"Informe seu salario atual: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [28 x i8] c"Voce nao recebera aumento.\0A\00"
@.str.4 = [28 x i8] c"Seu novo salario e: R$%.2f\0A\00"
define void @ex4() {
%1 = alloca i32
%2 = call i32 @print(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @print(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 2000
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @print(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
br label %15
9: ; preds = %0
%10 = load i32, i32* %1
%11 = sitofp i32 %10 to double
%12 = fmul double %11, 1.300000e+00
%13 = fptosi double %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %9, %7
%16 = call i32 @print(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0A------------------------------\0A\00"
@.str.1 = [28 x i8] c"Informe seu salario atual: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [28 x i8] c"Voce nao recebera aumento.\0A\00"
@.str.4 = [28 x i8] c"Seu novo salario e: R$%.2f\0A\00"
define void @ex4() {
%1 = alloca i32
%2 = tail call i32 @print(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @print(i8* getelementptr inbounds ([28 x i8], [28 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), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 2000
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @print(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
br label %15
10: ; preds = %0
%11 = sitofp i32 %6 to double
%12 = fmul double %11, 1.300000e+00
%13 = fptosi double %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %10, %8
%16 = call i32 @print(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}