#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*/ LC_ALL;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
main() {
  setlocale(LC_ALL, "");
  int octeto;
  printf("\n [ ------------------- Verificador de classes de IP "
         "------------------- ] \n");
  printf("\n Por favor, digite o primeiro octeto de seu IP: ");
  scanf("%d", &octeto);
  if (octeto < 0) {
    printf("\n Por favor, digite um número válido! \n");
  } else if (octeto >= 0 && octeto <= 127) {
    printf("\n Seu octeto %d é Classe A \n", octeto);
  } else if (octeto >= 128 && octeto <= 191) {
    printf("\n Seu octeto %d é Classe B \n", octeto);
  } else if (octeto >= 192 && octeto <= 223) {
    printf("\n Seu octeto %d é Classe C \n", octeto);
  } else if (octeto >= 224 && octeto <= 239) {
    printf("\n Seu octeto %d é Classe D \n", octeto);
  } else {
    printf("\n Seu octeto %d é Classe E \n", octeto);
  }
  printf("\n [ "
         "-------------------------------------------------------------------- "
         "] \n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xf5c(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    119d <main+0x6d>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <main+0x14c>
cmpl   $0x0,-0x8(%rbp)
jl     11c7 <main+0x97>
cmpl   $0x7f,-0x8(%rbp)
jg     11c7 <main+0x97>
mov    -0x8(%rbp),%esi
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1277 <main+0x147>
cmpl   $0x80,-0x8(%rbp)
jl     11f7 <main+0xc7>
cmpl   $0xbf,-0x8(%rbp)
jg     11f7 <main+0xc7>
mov    -0x8(%rbp),%esi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1272 <main+0x142>
cmpl   $0xc0,-0x8(%rbp)
jl     1227 <main+0xf7>
cmpl   $0xdf,-0x8(%rbp)
jg     1227 <main+0xf7>
mov    -0x8(%rbp),%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126d <main+0x13d>
cmpl   $0xe0,-0x8(%rbp)
jl     1257 <main+0x127>
cmpl   $0xef,-0x8(%rbp)
jg     1257 <main+0x127>
mov    -0x8(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1268 <main+0x138>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126d <main+0x13d>
jmp    1272 <main+0x142>
jmp    1277 <main+0x147>
jmp    127c <main+0x14c>
lea    0xebf(%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   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xf01(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xf6e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
js     1197 <main+0x57>
cmp    $0x7f,%esi
ja     11a5 <main+0x65>
lea    0xea0(%rip),%rdi
jmp    11df <main+0x9f>
lea    0xfc5(%rip),%rdi
call   1030 <puts@plt>
jmp    11e6 <main+0xa6>
cmp    $0xbf,%esi
ja     11b6 <main+0x76>
lea    0xe9f(%rip),%rdi
jmp    11df <main+0x9f>
cmp    $0xdf,%esi
ja     11c7 <main+0x87>
lea    0xeac(%rip),%rdi
jmp    11df <main+0x9f>
cmp    $0xef,%esi
ja     11d8 <main+0x98>
lea    0xeb9(%rip),%rdi
jmp    11df <main+0x9f>
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf2a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [77 x i8] c"\0A [ ------------------- Verificador de classes de IP ------------------- ] \0A\00"
@.str.2 = [50 x i8] c"\0A Por favor, digite o primeiro octeto de seu IP: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [42 x i8] c"\0A Por favor, digite um n\C3\BAmero v\C3\A1lido! \0A\00"
@.str.5 = [30 x i8] c"\0A Seu octeto %d \C3\A9 Classe A \0A\00"
@.str.6 = [30 x i8] c"\0A Seu octeto %d \C3\A9 Classe B \0A\00"
@.str.7 = [30 x i8] c"\0A Seu octeto %d \C3\A9 Classe C \0A\00"
@.str.8 = [30 x i8] c"\0A Seu octeto %d \C3\A9 Classe D \0A\00"
@.str.9 = [30 x i8] c"\0A Seu octeto %d \C3\A9 Classe E \0A\00"
@.str.10 = [77 x i8] c"\0A [ -------------------------------------------------------------------- ] \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @LC_ALL
%4 = call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
br label %55
12: ; preds = %0
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 127
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %19)
br label %54
21: ; preds = %15, %12
%22 = load i32, i32* %2
%23 = icmp sge i32 %22, 128
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = load i32, i32* %2
%26 = icmp sle i32 %25, 191
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %2
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %28)
br label %53
30: ; preds = %24, %21
%31 = load i32, i32* %2
%32 = icmp sge i32 %31, 192
br i1 %32, label %33, label %39
33: ; preds = %30
%34 = load i32, i32* %2
%35 = icmp sle i32 %34, 223
br i1 %35, label %36, label %39
36: ; preds = %33
%37 = load i32, i32* %2
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %37)
br label %52
39: ; preds = %33, %30
%40 = load i32, i32* %2
%41 = icmp sge i32 %40, 224
br i1 %41, label %42, label %48
42: ; preds = %39
%43 = load i32, i32* %2
%44 = icmp sle i32 %43, 239
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = load i32, i32* %2
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i32 %46)
br label %51
48: ; preds = %42, %39
%49 = load i32, i32* %2
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %48, %45
br label %52
52: ; preds = %51, %36
br label %53
53: ; preds = %52, %27
br label %54
54: ; preds = %53, %18
br label %55
55: ; preds = %54, %10
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.10, i64 0, i64 0))
%57 = load i32, i32* %1
ret i32 %57
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.2 = [50 x i8] c"\0A Por favor, digite o primeiro octeto de seu IP: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.5 = [30 x i8] c"\0A Seu octeto %d \C3\A9 Classe A \0A\00"
@.str.6 = [30 x i8] c"\0A Seu octeto %d \C3\A9 Classe B \0A\00"
@.str.7 = [30 x i8] c"\0A Seu octeto %d \C3\A9 Classe C \0A\00"
@.str.8 = [30 x i8] c"\0A Seu octeto %d \C3\A9 Classe D \0A\00"
@.str.9 = [30 x i8] c"\0A Seu octeto %d \C3\A9 Classe E \0A\00"
@str = [76 x i8] c"\0A [ ------------------- Verificador de classes de IP ------------------- ] \00"
@str.11 = [76 x i8] c"\0A [ -------------------------------------------------------------------- ] \00"
@str.12 = [41 x i8] c"\0A Por favor, digite um n\C3\BAmero v\C3\A1lido! \00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.12, i64 0, i64 0))
br label %30
12: ; preds = %0
%13 = icmp ult i32 %8, 128
br i1 %13, label %14, label %16
14: ; preds = %12
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %8)
br label %30
16: ; preds = %12
%17 = icmp ult i32 %8, 192
br i1 %17, label %18, label %20
18: ; preds = %16
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %8)
br label %30
20: ; preds = %16
%21 = icmp ult i32 %8, 224
br i1 %21, label %22, label %24
22: ; preds = %20
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %8)
br label %30
24: ; preds = %20
%25 = icmp ult i32 %8, 240
br i1 %25, label %26, label %28
26: ; preds = %24
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i32 %8)
br label %30
28: ; preds = %24
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %8)
br label %30
30: ; preds = %14, %22, %28, %26, %18, %10
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.11, i64 0, i64 0))
ret i32 0
}