#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 atoi(char *);
char *quality(char *qt) {
  char a, *b = "Otima", *c = "Boa", *d = "Aceitavel", *e = "Ruim",
          *f = "Pessima";
  int iqa = atoi(qt);
  if (iqa <= 100 && iqa > 80) {
    return b;
  }
  if (iqa <= 80 && iqa > 50) {
    return c;
  }
  if (iqa <= 50 && iqa > 36) {
    return d;
  }
  if (iqa <= 36 && iqa > 20) {
    return e;
  }
  if (iqa <= 20) {
    return f;
  }
}


x86 assembly (clang, -O0):
<quality>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xed8(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xed1(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xed0(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x64,-0x44(%rbp)
jg     1180 <quality+0x70>
cmpl   $0x50,-0x44(%rbp)
jle    1180 <quality+0x70>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11f5 <quality+0xe5>
cmpl   $0x50,-0x44(%rbp)
jg     11a1 <quality+0x91>
cmpl   $0x32,-0x44(%rbp)
jle    11a1 <quality+0x91>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11f5 <quality+0xe5>
cmpl   $0x32,-0x44(%rbp)
jg     11c2 <quality+0xb2>
cmpl   $0x24,-0x44(%rbp)
jle    11c2 <quality+0xb2>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11f5 <quality+0xe5>
cmpl   $0x24,-0x44(%rbp)
jg     11e3 <quality+0xd3>
cmpl   $0x14,-0x44(%rbp)
jle    11e3 <quality+0xd3>
mov    -0x38(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11f5 <quality+0xe5>
cmpl   $0x14,-0x44(%rbp)
jg     11f5 <quality+0xe5>
mov    -0x40(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quality>:
push   %rax
call   1030 <atoi@plt>
lea    -0x51(%rax),%ecx
cmp    $0x14,%ecx
jae    1127 <quality+0x17>
lea    0xedb(%rip),%rax
pop    %rcx
ret
lea    -0x33(%rax),%ecx
cmp    $0x1e,%ecx
jae    1138 <quality+0x28>
lea    0xed0(%rip),%rax
pop    %rcx
ret
lea    -0x25(%rax),%ecx
cmp    $0xe,%ecx
jae    1149 <quality+0x39>
lea    0xec3(%rip),%rax
pop    %rcx
ret
add    $0xffffffeb,%eax
cmp    $0x10,%eax
lea    0xebe(%rip),%rcx
lea    0xebc(%rip),%rax
cmovb  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Otima\00"
@.str.1 = [4 x i8] c"Boa\00"
@.str.2 = [10 x i8] c"Aceitavel\00"
@.str.3 = [5 x i8] c"Ruim\00"
@.str.4 = [8 x i8] c"Pessima\00"
define i8* @quality(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8** %9
%11 = load i8*, i8** %3
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %10
%13 = load i32, i32* %10
%14 = icmp sle i32 %13, 100
br i1 %14, label %15, label %20
15: ; preds = %1
%16 = load i32, i32* %10
%17 = icmp sgt i32 %16, 80
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = load i8*, i8** %5
store i8* %19, i8** %2
br label %49
20: ; preds = %15, %1
%21 = load i32, i32* %10
%22 = icmp sle i32 %21, 80
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i32, i32* %10
%25 = icmp sgt i32 %24, 50
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i8*, i8** %6
store i8* %27, i8** %2
br label %49
28: ; preds = %23, %20
%29 = load i32, i32* %10
%30 = icmp sle i32 %29, 50
br i1 %30, label %31, label %36
31: ; preds = %28
%32 = load i32, i32* %10
%33 = icmp sgt i32 %32, 36
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = load i8*, i8** %7
store i8* %35, i8** %2
br label %49
36: ; preds = %31, %28
%37 = load i32, i32* %10
%38 = icmp sle i32 %37, 36
br i1 %38, label %39, label %44
39: ; preds = %36
%40 = load i32, i32* %10
%41 = icmp sgt i32 %40, 20
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = load i8*, i8** %8
store i8* %43, i8** %2
br label %49
44: ; preds = %39, %36
%45 = load i32, i32* %10
%46 = icmp sle i32 %45, 20
br i1 %46, label %47, label %49
47: ; preds = %44
%48 = load i8*, i8** %9
store i8* %48, i8** %2
br label %49
49: ; preds = %18, %26, %34, %42, %47, %44
%50 = load i8*, i8** %2
ret i8* %50
}

LLVM IR (-O2):
@.str = [6 x i8] c"Otima\00"
@.str.1 = [4 x i8] c"Boa\00"
@.str.2 = [10 x i8] c"Aceitavel\00"
@.str.3 = [5 x i8] c"Ruim\00"
@.str.4 = [8 x i8] c"Pessima\00"
define i8* @quality(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = add i32 %2, -81
%4 = icmp ult i32 %3, 20
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = add i32 %2, -51
%7 = icmp ult i32 %6, 30
br i1 %7, label %15, label %8
8: ; preds = %5
%9 = add i32 %2, -37
%10 = icmp ult i32 %9, 14
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = add i32 %2, -21
%13 = icmp ult i32 %12, 16
%14 = select i1 %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0)
br label %15
15: ; preds = %11, %8, %5, %1
%16 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %8 ], [ %14, %11 ]
ret i8* %16
}