#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_binary_insertion_sort(int **, int);
int /*<<< orphan*/ stable_grail_merge_buffers_left(int **, int **, int **, int,
                                                   int, int, int, int);
int /*<<< orphan*/ stable_grail_merge_buffers_left_with_x_buf(int **, int **,
                                                              int **, int, int,
                                                              int, int);
int /*<<< orphan*/ stable_grail_swap1(int **, int **);
int /*<<< orphan*/ stable_grail_swap_n(int **, int **, int);
void stable_grail_combine_blocks(int **keys, int **arr, int len, int LL,
                                 int lblock, int havebuf, int **xbuf) {
  int M, b, NBlk, midkey, lrest, u, p, v, kc, nbl2, llast;
  int **arr1;
  M = len / (2 * LL);
  lrest = len % (2 * LL);
  if (lrest <= LL) {
    len -= lrest;
    lrest = 0;
  }
  if (xbuf) {
    memcpy(xbuf, arr - lblock, lblock * sizeof(int *));
  }
  for (b = 0; b <= M; b++) {
    if (b == M && lrest == 0) {
      break;
    }
    arr1 = arr + b * 2 * LL;
    NBlk = (b == M ? lrest : 2 * LL) / lblock;
    stable_binary_insertion_sort(keys, NBlk + (b == M ? 1 : 0));
    midkey = LL / lblock;
    for (u = 1; u < NBlk; u++) {
      p = u - 1;
      for (v = u; v < NBlk; v++) {
        kc = (*(*(arr1 + p * lblock)) - *(*(arr1 + v * lblock)));
        if (kc > 0 || (kc == 0 && (*(*(keys + p)) - *(*(keys + v))) > 0)) {
          p = v;
        }
      }
      if (p != u - 1) {
        stable_grail_swap_n(arr1 + (u - 1) * lblock, arr1 + p * lblock, lblock);
        stable_grail_swap1(keys + (u - 1), keys + p);
        if (midkey == u - 1 || midkey == p) {
          midkey ^= (u - 1) ^ p;
        }
      }
    }
    nbl2 = llast = 0;
    if (b == M) {
      llast = lrest % lblock;
    }
    if (llast != 0) {
      while (nbl2 < NBlk && (*(*(arr1 + NBlk * lblock)) -
                             *(*(arr1 + (NBlk - nbl2 - 1) * lblock))) < 0) {
        nbl2++;
      }
    }
    if (xbuf) {
      stable_grail_merge_buffers_left_with_x_buf(
          keys, keys + midkey, arr1, NBlk - nbl2, lblock, nbl2, llast);
    } else {
      stable_grail_merge_buffers_left(keys, keys + midkey, arr1, NBlk - nbl2,
                                      lblock, havebuf, nbl2, llast);
    }
  }
  if (xbuf) {
    for (p = len; --p >= 0;) {
      arr[p] = arr[p - lblock];
    }
    memcpy(arr - lblock, xbuf, lblock * sizeof(int *));
  } else if (havebuf)
    while (--len >= 0) {
      stable_grail_swap1(arr + len, arr + len - lblock);
    }
}


