#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, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int /*<<< orphan*/ troca(int *, int *);
int main() {
  int a, b, c;
  scanf("%i %i %i", &a, &b, &c);
  int aI = a, bI = b, cI = c;
  if (a > c)
    troca(&a, &c);
  if (b > c)
    troca(&b, &c);
  if (a > b)
    troca(&a, &b);
  printf("%i\n%i\n%i\n", a, b, c);
  printf("\n%i\n%i\n%i\n", aI, bI, cI);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
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    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1182 <main+0x52>
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <troca@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    119b <main+0x6b>
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <troca@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11b4 <main+0x84>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <troca@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%r14d
mov    0x4(%rsp),%ebp
mov    0x8(%rsp),%ebx
mov    %ebx,%eax
mov    %ebp,%edx
cmp    %ebx,%r14d
jle    1180 <main+0x50>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1050 <troca@plt>
mov    0x4(%rsp),%edx
mov    0x8(%rsp),%eax
cmp    %eax,%edx
jle    1197 <main+0x67>
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1050 <troca@plt>
mov    0x4(%rsp),%edx
mov    0xc(%rsp),%esi
cmp    %edx,%esi
jle    11b6 <main+0x86>
lea    0xc(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1050 <troca@plt>
mov    0xc(%rsp),%esi
mov    0x4(%rsp),%edx
mov    0x8(%rsp),%ecx
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
lea    0xe3c(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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