#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 *, int *);
int main(void) {
  int num1, num2, num3;
  printf("Insira o valor do primeiro número: \n");
  scanf("%i", &num1);
  printf("Insira o valor do segundo número: \n");
  scanf("%i", &num2);
  printf("Insira o valor do terceiro número: \n");
  scanf("%i", &num3);
  if (num1 > num2 && num1 > num3) {
    printf("O número %i é o maior\n", num1);
  } else if (num2 > num1 && num2 > num3) {
    printf("O número %i é o maior\n", num2);
  } else if (num3 > num1 && num3 > num2) {
    printf("O número %i é o maior\n", num3);
  }
  if (num1 < num2 && num1 < num3) {
    printf("O número %i é o menor\n", num1);
  } else if (num2 < num1 && num2 < num3) {
    printf("O número %i é o menor\n", num2);
  } else if (num3 < num1 && num3 < num2) {
    printf("O número %i é o menor\n", num3);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11b7 <main+0x97>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11b7 <main+0x97>
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1218 <main+0xf8>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11e5 <main+0xc5>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11e5 <main+0xc5>
mov    -0xc(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1213 <main+0xf3>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    120e <main+0xee>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    120e <main+0xee>
mov    -0x10(%rbp),%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1213 <main+0xf3>
jmp    1218 <main+0xf8>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1246 <main+0x126>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1246 <main+0x126>
mov    -0x8(%rbp),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a7 <main+0x187>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1274 <main+0x154>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1274 <main+0x154>
mov    -0xc(%rbp),%esi
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a2 <main+0x182>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    129d <main+0x17d>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    129d <main+0x17d>
mov    -0x10(%rbp),%esi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a2 <main+0x182>
jmp    12a7 <main+0x187>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%eax
mov    0x4(%rsp),%esi
cmp    %eax,%ecx
jle    119f <main+0x6f>
cmp    %esi,%ecx
jle    119f <main+0x6f>
mov    %ecx,%esi
jmp    11b3 <main+0x83>
cmp    %ecx,%eax
jle    11ab <main+0x7b>
cmp    %esi,%eax
jle    11ab <main+0x7b>
mov    %eax,%esi
jmp    11b3 <main+0x83>
cmp    %ecx,%esi
jle    11c1 <main+0x91>
cmp    %eax,%esi
jle    11c1 <main+0x91>
lea    0xe49(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%eax
mov    0x4(%rsp),%esi
cmp    %eax,%ecx
jge    11d9 <main+0xa9>
cmp    %esi,%ecx
jge    11d9 <main+0xa9>
mov    %ecx,%esi
jmp    11ed <main+0xbd>
cmp    %ecx,%eax
jge    11e5 <main+0xb5>
cmp    %esi,%eax
jge    11e5 <main+0xb5>
mov    %eax,%esi
jmp    11ed <main+0xbd>
cmp    %ecx,%esi
jge    11fb <main+0xcb>
cmp    %eax,%esi
jge    11fb <main+0xcb>
lea    0xe28(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Insira o valor do primeiro n\C3\BAmero: \0A\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [37 x i8] c"Insira o valor do segundo n\C3\BAmero: \0A\00"
@.str.3 = [38 x i8] c"Insira o valor do terceiro n\C3\BAmero: \0A\00"
@.str.4 = [25 x i8] c"O n\C3\BAmero %i \C3\A9 o maior\0A\00"
@.str.5 = [25 x i8] c"O n\C3\BAmero %i \C3\A9 o menor\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %21
14: ; preds = %0
%15 = load i32, i32* %2
%16 = load i32, i32* %4
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %19)
br label %45
21: ; preds = %14, %0
%22 = load i32, i32* %3
%23 = load i32, i32* %2
%24 = icmp sgt i32 %22, %23
br i1 %24, label %25, label %32
25: ; preds = %21
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = icmp sgt i32 %26, %27
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load i32, i32* %3
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %30)
br label %44
32: ; preds = %25, %21
%33 = load i32, i32* %4
%34 = load i32, i32* %2
%35 = icmp sgt i32 %33, %34
br i1 %35, label %36, label %43
36: ; preds = %32
%37 = load i32, i32* %4
%38 = load i32, i32* %3
%39 = icmp sgt i32 %37, %38
br i1 %39, label %40, label %43
40: ; preds = %36
%41 = load i32, i32* %4
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %40, %36, %32
br label %44
44: ; preds = %43, %29
br label %45
45: ; preds = %44, %18
%46 = load i32, i32* %2
%47 = load i32, i32* %3
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %56
49: ; preds = %45
%50 = load i32, i32* %2
%51 = load i32, i32* %4
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = load i32, i32* %2
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %54)
br label %80
56: ; preds = %49, %45
%57 = load i32, i32* %3
%58 = load i32, i32* %2
%59 = icmp slt i32 %57, %58
br i1 %59, label %60, label %67
60: ; preds = %56
%61 = load i32, i32* %3
%62 = load i32, i32* %4
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %67
64: ; preds = %60
%65 = load i32, i32* %3
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %65)
br label %79
67: ; preds = %60, %56
%68 = load i32, i32* %4
%69 = load i32, i32* %2
%70 = icmp slt i32 %68, %69
br i1 %70, label %71, label %78
71: ; preds = %67
%72 = load i32, i32* %4
%73 = load i32, i32* %3
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %78
75: ; preds = %71
%76 = load i32, i32* %4
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %76)
br label %78
78: ; preds = %75, %71, %67
br label %79
79: ; preds = %78, %64
br label %80
80: ; preds = %79, %53
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@.str.4 = [25 x i8] c"O n\C3\BAmero %i \C3\A9 o maior\0A\00"
@.str.5 = [25 x i8] c"O n\C3\BAmero %i \C3\A9 o menor\0A\00"
@str = [37 x i8] c"Insira o valor do primeiro n\C3\BAmero: \00"
@str.6 = [36 x i8] c"Insira o valor do segundo n\C3\BAmero: \00"
@str.7 = [37 x i8] c"Insira o valor do terceiro n\C3\BAmero: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.6, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.7, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = icmp sgt i32 %13, %14
%16 = load i32, i32* %3
%17 = icmp sgt i32 %13, %16
%18 = select i1 %15, i1 %17, i1 false
br i1 %18, label %27, label %19
19: ; preds = %0
%20 = icmp sgt i32 %14, %13
%21 = icmp sgt i32 %14, %16
%22 = select i1 %20, i1 %21, i1 false
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = icmp sgt i32 %16, %13
%25 = icmp sgt i32 %16, %14
%26 = select i1 %24, i1 %25, i1 false
br i1 %26, label %27, label %30
27: ; preds = %23, %19, %0
%28 = phi i32 [ %13, %0 ], [ %14, %19 ], [ %16, %23 ]
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %27, %23
%31 = load i32, i32* %1
%32 = load i32, i32* %2
%33 = icmp slt i32 %31, %32
%34 = load i32, i32* %3
%35 = icmp slt i32 %31, %34
%36 = select i1 %33, i1 %35, i1 false
br i1 %36, label %45, label %37
37: ; preds = %30
%38 = icmp slt i32 %32, %31
%39 = icmp slt i32 %32, %34
%40 = select i1 %38, i1 %39, i1 false
br i1 %40, label %45, label %41
41: ; preds = %37
%42 = icmp slt i32 %34, %31
%43 = icmp slt i32 %34, %32
%44 = select i1 %42, i1 %43, i1 false
br i1 %44, label %45, label %48
45: ; preds = %41, %37, %30
%46 = phi i32 [ %31, %30 ], [ %32, %37 ], [ %34, %41 ]
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %45, %41
ret i32 0
}