#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 main(void) {
  static int array[128];
  int i, j, tmp;
  for (i = 0; i < 128; i++)
    array[i] = 128 - i - 1;
  for (i = 0; i < 128 - 1; i++)
    for (j = 0; j < 128 - 1 - i; j++)
      if (array[j] > array[j + 1]) {
        tmp = array[j];
        array[j] = array[j + 1];
        array[j + 1] = tmp;
      }
  printf("sort exiting with code %d\n", array[0]);
  return array[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    115a <main+0x4a>
mov    $0x80,%edx
sub    -0x8(%rbp),%edx
sub    $0x1,%edx
movslq -0x8(%rbp),%rcx
lea    0x2ef7(%rip),%rax
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
movl   $0x0,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jge    121a <main+0x10a>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x7f,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    1207 <main+0xf7>
movslq -0xc(%rbp),%rcx
lea    0x2eb0(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rdx
lea    0x2e9d(%rip),%rcx
cmp    (%rcx,%rdx,4),%eax
jle    11f4 <main+0xe4>
movslq -0xc(%rbp),%rcx
lea    0x2e89(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2e73(%rip),%rax
mov    (%rax,%rcx,4),%edx
movslq -0xc(%rbp),%rcx
lea    0x2e65(%rip),%rax
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2e4f(%rip),%rax
mov    %edx,(%rax,%rcx,4)
jmp    11f9 <main+0xe9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1172 <main+0x62>
jmp    120c <main+0xfc>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1161 <main+0x51>
mov    0x2e20(%rip),%esi
lea    0xdd9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e0e(%rip),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x2f21(%rip)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x2f23(%rip)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,0x2f25(%rip)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0x2f27(%rip)
movaps 0xef0(%rip),%xmm0
movaps %xmm0,0x2f29(%rip)
movaps 0xef2(%rip),%xmm0
movaps %xmm0,0x2f2b(%rip)
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x2f2d(%rip)
movaps 0xef6(%rip),%xmm0
movaps %xmm0,0x2f2f(%rip)
movaps 0xef8(%rip),%xmm0
movaps %xmm0,0x2f31(%rip)
movaps 0xefa(%rip),%xmm0
movaps %xmm0,0x2f33(%rip)
movaps 0xefc(%rip),%xmm0
movaps %xmm0,0x2f35(%rip)
movaps 0xefe(%rip),%xmm0
movaps %xmm0,0x2f37(%rip)
movaps 0xf00(%rip),%xmm0
movaps %xmm0,0x2f39(%rip)
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0x2f3b(%rip)
movaps 0xf04(%rip),%xmm0
movaps %xmm0,0x2f3d(%rip)
movaps 0xf06(%rip),%xmm0
movaps %xmm0,0x2f3f(%rip)
movaps 0xf08(%rip),%xmm0
movaps %xmm0,0x2f41(%rip)
movaps 0xf0a(%rip),%xmm0
movaps %xmm0,0x2f43(%rip)
movaps 0xf0c(%rip),%xmm0
movaps %xmm0,0x2f45(%rip)
movaps 0xf0e(%rip),%xmm0
movaps %xmm0,0x2f47(%rip)
movaps 0xf10(%rip),%xmm0
movaps %xmm0,0x2f49(%rip)
movaps 0xf12(%rip),%xmm0
movaps %xmm0,0x2f4b(%rip)
movaps 0xf14(%rip),%xmm0
movaps %xmm0,0x2f4d(%rip)
movaps 0xf16(%rip),%xmm0
movaps %xmm0,0x2f4f(%rip)
movaps 0xf18(%rip),%xmm0
movaps %xmm0,0x2f51(%rip)
movaps 0xf1a(%rip),%xmm0
movaps %xmm0,0x2f53(%rip)
movaps 0xf1c(%rip),%xmm0
movaps %xmm0,0x2f55(%rip)
movaps 0xf1e(%rip),%xmm0
movaps %xmm0,0x2f57(%rip)
movaps 0xf20(%rip),%xmm0
movaps %xmm0,0x2f59(%rip)
movaps 0xf22(%rip),%xmm0
movaps %xmm0,0x2f5b(%rip)
movaps 0xf24(%rip),%xmm0
movaps %xmm0,0x2f5d(%rip)
movaps 0xf26(%rip),%xmm0
movaps %xmm0,0x2f5f(%rip)
mov    $0x7f,%r8d
xor    %r9d,%r9d
lea    0x2d5f(%rip),%rdx
jmp    1302 <main+0x1f2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r9
add    $0xffffffffffffffff,%r8
cmp    $0x7f,%r9d
je     1382 <main+0x272>
mov    0x2d38(%rip),%edi
cmp    $0x7e,%r9
jne    1330 <main+0x220>
xor    %ecx,%ecx
test   $0x1,%r8b
je     12f0 <main+0x1e0>
mov    0x4(%rdx,%rcx,4),%eax
cmp    %eax,%edi
jle    12f0 <main+0x1e0>
mov    %eax,(%rdx,%rcx,4)
mov    %edi,0x4(%rdx,%rcx,4)
jmp    12f0 <main+0x1e0>
nopw   0x0(%rax,%rax,1)
mov    %r8,%r10
and    $0xfffffffffffffffe,%r10
xor    %eax,%eax
jmp    1350 <main+0x240>
nopl   0x0(%rax,%rax,1)
mov    %esi,0x4(%rdx,%rax,4)
mov    %edi,0x8(%rdx,%rax,4)
mov    %rcx,%rax
cmp    %rcx,%r10
je     1310 <main+0x200>
mov    0x4(%rdx,%rax,4),%ecx
cmp    %ecx,%edi
jle    1370 <main+0x260>
mov    %ecx,(%rdx,%rax,4)
mov    %edi,0x4(%rdx,%rax,4)
jmp    1372 <main+0x262>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ecx,%edi
lea    0x2(%rax),%rcx
mov    0x8(%rdx,%rax,4),%esi
cmp    %esi,%edi
jg     1340 <main+0x230>
mov    %esi,%edi
jmp    1348 <main+0x238>
mov    0x2cb8(%rip),%esi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ca6(%rip),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@main.array = internal unnamed_addr global [128 x i32] zeroinitializer
@.str = [27 x i8] c"sort exiting with code %d\0A\00"
define i32 @main() {
store <4 x i32> <i32 127, i32 126, i32 125, i32 124>, <4 x i32>* bitcast ([128 x i32]* @main.array to <4 x i32>*)
store <4 x i32> <i32 123, i32 122, i32 121, i32 120>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 4) to <4 x i32>*)
store <4 x i32> <i32 119, i32 118, i32 117, i32 116>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 8) to <4 x i32>*)
store <4 x i32> <i32 115, i32 114, i32 113, i32 112>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 12) to <4 x i32>*)
store <4 x i32> <i32 111, i32 110, i32 109, i32 108>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 16) to <4 x i32>*)
store <4 x i32> <i32 107, i32 106, i32 105, i32 104>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 20) to <4 x i32>*)
store <4 x i32> <i32 103, i32 102, i32 101, i32 100>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 24) to <4 x i32>*)
store <4 x i32> <i32 99, i32 98, i32 97, i32 96>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 28) to <4 x i32>*)
store <4 x i32> <i32 95, i32 94, i32 93, i32 92>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 32) to <4 x i32>*)
store <4 x i32> <i32 91, i32 90, i32 89, i32 88>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 36) to <4 x i32>*)
store <4 x i32> <i32 87, i32 86, i32 85, i32 84>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 40) to <4 x i32>*)
store <4 x i32> <i32 83, i32 82, i32 81, i32 80>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 44) to <4 x i32>*)
store <4 x i32> <i32 79, i32 78, i32 77, i32 76>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 48) to <4 x i32>*)
store <4 x i32> <i32 75, i32 74, i32 73, i32 72>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 52) to <4 x i32>*)
store <4 x i32> <i32 71, i32 70, i32 69, i32 68>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 56) to <4 x i32>*)
store <4 x i32> <i32 67, i32 66, i32 65, i32 64>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 60) to <4 x i32>*)
store <4 x i32> <i32 63, i32 62, i32 61, i32 60>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 64) to <4 x i32>*)
store <4 x i32> <i32 59, i32 58, i32 57, i32 56>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 68) to <4 x i32>*)
store <4 x i32> <i32 55, i32 54, i32 53, i32 52>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 72) to <4 x i32>*)
store <4 x i32> <i32 51, i32 50, i32 49, i32 48>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 76) to <4 x i32>*)
store <4 x i32> <i32 47, i32 46, i32 45, i32 44>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 80) to <4 x i32>*)
store <4 x i32> <i32 43, i32 42, i32 41, i32 40>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 84) to <4 x i32>*)
store <4 x i32> <i32 39, i32 38, i32 37, i32 36>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 88) to <4 x i32>*)
store <4 x i32> <i32 35, i32 34, i32 33, i32 32>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 92) to <4 x i32>*)
store <4 x i32> <i32 31, i32 30, i32 29, i32 28>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 96) to <4 x i32>*)
store <4 x i32> <i32 27, i32 26, i32 25, i32 24>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 100) to <4 x i32>*)
store <4 x i32> <i32 23, i32 22, i32 21, i32 20>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 104) to <4 x i32>*)
store <4 x i32> <i32 19, i32 18, i32 17, i32 16>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 108) to <4 x i32>*)
store <4 x i32> <i32 15, i32 14, i32 13, i32 12>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 112) to <4 x i32>*)
store <4 x i32> <i32 11, i32 10, i32 9, i32 8>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 116) to <4 x i32>*)
store <4 x i32> <i32 7, i32 6, i32 5, i32 4>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 120) to <4 x i32>*)
store <4 x i32> <i32 3, i32 2, i32 1, i32 0>, <4 x i32>* bitcast (i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 124) to <4 x i32>*)
br label %1
1: ; preds = %0, %43
%2 = phi i64 [ 0, %0 ], [ %47, %43 ]
%3 = phi i64 [ 127, %0 ], [ %45, %43 ]
%4 = phi i32 [ 0, %0 ], [ %44, %43 ]
%5 = load i32, i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 0)
%6 = and i64 %3, 1
%7 = icmp eq i64 %2, 126
br i1 %7, label %32, label %8
8: ; preds = %1
%9 = and i64 %3, -2
br label %10
10: ; preds = %28, %8
%11 = phi i32 [ %5, %8 ], [ %29, %28 ]
%12 = phi i64 [ 0, %8 ], [ %22, %28 ]
%13 = phi i64 [ 0, %8 ], [ %30, %28 ]
%14 = or i64 %12, 1
%15 = getelementptr inbounds [128 x i32], [128 x i32]* @main.array, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = icmp sgt i32 %11, %16
br i1 %17, label %18, label %20
18: ; preds = %10
%19 = getelementptr inbounds [128 x i32], [128 x i32]* @main.array, i64 0, i64 %12
store i32 %16, i32* %19
store i32 %11, i32* %15
br label %20
20: ; preds = %10, %18
%21 = phi i32 [ %16, %10 ], [ %11, %18 ]
%22 = add nuw nsw i64 %12, 2
%23 = getelementptr inbounds [128 x i32], [128 x i32]* @main.array, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = icmp sgt i32 %21, %24
br i1 %25, label %26, label %28
26: ; preds = %20
%27 = getelementptr inbounds [128 x i32], [128 x i32]* @main.array, i64 0, i64 %14
store i32 %24, i32* %27
store i32 %21, i32* %23
br label %28
28: ; preds = %26, %20
%29 = phi i32 [ %24, %20 ], [ %21, %26 ]
%30 = add i64 %13, 2
%31 = icmp eq i64 %30, %9
br i1 %31, label %32, label %10
32: ; preds = %28, %1
%33 = phi i32 [ %5, %1 ], [ %29, %28 ]
%34 = phi i64 [ 0, %1 ], [ %22, %28 ]
%35 = icmp eq i64 %6, 0
br i1 %35, label %43, label %36
36: ; preds = %32
%37 = add nuw nsw i64 %34, 1
%38 = getelementptr inbounds [128 x i32], [128 x i32]* @main.array, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = icmp sgt i32 %33, %39
br i1 %40, label %41, label %43
41: ; preds = %36
%42 = getelementptr inbounds [128 x i32], [128 x i32]* @main.array, i64 0, i64 %34
store i32 %39, i32* %42
store i32 %33, i32* %38
br label %43
43: ; preds = %36, %41, %32
%44 = add nuw nsw i32 %4, 1
%45 = add nsw i64 %3, -1
%46 = icmp eq i32 %44, 127
%47 = add i64 %2, 1
br i1 %46, label %48, label %1
48: ; preds = %43
%49 = load i32, i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 0)
%50 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %49)
%51 = load i32, i32* getelementptr inbounds ([128 x i32], [128 x i32]* @main.array, i64 0, i64 0)
ret i32 %51
}