#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*/ getch();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int a;
  int b;
  int c;
  printf("digite um numero: ");
  scanf("%d", &a);
  printf("digite outro numero: ");
  scanf("%d", &b);
  printf("digite mais um numero: ");
  scanf("%d", &c);
  if (a >= b && b >= c) {
    int maior = a;
    int medio = b;
    int menor = c;
    printf("%d %d %d ", menor, medio, maior);
  } else if (b >= a && a >= c) {
    int maior = b;
    int medio = a;
    int menor = c;
    printf("%d %d %d ", menor, medio, maior);
  } else if (c >= a && a >= b) {
    int maior = c;
    int medio = a;
    int menor = b;
    printf("%d %d %d ", menor, medio, maior);
  } else if (a >= c && c >= b) {
    int maior = a;
    int medio = c;
    int menor = b;
    printf("%d %d %d ", menor, medio, maior);
  } else if (b >= c && c >= a) {
    int maior = b;
    int medio = c;
    int menor = a;
    printf("%d %d %d ", menor, medio, maior);
  } else if (c >= b && b >= a) {
    int maior = c;
    int medio = b;
    int menor = a;
    printf("%d %d %d ", menor, medio, maior);
  }
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe83(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     11df <main+0xaf>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11df <main+0xaf>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1351 <main+0x221>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1225 <main+0xf5>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1225 <main+0xf5>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    134c <main+0x21c>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     126b <main+0x13b>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     126b <main+0x13b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x2c(%rbp),%ecx
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1347 <main+0x217>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     12b1 <main+0x181>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     12b1 <main+0x181>
mov    -0x8(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%ecx
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1342 <main+0x212>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     12f7 <main+0x1c7>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     12f7 <main+0x1c7>
mov    -0xc(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%esi
mov    -0x48(%rbp),%edx
mov    -0x44(%rbp),%ecx
lea    0xd59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    133d <main+0x20d>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1338 <main+0x208>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1338 <main+0x208>
mov    -0x10(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%esi
mov    -0x54(%rbp),%edx
mov    -0x50(%rbp),%ecx
lea    0xd13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    133d <main+0x20d>
jmp    1342 <main+0x212>
jmp    1347 <main+0x217>
jmp    134c <main+0x21c>
jmp    1351 <main+0x221>
mov    $0x0,%al
call   1050 <getch@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec9(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
cmp    %ecx,%eax
jl     11a1 <main+0x71>
mov    0x4(%rsp),%esi
cmp    %esi,%ecx
jge    11d6 <main+0xa6>
mov    0x4(%rsp),%r8d
cmp    %eax,%ecx
jl     11bd <main+0x8d>
cmp    %r8d,%eax
jl     11bd <main+0x8d>
lea    0xe8e(%rip),%rdi
mov    %r8d,%esi
mov    %eax,%edx
jmp    1213 <main+0xe3>
cmp    %eax,%r8d
jl     11e3 <main+0xb3>
cmp    %ecx,%eax
jl     11e3 <main+0xb3>
lea    0xe77(%rip),%rdi
mov    %ecx,%esi
mov    %eax,%edx
mov    %r8d,%ecx
jmp    1213 <main+0xe3>
lea    0xe67(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
jmp    1213 <main+0xe3>
cmp    %r8d,%eax
jl     11fd <main+0xcd>
cmp    %ecx,%r8d
jl     11fd <main+0xcd>
lea    0xe50(%rip),%rdi
mov    %ecx,%esi
mov    %r8d,%edx
mov    %eax,%ecx
jmp    1213 <main+0xe3>
cmp    %r8d,%ecx
jl     1229 <main+0xf9>
cmp    %eax,%r8d
jl     1229 <main+0xf9>
lea    0xe36(%rip),%rdi
mov    %eax,%esi
mov    %r8d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
cmp    %ecx,%r8d
jl     121a <main+0xea>
cmp    %eax,%ecx
jl     121a <main+0xea>
lea    0xe0b(%rip),%rdi
mov    %eax,%esi
mov    %ecx,%edx
jmp    11d1 <main+0xa1>

LLVM IR (-O0):
@.str = [19 x i8] c"digite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"digite outro numero: \00"
@.str.3 = [24 x i8] c"digite mais um numero: \00"
@.str.4 = [10 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
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32 0, i32* %1
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%29 = load i32, i32* %2
%30 = load i32, i32* %3
%31 = icmp sge i32 %29, %30
br i1 %31, label %32, label %44
32: ; preds = %0
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = icmp sge i32 %33, %34
br i1 %35, label %36, label %44
36: ; preds = %32
%37 = load i32, i32* %2
store i32 %37, i32* %5
%38 = load i32, i32* %3
store i32 %38, i32* %6
%39 = load i32, i32* %4
store i32 %39, i32* %7
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = load i32, i32* %5
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %40, i32 %41, i32 %42)
br label %129
44: ; preds = %32, %0
%45 = load i32, i32* %3
%46 = load i32, i32* %2
%47 = icmp sge i32 %45, %46
br i1 %47, label %48, label %60
48: ; preds = %44
%49 = load i32, i32* %2
%50 = load i32, i32* %4
%51 = icmp sge i32 %49, %50
br i1 %51, label %52, label %60
52: ; preds = %48
%53 = load i32, i32* %3
store i32 %53, i32* %8
%54 = load i32, i32* %2
store i32 %54, i32* %9
%55 = load i32, i32* %4
store i32 %55, i32* %10
%56 = load i32, i32* %10
%57 = load i32, i32* %9
%58 = load i32, i32* %8
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %56, i32 %57, i32 %58)
br label %128
60: ; preds = %48, %44
%61 = load i32, i32* %4
%62 = load i32, i32* %2
%63 = icmp sge i32 %61, %62
br i1 %63, label %64, label %76
64: ; preds = %60
%65 = load i32, i32* %2
%66 = load i32, i32* %3
%67 = icmp sge i32 %65, %66
br i1 %67, label %68, label %76
68: ; preds = %64
%69 = load i32, i32* %4
store i32 %69, i32* %11
%70 = load i32, i32* %2
store i32 %70, i32* %12
%71 = load i32, i32* %3
store i32 %71, i32* %13
%72 = load i32, i32* %13
%73 = load i32, i32* %12
%74 = load i32, i32* %11
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %72, i32 %73, i32 %74)
br label %127
76: ; preds = %64, %60
%77 = load i32, i32* %2
%78 = load i32, i32* %4
%79 = icmp sge i32 %77, %78
br i1 %79, label %80, label %92
80: ; preds = %76
%81 = load i32, i32* %4
%82 = load i32, i32* %3
%83 = icmp sge i32 %81, %82
br i1 %83, label %84, label %92
84: ; preds = %80
%85 = load i32, i32* %2
store i32 %85, i32* %14
%86 = load i32, i32* %4
store i32 %86, i32* %15
%87 = load i32, i32* %3
store i32 %87, i32* %16
%88 = load i32, i32* %16
%89 = load i32, i32* %15
%90 = load i32, i32* %14
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %88, i32 %89, i32 %90)
br label %126
92: ; preds = %80, %76
%93 = load i32, i32* %3
%94 = load i32, i32* %4
%95 = icmp sge i32 %93, %94
br i1 %95, label %96, label %108
96: ; preds = %92
%97 = load i32, i32* %4
%98 = load i32, i32* %2
%99 = icmp sge i32 %97, %98
br i1 %99, label %100, label %108
100: ; preds = %96
%101 = load i32, i32* %3
store i32 %101, i32* %17
%102 = load i32, i32* %4
store i32 %102, i32* %18
%103 = load i32, i32* %2
store i32 %103, i32* %19
%104 = load i32, i32* %19
%105 = load i32, i32* %18
%106 = load i32, i32* %17
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %104, i32 %105, i32 %106)
br label %125
108: ; preds = %96, %92
%109 = load i32, i32* %4
%110 = load i32, i32* %3
%111 = icmp sge i32 %109, %110
br i1 %111, label %112, label %124
112: ; preds = %108
%113 = load i32, i32* %3
%114 = load i32, i32* %2
%115 = icmp sge i32 %113, %114
br i1 %115, label %116, label %124
116: ; preds = %112
%117 = load i32, i32* %4
store i32 %117, i32* %20
%118 = load i32, i32* %3
store i32 %118, i32* %21
%119 = load i32, i32* %2
store i32 %119, i32* %22
%120 = load i32, i32* %22
%121 = load i32, i32* %21
%122 = load i32, i32* %20
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %120, i32 %121, i32 %122)
br label %124
124: ; preds = %116, %112, %108
br label %125
125: ; preds = %124, %100
br label %126
126: ; preds = %125, %84
br label %127
127: ; preds = %126, %68
br label %128
128: ; preds = %127, %52
br label %129
129: ; preds = %128, %36
%130 = call i32 (...) @getch()
%131 = load i32, i32* %1
ret i32 %131
}

