#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*/ assert(int);
int /*<<< orphan*/ merge_sort(int *, int /*<<< orphan*/, int);
void test_simple() {
  int array[] = {9, 6, 7, 2, 5, 6, 9, 6, 7, 2, 5, 6};
  merge_sort(array, 0, 11);
  assert(array[0] == 2);
  assert(array[1] == 2);
  assert(array[2] == 5);
  assert(array[3] == 5);
  assert(array[4] == 6);
  assert(array[5] == 6);
  assert(array[6] == 6);
  assert(array[7] == 6);
  assert(array[8] == 7);
  assert(array[9] == 7);
  assert(array[10] == 9);
  assert(array[11] == 9);
}


x86 assembly (clang, -O0):
<test_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0xb,%edx
call   1050 <merge_sort@plt>
cmpl   $0x2,-0x30(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,-0x2c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x5,-0x28(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x5,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x6,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x6,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x6,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x6,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x7,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x7,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x9,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x9,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_simple>:
sub    $0x38,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0xb,%edx
call   1040 <merge_sort@plt>
xor    %edi,%edi
cmpl   $0x2,(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x2,0x4(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x5,0x8(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x5,0xc(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x6,0x10(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x6,0x14(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x6,0x18(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x6,0x1c(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x7,0x20(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x7,0x24(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x9,0x28(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x9,0x2c(%rsp)
sete   %dil
call   1030 <assert@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.test_simple.array = [12 x i32] [i32 9, i32 6, i32 7, i32 2, i32 5, i32 6, i32 9, i32 6, i32 7, i32 2, i32 5, i32 6]
define void @test_simple() {
%1 = alloca [12 x i32]
%2 = bitcast [12 x i32]* %1 to i8*
%3 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%4 = call i32 @merge_sort(i32* %3, i32 0, i32 11)
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 1
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 2
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 2
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 5
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 3
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, 5
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 4
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, 6
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 5
%31 = load i32, i32* %30
%32 = icmp eq i32 %31, 6
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 6
%36 = load i32, i32* %35
%37 = icmp eq i32 %36, 6
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
%40 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 7
%41 = load i32, i32* %40
%42 = icmp eq i32 %41, 6
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 8
%46 = load i32, i32* %45
%47 = icmp eq i32 %46, 7
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
%50 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 9
%51 = load i32, i32* %50
%52 = icmp eq i32 %51, 7
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 10
%56 = load i32, i32* %55
%57 = icmp eq i32 %56, 9
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
%60 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 11
%61 = load i32, i32* %60
%62 = icmp eq i32 %61, 9
%63 = zext i1 %62 to i32
%64 = call i32 @assert(i32 %63)
ret void
}

LLVM IR (-O2):
@__const.test_simple.array = [12 x i32] [i32 9, i32 6, i32 7, i32 2, i32 5, i32 6, i32 9, i32 6, i32 7, i32 2, i32 5, i32 6]
define void @test_simple() {
%1 = alloca [12 x i32]
%2 = bitcast [12 x i32]* %1 to i8*
%3 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%4 = call i32 @merge_sort(i32* %3, i32 0, i32 11)
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 1
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 2
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 2
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 5
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 3
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, 5
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 4
%25 = load i32, i32* %24
%26 = icmp eq i32 %25, 6
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 5
%30 = load i32, i32* %29
%31 = icmp eq i32 %30, 6
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 6
%35 = load i32, i32* %34
%36 = icmp eq i32 %35, 6
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
%39 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 7
%40 = load i32, i32* %39
%41 = icmp eq i32 %40, 6
%42 = zext i1 %41 to i32
%43 = call i32 @assert(i32 %42)
%44 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 8
%45 = load i32, i32* %44
%46 = icmp eq i32 %45, 7
%47 = zext i1 %46 to i32
%48 = call i32 @assert(i32 %47)
%49 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 9
%50 = load i32, i32* %49
%51 = icmp eq i32 %50, 7
%52 = zext i1 %51 to i32
%53 = call i32 @assert(i32 %52)
%54 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 10
%55 = load i32, i32* %54
%56 = icmp eq i32 %55, 9
%57 = zext i1 %56 to i32
%58 = call i32 @assert(i32 %57)
%59 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 11
%60 = load i32, i32* %59
%61 = icmp eq i32 %60, 9
%62 = zext i1 %61 to i32
%63 = call i32 @assert(i32 %62)
ret void
}