#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 main() {
  int temp, i, j;
  int data[10] = {1, 6, 2, 88, 32, 7, 0, 3, 12, 55};
  for (i = 1; i < 10; i++) {
    temp = data[i];
    j = i - 1;
    while (temp < data[j] && j >= 0) {
      data[j + 1] = data[j];
      --j;
    }
    data[j + 1] = temp;
  }
  printf("In ascending order: ");
  for (i = 0; i < 10; i++)
    printf("%d ", data[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11d8 <main+0xb8>
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
movslq -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    -0x40(%rbp,%rdx,4),%ecx
mov    %al,-0x41(%rbp)
jge    1189 <main+0x69>
cmpl   $0x0,-0x10(%rbp)
setge  %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    1199 <main+0x79>
jmp    11bb <main+0x9b>
movslq -0x10(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%ecx
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <main+0x49>
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <main+0x2b>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    121b <main+0xfb>
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%esi
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ed <main+0xcd>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xf04(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x1,%ebx
mov    $0x6,%edx
mov    $0x1,%esi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %rbx,%rax
cmp    %esi,%edx
jge    117e <main+0x6e>
mov    %rcx,%rdi
nopw   0x0(%rax,%rax,1)
lea    0x1(%rdi),%eax
mov    %esi,(%rsp,%rax,4)
lea    -0x1(%rdi),%rax
mov    -0x4(%rsp,%rdi,4),%esi
cmp    %esi,%edx
jge    117a <main+0x6a>
test   %rdi,%rdi
mov    %rax,%rdi
jg     1160 <main+0x50>
add    $0x1,%rax
cltq
mov    %edx,(%rsp,%rax,4)
add    $0x1,%rcx
cmp    $0x9,%rcx
je     1199 <main+0x89>
mov    (%rsp,%rbx,4),%esi
add    $0x1,%rbx
mov    (%rsp,%rbx,4),%edx
jmp    1150 <main+0x40>
lea    0xe88(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%esi
lea    0xe8c(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.data = [10 x i32] [i32 1, i32 6, i32 2, i32 88, i32 32, i32 7, i32 0, i32 3, i32 12, i32 55]
@.str = [21 x i8] c"In ascending order: \00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x i32]
store i32 0, i32* %1
%6 = bitcast [10 x i32]* %5 to i8*
store i32 1, i32* %3
br label %7
7: ; preds = %46, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %49
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %12
%14 = load i32, i32* %13
store i32 %14, i32* %2
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1
store i32 %16, i32* %4
br label %17
17: ; preds = %29, %10
%18 = load i32, i32* %2
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = icmp slt i32 %18, %22
br i1 %23, label %24, label %27
24: ; preds = %17
%25 = load i32, i32* %4
%26 = icmp sge i32 %25, 0
br label %27
27: ; preds = %24, %17
%28 = phi i1 [ false, %17 ], [ %26, %24 ]
br i1 %28, label %29, label %40
29: ; preds = %27
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %36
store i32 %33, i32* %37
%38 = load i32, i32* %4
%39 = add nsw i32 %38, -1
store i32 %39, i32* %4
br label %17
40: ; preds = %27
%41 = load i32, i32* %2
%42 = load i32, i32* %4
%43 = add nsw i32 %42, 1
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %44
store i32 %41, i32* %45
br label %46
46: ; preds = %40
%47 = load i32, i32* %3
%48 = add nsw i32 %47, 1
store i32 %48, i32* %3
br label %7
49: ; preds = %7
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %51
51: ; preds = %60, %49
%52 = load i32, i32* %3
%53 = icmp slt i32 %52, 10
br i1 %53, label %54, label %63
54: ; preds = %51
%55 = load i32, i32* %3
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %54
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
store i32 %62, i32* %3
br label %51
63: ; preds = %51
ret i32 0
}

LLVM IR (-O2):
@__const.main.data = [10 x i32] [i32 1, i32 6, i32 2, i32 88, i32 32, i32 7, i32 0, i32 3, i32 12, i32 55]
@.str = [21 x i8] c"In ascending order: \00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
br label %3
3: ; preds = %30, %0
%4 = phi i32 [ 1, %0 ], [ %33, %30 ]
%5 = phi i32 [ 6, %0 ], [ %32, %30 ]
%6 = phi i64 [ 1, %0 ], [ %27, %30 ]
%7 = phi i64 [ 0, %0 ], [ %28, %30 ]
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %6
%9 = icmp slt i32 %5, %4
br i1 %9, label %10, label %22
10: ; preds = %3, %10
%11 = phi i64 [ %16, %10 ], [ %7, %3 ]
%12 = phi i32 [ %18, %10 ], [ %4, %3 ]
%13 = phi i64 [ %11, %10 ], [ %6, %3 ]
%14 = and i64 %13, 4294967295
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %14
store i32 %12, i32* %15
%16 = add nsw i64 %11, -1
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = icmp slt i32 %5, %18
%20 = icmp sgt i64 %11, 0
%21 = select i1 %19, i1 %20, i1 false
br i1 %21, label %10, label %22
22: ; preds = %10, %3
%23 = phi i64 [ %6, %3 ], [ %11, %10 ]
%24 = shl i64 %23, 32
%25 = ashr exact i64 %24, 32
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %25
store i32 %5, i32* %26
%27 = add nuw nsw i64 %6, 1
%28 = add nuw nsw i64 %7, 1
%29 = icmp eq i64 %28, 9
br i1 %29, label %34, label %30
30: ; preds = %22
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %27
%32 = load i32, i32* %31
%33 = load i32, i32* %8
br label %3
34: ; preds = %22
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%37 = load i32, i32* %36
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%40 = load i32, i32* %39
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %40)
%42 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%43 = load i32, i32* %42
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %43)
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%46 = load i32, i32* %45
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %46)
%48 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%49 = load i32, i32* %48
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %49)
%51 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%52 = load i32, i32* %51
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %52)
%54 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%55 = load i32, i32* %54
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %55)
%57 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%58 = load i32, i32* %57
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %58)
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%61 = load i32, i32* %60
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %61)
%63 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%64 = load i32, i32* %63
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %64)
ret i32 0
}