LLVM IR (-O2):
@.str = [19 x i8] c"digite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"digite outro numero: \00"
@.str.3 = [24 x i8] c"digite mais um numero: \00"
@.str.4 = [10 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*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, 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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, 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 slt i32 %13, %14
br i1 %15, label %21, label %16
16: ; preds = %0
%17 = load i32, i32* %3
%18 = icmp slt i32 %14, %17
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %17, i32 %14, i32 %13)
br label %48
21: ; preds = %16, %0
%22 = icmp slt i32 %14, %13
%23 = load i32, i32* %3
%24 = icmp slt i32 %13, %23
%25 = select i1 %22, i1 true, i1 %24
br i1 %25, label %28, label %26
26: ; preds = %21
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %23, i32 %13, i32 %14)
br label %48
28: ; preds = %21
%29 = icmp slt i32 %23, %13
%30 = select i1 %29, i1 true, i1 %15
br i1 %30, label %33, label %31
31: ; preds = %28
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %14, i32 %13, i32 %23)
br label %48
33: ; preds = %28
%34 = icmp slt i32 %13, %23
%35 = icmp slt i32 %23, %14
%36 = select i1 %34, i1 true, i1 %35
br i1 %36, label %39, label %37
37: ; preds = %33
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %14, i32 %23, i32 %13)
br label %48
39: ; preds = %33
%40 = icmp slt i32 %14, %23
%41 = select i1 %40, i1 true, i1 %29
br i1 %41, label %44, label %42
42: ; preds = %39
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %13, i32 %23, i32 %14)
br label %48
44: ; preds = %39
%45 = select i1 %35, i1 true, i1 %22
br i1 %45, label %48, label %46
46: ; preds = %44
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %13, i32 %14, i32 %23)
br label %48
48: ; preds = %44, %26, %37, %46, %42, %31, %19
%49 = call i32 (...) @getch()
ret i32 0
}