#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 *);
int main() {
  int abaixo2000 = 0, acima2000 = 0;
  while (1) {
    float salario;
    printf("Digite o seu salario (para cancelar digite -1): ");
    scanf("%f", &salario);
    if (salario == -1)
      break;
    if (salario < 2000)
      abaixo2000++;
    else
      acima2000++;
  }
  printf("Pessoas com salario maior de 2000.00 reais: %d\ne menor de 2000.00 "
         "reais: %d\n",
         acima2000, abaixo2000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x10(%rbp),%xmm0
movss  0xe98(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    117c <main+0x5c>
jp     117c <main+0x5c>
jmp    11aa <main+0x8a>
movss  0xe80(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    119c <main+0x7c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a5 <main+0x85>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xed5(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0xea6(%rip),%xmm0
mov    $0x0,%ebp
jne    1163 <main+0x43>
jnp    11bf <main+0x9f>
lea    0xe9e(%rip),%r14
lea    0xec8(%rip),%r15
lea    0xc(%rsp),%r12
xor    %ebp,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
xor    %ecx,%ecx
movss  0xe78(%rip),%xmm1
ucomiss %xmm0,%xmm1
setbe  %al
seta   %cl
add    %ecx,%ebx
add    %eax,%ebp
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0xe45(%rip),%xmm0
jne    1180 <main+0x60>
jp     1180 <main+0x60>
lea    0xe76(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Digite o seu salario (para cancelar digite -1): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [77 x i8] c"Pessoas com salario maior de 2000.00 reais: %d\0Ae menor de 2000.00 reais: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %0, %20
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%8 = load float, float* %4
%9 = fcmp oeq float %8, -1.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %5
br label %21
11: ; preds = %5
%12 = load float, float* %4
%13 = fcmp olt float %12, 2.000000e+03
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %20
17: ; preds = %11
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %20
20: ; preds = %17, %14
br label %5
21: ; preds = %10
%22 = load i32, i32* %3
%23 = load i32, i32* %2
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0), i32 %22, i32 %23)
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@.str = [49 x i8] c"Digite o seu salario (para cancelar digite -1): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [77 x i8] c"Pessoas com salario maior de 2000.00 reais: %d\0Ae menor de 2000.00 reais: %d\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 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), float* %1)
%5 = load float, float* %1
%6 = fcmp oeq float %5, -1.000000e+00
br i1 %6, label %21, label %7
7: ; preds = %0, %7
%8 = phi float [ %19, %7 ], [ %5, %0 ]
%9 = phi i32 [ %16, %7 ], [ 0, %0 ]
%10 = phi i32 [ %13, %7 ], [ 0, %0 ]
%11 = fcmp olt float %8, 2.000000e+03
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %10, %12
%14 = xor i1 %11, true
%15 = zext i1 %14 to i32
%16 = add nuw nsw i32 %9, %15
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%19 = load float, float* %1
%20 = fcmp oeq float %19, -1.000000e+00
br i1 %20, label %21, label %7
21: ; preds = %7, %0
%22 = phi i32 [ 0, %0 ], [ %13, %7 ]
%23 = phi i32 [ 0, %0 ], [ %16, %7 ]
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0), i32 %23, i32 %22)
ret i32 0
}