#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 main(void) {
  int n1 = 0, n2 = 0, n3 = 0, maior = 0, menor = 0, meio = 0;
  printf("Digite 3 numeros com espacos entre eles: ");
  scanf("%d %d %d", &n1, &n2, &n3);
  if (n1 > n2) {
    maior = n1;
    menor = n2;
  } else {
    maior = n2;
    menor = n1;
  }
  if (n3 > maior) {
    meio = maior;
    maior = n3;
  } else if (n3 < menor) {
    meio = menor;
    menor = n3;
  } else
    meio = n3;
  printf("%d %d %d", maior, meio, menor);
}


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)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    119c <main+0x7c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    11a8 <main+0x88>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    11c5 <main+0xa5>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11ed <main+0xcd>
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11e2 <main+0xc2>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    11e8 <main+0xc8>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11ed <main+0xcd>
mov    -0x14(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rbx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
cmp    %ecx,%eax
mov    %ecx,%edi
cmovg  %eax,%edi
cmovg  %ecx,%eax
mov    0x4(%rsp),%esi
cmp    %eax,%esi
mov    %eax,%ecx
cmovl  %esi,%ecx
mov    %esi,%edx
cmovl  %eax,%edx
cmp    %edi,%esi
cmovle %edi,%esi
cmovg  %eax,%ecx
cmovg  %edi,%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Digite 3 numeros com espacos entre eles: \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = 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
store i32 0, i32* %6
store i32 0, i32* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %0
%14 = load i32, i32* %2
store i32 %14, i32* %5
%15 = load i32, i32* %3
store i32 %15, i32* %6
br label %19
16: ; preds = %0
%17 = load i32, i32* %3
store i32 %17, i32* %5
%18 = load i32, i32* %2
store i32 %18, i32* %6
br label %19
19: ; preds = %16, %13
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32, i32* %5
store i32 %24, i32* %7
%25 = load i32, i32* %4
store i32 %25, i32* %5
br label %36
26: ; preds = %19
%27 = load i32, i32* %4
%28 = load i32, i32* %6
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = load i32, i32* %6
store i32 %31, i32* %7
%32 = load i32, i32* %4
store i32 %32, i32* %6
br label %35
33: ; preds = %26
%34 = load i32, i32* %4
store i32 %34, i32* %7
br label %35
35: ; preds = %33, %30
br label %36
36: ; preds = %35, %23
%37 = load i32, i32* %5
%38 = load i32, i32* %7
%39 = load i32, i32* %6
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %37, i32 %38, i32 %39)
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
@.str = [42 x i8] c"Digite 3 numeros com espacos entre eles: \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp sgt i32 %9, %10
%12 = select i1 %11, i32 %9, i32 %10
%13 = select i1 %11, i32 %10, i32 %9
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, %12
%16 = icmp slt i32 %14, %13
%17 = select i1 %16, i32 %14, i32 %13
%18 = select i1 %16, i32 %13, i32 %14
%19 = select i1 %15, i32 %14, i32 %12
%20 = select i1 %15, i32 %13, i32 %17
%21 = select i1 %15, i32 %12, i32 %18
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %21, i32 %20)
ret i32 0
}