#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*/ SelectionSort();
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  int array[5], i;
  for (i = 5 - 1; i >= 0; i--)
    array[i] = i;
  SelectionSort();
  for (i = 0; i < 5; i++)
    __VERIFIER_assert(array[i] == i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1159 <main+0x39>
mov    -0x24(%rbp),%ecx
movslq -0x24(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1136 <main+0x16>
mov    $0x0,%al
call   1030 <SelectionSort@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    1197 <main+0x77>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
cmp    -0x24(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1167 <main+0x47>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <SelectionSort@plt>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %10
store i32 %8, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, -1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = call i32 (...) @SelectionSort()
store i32 0, i32* %3
br label %17
17: ; preds = %29, %15
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 5
br i1 %19, label %20, label %32
20: ; preds = %17
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = load i32, i32* %3
%26 = icmp eq i32 %24, %25
%27 = zext i1 %26 to i32
%28 = call i32 @__VERIFIER_assert(i32 %27)
br label %29
29: ; preds = %20
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %17
32: ; preds = %17
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @SelectionSort()
%2 = tail call i32 @__VERIFIER_assert(i32 1)
%3 = tail call i32 @__VERIFIER_assert(i32 1)
%4 = tail call i32 @__VERIFIER_assert(i32 1)
%5 = tail call i32 @__VERIFIER_assert(i32 1)
%6 = tail call i32 @__VERIFIER_assert(i32 1)
ret i32 0
}