#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 *, int *, int *);
int main() {
  int numero1 = 0, numero2 = 0, numero3 = 0, numero4 = 0;
  printf("\nDigite quatro numeros:\n");
  scanf("%d%d%d%d", &numero1, &numero2, &numero3, &numero4);
  if (numero1 >= numero2 && numero1 >= numero4 && numero1 >= numero3) {
    printf("\nO primeiro 1 eh o maior: %d\n", numero1);
  } else {
    if (numero2 >= numero3 && numero2 >= numero4) {
      printf("\nO segundo numero e o maior: %d\n", numero2);
    } else {
      if (numero3 >= numero4 && numero3 >= numero2) {
        printf("\nO terceiro numero e o maior: %d\n", numero3);
      } else {
        printf("\nO quarto numero e o maior: %d\n", numero4);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     11af <main+0x8f>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     11af <main+0x8f>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11af <main+0x8f>
mov    -0x8(%rbp),%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1226 <main+0x106>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11dd <main+0xbd>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     11dd <main+0xbd>
mov    -0xc(%rbp),%esi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1221 <main+0x101>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     120b <main+0xeb>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     120b <main+0xeb>
mov    -0x10(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121c <main+0xfc>
mov    -0x14(%rbp),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1221 <main+0x101>
jmp    1226 <main+0x106>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xf2f(%rip),%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1050 <scanf@plt>
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%eax
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%ecx
cmp    %eax,%edx
jl     11a7 <main+0x77>
cmp    %esi,%edx
jl     11a7 <main+0x77>
cmp    %ecx,%edx
jl     11a7 <main+0x77>
lea    0xe66(%rip),%rdi
mov    %edx,%esi
jmp    11d4 <main+0xa4>
cmp    %ecx,%eax
jl     11ba <main+0x8a>
cmp    %esi,%eax
jl     11ba <main+0x8a>
lea    0xe71(%rip),%rdi
mov    %eax,%esi
jmp    11d4 <main+0xa4>
cmp    %esi,%ecx
jl     11cd <main+0x9d>
cmp    %eax,%ecx
jl     11cd <main+0x9d>
lea    0xe7f(%rip),%rdi
mov    %ecx,%esi
jmp    11d4 <main+0xa4>
lea    0xe96(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0ADigite quatro numeros:\0A\00"
@.str.1 = [9 x i8] c"%d%d%d%d\00"
@.str.2 = [30 x i8] c"\0AO primeiro 1 eh o maior: %d\0A\00"
@.str.3 = [33 x i8] c"\0AO segundo numero e o maior: %d\0A\00"
@.str.4 = [34 x i8] c"\0AO terceiro numero e o maior: %d\0A\00"
@.str.5 = [32 x i8] c"\0AO quarto numero e o maior: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %0
%12 = load i32, i32* %2
%13 = load i32, i32* %5
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = icmp sge i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %49
22: ; preds = %15, %11, %0
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = icmp sge i32 %23, %24
br i1 %25, label %26, label %33
26: ; preds = %22
%27 = load i32, i32* %3
%28 = load i32, i32* %5
%29 = icmp sge i32 %27, %28
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = load i32, i32* %3
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %31)
br label %48
33: ; preds = %26, %22
%34 = load i32, i32* %4
%35 = load i32, i32* %5
%36 = icmp sge i32 %34, %35
br i1 %36, label %37, label %44
37: ; preds = %33
%38 = load i32, i32* %4
%39 = load i32, i32* %3
%40 = icmp sge i32 %38, %39
br i1 %40, label %41, label %44
41: ; preds = %37
%42 = load i32, i32* %4
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 %42)
br label %47
44: ; preds = %37, %33
%45 = load i32, i32* %5
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %44, %41
br label %48
48: ; preds = %47, %30
br label %49
49: ; preds = %48, %19
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d%d%d%d\00"
@.str.2 = [30 x i8] c"\0AO primeiro 1 eh o maior: %d\0A\00"
@.str.3 = [33 x i8] c"\0AO segundo numero e o maior: %d\0A\00"
@.str.4 = [34 x i8] c"\0AO terceiro numero e o maior: %d\0A\00"
@.str.5 = [32 x i8] c"\0AO quarto numero e o maior: %d\0A\00"
@str = [24 x i8] c"\0ADigite quatro numeros:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%6 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
%14 = load i32, i32* %4
%15 = icmp slt i32 %11, %14
%16 = select i1 %13, i1 true, i1 %15
%17 = load i32, i32* %3
%18 = icmp slt i32 %11, %17
%19 = select i1 %16, i1 true, i1 %18
br i1 %19, label %22, label %20
20: ; preds = %0
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %36
22: ; preds = %0
%23 = icmp slt i32 %12, %17
%24 = icmp slt i32 %12, %14
%25 = select i1 %23, i1 true, i1 %24
br i1 %25, label %28, label %26
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %12)
br label %36
28: ; preds = %22
%29 = icmp slt i32 %17, %14
%30 = icmp slt i32 %17, %12
%31 = select i1 %29, i1 true, i1 %30
br i1 %31, label %34, label %32
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 %17)
br label %36
34: ; preds = %28
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %14)
br label %36
36: ; preds = %26, %34, %32, %20
ret i32 0
}