#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 primeiro valor: \n");
  scanf("%i", &num1);
  printf("Insira o segundo valor: \n");
  scanf("%i", &num2);
  printf("Insira o terceiro valor: \n");
  scanf("%i", &num3);
  if (num1 > num2 && num1 > num3) {
    printf("%i\n", num1);
    if (num2 > num3) {
      printf("%i\n", num2);
      printf("%i\n", num3);
    } else
      printf("%i\n", num3);
    printf("%i\n", num2);
  }
  if (num2 > num1 && num2 > num3) {
    printf("%i\n", num2);
    if (num1 > num3) {
      printf("%i\n", num1);
      printf("%i\n", num3);
    } else
      printf("%i\n", num1);
    printf("%i\n", num3);
  }
  if (num3 > num1 && num3 > num2) {
    printf("%i\n", num3);
    if (num1 > num2) {
      printf("%i\n", num1);
      printf("%i\n", num2);
    } else
      printf("%i\n", num2);
    printf("%i\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    0xed7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1207 <main+0xe7>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1207 <main+0xe7>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11e5 <main+0xc5>
mov    -0xc(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f6 <main+0xd6>
mov    -0x10(%rbp),%esi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1285 <main+0x165>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1285 <main+0x165>
mov    -0xc(%rbp),%esi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1263 <main+0x143>
mov    -0x8(%rbp),%esi
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1274 <main+0x154>
mov    -0x8(%rbp),%esi
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1303 <main+0x1e3>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1303 <main+0x1e3>
mov    -0x10(%rbp),%esi
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    12e1 <main+0x1c1>
mov    -0x8(%rbp),%esi
lea    0xd8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f2 <main+0x1d2>
mov    -0xc(%rbp),%esi
lea    0xd68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xec2(%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    11f9 <main+0xc9>
cmp    %esi,%ecx
jle    11f9 <main+0xc9>
lea    0xe5e(%rip),%rdi
mov    %ecx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
mov    0x4(%rsp),%esi
cmp    %esi,%eax
jle    11ce <main+0x9e>
lea    0xe42(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xe2e(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%ecx
mov    0x4(%rsp),%esi
cmp    %ecx,%eax
jle    125c <main+0x12c>
cmp    %esi,%eax
jle    125c <main+0x12c>
lea    0xdfb(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%ebp
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebx,%ebp
jle    123e <main+0x10e>
mov    0x4(%rsp),%esi
lea    0xdcc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xdba(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%eax
cmp    %ecx,%esi
jle    12b1 <main+0x181>
cmp    %eax,%esi
jle    12b1 <main+0x181>
lea    0xd98(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%esi
cmp    %esi,%eax
jle    1292 <main+0x162>
lea    0xd7e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xd6a(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Insira o primeiro valor: \0A\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [26 x i8] c"Insira o segundo valor: \0A\00"
@.str.3 = [27 x i8] c"Insira o terceiro valor: \0A\00"
@.str.4 = [4 x i8] c"%i\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 ([27 x i8], [27 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 ([26 x i8], [26 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 ([27 x i8], [27 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 %35
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 %35
18: ; preds = %14
%19 = load i32, i32* %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %29
24: ; preds = %18
%25 = load i32, i32* %3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %4
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %27)
br label %32
29: ; preds = %18
%30 = load i32, i32* %4
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %29, %24
%33 = load i32, i32* %3
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %32, %14, %0
%36 = load i32, i32* %3
%37 = load i32, i32* %2
%38 = icmp sgt i32 %36, %37
br i1 %38, label %39, label %60
39: ; preds = %35
%40 = load i32, i32* %3
%41 = load i32, i32* %4
%42 = icmp sgt i32 %40, %41
br i1 %42, label %43, label %60
43: ; preds = %39
%44 = load i32, i32* %3
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %44)
%46 = load i32, i32* %2
%47 = load i32, i32* %4
%48 = icmp sgt i32 %46, %47
br i1 %48, label %49, label %54
49: ; preds = %43
%50 = load i32, i32* %2
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %4
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %52)
br label %57
54: ; preds = %43
%55 = load i32, i32* %2
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %55)
br label %57
57: ; preds = %54, %49
%58 = load i32, i32* %4
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %57, %39, %35
%61 = load i32, i32* %4
%62 = load i32, i32* %2
%63 = icmp sgt i32 %61, %62
br i1 %63, label %64, label %85
64: ; preds = %60
%65 = load i32, i32* %4
%66 = load i32, i32* %3
%67 = icmp sgt i32 %65, %66
br i1 %67, label %68, label %85
68: ; preds = %64
%69 = load i32, i32* %4
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %69)
%71 = load i32, i32* %2
%72 = load i32, i32* %3
%73 = icmp sgt i32 %71, %72
br i1 %73, label %74, label %79
74: ; preds = %68
%75 = load i32, i32* %2
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %75)
%77 = load i32, i32* %3
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %77)
br label %82
79: ; preds = %68
%80 = load i32, i32* %3
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %80)
br label %82
82: ; preds = %79, %74
%83 = load i32, i32* %4
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %83)
br label %85
85: ; preds = %82, %64, %60
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@.str.4 = [4 x i8] c"%i\0A\00"
@str = [26 x i8] c"Insira o primeiro valor: \00"
@str.5 = [25 x i8] c"Insira o segundo valor: \00"
@str.6 = [26 x i8] c"Insira o terceiro valor: \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 ([26 x i8], [26 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 ([25 x i8], [25 x i8]* @str.5, 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 ([26 x i8], [26 x i8]* @str.6, 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 %19, label %35
19: ; preds = %0
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %13)
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%26 = load i32, i32* %3
br label %27
27: ; preds = %19, %24
%28 = phi i32 [ %26, %24 ], [ %22, %19 ]
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %2
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %2
%33 = load i32, i32* %1
%34 = load i32, i32* %3
br label %35
35: ; preds = %27, %0
%36 = phi i32 [ %34, %27 ], [ %16, %0 ]
%37 = phi i32 [ %33, %27 ], [ %13, %0 ]
%38 = phi i32 [ %32, %27 ], [ %14, %0 ]
%39 = icmp sgt i32 %38, %37
%40 = icmp sgt i32 %38, %36
%41 = select i1 %39, i1 %40, i1 false
br i1 %41, label %42, label %57
42: ; preds = %35
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %38)
%44 = load i32, i32* %1
%45 = load i32, i32* %3
%46 = icmp sgt i32 %44, %45
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %44)
br i1 %46, label %48, label %51
48: ; preds = %42
%49 = load i32, i32* %3
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %42, %48
%52 = load i32, i32* %3
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %52)
%54 = load i32, i32* %3
%55 = load i32, i32* %1
%56 = load i32, i32* %2
br label %57
57: ; preds = %51, %35
%58 = phi i32 [ %56, %51 ], [ %38, %35 ]
%59 = phi i32 [ %55, %51 ], [ %37, %35 ]
%60 = phi i32 [ %54, %51 ], [ %36, %35 ]
%61 = icmp sgt i32 %60, %59
%62 = icmp sgt i32 %60, %58
%63 = select i1 %61, i1 %62, i1 false
br i1 %63, label %64, label %77
64: ; preds = %57
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %60)
%66 = load i32, i32* %1
%67 = load i32, i32* %2
%68 = icmp sgt i32 %66, %67
br i1 %68, label %69, label %72
69: ; preds = %64
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %66)
%71 = load i32, i32* %2
br label %72
72: ; preds = %64, %69
%73 = phi i32 [ %71, %69 ], [ %67, %64 ]
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %73)
%75 = load i32, i32* %3
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %75)
br label %77
77: ; preds = %72, %57
ret i32 0
}