#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*/ memcpy(int **, int **, int);
int /*<<< orphan*/ stable_sqrt_sort_merge_left_with_x_buf(int **, int, int,
                                                          int);
int /*<<< orphan*/ stable_sqrt_sort_smart_merge_with_x_buf(int **, int *, int *,
                                                           int, int);
void stable_sqrt_sort_merge_buffers_left_with_x_buf(int *keys, int midkey,
                                                    int **arr, int nblock,
                                                    int lblock, int nblock2,
                                                    int llast) {
  int l, prest, lrest, frest, pidx, cidx, fnext, plast;
  if (nblock == 0) {
    l = nblock2 * lblock;
    stable_sqrt_sort_merge_left_with_x_buf(arr, l, llast, -lblock);
    return;
  }
  lrest = lblock;
  frest = keys[0] < midkey ? 0 : 1;
  pidx = lblock;
  for (cidx = 1; cidx < nblock; cidx++, pidx += lblock) {
    prest = pidx - lrest;
    fnext = keys[cidx] < midkey ? 0 : 1;
    if (fnext == frest) {
      memcpy(arr + prest - lblock, arr + prest, lrest * sizeof(int *));
      prest = pidx;
      lrest = lblock;
    } else {
      stable_sqrt_sort_smart_merge_with_x_buf(arr + prest, &lrest, &frest,
                                              lblock, lblock);
    }
  }
  prest = pidx - lrest;
  if (llast) {
    plast = pidx + lblock * nblock2;
    if (frest) {
      memcpy(arr + prest - lblock, arr + prest, lrest * sizeof(int *));
      prest = pidx;
      lrest = lblock * nblock2;
      frest = 0;
    } else {
      lrest += lblock * nblock2;
    }
    stable_sqrt_sort_merge_left_with_x_buf(arr + prest, lrest, llast, -lblock);
  } else {
    memcpy(arr + prest - lblock, arr + prest, lrest * sizeof(int *));
  }
}


