#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 inp[8], i, k;
  k = 0;
  for (i = 0; i <= 8; ++i) {
    scanf("%d\n", &inp[i]);
  }
loop:;
  for (k = 0; k <= 7; ++k) {
    i = k;
    if (inp[i] > inp[i + 1]) {
      int t, t1;
      t = inp[i];
      t1 = inp[i + 1];
      inp[i] = t;
      inp[i + 1] = t1;
      inp[i] = t1;
      inp[i + 1] = t;
    }
  }
  for (i = 0; i <= 8; ++i) {
    printf("%d,", inp[i]);
  }
  printf("\n");
  getch();
  goto loop;
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jg     1180 <main+0x50>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe93(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    114d <main+0x1d>
jmp    1185 <main+0x55>
movl   $0x0,-0x38(%rbp)
cmpl   $0x7,-0x38(%rbp)
jg     1218 <main+0xe8>
mov    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jle    1205 <main+0xd5>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x40(%rbp)
mov    -0x3c(%rbp),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x40(%rbp),%ecx
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x40(%rbp),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x3c(%rbp),%ecx
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x30(%rbp,%rax,4)
jmp    120a <main+0xda>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    118c <main+0x5c>
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jg     124d <main+0x11d>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    121f <main+0xef>
lea    0xdae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getch@plt>
jmp    1185 <main+0x55>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeb4(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe3e(%rip),%rbx
jmp    125b <main+0x11b>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getch@plt>
mov    (%rsp),%eax
mov    0x4(%rsp),%ecx
cmp    %ecx,%eax
jle    1280 <main+0x140>
mov    %ecx,(%rsp)
mov    %eax,0x4(%rsp)
mov    %ecx,%esi
jmp    1284 <main+0x144>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%esi
mov    %ecx,%eax
mov    0x8(%rsp),%ecx
cmp    %ecx,%eax
jle    12a0 <main+0x160>
mov    %ecx,0x4(%rsp)
mov    %eax,0x8(%rsp)
jmp    12a2 <main+0x162>
cs nopw 0x0(%rax,%rax,1)
mov    %ecx,%eax
mov    0xc(%rsp),%ecx
cmp    %ecx,%eax
jle    12c0 <main+0x180>
mov    %ecx,0x8(%rsp)
mov    %eax,0xc(%rsp)
jmp    12c2 <main+0x182>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ecx,%eax
mov    0x10(%rsp),%ecx
cmp    %ecx,%eax
jle    12e0 <main+0x1a0>
mov    %ecx,0xc(%rsp)
mov    %eax,0x10(%rsp)
jmp    12e2 <main+0x1a2>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ecx,%eax
mov    0x14(%rsp),%ecx
cmp    %ecx,%eax
jle    1300 <main+0x1c0>
mov    %ecx,0x10(%rsp)
mov    %eax,0x14(%rsp)
jmp    1302 <main+0x1c2>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ecx,%eax
mov    0x18(%rsp),%ecx
cmp    %ecx,%eax
jle    1320 <main+0x1e0>
mov    %ecx,0x14(%rsp)
mov    %eax,0x18(%rsp)
jmp    1322 <main+0x1e2>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ecx,%eax
mov    0x1c(%rsp),%ecx
cmp    %ecx,%eax
jle    1340 <main+0x200>
mov    %ecx,0x18(%rsp)
mov    %eax,0x1c(%rsp)
jmp    1342 <main+0x202>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ecx,%eax
mov    0x20(%rsp),%ecx
cmp    %ecx,%eax
jle    11d0 <main+0x90>
mov    %ecx,0x1c(%rsp)
mov    %eax,0x20(%rsp)
jmp    11d0 <main+0x90>

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

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