#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 */
typedef int /*<<< orphan*/ sort;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long, int, long long);
int main() {
  long long sort[] = {
      -38585, -31956, -31865, -27508, -26193, -23905, -15051, -14572, -12986,
      -12967, -10875, -9095,  -6959,  -3741,  -1085,  247,    800,    1256,
      3753,   4644,   7011,   8678,   9712,   10570,  11664,  12102,  12446,
      13317,  14883,  15806,  16885,  18354,  18513,  20375,  20764,  21514,
      21517,  21571,  21607,  22100,  22295,  23662,  25458,  25641,  26573,
      28143,  29594,  30559,  30932,  32069,  32185,  32807,  34827,  34949,
      35129,  35383,  36221,  41068,  41565,  53893,
  };
  long long cnt = 0;
  while (cnt < (sizeof(sort) / sizeof(long long) - 1) &&
         sort[cnt] <= sort[cnt + 1])
    cnt++;
  printf("made it to %d of %d - value = %d\n", cnt,
         sizeof(sort) / sizeof(long long) - 1, sort[cnt]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1f0(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x1e0,%edx
call   1040 <memcpy@plt>
movq   $0x0,-0x1f8(%rbp)
xor    %eax,%eax
cmpq   $0x3b,-0x1f8(%rbp)
3b
mov    %al,-0x1f9(%rbp)
jae    1192 <main+0x72>
mov    -0x1f8(%rbp),%rax
mov    -0x1f0(%rbp,%rax,8),%rax
ff
mov    -0x1f8(%rbp),%rcx
cmp    -0x1e8(%rbp,%rcx,8),%rax
ff
setle  %al
mov    %al,-0x1f9(%rbp)
mov    -0x1f9(%rbp),%al
test   $0x1,%al
jne    11a5 <main+0x85>
jmp    11bc <main+0x9c>
mov    -0x1f8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1f8(%rbp)
jmp    1155 <main+0x35>
mov    -0x1f8(%rbp),%rsi
mov    -0x1f8(%rbp),%rax
mov    -0x1f0(%rbp,%rax,8),%rcx
ff
lea    0x1007(%rip),%rdi
mov    $0x3b,%edx
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
lea    0xee6(%rip),%rdx
nopw   0x0(%rax,%rax,1)
mov    (%rdx,%rax,8),%rcx
cmp    0x8(%rdx,%rax,8),%rcx
jg     1156 <main+0x46>
mov    0x8(%rdx,%rax,8),%rcx
cmp    0x10(%rdx,%rax,8),%rcx
jg     115b <main+0x4b>
lea    0x2(%rax),%rsi
cmp    $0x39,%rax
je     1164 <main+0x54>
mov    0x10(%rdx,%rax,8),%rcx
lea    0x3(%rax),%rdi
cmp    0x18(%rdx,%rax,8),%rcx
mov    %rdi,%rax
jle    1120 <main+0x10>
jmp    1169 <main+0x59>
mov    %rax,%rsi
jmp    1169 <main+0x59>
add    $0x1,%rax
mov    %rax,%rsi
jmp    1169 <main+0x59>
mov    $0xd285,%ecx
lea    0x1070(%rip),%rdi
mov    $0x3b,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.sort = [60 x i64] [i64 -38585, i64 -31956, i64 -31865, i64 -27508, i64 -26193, i64 -23905, i64 -15051, i64 -14572, i64 -12986, i64 -12967, i64 -10875, i64 -9095, i64 -6959, i64 -3741, i64 -1085, i64 247, i64 800, i64 1256, i64 3753, i64 4644, i64 7011, i64 8678, i64 9712, i64 10570, i64 11664, i64 12102, i64 12446, i64 13317, i64 14883, i64 15806, i64 16885, i64 18354, i64 18513, i64 20375, i64 20764, i64 21514, i64 21517, i64 21571, i64 21607, i64 22100, i64 22295, i64 23662, i64 25458, i64 25641, i64 26573, i64 28143, i64 29594, i64 30559, i64 30932, i64 32069, i64 32185, i64 32807, i64 34827, i64 34949, i64 35129, i64 35383, i64 36221, i64 41068, i64 41565, i64 53893]
@.str = [34 x i8] c"made it to %d of %d - value = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [60 x i64]
%3 = alloca i64
store i32 0, i32* %1
%4 = bitcast [60 x i64]* %2 to i8*
store i64 0, i64* %3
br label %5
5: ; preds = %19, %0
%6 = load i64, i64* %3
%7 = icmp ult i64 %6, 59
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i64, i64* %3
%10 = getelementptr inbounds [60 x i64], [60 x i64]* %2, i64 0, i64 %9
%11 = load i64, i64* %10
%12 = load i64, i64* %3
%13 = add nsw i64 %12, 1
%14 = getelementptr inbounds [60 x i64], [60 x i64]* %2, i64 0, i64 %13
%15 = load i64, i64* %14
%16 = icmp sle i64 %11, %15
br label %17
17: ; preds = %8, %5
%18 = phi i1 [ false, %5 ], [ %16, %8 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i64, i64* %3
%21 = add nsw i64 %20, 1
store i64 %21, i64* %3
br label %5
22: ; preds = %17
%23 = load i64, i64* %3
%24 = load i64, i64* %3
%25 = getelementptr inbounds [60 x i64], [60 x i64]* %2, i64 0, i64 %24
%26 = load i64, i64* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %23, i32 59, i64 %26)
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@__const.main.sort = [60 x i64] [i64 -38585, i64 -31956, i64 -31865, i64 -27508, i64 -26193, i64 -23905, i64 -15051, i64 -14572, i64 -12986, i64 -12967, i64 -10875, i64 -9095, i64 -6959, i64 -3741, i64 -1085, i64 247, i64 800, i64 1256, i64 3753, i64 4644, i64 7011, i64 8678, i64 9712, i64 10570, i64 11664, i64 12102, i64 12446, i64 13317, i64 14883, i64 15806, i64 16885, i64 18354, i64 18513, i64 20375, i64 20764, i64 21514, i64 21517, i64 21571, i64 21607, i64 22100, i64 22295, i64 23662, i64 25458, i64 25641, i64 26573, i64 28143, i64 29594, i64 30559, i64 30932, i64 32069, i64 32185, i64 32807, i64 34827, i64 34949, i64 35129, i64 35383, i64 36221, i64 41068, i64 41565, i64 53893]
@.str = [34 x i8] c"made it to %d of %d - value = %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %18, %0
%2 = phi i64 [ 0, %0 ], [ %21, %18 ]
%3 = getelementptr inbounds [60 x i64], [60 x i64]* @__const.main.sort, i64 0, i64 %2
%4 = load i64, i64* %3
%5 = add nuw nsw i64 %2, 1
%6 = getelementptr inbounds [60 x i64], [60 x i64]* @__const.main.sort, i64 0, i64 %5
%7 = load i64, i64* %6
%8 = icmp sgt i64 %4, %7
br i1 %8, label %25, label %9
9: ; preds = %1
%10 = getelementptr inbounds [60 x i64], [60 x i64]* @__const.main.sort, i64 0, i64 %5
%11 = load i64, i64* %10
%12 = add nuw nsw i64 %2, 2
%13 = getelementptr inbounds [60 x i64], [60 x i64]* @__const.main.sort, i64 0, i64 %12
%14 = load i64, i64* %13
%15 = icmp sgt i64 %11, %14
br i1 %15, label %25, label %16
16: ; preds = %9
%17 = icmp eq i64 %12, 59
br i1 %17, label %25, label %18
18: ; preds = %16
%19 = getelementptr inbounds [60 x i64], [60 x i64]* @__const.main.sort, i64 0, i64 %12
%20 = load i64, i64* %19
%21 = add nuw nsw i64 %2, 3
%22 = getelementptr inbounds [60 x i64], [60 x i64]* @__const.main.sort, i64 0, i64 %21
%23 = load i64, i64* %22
%24 = icmp sgt i64 %20, %23
br i1 %24, label %25, label %1
25: ; preds = %18, %16, %9, %1
%26 = phi i64 [ %2, %1 ], [ %5, %9 ], [ %12, %16 ], [ %12, %18 ]
%27 = phi i64 [ %4, %1 ], [ %11, %9 ], [ 53893, %16 ], [ %20, %18 ]
%28 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %26, i32 59, i64 %27)
ret i32 0
}