x86 assembly (clang, -O0):
<stable_sqrt_sort_merge_buffers_left_with_x_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    117e <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x4e>
mov    -0x24(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    0x10(%rbp),%edx
xor    %ecx,%ecx
sub    -0x20(%rbp),%ecx
call   1030 <stable_sqrt_sort_merge_left_with_x_buf@plt>
jmp    1367 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x237>
mov    -0x20(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x38(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1274 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x144>
mov    -0x38(%rbp),%eax
sub    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0xc(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x34(%rbp),%eax
jne    1235 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x105>
mov    -0x18(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
movslq -0x20(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
movslq -0x30(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    1258 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x128>
mov    -0x18(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    -0x30(%rbp),%rsi
lea    -0x34(%rbp),%rdx
call   1040 <stable_sqrt_sort_smart_merge_with_x_buf@plt>
jmp    125d <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x12d>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    11a9 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x79>
mov    -0x38(%rbp),%eax
sub    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,0x10(%rbp)
je     132a <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x1fa>
mov    -0x38(%rbp),%eax
mov    -0x20(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     12f9 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x1c9>
mov    -0x18(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
movslq -0x20(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
movslq -0x30(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
imul   -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
jmp    1306 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x1d6>
mov    -0x20(%rbp),%eax
imul   -0x24(%rbp),%eax
add    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x30(%rbp),%esi
mov    0x10(%rbp),%edx
xor    %ecx,%ecx
sub    -0x20(%rbp),%ecx
call   1030 <stable_sqrt_sort_merge_left_with_x_buf@plt>
jmp    1367 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x237>
mov    -0x18(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
movslq -0x20(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
movslq -0x30(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stable_sqrt_sort_merge_buffers_left_with_x_buf>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9d,%ebx
mov    0x70(%rsp),%r13d
test   %ecx,%ecx
je     1243 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x113>
mov    %rdi,%rbp
mov    %rdx,0x10(%rsp)
mov    %r8d,0x8(%rsp)
xor    %eax,%eax
cmp    %esi,(%rdi)
setge  %al
mov    %eax,0xc(%rsp)
mov    %r8d,%edx
mov    %r8d,%r14d
cmp    $0x2,%ecx
mov    %r8,0x18(%rsp)
jl     1271 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x141>
mov    %r13d,0x20(%rsp)
mov    %ebx,0x24(%rsp)
movslq %r8d,%rdx
mov    %ecx,%ecx
add    $0xfffffffffffffffe,%rcx
mov    %rcx,0x28(%rsp)
shl    $0x3,%rdx
mov    %rdx,0x30(%rsp)
lea    (%r8,%r8,1),%r14d
xor    %r13d,%r13d
mov    0x10(%rsp),%rdi
mov    %r8d,%edx
nopl   0x0(%rax)
xor    %ebx,%ebx
mov    %esi,%r15d
mov    %rbp,%r12
cmp    %esi,0x4(%rbp,%r13,4)
setge  %bl
movslq %edx,%rcx
shl    $0x3,%rcx
mov    0x30(%rsp),%rsi
lea    (%rdi,%rsi,1),%rbp
mov    %rbp,%rsi
sub    %rcx,%rsi
cmp    %ebx,%eax
jne    1200 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0xd0>
sub    %rcx,%rdi
shl    $0x3,%edx
call   1050 <memcpy@plt>
mov    0x18(%rsp),%r8
mov    %r8d,0x8(%rsp)
jmp    121f <stable_sqrt_sort_merge_buffers_left_with_x_buf+0xef>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rsi,%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r8d,%ecx
mov    0x18(%rsp),%r8
call   1040 <stable_sqrt_sort_smart_merge_with_x_buf@plt>
mov    0x18(%rsp),%r8
mov    0x8(%rsp),%edx
cmp    %r13,0x28(%rsp)
je     1268 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x138>
mov    0xc(%rsp),%eax
add    $0x1,%r13
add    %r8d,%r14d
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r12,%rbp
jmp    11b0 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x80>
imul   %r8d,%ebx
neg    %r8d
mov    %rdx,%rdi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r8d,%ecx
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <stable_sqrt_sort_merge_left_with_x_buf@plt>
mov    0x24(%rsp),%ebx
mov    0x20(%rsp),%r13d
mov    %r14d,%eax
sub    %edx,%eax
test   %r13d,%r13d
je     12b9 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x189>
imul   %r8d,%ebx
cmpl   $0x0,0xc(%rsp)
je     12db <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x1ab>
cltq
mov    0x10(%rsp),%r15
lea    (%r15,%rax,8),%rsi
movslq %r8d,%rax
shl    $0x3,%rax
mov    %rsi,%rdi
sub    %rax,%rdi
shl    $0x3,%edx
call   1050 <memcpy@plt>
mov    0x18(%rsp),%r8
mov    %ebx,0x8(%rsp)
movl   $0x0,0xc(%rsp)
jmp    12e9 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x1b9>
cltq
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,8),%rsi
movslq %r8d,%rax
shl    $0x3,%rax
mov    %rsi,%rdi
sub    %rax,%rdi
shl    $0x3,%edx
call   1050 <memcpy@plt>
jmp    1300 <stable_sqrt_sort_merge_buffers_left_with_x_buf+0x1d0>
add    %edx,%ebx
mov    %ebx,0x8(%rsp)
mov    %eax,%r14d
mov    0x10(%rsp),%r15
movslq %r14d,%rax
lea    (%r15,%rax,8),%rdi
neg    %r8d
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r8d,%ecx
call   1030 <stable_sqrt_sort_merge_left_with_x_buf@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @stable_sqrt_sort_merge_buffers_left_with_x_buf(i32* %0, i32 %1, i32** %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32**
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32* %0, i32** %8
store i32 %1, i32* %9
store i32** %2, i32*** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%23 = load i32, i32* %11
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %35
25: ; preds = %7
%26 = load i32, i32* %13
%27 = load i32, i32* %12
%28 = mul nsw i32 %26, %27
store i32 %28, i32* %15
%29 = load i32**, i32*** %10
%30 = load i32, i32* %15
%31 = load i32, i32* %14
%32 = load i32, i32* %12
%33 = sub nsw i32 0, %32
%34 = call i32 @stable_sqrt_sort_merge_left_with_x_buf(i32** %29, i32 %30, i32 %31, i32 %33)
br label %170
35: ; preds = %7
%36 = load i32, i32* %12
store i32 %36, i32* %17
%37 = load i32*, i32** %8
%38 = getelementptr inbounds i32, i32* %37, i64 0
%39 = load i32, i32* %38
%40 = load i32, i32* %9
%41 = icmp slt i32 %39, %40
%42 = zext i1 %41 to i64
%43 = select i1 %41, i32 0, i32 1
store i32 %43, i32* %18
%44 = load i32, i32* %12
store i32 %44, i32* %19
store i32 1, i32* %20
br label %45
45: ; preds = %94, %35
%46 = load i32, i32* %20
%47 = load i32, i32* %11
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %100
49: ; preds = %45
%50 = load i32, i32* %19
%51 = load i32, i32* %17
%52 = sub nsw i32 %50, %51
store i32 %52, i32* %16
%53 = load i32*, i32** %8
%54 = load i32, i32* %20
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %53, i64 %55
%57 = load i32, i32* %56
%58 = load i32, i32* %9
%59 = icmp slt i32 %57, %58
%60 = zext i1 %59 to i64
%61 = select i1 %59, i32 0, i32 1
store i32 %61, i32* %21
%62 = load i32, i32* %21
%63 = load i32, i32* %18
%64 = icmp eq i32 %62, %63
br i1 %64, label %65, label %85
65: ; preds = %49
%66 = load i32**, i32*** %10
%67 = load i32, i32* %16
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32*, i32** %66, i64 %68
%70 = load i32, i32* %12
%71 = sext i32 %70 to i64
%72 = sub i64 0, %71
%73 = getelementptr inbounds i32*, i32** %69, i64 %72
%74 = load i32**, i32*** %10
%75 = load i32, i32* %16
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i32*, i32** %74, i64 %76
%78 = load i32, i32* %17
%79 = sext i32 %78 to i64
%80 = mul i64 %79, 8
%81 = trunc i64 %80 to i32
%82 = call i32 @memcpy(i32** %73, i32** %77, i32 %81)
%83 = load i32, i32* %19
store i32 %83, i32* %16
%84 = load i32, i32* %12
store i32 %84, i32* %17
br label %93
85: ; preds = %49
%86 = load i32**, i32*** %10
%87 = load i32, i32* %16
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i32*, i32** %86, i64 %88
%90 = load i32, i32* %12
%91 = load i32, i32* %12
%92 = call i32 @stable_sqrt_sort_smart_merge_with_x_buf(i32** %89, i32* %17, i32* %18, i32 %90, i32 %91)
br label %93
93: ; preds = %85, %65
br label %94
94: ; preds = %93
%95 = load i32, i32* %20
%96 = add nsw i32 %95, 1
store i32 %96, i32* %20
%97 = load i32, i32* %12
%98 = load i32, i32* %19
%99 = add nsw i32 %98, %97
store i32 %99, i32* %19
br label %45
100: ; preds = %45
%101 = load i32, i32* %19
%102 = load i32, i32* %17
%103 = sub nsw i32 %101, %102
store i32 %103, i32* %16
%104 = load i32, i32* %14
%105 = icmp ne i32 %104, 0
br i1 %105, label %106, label %152
106: ; preds = %100
%107 = load i32, i32* %19
%108 = load i32, i32* %12
%109 = load i32, i32* %13
%110 = mul nsw i32 %108, %109
%111 = add nsw i32 %107, %110
store i32 %111, i32* %22
%112 = load i32, i32* %18
%113 = icmp ne i32 %112, 0
br i1 %113, label %114, label %136
114: ; preds = %106
%115 = load i32**, i32*** %10
%116 = load i32, i32* %16
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i32*, i32** %115, i64 %117
%119 = load i32, i32* %12
%120 = sext i32 %119 to i64
%121 = sub i64 0, %120
%122 = getelementptr inbounds i32*, i32** %118, i64 %121
%123 = load i32**, i32*** %10
%124 = load i32, i32* %16
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds i32*, i32** %123, i64 %125
%127 = load i32, i32* %17
%128 = sext i32 %127 to i64
%129 = mul i64 %128, 8
%130 = trunc i64 %129 to i32
%131 = call i32 @memcpy(i32** %122, i32** %126, i32 %130)
%132 = load i32, i32* %19
store i32 %132, i32* %16
%133 = load i32, i32* %12
%134 = load i32, i32* %13
%135 = mul nsw i32 %133, %134
store i32 %135, i32* %17
store i32 0, i32* %18
br label %142
136: ; preds = %106
%137 = load i32, i32* %12
%138 = load i32, i32* %13
%139 = mul nsw i32 %137, %138
%140 = load i32, i32* %17
%141 = add nsw i32 %140, %139
store i32 %141, i32* %17
br label %142
142: ; preds = %136, %114
%143 = load i32**, i32*** %10
%144 = load i32, i32* %16
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds i32*, i32** %143, i64 %145
%147 = load i32, i32* %17
%148 = load i32, i32* %14
%149 = load i32, i32* %12
%150 = sub nsw i32 0, %149
%151 = call i32 @stable_sqrt_sort_merge_left_with_x_buf(i32** %146, i32 %147, i32 %148, i32 %150)
br label %170
152: ; preds = %100
%153 = load i32**, i32*** %10
%154 = load i32, i32* %16
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i32*, i32** %153, i64 %155
%157 = load i32, i32* %12
%158 = sext i32 %157 to i64
%159 = sub i64 0, %158
%160 = getelementptr inbounds i32*, i32** %156, i64 %159
%161 = load i32**, i32*** %10
%162 = load i32, i32* %16
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds i32*, i32** %161, i64 %163
%165 = load i32, i32* %17
%166 = sext i32 %165 to i64
%167 = mul i64 %166, 8
%168 = trunc i64 %167 to i32
%169 = call i32 @memcpy(i32** %160, i32** %164, i32 %168)
br label %170
170: ; preds = %25, %152, %142
ret void
}

LLVM IR (-O2):
define void @stable_sqrt_sort_merge_buffers_left_with_x_buf(i32* nocapture %0, i32 %1, i32** %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = bitcast i32* %8 to i8*
%11 = bitcast i32* %9 to i8*
%12 = icmp eq i32 %3, 0
br i1 %12, label %13, label %17
13: ; preds = %7
%14 = mul nsw i32 %5, %4
%15 = sub nsw i32 0, %4
%16 = tail call i32 @stable_sqrt_sort_merge_left_with_x_buf(i32** %2, i32 %14, i32 %6, i32 %15)
br label %86
17: ; preds = %7
store i32 %4, i32* %8
%18 = load i32, i32* %0
%19 = icmp sge i32 %18, %1
%20 = zext i1 %19 to i32
store i32 %20, i32* %9
%21 = icmp sgt i32 %3, 1
br i1 %21, label %22, label %52
22: ; preds = %17
%23 = sext i32 %4 to i64
%24 = sub nsw i64 0, %23
%25 = zext i32 %3 to i64
br label %26
26: ; preds = %50, %22
%27 = phi i32 [ %20, %22 ], [ %51, %50 ]
%28 = phi i32 [ %4, %22 ], [ %49, %50 ]
%29 = phi i64 [ 1, %22 ], [ %46, %50 ]
%30 = phi i32 [ %4, %22 ], [ %47, %50 ]
%31 = sub nsw i32 %30, %28
%32 = getelementptr inbounds i32, i32* %0, i64 %29
%33 = load i32, i32* %32
%34 = icmp sge i32 %33, %1
%35 = zext i1 %34 to i32
%36 = icmp eq i32 %27, %35
%37 = sext i32 %31 to i64
%38 = getelementptr inbounds i32*, i32** %2, i64 %37
br i1 %36, label %39, label %43
39: ; preds = %26
%40 = getelementptr inbounds i32*, i32** %38, i64 %24
%41 = shl i32 %28, 3
%42 = call i32 @memcpy(i32** %40, i32** %38, i32 %41)
store i32 %4, i32* %8
br label %45
43: ; preds = %26
%44 = call i32 @stable_sqrt_sort_smart_merge_with_x_buf(i32** %38, i32* %8, i32* %9, i32 %4, i32 %4)
br label %45
45: ; preds = %39, %43
%46 = add nuw nsw i64 %29, 1
%47 = add nsw i32 %30, %4
%48 = icmp eq i64 %46, %25
%49 = load i32, i32* %8
br i1 %48, label %52, label %50
50: ; preds = %45
%51 = load i32, i32* %9
br label %26
52: ; preds = %45, %17
%53 = phi i32 [ %4, %17 ], [ %49, %45 ]
%54 = phi i32 [ %4, %17 ], [ %47, %45 ]
%55 = sub nsw i32 %54, %53
%56 = icmp eq i32 %6, 0
br i1 %56, label %78, label %57
57: ; preds = %52
%58 = mul nsw i32 %5, %4
%59 = load i32, i32* %9
%60 = icmp eq i32 %59, 0
br i1 %60, label %69, label %61
61: ; preds = %57
%62 = sext i32 %55 to i64
%63 = getelementptr inbounds i32*, i32** %2, i64 %62
%64 = sext i32 %4 to i64
%65 = sub nsw i64 0, %64
%66 = getelementptr inbounds i32*, i32** %63, i64 %65
%67 = shl i32 %53, 3
%68 = call i32 @memcpy(i32** %66, i32** %63, i32 %67)
store i32 %58, i32* %8
store i32 0, i32* %9
br label %71
69: ; preds = %57
%70 = add nsw i32 %53, %58
store i32 %70, i32* %8
br label %71
71: ; preds = %69, %61
%72 = phi i32 [ %58, %61 ], [ %70, %69 ]
%73 = phi i32 [ %54, %61 ], [ %55, %69 ]
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i32*, i32** %2, i64 %74
%76 = sub nsw i32 0, %4
%77 = call i32 @stable_sqrt_sort_merge_left_with_x_buf(i32** %75, i32 %72, i32 %6, i32 %76)
br label %86
78: ; preds = %52
%79 = sext i32 %55 to i64
%80 = getelementptr inbounds i32*, i32** %2, i64 %79
%81 = sext i32 %4 to i64
%82 = sub nsw i64 0, %81
%83 = getelementptr inbounds i32*, i32** %80, i64 %82
%84 = shl i32 %53, 3
%85 = call i32 @memcpy(i32** %83, i32** %80, i32 %84)
br label %86
86: ; preds = %71, %78, %13
ret void
}