#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 número: \n");
  scanf("%i", &num1);
  printf("Insira o segundo número: \n");
  scanf("%i", &num2);
  printf("Insira o 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);
  }
  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    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9d(%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    0xeae(%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    0xe80(%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    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1213 <main+0xf3>
jmp    1218 <main+0xf8>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xede(%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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Insira o primeiro n\C3\BAmero: \0A\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [28 x i8] c"Insira o segundo n\C3\BAmero: \0A\00"
@.str.3 = [29 x i8] c"Insira o terceiro n\C3\BAmero: \0A\00"
@.str.4 = [25 x i8] c"O n\C3\BAmero %i \C3\A9 o maior\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 ([29 x i8], [29 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 ([28 x i8], [28 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 ([29 x i8], [29 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
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 = [28 x i8] c"Insira o primeiro n\C3\BAmero: \00"
@str.5 = [27 x i8] c"Insira o segundo n\C3\BAmero: \00"
@str.6 = [28 x i8] c"Insira o 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 ([28 x i8], [28 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 ([27 x i8], [27 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 ([28 x i8], [28 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 %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
ret i32 0
}