x86 assembly (clang, -O0):
<stable_grail_combine_blocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     11be <stable_grail_combine_blocks+0x5e>
mov    -0x34(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x34(%rbp)
cmpq   $0x0,0x10(%rbp)
je     11f0 <stable_grail_combine_blocks+0x90>
mov    0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x1c(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x3,%rax
add    %rax,%rsi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1060 <memcpy@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     1514 <stable_grail_combine_blocks+0x3b4>
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    121e <stable_grail_combine_blocks+0xbe>
cmpl   $0x0,-0x34(%rbp)
jne    121e <stable_grail_combine_blocks+0xbe>
jmp    1514 <stable_grail_combine_blocks+0x3b4>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
shl    $0x1,%ecx
imul   -0x18(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    1251 <stable_grail_combine_blocks+0xf1>
mov    -0x34(%rbp),%eax
mov    %eax,-0x5c(%rbp)
jmp    125a <stable_grail_combine_blocks+0xfa>
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x24(%rbp),%r8d
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %r8d,%edx
cmove  %ecx,%eax
add    %eax,%esi
call   1030 <stable_binary_insertion_sort@plt>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %eax,-0x30(%rbp)
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    13ea <stable_grail_combine_blocks+0x28a>
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    133b <stable_grail_combine_blocks+0x1db>
mov    -0x58(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%eax
mov    -0x58(%rbp),%rcx
mov    -0x40(%rbp),%edx
imul   -0x1c(%rbp),%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
sub    (%rcx),%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jg     1322 <stable_grail_combine_blocks+0x1c2>
cmpl   $0x0,-0x44(%rbp)
jne    1328 <stable_grail_combine_blocks+0x1c8>
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
movslq -0x40(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
sub    (%rcx),%eax
cmp    $0x0,%eax
jle    1328 <stable_grail_combine_blocks+0x1c8>
mov    -0x40(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    132d <stable_grail_combine_blocks+0x1cd>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    12b2 <stable_grail_combine_blocks+0x152>
mov    -0x3c(%rbp),%eax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     13d7 <stable_grail_combine_blocks+0x277>
mov    -0x58(%rbp),%rdi
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x58(%rbp),%rsi
mov    -0x3c(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
call   1040 <stable_grail_swap_n@plt>
mov    -0x8(%rbp),%rdi
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
call   1070 <stable_grail_swap1@plt>
mov    -0x30(%rbp),%eax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     13c3 <stable_grail_combine_blocks+0x263>
mov    -0x30(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jne    13d2 <stable_grail_combine_blocks+0x272>
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
xor    -0x3c(%rbp),%eax
xor    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    13d7 <stable_grail_combine_blocks+0x277>
jmp    13dc <stable_grail_combine_blocks+0x27c>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1297 <stable_grail_combine_blocks+0x137>
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    140e <stable_grail_combine_blocks+0x2ae>
mov    -0x34(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %edx,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     1488 <stable_grail_combine_blocks+0x328>
jmp    141d <stable_grail_combine_blocks+0x2bd>
mov    -0x48(%rbp),%ecx
xor    %eax,%eax
cmp    -0x2c(%rbp),%ecx
mov    %al,-0x5d(%rbp)
jge    1465 <stable_grail_combine_blocks+0x305>
mov    -0x58(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%eax
mov    -0x58(%rbp),%rcx
mov    -0x2c(%rbp),%edx
sub    -0x48(%rbp),%edx
sub    $0x1,%edx
imul   -0x1c(%rbp),%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
sub    (%rcx),%eax
cmp    $0x0,%eax
setl   %al
mov    %al,-0x5d(%rbp)
mov    -0x5d(%rbp),%al
test   $0x1,%al
jne    1475 <stable_grail_combine_blocks+0x315>
jmp    1483 <stable_grail_combine_blocks+0x323>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    141d <stable_grail_combine_blocks+0x2bd>
jmp    1488 <stable_grail_combine_blocks+0x328>
cmpq   $0x0,0x10(%rbp)
je     14c8 <stable_grail_combine_blocks+0x368>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x30(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x58(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
sub    -0x48(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x48(%rbp),%r9d
mov    -0x4c(%rbp),%eax
mov    %eax,(%rsp)
call   1050 <stable_grail_merge_buffers_left_with_x_buf@plt>
jmp    1501 <stable_grail_combine_blocks+0x3a1>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x30(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x58(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
sub    -0x48(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0x48(%rbp),%r10d
mov    -0x4c(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1080 <stable_grail_merge_buffers_left@plt>
jmp    1506 <stable_grail_combine_blocks+0x3a6>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11f7 <stable_grail_combine_blocks+0x97>
cmpq   $0x0,0x10(%rbp)
je     1585 <stable_grail_combine_blocks+0x425>
mov    -0x14(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
cmp    $0x0,%eax
jl     1559 <stable_grail_combine_blocks+0x3f9>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    1525 <stable_grail_combine_blocks+0x3c5>
mov    -0x10(%rbp),%rdi
movslq -0x1c(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    0x10(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1060 <memcpy@plt>
jmp    15e8 <stable_grail_combine_blocks+0x488>
cmpl   $0x0,-0x20(%rbp)
je     15e3 <stable_grail_combine_blocks+0x483>
jmp    1594 <stable_grail_combine_blocks+0x434>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     15de <stable_grail_combine_blocks+0x47e>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
movslq -0x1c(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x3,%rax
add    %rax,%rsi
call   1070 <stable_grail_swap1@plt>
jmp    1594 <stable_grail_combine_blocks+0x434>
jmp    15e3 <stable_grail_combine_blocks+0x483>
jmp    15e8 <stable_grail_combine_blocks+0x488>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stable_grail_combine_blocks>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r9d,0x18(%rsp)
mov    %r8d,%ebp
mov    %edx,%eax
mov    %rsi,%r15
mov    0xc0(%rsp),%r14
lea    (%rcx,%rcx,1),%ebx
mov    %edx,0x48(%rsp)
cltd
idiv   %ebx
mov    %eax,%r13d
xor    %eax,%eax
mov    %rcx,0x80(%rsp)
cmp    %ecx,%edx
mov    $0x0,%ecx
cmovg  %edx,%ecx
mov    %ecx,0x14(%rsp)
cmovle %edx,%eax
mov    %rax,0x68(%rsp)
movslq %r8d,%r12
test   %r14,%r14
mov    %rdi,0x8(%rsp)
je     11e3 <stable_grail_combine_blocks+0x83>
lea    0x0(,%r12,8),%rax
mov    %r15,%rsi
sub    %rax,%rsi
lea    0x0(,%r12,8),%edx
mov    %r14,%rdi
call   1060 <memcpy@plt>
mov    0x8(%rsp),%rdi
mov    %r12,0x40(%rsp)
mov    %r14,0x50(%rsp)
test   %r13d,%r13d
js     14ac <stable_grail_combine_blocks+0x34c>
mov    %r13d,%eax
mov    %rax,0x38(%rsp)
add    $0x1,%r13d
mov    %r13,0x78(%rsp)
mov    0x40(%rsp),%rax
lea    (%r15,%rax,8),%rcx
mov    %rcx,0x70(%rsp)
lea    0x0(,%rax,8),%r14
xor    %eax,%eax
mov    %rax,0x28(%rsp)
xor    %ecx,%ecx
mov    %r15,0x20(%rsp)
mov    %ebx,0x1c(%rsp)
jmp    1288 <stable_grail_combine_blocks+0x128>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
sub    $0x8,%rsp
mov    0x10(%rsp),%rdi
mov    %r13,%rdx
mov    %r12d,%ecx
mov    %ebp,%r8d
mov    %ebx,%r9d
push   %rax
call   1050 <stable_grail_merge_buffers_left_with_x_buf@plt>
mov    0x18(%rsp),%rdi
add    $0x10,%rsp
mov    0x1c(%rsp),%ebx
mov    0x30(%rsp),%rcx
add    $0x1,%rcx
mov    0x28(%rsp),%rax
add    %ebx,%eax
mov    %rax,0x28(%rsp)
cmp    0x78(%rsp),%rcx
je     14ac <stable_grail_combine_blocks+0x34c>
cmp    0x38(%rsp),%rcx
jne    129a <stable_grail_combine_blocks+0x13a>
cmpl   $0x0,0x14(%rsp)
je     14ac <stable_grail_combine_blocks+0x34c>
mov    %ebx,%eax
imul   %ecx,%eax
xor    %esi,%esi
mov    %rcx,0x30(%rsp)
cmp    0x38(%rsp),%rcx
sete   %sil
movslq %eax,%rcx
mov    %ebx,%eax
cmove  0x14(%rsp),%eax
lea    (%r15,%rcx,8),%r13
cltd
idiv   %ebp
mov    %eax,%r12d
add    %eax,%esi
call   1030 <stable_binary_insertion_sort@plt>
mov    0x80(%rsp),%rax
cltd
idiv   %ebp
mov    %eax,%r8d
cmp    $0x2,%r12d
jl     1400 <stable_grail_combine_blocks+0x2a0>
movslq 0x28(%rsp),%rax
mov    0x70(%rsp),%rcx
lea    (%rcx,%rax,8),%rdi
mov    $0x1,%r15d
mov    0x8(%rsp),%r9
jmp    1320 <stable_grail_combine_blocks+0x1c0>
nopl   (%rax)
xor    %ecx,%r8d
xor    %ebx,%r8d
mov    0x8(%rsp),%r9
mov    0x58(%rsp),%rdi
add    $0x1,%r15
add    %r14,%rdi
cmp    %r12,%r15
je     1405 <stable_grail_combine_blocks+0x2a5>
lea    -0x1(%r15),%r10
mov    %rdi,%rax
mov    %r15,%rcx
mov    %r10d,%ebx
jmp    133e <stable_grail_combine_blocks+0x1de>
nop
mov    %ecx,%ebx
add    $0x1,%rcx
add    %r14,%rax
cmp    %rcx,%r12
je     1370 <stable_grail_combine_blocks+0x210>
mov    %ebx,%edx
imul   %ebp,%edx
movslq %edx,%rdx
mov    0x0(%r13,%rdx,8),%rdx
mov    (%rdx),%edx
mov    (%rax),%rsi
sub    (%rsi),%edx
jg     1330 <stable_grail_combine_blocks+0x1d0>
jne    1332 <stable_grail_combine_blocks+0x1d2>
movslq %ebx,%rdx
mov    (%r9,%rdx,8),%rdx
mov    (%rdx),%edx
mov    (%r9,%rcx,8),%rsi
cmp    (%rsi),%edx
jg     1330 <stable_grail_combine_blocks+0x1d0>
jmp    1332 <stable_grail_combine_blocks+0x1d2>
nopl   0x0(%rax)
mov    %ebx,%eax
cmp    %rax,%r10
je     1310 <stable_grail_combine_blocks+0x1b0>
mov    %rdi,0x58(%rsp)
mov    %r10,%rax
imul   0x40(%rsp),%rax
lea    0x0(,%rax,8),%rdi
add    %r13,%rdi
mov    %ebx,%eax
imul   %ebp,%eax
cltq
lea    0x0(,%rax,8),%rsi
add    %r13,%rsi
mov    %ebp,%edx
mov    %r8d,0x4c(%rsp)
mov    %r10,0x60(%rsp)
call   1040 <stable_grail_swap_n@plt>
mov    0x60(%rsp),%rax
mov    0x8(%rsp),%rcx
lea    (%rcx,%rax,8),%rdi
movslq %ebx,%rax
lea    (%rcx,%rax,8),%rsi
call   1070 <stable_grail_swap1@plt>
mov    0x60(%rsp),%rcx
mov    0x4c(%rsp),%r8d
mov    %r8d,%eax
cmp    %rax,%rcx
je     1300 <stable_grail_combine_blocks+0x1a0>
cmp    %ebx,%r8d
jne    1306 <stable_grail_combine_blocks+0x1a6>
jmp    1300 <stable_grail_combine_blocks+0x1a0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%r9
xor    %ebx,%ebx
mov    0x30(%rsp),%rax
cmp    0x38(%rsp),%rax
jne    1470 <stable_grail_combine_blocks+0x310>
mov    0x14(%rsp),%eax
cltd
idiv   %ebp
test   %edx,%edx
je     1470 <stable_grail_combine_blocks+0x310>
mov    %edx,%eax
test   %r12d,%r12d
mov    0x20(%rsp),%r15
jle    1477 <stable_grail_combine_blocks+0x317>
mov    %r12d,%ecx
imul   %ebp,%ecx
movslq %ecx,%rcx
mov    0x0(%r13,%rcx,8),%rcx
mov    (%rcx),%ecx
lea    -0x1(%r12),%edx
imul   %ebp,%edx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq %edx,%rsi
mov    0x0(%r13,%rsi,8),%rsi
cmp    (%rsi),%ecx
jge    1477 <stable_grail_combine_blocks+0x317>
add    $0x1,%rbx
sub    %ebp,%edx
cmp    %rbx,%r12
jne    1450 <stable_grail_combine_blocks+0x2f0>
mov    %r12d,%ebx
jmp    1477 <stable_grail_combine_blocks+0x317>
nopl   0x0(%rax)
xor    %eax,%eax
mov    0x20(%rsp),%r15
sub    %ebx,%r12d
movslq %r8d,%rcx
lea    (%r9,%rcx,8),%rsi
cmpq   $0x0,0x50(%rsp)
jne    1240 <stable_grail_combine_blocks+0xe0>
mov    0x8(%rsp),%rdi
mov    %r13,%rdx
mov    %r12d,%ecx
mov    %ebp,%r8d
mov    0x18(%rsp),%r9d
push   %rax
push   %rbx
call   1080 <stable_grail_merge_buffers_left@plt>
jmp    125b <stable_grail_combine_blocks+0xfb>
mov    0x48(%rsp),%edx
mov    %edx,%eax
mov    0x68(%rsp),%r8
sub    %r8d,%eax
mov    0x50(%rsp),%rsi
test   %rsi,%rsi
je     150d <stable_grail_combine_blocks+0x3ad>
test   %eax,%eax
jle    155d <stable_grail_combine_blocks+0x3fd>
mov    %eax,%ebx
movslq %ebp,%r11
cmp    $0x4,%eax
jae    1587 <stable_grail_combine_blocks+0x427>
add    $0xffffffffffffffff,%rbx
lea    0x0(,%r11,8),%rcx
mov    %r15,%rax
sub    %rcx,%rax
nopl   0x0(%rax)
mov    (%rax,%rbx,8),%rcx
mov    %ebx,%edx
mov    %rcx,(%r15,%rdx,8)
lea    -0x1(%rbx),%rcx
add    $0x1,%rbx
cmp    $0x1,%rbx
mov    %rcx,%rbx
ja     14f0 <stable_grail_combine_blocks+0x390>
jmp    1562 <stable_grail_combine_blocks+0x402>
cmpl   $0x0,0x18(%rsp)
je     154b <stable_grail_combine_blocks+0x3eb>
test   %eax,%eax
jle    154b <stable_grail_combine_blocks+0x3eb>
movslq %ebp,%rbx
neg    %rbx
mov    %eax,%ebp
add    $0xffffffffffffffff,%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%eax
lea    (%r15,%rax,8),%rdi
lea    (%rdi,%rbx,8),%rsi
call   1070 <stable_grail_swap1@plt>
add    $0xffffffffffffffff,%rbp
lea    0x2(%rbp),%eax
cmp    $0x1,%eax
jg     1530 <stable_grail_combine_blocks+0x3d0>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x40(%rsp),%r11
shl    $0x3,%r11
sub    %r11,%r15
shl    $0x3,%ebp
mov    %r15,%rdi
mov    %ebp,%edx
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <memcpy@plt>
lea    -0x1(%rbx),%rcx
not    %r8d
add    %edx,%r8d
mov    $0x8,%edx
mov    %rcx,%rax
mul    %rdx
seto   %dl
cmp    %ecx,%r8d
jb     14da <stable_grail_combine_blocks+0x37a>
shr    $0x20,%rcx
jne    14da <stable_grail_combine_blocks+0x37a>
lea    (%r15,%r8,8),%rcx
mov    %rcx,%rdi
sub    %rax,%rdi
cmp    %rcx,%rdi
ja     14da <stable_grail_combine_blocks+0x37a>
test   %dl,%dl
jne    14da <stable_grail_combine_blocks+0x37a>
mov    %r11,%rcx
not    %rcx
add    %rbx,%rcx
lea    (%r15,%rcx,8),%rcx
mov    %rcx,%rdi
sub    %rax,%rdi
cmp    %rcx,%rdi
ja     14da <stable_grail_combine_blocks+0x37a>
test   %dl,%dl
jne    14da <stable_grail_combine_blocks+0x37a>
lea    0x1(%r8),%rax
sub    %rbx,%rax
lea    (%r15,%rax,8),%rax
mov    %rbx,%rcx
sub    %r11,%rcx
lea    (%r15,%rcx,8),%rcx
cmp    %rcx,%rax
jae    162a <stable_grail_combine_blocks+0x4ca>
lea    (%r15,%r8,8),%rax
add    $0x8,%rax
lea    0x0(,%r11,8),%rcx
mov    %r15,%rdx
sub    %rcx,%rdx
cmp    %rax,%rdx
jb     14da <stable_grail_combine_blocks+0x37a>
mov    %ebx,%r8d
and    $0xfffffffc,%r8d
lea    -0x4(%r8),%rax
mov    %rax,%r9
shr    $0x2,%r9
add    $0x1,%r9
test   %rax,%rax
je     16ed <stable_grail_combine_blocks+0x58d>
mov    %r9,%rdi
and    $0xfffffffffffffffe,%rdi
mov    $0xfffffffffffffffe,%rax
sub    %r11,%rax
lea    (%r15,%rax,8),%r10
mov    $0xffffffffffffffff,%rdx
mov    %rbx,%rax
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rax),%ecx
movups -0x10(%r10,%rax,8),%xmm0
movups (%r10,%rax,8),%xmm1
movups %xmm1,-0x8(%r15,%rcx,8)
movups %xmm0,-0x18(%r15,%rcx,8)
lea    -0x5(%rax),%ecx
movups -0x30(%r10,%rax,8),%xmm0
movups -0x20(%r10,%rax,8),%xmm1
movups %xmm1,-0x8(%r15,%rcx,8)
movups %xmm0,-0x18(%r15,%rcx,8)
add    $0xfffffffffffffff8,%rdx
add    $0xfffffffffffffff8,%rax
add    $0xfffffffffffffffe,%rdi
jne    1670 <stable_grail_combine_blocks+0x510>
test   $0x1,%r9b
je     16dc <stable_grail_combine_blocks+0x57c>
add    %rbx,%rdx
mov    %rdx,%rax
sub    %r11,%rax
movups -0x18(%r15,%rax,8),%xmm0
movups -0x8(%r15,%rax,8),%xmm1
mov    %edx,%eax
movups %xmm1,-0x8(%r15,%rax,8)
movups %xmm0,-0x18(%r15,%rax,8)
cmp    %rbx,%r8
je     1562 <stable_grail_combine_blocks+0x402>
and    $0x3,%ebx
jmp    14da <stable_grail_combine_blocks+0x37a>
mov    $0xffffffffffffffff,%rdx
test   $0x1,%r9b
jne    16b9 <stable_grail_combine_blocks+0x559>
jmp    16dc <stable_grail_combine_blocks+0x57c>

LLVM IR (-O0):
define void @stable_grail_combine_blocks(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
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = 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
%27 = load i32, i32* %10
%28 = load i32, i32* %11
%29 = mul nsw i32 2, %28
%30 = sdiv i32 %27, %29
store i32 %30, i32* %15
%31 = load i32, i32* %10
%32 = load i32, i32* %11
%33 = mul nsw i32 2, %32
%34 = srem i32 %31, %33
store i32 %34, i32* %19
%35 = load i32, i32* %19
%36 = load i32, i32* %11
%37 = icmp sle i32 %35, %36
br i1 %37, label %38, label %42
38: ; preds = %7
%39 = load i32, i32* %19
%40 = load i32, i32* %10
%41 = sub nsw i32 %40, %39
store i32 %41, i32* %10
store i32 0, i32* %19
br label %42
42: ; preds = %38, %7
%43 = load i32**, i32*** %14
%44 = icmp ne i32** %43, null
br i1 %44, label %45, label %57
45: ; preds = %42
%46 = load i32**, i32*** %14
%47 = load i32**, i32*** %9
%48 = load i32, i32* %12
%49 = sext i32 %48 to i64
%50 = sub i64 0, %49
%51 = getelementptr inbounds i32*, i32** %47, i64 %50
%52 = load i32, i32* %12
%53 = sext i32 %52 to i64
%54 = mul i64 %53, 8
%55 = trunc i64 %54 to i32
%56 = call i32 @memcpy(i32** %46, i32** %51, i32 %55)
br label %57
57: ; preds = %45, %42
store i32 0, i32* %16
br label %58
58: ; preds = %286, %57
%59 = load i32, i32* %16
%60 = load i32, i32* %15
%61 = icmp sle i32 %59, %60
br i1 %61, label %62, label %289
62: ; preds = %58
%63 = load i32, i32* %16
%64 = load i32, i32* %15
%65 = icmp eq i32 %63, %64
br i1 %65, label %66, label %70
66: ; preds = %62
%67 = load i32, i32* %19
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %66
br label %289
70: ; preds = %66, %62
%71 = load i32**, i32*** %9
%72 = load i32, i32* %16
%73 = mul nsw i32 %72, 2
%74 = load i32, i32* %11
%75 = mul nsw i32 %73, %74
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i32*, i32** %71, i64 %76
store i32** %77, i32*** %26
%78 = load i32, i32* %16
%79 = load i32, i32* %15
%80 = icmp eq i32 %78, %79
br i1 %80, label %81, label %83
81: ; preds = %70
%82 = load i32, i32* %19
br label %86
83: ; preds = %70
%84 = load i32, i32* %11
%85 = mul nsw i32 2, %84
br label %86
86: ; preds = %83, %81
%87 = phi i32 [ %82, %81 ], [ %85, %83 ]
%88 = load i32, i32* %12
%89 = sdiv i32 %87, %88
store i32 %89, i32* %17
%90 = load i32**, i32*** %8
%91 = load i32, i32* %17
%92 = load i32, i32* %16
%93 = load i32, i32* %15
%94 = icmp eq i32 %92, %93
%95 = zext i1 %94 to i64
%96 = select i1 %94, i32 1, i32 0
%97 = add nsw i32 %91, %96
%98 = call i32 @stable_binary_insertion_sort(i32** %90, i32 %97)
%99 = load i32, i32* %11
%100 = load i32, i32* %12
%101 = sdiv i32 %99, %100
store i32 %101, i32* %18
store i32 1, i32* %20
br label %102
102: ; preds = %206, %86
%103 = load i32, i32* %20
%104 = load i32, i32* %17
%105 = icmp slt i32 %103, %104
br i1 %105, label %106, label %209
106: ; preds = %102
%107 = load i32, i32* %20
%108 = sub nsw i32 %107, 1
store i32 %108, i32* %21
%109 = load i32, i32* %20
store i32 %109, i32* %22
br label %110
110: ; preds = %155, %106
%111 = load i32, i32* %22
%112 = load i32, i32* %17
%113 = icmp slt i32 %111, %112
br i1 %113, label %114, label %158
114: ; preds = %110
%115 = load i32**, i32*** %26
%116 = load i32, i32* %21
%117 = load i32, i32* %12
%118 = mul nsw i32 %116, %117
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i32*, i32** %115, i64 %119
%121 = load i32*, i32** %120
%122 = load i32, i32* %121
%123 = load i32**, i32*** %26
%124 = load i32, i32* %22
%125 = load i32, i32* %12
%126 = mul nsw i32 %124, %125
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i32*, i32** %123, i64 %127
%129 = load i32*, i32** %128
%130 = load i32, i32* %129
%131 = sub nsw i32 %122, %130
store i32 %131, i32* %23
%132 = load i32, i32* %23
%133 = icmp sgt i32 %132, 0
br i1 %133, label %152, label %134
134: ; preds = %114
%135 = load i32, i32* %23
%136 = icmp eq i32 %135, 0
br i1 %136, label %137, label %154
137: ; preds = %134
%138 = load i32**, i32*** %8
%139 = load i32, i32* %21
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i32*, i32** %138, i64 %140
%142 = load i32*, i32** %141
%143 = load i32, i32* %142
%144 = load i32**, i32*** %8
%145 = load i32, i32* %22
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i32*, i32** %144, i64 %146
%148 = load i32*, i32** %147
%149 = load i32, i32* %148
%150 = sub nsw i32 %143, %149
%151 = icmp sgt i32 %150, 0
br i1 %151, label %152, label %154
152: ; preds = %137, %114
%153 = load i32, i32* %22
store i32 %153, i32* %21
br label %154
154: ; preds = %152, %137, %134
br label %155
155: ; preds = %154
%156 = load i32, i32* %22
%157 = add nsw i32 %156, 1
store i32 %157, i32* %22
br label %110
158: ; preds = %110
%159 = load i32, i32* %21
%160 = load i32, i32* %20
%161 = sub nsw i32 %160, 1
%162 = icmp ne i32 %159, %161
br i1 %162, label %163, label %205
163: ; preds = %158
%164 = load i32**, i32*** %26
%165 = load i32, i32* %20
%166 = sub nsw i32 %165, 1
%167 = load i32, i32* %12
%168 = mul nsw i32 %166, %167
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds i32*, i32** %164, i64 %169
%171 = load i32**, i32*** %26
%172 = load i32, i32* %21
%173 = load i32, i32* %12
%174 = mul nsw i32 %172, %173
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i32*, i32** %171, i64 %175
%177 = load i32, i32* %12
%178 = call i32 @stable_grail_swap_n(i32** %170, i32** %176, i32 %177)
%179 = load i32**, i32*** %8
%180 = load i32, i32* %20
%181 = sub nsw i32 %180, 1
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds i32*, i32** %179, i64 %182
%184 = load i32**, i32*** %8
%185 = load i32, i32* %21
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds i32*, i32** %184, i64 %186
%188 = call i32 @stable_grail_swap1(i32** %183, i32** %187)
%189 = load i32, i32* %18
%190 = load i32, i32* %20
%191 = sub nsw i32 %190, 1
%192 = icmp eq i32 %189, %191
br i1 %192, label %197, label %193
193: ; preds = %163
%194 = load i32, i32* %18
%195 = load i32, i32* %21
%196 = icmp eq i32 %194, %195
br i1 %196, label %197, label %204
197: ; preds = %193, %163
%198 = load i32, i32* %20
%199 = sub nsw i32 %198, 1
%200 = load i32, i32* %21
%201 = xor i32 %199, %200
%202 = load i32, i32* %18
%203 = xor i32 %202, %201
store i32 %203, i32* %18
br label %204
204: ; preds = %197, %193
br label %205
205: ; preds = %204, %158
br label %206
206: ; preds = %205
%207 = load i32, i32* %20
%208 = add nsw i32 %207, 1
store i32 %208, i32* %20
br label %102
209: ; preds = %102
store i32 0, i32* %25
store i32 0, i32* %24
%210 = load i32, i32* %16
%211 = load i32, i32* %15
%212 = icmp eq i32 %210, %211
br i1 %212, label %213, label %217
213: ; preds = %209
%214 = load i32, i32* %19
%215 = load i32, i32* %12
%216 = srem i32 %214, %215
store i32 %216, i32* %25
br label %217
217: ; preds = %213, %209
%218 = load i32, i32* %25
%219 = icmp ne i32 %218, 0
br i1 %219, label %220, label %253
220: ; preds = %217
br label %221
221: ; preds = %249, %220
%222 = load i32, i32* %24
%223 = load i32, i32* %17
%224 = icmp slt i32 %222, %223
br i1 %224, label %225, label %247
225: ; preds = %221
%226 = load i32**, i32*** %26
%227 = load i32, i32* %17
%228 = load i32, i32* %12
%229 = mul nsw i32 %227, %228
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds i32*, i32** %226, i64 %230
%232 = load i32*, i32** %231
%233 = load i32, i32* %232
%234 = load i32**, i32*** %26
%235 = load i32, i32* %17
%236 = load i32, i32* %24
%237 = sub nsw i32 %235, %236
%238 = sub nsw i32 %237, 1
%239 = load i32, i32* %12
%240 = mul nsw i32 %238, %239
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds i32*, i32** %234, i64 %241
%243 = load i32*, i32** %242
%244 = load i32, i32* %243
%245 = sub nsw i32 %233, %244
%246 = icmp slt i32 %245, 0
br label %247
247: ; preds = %225, %221
%248 = phi i1 [ false, %221 ], [ %246, %225 ]
br i1 %248, label %249, label %252
249: ; preds = %247
%250 = load i32, i32* %24
%251 = add nsw i32 %250, 1
store i32 %251, i32* %24
br label %221
252: ; preds = %247
br label %253
253: ; preds = %252, %217
%254 = load i32**, i32*** %14
%255 = icmp ne i32** %254, null
br i1 %255, label %256, label %270
256: ; preds = %253
%257 = load i32**, i32*** %8
%258 = load i32**, i32*** %8
%259 = load i32, i32* %18
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds i32*, i32** %258, i64 %260
%262 = load i32**, i32*** %26
%263 = load i32, i32* %17
%264 = load i32, i32* %24
%265 = sub nsw i32 %263, %264
%266 = load i32, i32* %12
%267 = load i32, i32* %24
%268 = load i32, i32* %25
%269 = call i32 @stable_grail_merge_buffers_left_with_x_buf(i32** %257, i32** %261, i32** %262, i32 %265, i32 %266, i32 %267, i32 %268)
br label %285
270: ; preds = %253
%271 = load i32**, i32*** %8
%272 = load i32**, i32*** %8
%273 = load i32, i32* %18
%274 = sext i32 %273 to i64
%275 = getelementptr inbounds i32*, i32** %272, i64 %274
%276 = load i32**, i32*** %26
%277 = load i32, i32* %17
%278 = load i32, i32* %24
%279 = sub nsw i32 %277, %278
%280 = load i32, i32* %12
%281 = load i32, i32* %13
%282 = load i32, i32* %24
%283 = load i32, i32* %25
%284 = call i32 @stable_grail_merge_buffers_left(i32** %271, i32** %275, i32** %276, i32 %279, i32 %280, i32 %281, i32 %282, i32 %283)
br label %285
285: ; preds = %270, %256
br label %286
286: ; preds = %285
%287 = load i32, i32* %16
%288 = add nsw i32 %287, 1
store i32 %288, i32* %16
br label %58
289: ; preds = %69, %58
%290 = load i32**, i32*** %14
%291 = icmp ne i32** %290, null
br i1 %291, label %292, label %322
292: ; preds = %289
%293 = load i32, i32* %10
store i32 %293, i32* %21
br label %294
294: ; preds = %298, %292
%295 = load i32, i32* %21
%296 = add nsw i32 %295, -1
store i32 %296, i32* %21
%297 = icmp sge i32 %296, 0
br i1 %297, label %298, label %310
298: ; preds = %294
%299 = load i32**, i32*** %9
%300 = load i32, i32* %21
%301 = load i32, i32* %12
%302 = sub nsw i32 %300, %301
%303 = sext i32 %302 to i64
%304 = getelementptr inbounds i32*, i32** %299, i64 %303
%305 = load i32*, i32** %304
%306 = load i32**, i32*** %9
%307 = load i32, i32* %21
%308 = sext i32 %307 to i64
%309 = getelementptr inbounds i32*, i32** %306, i64 %308
store i32* %305, i32** %309
br label %294
310: ; preds = %294
%311 = load i32**, i32*** %9
%312 = load i32, i32* %12
%313 = sext i32 %312 to i64
%314 = sub i64 0, %313
%315 = getelementptr inbounds i32*, i32** %311, i64 %314
%316 = load i32**, i32*** %14
%317 = load i32, i32* %12
%318 = sext i32 %317 to i64
%319 = mul i64 %318, 8
%320 = trunc i64 %319 to i32
%321 = call i32 @memcpy(i32** %315, i32** %316, i32 %320)
br label %346
322: ; preds = %289
%323 = load i32, i32* %13
%324 = icmp ne i32 %323, 0
br i1 %324, label %325, label %345
325: ; preds = %322
br label %326
326: ; preds = %330, %325
%327 = load i32, i32* %10
%328 = add nsw i32 %327, -1
store i32 %328, i32* %10
%329 = icmp sge i32 %328, 0
br i1 %329, label %330, label %344
330: ; preds = %326
%331 = load i32**, i32*** %9
%332 = load i32, i32* %10
%333 = sext i32 %332 to i64
%334 = getelementptr inbounds i32*, i32** %331, i64 %333
%335 = load i32**, i32*** %9
%336 = load i32, i32* %10
%337 = sext i32 %336 to i64
%338 = getelementptr inbounds i32*, i32** %335, i64 %337
%339 = load i32, i32* %12
%340 = sext i32 %339 to i64
%341 = sub i64 0, %340
%342 = getelementptr inbounds i32*, i32** %338, i64 %341
%343 = call i32 @stable_grail_swap1(i32** %334, i32** %342)
br label %326
344: ; preds = %326
br label %345
345: ; preds = %344, %322
br label %346
346: ; preds = %345, %310
ret void
}

LLVM IR (-O2):
define void @stable_grail_combine_blocks(i32** %0, i32** %1, i32 %2, i32 %3, i32 %4, i32 %5, i32** %6) {
%8 = shl i32 %3, 1
%9 = sdiv i32 %2, %8
%10 = srem i32 %2, %8
%11 = icmp sgt i32 %10, %3
%12 = select i1 %11, i32 %10, i32 0
%13 = select i1 %11, i32 0, i32 %10
%14 = sub i32 %2, %13
%15 = icmp eq i32** %6, null
br i1 %15, label %22, label %16
16: ; preds = %7
%17 = sext i32 %4 to i64
%18 = sub nsw i64 0, %17
%19 = getelementptr inbounds i32*, i32** %1, i64 %18
%20 = shl i32 %4, 3
%21 = tail call i32 @memcpy(i32** %6, i32** %19, i32 %20)
br label %22
22: ; preds = %16, %7
%23 = icmp slt i32 %9, 0
br i1 %23, label %152, label %24
24: ; preds = %22
%25 = icmp eq i32 %12, 0
%26 = sext i32 %4 to i64
%27 = zext i32 %9 to i64
%28 = add nuw i32 %9, 1
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %24, %149
%31 = phi i64 [ 0, %24 ], [ %150, %149 ]
%32 = icmp eq i64 %31, %27
%33 = and i1 %32, %25
br i1 %33, label %152, label %34
34: ; preds = %30
%35 = trunc i64 %31 to i32
%36 = mul i32 %8, %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32*, i32** %1, i64 %37
%39 = select i1 %32, i32 %12, i32 %8
%40 = sdiv i32 %39, %4
%41 = zext i1 %32 to i32
%42 = add nsw i32 %40, %41
%43 = tail call i32 @stable_binary_insertion_sort(i32** %0, i32 %42)
%44 = sdiv i32 %3, %4
%45 = icmp sgt i32 %40, 1
br i1 %45, label %46, label %109
46: ; preds = %34
%47 = zext i32 %40 to i64
br label %48
48: ; preds = %105, %46
%49 = phi i64 [ 1, %46 ], [ %107, %105 ]
%50 = phi i32 [ %44, %46 ], [ %106, %105 ]
%51 = add nsw i64 %49, -1
%52 = trunc i64 %51 to i32
br label %53
53: ; preds = %48, %80
%54 = phi i64 [ %49, %48 ], [ %82, %80 ]
%55 = phi i32 [ %52, %48 ], [ %81, %80 ]
%56 = mul nsw i32 %55, %4
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32*, i32** %38, i64 %57
%59 = load i32*, i32** %58
%60 = load i32, i32* %59
%61 = mul nsw i64 %54, %26
%62 = getelementptr inbounds i32*, i32** %38, i64 %61
%63 = load i32*, i32** %62
%64 = load i32, i32* %63
%65 = sub nsw i32 %60, %64
%66 = icmp sgt i32 %65, 0
br i1 %66, label %78, label %67
67: ; preds = %53
%68 = icmp eq i32 %65, 0
br i1 %68, label %69, label %80
69: ; preds = %67
%70 = sext i32 %55 to i64
%71 = getelementptr inbounds i32*, i32** %0, i64 %70
%72 = load i32*, i32** %71
%73 = load i32, i32* %72
%74 = getelementptr inbounds i32*, i32** %0, i64 %54
%75 = load i32*, i32** %74
%76 = load i32, i32* %75
%77 = icmp sgt i32 %73, %76
br i1 %77, label %78, label %80
78: ; preds = %69, %53
%79 = trunc i64 %54 to i32
br label %80
80: ; preds = %67, %69, %78
%81 = phi i32 [ %79, %78 ], [ %55, %69 ], [ %55, %67 ]
%82 = add nuw nsw i64 %54, 1
%83 = icmp eq i64 %82, %47
br i1 %83, label %84, label %53
84: ; preds = %80
%85 = zext i32 %81 to i64
%86 = icmp eq i64 %51, %85
br i1 %86, label %105, label %87
87: ; preds = %84
%88 = mul nsw i64 %51, %26
%89 = getelementptr inbounds i32*, i32** %38, i64 %88
%90 = mul nsw i32 %81, %4
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32*, i32** %38, i64 %91
%93 = tail call i32 @stable_grail_swap_n(i32** %89, i32** %92, i32 %4)
%94 = getelementptr inbounds i32*, i32** %0, i64 %51
%95 = sext i32 %81 to i64
%96 = getelementptr inbounds i32*, i32** %0, i64 %95
%97 = tail call i32 @stable_grail_swap1(i32** %94, i32** %96)
%98 = zext i32 %50 to i64
%99 = icmp eq i64 %51, %98
%100 = icmp eq i32 %50, %81
%101 = select i1 %99, i1 true, i1 %100
br i1 %101, label %102, label %105
102: ; preds = %87
%103 = xor i32 %50, %52
%104 = xor i32 %103, %81
br label %105
105: ; preds = %87, %84, %102
%106 = phi i32 [ %104, %102 ], [ %50, %84 ], [ %50, %87 ]
%107 = add nuw nsw i64 %49, 1
%108 = icmp eq i64 %107, %47
br i1 %108, label %109, label %48
109: ; preds = %105, %34
%110 = phi i32 [ %44, %34 ], [ %106, %105 ]
br i1 %32, label %111, label %139
111: ; preds = %109
%112 = srem i32 %12, %4
%113 = icmp eq i32 %112, 0
br i1 %113, label %139, label %114
114: ; preds = %111
%115 = icmp sgt i32 %40, 0
br i1 %115, label %116, label %139
116: ; preds = %114
%117 = mul nsw i32 %40, %4
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i32*, i32** %38, i64 %118
%120 = load i32*, i32** %119
%121 = load i32, i32* %120
%122 = zext i32 %40 to i64
br label %123
123: ; preds = %116, %134
%124 = phi i64 [ 0, %116 ], [ %135, %134 ]
%125 = trunc i64 %124 to i32
%126 = xor i32 %125, -1
%127 = add i32 %40, %126
%128 = mul nsw i32 %127, %4
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i32*, i32** %38, i64 %129
%131 = load i32*, i32** %130
%132 = load i32, i32* %131
%133 = icmp slt i32 %121, %132
br i1 %133, label %134, label %137
134: ; preds = %123
%135 = add nuw nsw i64 %124, 1
%136 = icmp eq i64 %135, %122
br i1 %136, label %139, label %123
137: ; preds = %123
%138 = trunc i64 %124 to i32
br label %139
139: ; preds = %134, %137, %114, %109, %111
%140 = phi i32 [ 0, %111 ], [ 0, %109 ], [ %112, %114 ], [ %112, %137 ], [ %112, %134 ]
%141 = phi i32 [ 0, %111 ], [ 0, %109 ], [ 0, %114 ], [ %138, %137 ], [ %40, %134 ]
%142 = sext i32 %110 to i64
%143 = getelementptr inbounds i32*, i32** %0, i64 %142
%144 = sub nsw i32 %40, %141
br i1 %15, label %147, label %145
145: ; preds = %139
%146 = tail call i32 @stable_grail_merge_buffers_left_with_x_buf(i32** %0, i32** %143, i32** %38, i32 %144, i32 %4, i32 %141, i32 %140)
br label %149
147: ; preds = %139
%148 = tail call i32 @stable_grail_merge_buffers_left(i32** %0, i32** %143, i32** %38, i32 %144, i32 %4, i32 %5, i32 %141, i32 %140)
br label %149
149: ; preds = %145, %147
%150 = add nuw nsw i64 %31, 1
%151 = icmp eq i64 %150, %29
br i1 %151, label %152, label %30
152: ; preds = %149, %30, %22
br i1 %15, label %302, label %153
153: ; preds = %152
%154 = icmp sgt i32 %14, 0
br i1 %154, label %157, label %155
155: ; preds = %153
%156 = sext i32 %4 to i64
br label %296
157: ; preds = %153
%158 = zext i32 %14 to i64
%159 = sext i32 %4 to i64
%160 = icmp ult i32 %14, 4
br i1 %160, label %285, label %161
161: ; preds = %157
%162 = add nsw i64 %158, -1
%163 = xor i32 %13, -1
%164 = add i32 %163, %2
%165 = trunc i64 %162 to i32
%166 = icmp ult i32 %164, %165
%167 = icmp ugt i64 %162, 4294967295
%168 = or i1 %166, %167
%169 = zext i32 %164 to i64
%170 = getelementptr i32*, i32** %1, i64 %169
%171 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %162, i64 8)
%172 = extractvalue { i64, i1 } %171, 0
%173 = extractvalue { i64, i1 } %171, 1
%174 = bitcast i32** %170 to i8*
%175 = sub i64 0, %172
%176 = getelementptr i8, i8* %174, i64 %175
%177 = icmp ugt i8* %176, %174
%178 = or i1 %177, %173
%179 = xor i64 %159, -1
%180 = add nsw i64 %179, %158
%181 = getelementptr i32*, i32** %1, i64 %180
%182 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %162, i64 8)
%183 = extractvalue { i64, i1 } %182, 0
%184 = extractvalue { i64, i1 } %182, 1
%185 = bitcast i32** %181 to i8*
%186 = sub i64 0, %183
%187 = getelementptr i8, i8* %185, i64 %186
%188 = icmp ugt i8* %187, %185
%189 = or i1 %188, %184
%190 = or i1 %168, %178
%191 = or i1 %190, %189
br i1 %191, label %285, label %192
192: ; preds = %161
%193 = xor i32 %13, -1
%194 = add i32 %193, %2
%195 = zext i32 %194 to i64
%196 = add nuw nsw i64 %195, 1
%197 = sub nsw i64 %196, %158
%198 = getelementptr i32*, i32** %1, i64 %197
%199 = add nuw nsw i64 %195, 1
%200 = getelementptr i32*, i32** %1, i64 %199
%201 = sub nsw i64 0, %159
%202 = getelementptr i32*, i32** %1, i64 %201
%203 = sub nsw i64 %158, %159
%204 = getelementptr i32*, i32** %1, i64 %203
%205 = icmp ult i32** %198, %204
%206 = icmp ult i32** %202, %200
%207 = and i1 %205, %206
br i1 %207, label %285, label %208
208: ; preds = %192
%209 = and i64 %158, 4294967292
%210 = and i64 %158, 3
%211 = add nsw i64 %209, -4
%212 = lshr exact i64 %211, 2
%213 = add nuw nsw i64 %212, 1
%214 = and i64 %213, 1
%215 = icmp eq i64 %211, 0
br i1 %215, label %262, label %216
216: ; preds = %208
%217 = and i64 %213, 9223372036854775806
br label %218
218: ; preds = %218, %216
%219 = phi i64 [ 0, %216 ], [ %257, %218 ]
%220 = phi i64 [ 0, %216 ], [ %258, %218 ]
%221 = xor i64 %219, -1
%222 = add i64 %221, %158
%223 = sub nsw i64 %222, %159
%224 = getelementptr inbounds i32*, i32** %1, i64 %223
%225 = getelementptr inbounds i32*, i32** %224, i64 -1
%226 = bitcast i32** %225 to <2 x i32*>*
%227 = load <2 x i32*>, <2 x i32*>* %226
%228 = getelementptr inbounds i32*, i32** %224, i64 -2
%229 = getelementptr inbounds i32*, i32** %228, i64 -1
%230 = bitcast i32** %229 to <2 x i32*>*
%231 = load <2 x i32*>, <2 x i32*>* %230
%232 = and i64 %222, 4294967295
%233 = getelementptr inbounds i32*, i32** %1, i64 %232
%234 = getelementptr inbounds i32*, i32** %233, i64 -1
%235 = bitcast i32** %234 to <2 x i32*>*
store <2 x i32*> %227, <2 x i32*>* %235
%236 = getelementptr inbounds i32*, i32** %233, i64 -2
%237 = getelementptr inbounds i32*, i32** %236, i64 -1
%238 = bitcast i32** %237 to <2 x i32*>*
store <2 x i32*> %231, <2 x i32*>* %238
%239 = sub nuw nsw i64 -5, %219
%240 = add i64 %239, %158
%241 = sub nsw i64 %240, %159
%242 = getelementptr inbounds i32*, i32** %1, i64 %241
%243 = getelementptr inbounds i32*, i32** %242, i64 -1
%244 = bitcast i32** %243 to <2 x i32*>*
%245 = load <2 x i32*>, <2 x i32*>* %244
%246 = getelementptr inbounds i32*, i32** %242, i64 -2
%247 = getelementptr inbounds i32*, i32** %246, i64 -1
%248 = bitcast i32** %247 to <2 x i32*>*
%249 = load <2 x i32*>, <2 x i32*>* %248
%250 = and i64 %240, 4294967295
%251 = getelementptr inbounds i32*, i32** %1, i64 %250
%252 = getelementptr inbounds i32*, i32** %251, i64 -1
%253 = bitcast i32** %252 to <2 x i32*>*
store <2 x i32*> %245, <2 x i32*>* %253
%254 = getelementptr inbounds i32*, i32** %251, i64 -2
%255 = getelementptr inbounds i32*, i32** %254, i64 -1
%256 = bitcast i32** %255 to <2 x i32*>*
store <2 x i32*> %249, <2 x i32*>* %256
%257 = add nuw i64 %219, 8
%258 = add i64 %220, 2
%259 = icmp eq i64 %258, %217
br i1 %259, label %260, label %218
260: ; preds = %218
%261 = sub i64 -9, %219
br label %262
262: ; preds = %260, %208
%263 = phi i64 [ -1, %208 ], [ %261, %260 ]
%264 = icmp eq i64 %214, 0
br i1 %264, label %283, label %265
265: ; preds = %262
%266 = add i64 %263, %158
%267 = sub nsw i64 %266, %159
%268 = getelementptr inbounds i32*, i32** %1, i64 %267
%269 = getelementptr inbounds i32*, i32** %268, i64 -1
%270 = bitcast i32** %269 to <2 x i32*>*
%271 = load <2 x i32*>, <2 x i32*>* %270
%272 = getelementptr inbounds i32*, i32** %268, i64 -2
%273 = getelementptr inbounds i32*, i32** %272, i64 -1
%274 = bitcast i32** %273 to <2 x i32*>*
%275 = load <2 x i32*>, <2 x i32*>* %274
%276 = and i64 %266, 4294967295
%277 = getelementptr inbounds i32*, i32** %1, i64 %276
%278 = getelementptr inbounds i32*, i32** %277, i64 -1
%279 = bitcast i32** %278 to <2 x i32*>*
store <2 x i32*> %271, <2 x i32*>* %279
%280 = getelementptr inbounds i32*, i32** %277, i64 -2
%281 = getelementptr inbounds i32*, i32** %280, i64 -1
%282 = bitcast i32** %281 to <2 x i32*>*
store <2 x i32*> %275, <2 x i32*>* %282
br label %283
283: ; preds = %262, %265
%284 = icmp eq i64 %209, %158
br i1 %284, label %296, label %285
285: ; preds = %192, %161, %157, %283
%286 = phi i64 [ %158, %192 ], [ %158, %161 ], [ %158, %157 ], [ %210, %283 ]
br label %287
287: ; preds = %285, %287
%288 = phi i64 [ %289, %287 ], [ %286, %285 ]
%289 = add nsw i64 %288, -1
%290 = sub nsw i64 %289, %159
%291 = getelementptr inbounds i32*, i32** %1, i64 %290
%292 = load i32*, i32** %291
%293 = and i64 %289, 4294967295
%294 = getelementptr inbounds i32*, i32** %1, i64 %293
store i32* %292, i32** %294
%295 = icmp ugt i64 %288, 1
br i1 %295, label %287, label %296
296: ; preds = %287, %283, %155
%297 = phi i64 [ %156, %155 ], [ %159, %283 ], [ %159, %287 ]
%298 = sub nsw i64 0, %297
%299 = getelementptr inbounds i32*, i32** %1, i64 %298
%300 = shl i32 %4, 3
%301 = tail call i32 @memcpy(i32** %299, i32** %6, i32 %300)
br label %319
302: ; preds = %152
%303 = icmp ne i32 %5, 0
%304 = icmp sgt i32 %14, 0
%305 = and i1 %303, %304
br i1 %305, label %306, label %319
306: ; preds = %302
%307 = sext i32 %4 to i64
%308 = sub nsw i64 0, %307
%309 = zext i32 %14 to i64
br label %310
310: ; preds = %306, %310
%311 = phi i64 [ %309, %306 ], [ %312, %310 ]
%312 = add nsw i64 %311, -1
%313 = and i64 %312, 4294967295
%314 = getelementptr inbounds i32*, i32** %1, i64 %313
%315 = getelementptr inbounds i32*, i32** %314, i64 %308
%316 = tail call i32 @stable_grail_swap1(i32** %314, i32** %315)
%317 = trunc i64 %311 to i32
%318 = icmp sgt i32 %317, 1
br i1 %318, label %310, label %319
319: ; preds = %310, %302, %296
ret void
}