#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() {
  int a, b, c;
  printf("Digite 3 numeros:\n");
  scanf("%d %d %d", &a, &b, &c);
  if (a > c) {
    int tmp = c;
    c = a;
    a = tmp;
  }
  if (a > b) {
    int tmp = b;
    b = a;
    a = tmp;
  }
  if (b > c) {
    int tmp = c;
    c = b;
    b = tmp;
  }
  printf("%d %d %d", a, b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1173 <main+0x53>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1191 <main+0x71>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11af <main+0x8f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x14(%rsp),%ecx
mov    0xc(%rsp),%eax
cmp    %eax,%ecx
jle    1173 <main+0x43>
mov    %ecx,0xc(%rsp)
mov    %eax,0x14(%rsp)
mov    %ecx,%edx
jmp    1177 <main+0x47>
mov    %eax,%edx
mov    %ecx,%eax
mov    0x10(%rsp),%ecx
cmp    %ecx,%eax
jle    1193 <main+0x63>
mov    %eax,0x10(%rsp)
mov    %ecx,0x14(%rsp)
mov    %ecx,%esi
cmp    %edx,%eax
jg     119b <main+0x6b>
mov    %edx,%ecx
mov    %eax,%edx
jmp    11a5 <main+0x75>
mov    %eax,%esi
mov    %ecx,%eax
cmp    %edx,%eax
jle    118d <main+0x5d>
mov    %eax,0xc(%rsp)
mov    %edx,0x10(%rsp)
mov    %eax,%ecx
lea    0xe54(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d %d %d\00"
@str = [18 x i8] c"Digite 3 numeros:\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 ([18 x i8], [18 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* %3
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %0
store i32 %9, i32* %3
store i32 %10, i32* %1
br label %13
13: ; preds = %12, %0
%14 = phi i32 [ %9, %12 ], [ %10, %0 ]
%15 = phi i32 [ %10, %12 ], [ %9, %0 ]
%16 = load i32, i32* %2
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 %15, i32* %2
store i32 %16, i32* %1
br label %19
19: ; preds = %18, %13
%20 = phi i32 [ %16, %18 ], [ %15, %13 ]
%21 = phi i32 [ %15, %18 ], [ %16, %13 ]
%22 = icmp sgt i32 %21, %14
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 %21, i32* %3
store i32 %14, i32* %2
br label %24
24: ; preds = %23, %19
%25 = phi i32 [ %21, %23 ], [ %14, %19 ]
%26 = phi i32 [ %14, %23 ], [ %21, %19 ]
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %26, i32 %25)
ret i32 0
}