#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*/ merge(unsigned int *, unsigned int, unsigned int,
                         unsigned int, unsigned int, int (*)(void *, void *));
int msort_nnt(unsigned int *arr, unsigned int low, unsigned int high,
              unsigned int size, int (*cmpFunc)(void *a, void *b)) {
  unsigned int middle;
  if (low < high) {
    middle = (low + high) / 2;
    msort_nnt(arr, low, middle, size, cmpFunc);
    msort_nnt(arr, middle + 1, high, size, cmpFunc);
    merge(arr, low, middle, high, size, cmpFunc);
  }
  return 0;
}


x86 assembly (clang, -O0):
<msort_nnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    119a <msort_nnt+0x7a>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1040 <msort_nnt@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1040 <msort_nnt@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
call   1030 <merge@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msort_nnt>:
cmp    %edx,%esi
jae    1182 <msort_nnt+0x62>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %ecx,%r15d
mov    %edx,%r13d
mov    %esi,%ebp
mov    %rdi,%r12
lea    0x0(%r13,%rbp,1),%ebx
shr    %ebx
mov    %ebx,%edx
call   1040 <msort_nnt@plt>
lea    0x1(%rbx),%esi
mov    %r12,%rdi
mov    %r13d,%edx
mov    %r15d,%ecx
mov    %r14,%r8
call   1040 <msort_nnt@plt>
mov    %r12,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r13d,%ecx
mov    %r15d,%r8d
mov    %r14,%r9
call   1030 <merge@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @msort_nnt(i32* %0, i32 %1, i32 %2, i32 %3, i32 (i8*, i8*)* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32 (i8*, i8*)*
%11 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 (i8*, i8*)* %4, i32 (i8*, i8*)** %10
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = icmp ult i32 %12, %13
br i1 %14, label %15, label %40
15: ; preds = %5
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = add i32 %16, %17
%19 = udiv i32 %18, 2
store i32 %19, i32* %11
%20 = load i32*, i32** %6
%21 = load i32, i32* %7
%22 = load i32, i32* %11
%23 = load i32, i32* %9
%24 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %10
%25 = call i32 @msort_nnt(i32* %20, i32 %21, i32 %22, i32 %23, i32 (i8*, i8*)* %24)
%26 = load i32*, i32** %6
%27 = load i32, i32* %11
%28 = add i32 %27, 1
%29 = load i32, i32* %8
%30 = load i32, i32* %9
%31 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %10
%32 = call i32 @msort_nnt(i32* %26, i32 %28, i32 %29, i32 %30, i32 (i8*, i8*)* %31)
%33 = load i32*, i32** %6
%34 = load i32, i32* %7
%35 = load i32, i32* %11
%36 = load i32, i32* %8
%37 = load i32, i32* %9
%38 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %10
%39 = call i32 @merge(i32* %33, i32 %34, i32 %35, i32 %36, i32 %37, i32 (i8*, i8*)* %38)
br label %40
40: ; preds = %15, %5
ret i32 0
}

LLVM IR (-O2):
define i32 @msort_nnt(i32* %0, i32 %1, i32 %2, i32 %3, i32 (i8*, i8*)* %4) {
%6 = icmp ult i32 %1, %2
br i1 %6, label %8, label %7
7: ; preds = %5, %8
ret i32 0
8: ; preds = %5
%9 = add i32 %2, %1
%10 = lshr i32 %9, 1
%11 = tail call i32 @msort_nnt(i32* %0, i32 %1, i32 %10, i32 %3, i32 (i8*, i8*)* %4)
%12 = add nuw i32 %10, 1
%13 = tail call i32 @msort_nnt(i32* %0, i32 %12, i32 %2, i32 %3, i32 (i8*, i8*)* %4)
%14 = tail call i32 @merge(i32* %0, i32 %1, i32 %10, i32 %2, i32 %3, i32 (i8*, i8*)* %4)
br label %7
}