#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*/ getchar();
int /*<<< orphan*/ printf(char *, char, char, char);
int scanf(char *, char *, char *, char *);
int main() {
  char a, b, c;
  while (scanf("%c%c%c", &a, &b, &c) == 3) {
    if (a > b) {
      if (a < c)
        printf("%c %c %c\n", b, a, c);
      else if (c > b)
        printf("%c %c %c\n", b, c, a);
      else
        printf("%c %c %c\n", c, b, a);
    } else {
      if (c > b)
        printf("%c %c %c\n", a, b, c);
      else if (c > a)
        printf("%c %c %c\n", a, c, b);
      else
        printf("%c %c %c\n", c, a, b);
    }
    getchar();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x5(%rbp),%rsi
lea    -0x6(%rbp),%rdx
lea    -0x7(%rbp),%rcx
call   1050 <scanf@plt>
cmp    $0x3,%eax
jne    128c <main+0x15c>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jle    11f8 <main+0xc8>
movsbl -0x5(%rbp),%eax
movsbl -0x7(%rbp),%ecx
cmp    %ecx,%eax
jge    11a1 <main+0x71>
mov    -0x6(%rbp),%cl
mov    -0x5(%rbp),%al
lea    0xe7a(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x7(%rbp),%ecx
call   1030 <printf@plt>
jmp    11f3 <main+0xc3>
movsbl -0x7(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jle    11d2 <main+0xa2>
mov    -0x6(%rbp),%cl
mov    -0x7(%rbp),%al
lea    0xe49(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x5(%rbp),%ecx
call   1030 <printf@plt>
jmp    11ee <main+0xbe>
mov    -0x7(%rbp),%cl
mov    -0x6(%rbp),%al
lea    0xe28(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x5(%rbp),%ecx
call   1030 <printf@plt>
jmp    11f3 <main+0xc3>
jmp    1280 <main+0x150>
movsbl -0x7(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jle    1229 <main+0xf9>
mov    -0x5(%rbp),%cl
mov    -0x6(%rbp),%al
lea    0xdf2(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x7(%rbp),%ecx
call   1030 <printf@plt>
jmp    127b <main+0x14b>
movsbl -0x7(%rbp),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jle    125a <main+0x12a>
mov    -0x5(%rbp),%cl
mov    -0x7(%rbp),%al
lea    0xdc1(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x6(%rbp),%ecx
call   1030 <printf@plt>
jmp    1276 <main+0x146>
mov    -0x7(%rbp),%cl
mov    -0x5(%rbp),%al
lea    0xda0(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x6(%rbp),%ecx
call   1030 <printf@plt>
jmp    127b <main+0x14b>
jmp    1280 <main+0x150>
mov    $0x0,%al
call   1040 <getchar@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
lea    0x7(%rsp),%rsi
lea    0x6(%rsp),%rdx
lea    0x5(%rsp),%rcx
call   1050 <scanf@plt>
cmp    $0x3,%eax
jne    1205 <main+0xd5>
lea    0xea1(%rip),%r14
lea    0xe93(%rip),%r15
lea    0x7(%rsp),%r12
lea    0x6(%rsp),%r13
lea    0x5(%rsp),%rbp
jmp    11ae <main+0x7e>
xchg   %ax,%ax
movsbl %al,%esi
movsbl %cl,%edx
movsbl %bl,%ecx
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbp,%rcx
call   1050 <scanf@plt>
cmp    $0x3,%eax
jne    1205 <main+0xd5>
movzbl 0x7(%rsp),%eax
movzbl 0x6(%rsp),%ecx
movzbl 0x5(%rsp),%ebx
cmp    %cl,%al
jle    11d0 <main+0xa0>
cmp    %bl,%al
jge    11e0 <main+0xb0>
movsbl %cl,%esi
movsbl %al,%edx
jmp    1186 <main+0x56>
nopl   (%rax)
cmp    %cl,%bl
jg     1180 <main+0x50>
cmp    %al,%bl
jle    11ef <main+0xbf>
movsbl %al,%esi
movsbl %bl,%edx
jmp    11f5 <main+0xc5>
cmp    %cl,%bl
jle    11fa <main+0xca>
movsbl %cl,%esi
movsbl %bl,%edx
movsbl %al,%ecx
jmp    1189 <main+0x59>
movsbl %bl,%esi
movsbl %al,%edx
movsbl %cl,%ecx
jmp    1189 <main+0x59>
movsbl %bl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
jmp    1189 <main+0x59>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [10 x i8] c"%c %c %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i32 0, i32* %1
br label %5
5: ; preds = %72, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8* %4)
%7 = icmp eq i32 %6, 3
br i1 %7, label %8, label %74
8: ; preds = %5
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp sgt i32 %10, %12
br i1 %13, label %14, label %43
14: ; preds = %8
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = icmp slt i32 %16, %18
br i1 %19, label %20, label %25
20: ; preds = %14
%21 = load i8, i8* %3
%22 = load i8, i8* %2
%23 = load i8, i8* %4
%24 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %21, i8 signext %22, i8 signext %23)
br label %42
25: ; preds = %14
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp sgt i32 %27, %29
br i1 %30, label %31, label %36
31: ; preds = %25
%32 = load i8, i8* %3
%33 = load i8, i8* %4
%34 = load i8, i8* %2
%35 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %32, i8 signext %33, i8 signext %34)
br label %41
36: ; preds = %25
%37 = load i8, i8* %4
%38 = load i8, i8* %3
%39 = load i8, i8* %2
%40 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %37, i8 signext %38, i8 signext %39)
br label %41
41: ; preds = %36, %31
br label %42
42: ; preds = %41, %20
br label %72
43: ; preds = %8
%44 = load i8, i8* %4
%45 = sext i8 %44 to i32
%46 = load i8, i8* %3
%47 = sext i8 %46 to i32
%48 = icmp sgt i32 %45, %47
br i1 %48, label %49, label %54
49: ; preds = %43
%50 = load i8, i8* %2
%51 = load i8, i8* %3
%52 = load i8, i8* %4
%53 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %50, i8 signext %51, i8 signext %52)
br label %71
54: ; preds = %43
%55 = load i8, i8* %4
%56 = sext i8 %55 to i32
%57 = load i8, i8* %2
%58 = sext i8 %57 to i32
%59 = icmp sgt i32 %56, %58
br i1 %59, label %60, label %65
60: ; preds = %54
%61 = load i8, i8* %2
%62 = load i8, i8* %4
%63 = load i8, i8* %3
%64 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %61, i8 signext %62, i8 signext %63)
br label %70
65: ; preds = %54
%66 = load i8, i8* %4
%67 = load i8, i8* %2
%68 = load i8, i8* %3
%69 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %66, i8 signext %67, i8 signext %68)
br label %70
70: ; preds = %65, %60
br label %71
71: ; preds = %70, %49
br label %72
72: ; preds = %71, %42
%73 = call i32 (...) @getchar()
br label %5
74: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [10 x i8] c"%c %c %c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %35
6: ; preds = %0, %31
%7 = load i8, i8* %1
%8 = load i8, i8* %2
%9 = icmp sgt i8 %7, %8
%10 = load i8, i8* %3
br i1 %9, label %11, label %21
11: ; preds = %6
%12 = icmp slt i8 %7, %10
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %8, i8 signext %7, i8 signext %10)
br label %31
15: ; preds = %11
%16 = icmp sgt i8 %10, %8
br i1 %16, label %17, label %19
17: ; preds = %15
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %8, i8 signext %10, i8 signext %7)
br label %31
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %10, i8 signext %8, i8 signext %7)
br label %31
21: ; preds = %6
%22 = icmp sgt i8 %10, %8
br i1 %22, label %23, label %25
23: ; preds = %21
%24 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %7, i8 signext %8, i8 signext %10)
br label %31
25: ; preds = %21
%26 = icmp sgt i8 %10, %7
br i1 %26, label %27, label %29
27: ; preds = %25
%28 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %7, i8 signext %10, i8 signext %8)
br label %31
29: ; preds = %25
%30 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %10, i8 signext %7, i8 signext %8)
br label %31
31: ; preds = %23, %29, %27, %13, %19, %17
%32 = call i32 (...) @getchar()
%33 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
%34 = icmp eq i32 %33, 3
br i1 %34, label %6, label %35
35: ; preds = %31, %0
ret i32 0
}