#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int arr[20], i;
  for (i = 0; i < 20; i++)
    scanf("%d", &arr[i]);
  int j;
  for (i = 1; i < 20; i++) {
    int temp = arr[i];
    for (j = i - 1; j >= 0; j--) {
      if (arr[j] >= temp) {
        arr[j + 1] = arr[j];
        if (j == 0)
          arr[j] = temp;
      } else {
        arr[j + 1] = temp;
        break;
      }
    }
  }
  for (i = 0; i < 20; i++)
    printf("%d ", arr[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x64(%rbp)
cmpl   $0x14,-0x64(%rbp)
jge    1169 <main+0x49>
movslq -0x64(%rbp),%rax
lea    -0x60(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1136 <main+0x16>
movl   $0x1,-0x64(%rbp)
cmpl   $0x14,-0x64(%rbp)
jge    1211 <main+0xf1>
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x64(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x68(%rbp)
cmpl   $0x0,-0x68(%rbp)
jl     11fe <main+0xde>
movslq -0x68(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%eax
cmp    -0x6c(%rbp),%eax
jl     11d7 <main+0xb7>
movslq -0x68(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%ecx
mov    -0x68(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x60(%rbp,%rax,4)
cmpl   $0x0,-0x68(%rbp)
jne    11d2 <main+0xb2>
mov    -0x6c(%rbp),%ecx
movslq -0x68(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
jmp    11eb <main+0xcb>
mov    -0x6c(%rbp),%ecx
mov    -0x68(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x60(%rbp,%rax,4)
jmp    11fe <main+0xde>
jmp    11f0 <main+0xd0>
mov    -0x68(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x68(%rbp)
jmp    118e <main+0x6e>
jmp    1203 <main+0xe3>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1170 <main+0x50>
movl   $0x0,-0x64(%rbp)
cmpl   $0x14,-0x64(%rbp)
jge    1244 <main+0x124>
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xdd2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1218 <main+0xf8>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xed4(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x34(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x38(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x3c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x40(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x44(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x48(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0x1,%eax
xor    %ecx,%ecx
jmp    1254 <main+0x134>
nopw   0x0(%rax,%rax,1)
add    $0x1,%esi
mov    %edx,(%rsp,%rsi,4)
add    $0x1,%rax
add    $0x1,%rcx
cmp    $0x14,%rax
je     1287 <main+0x167>
mov    (%rsp,%rax,4),%edx
mov    %rcx,%rsi
jmp    1271 <main+0x151>
nopl   0x0(%rax)
lea    -0x1(%rsi),%rdi
add    $0x1,%rsi
cmp    $0x1,%rsi
mov    %rdi,%rsi
jle    1246 <main+0x126>
mov    %esi,%edi
mov    (%rsp,%rdi,4),%ebx
cmp    %edx,%ebx
jl     1240 <main+0x120>
mov    %ebx,0x4(%rsp,%rsi,4)
test   %esi,%esi
jne    1260 <main+0x140>
mov    %edx,(%rsp,%rdi,4)
jmp    1260 <main+0x140>
mov    (%rsp),%esi
lea    0xd72(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x30(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x34(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x38(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x3c(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x40(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x44(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x48(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x4c(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 2
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 3
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 4
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 5
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 6
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 7
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%19 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 8
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
%21 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 9
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
%23 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 10
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %23)
%25 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 11
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %25)
%27 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 12
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %27)
%29 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 13
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %29)
%31 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 14
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %31)
%33 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 15
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %33)
%35 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 16
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %35)
%37 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 17
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %37)
%39 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 18
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %39)
%41 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 19
%42 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %41)
br label %43
43: ; preds = %0, %64
%44 = phi i64 [ 1, %0 ], [ %65, %64 ]
%45 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %44
%46 = load i32, i32* %45
br label %47
47: ; preds = %43, %62
%48 = phi i64 [ %44, %43 ], [ %49, %62 ]
%49 = add nsw i64 %48, -1
%50 = and i64 %49, 4294967295
%51 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = icmp slt i32 %52, %46
br i1 %53, label %59, label %54
54: ; preds = %47
%55 = trunc i64 %49 to i32
%56 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %48
store i32 %52, i32* %56
%57 = icmp eq i32 %55, 0
br i1 %57, label %58, label %62
58: ; preds = %54
store i32 %46, i32* %51
br label %62
59: ; preds = %47
%60 = and i64 %48, 4294967295
%61 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %60
store i32 %46, i32* %61
br label %64
62: ; preds = %58, %54
%63 = icmp sgt i64 %48, 1
br i1 %63, label %47, label %64
64: ; preds = %62, %59
%65 = add nuw nsw i64 %44, 1
%66 = icmp eq i64 %65, 20
br i1 %66, label %67, label %43
67: ; preds = %64
%68 = load i32, i32* %3
%69 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %68)
%70 = load i32, i32* %5
%71 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %70)
%72 = load i32, i32* %7
%73 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %72)
%74 = load i32, i32* %9
%75 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %74)
%76 = load i32, i32* %11
%77 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %76)
%78 = load i32, i32* %13
%79 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %78)
%80 = load i32, i32* %15
%81 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %80)
%82 = load i32, i32* %17
%83 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %82)
%84 = load i32, i32* %19
%85 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %84)
%86 = load i32, i32* %21
%87 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %86)
%88 = load i32, i32* %23
%89 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %88)
%90 = load i32, i32* %25
%91 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %90)
%92 = load i32, i32* %27
%93 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %92)
%94 = load i32, i32* %29
%95 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %94)
%96 = load i32, i32* %31
%97 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %96)
%98 = load i32, i32* %33
%99 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %98)
%100 = load i32, i32* %35
%101 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %100)
%102 = load i32, i32* %37
%103 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %102)
%104 = load i32, i32* %39
%105 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %104)
%106 = load i32, i32* %41
%107 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %106)
ret i32 0
}