#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*/ insertion_sort(int *, int *);
int *seqpart(int *, int *);
void seqquick(int *low, int *high) {
  while (high - low > 20) {
    int *p = seqpart(low, high);
    seqquick(low, p);
    low = p + 1;
  }
  insertion_sort(low, high);
}


x86 assembly (clang, -O0):
<seqquick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x14,%rax
jle    1188 <seqquick+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <seqpart@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <seqquick@plt>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1140 <seqquick+0x10>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <insertion_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seqquick>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rax
sub    %rdi,%rax
cmp    $0x51,%rax
jl     117e <seqquick+0x4e>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <seqpart@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <seqquick@plt>
add    $0x4,%rbx
mov    %r14,%rax
sub    %rbx,%rax
mov    %rbx,%r15
cmp    $0x50,%rax
jg     1150 <seqquick+0x20>
jmp    1181 <seqquick+0x51>
mov    %r15,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <insertion_sort@plt>

LLVM IR (-O0):
define void @seqquick(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %14, %2
%7 = load i32*, i32** %4
%8 = load i32*, i32** %3
%9 = ptrtoint i32* %7 to i64
%10 = ptrtoint i32* %8 to i64
%11 = sub i64 %9, %10
%12 = sdiv exact i64 %11, 4
%13 = icmp sgt i64 %12, 20
br i1 %13, label %14, label %22
14: ; preds = %6
%15 = load i32*, i32** %3
%16 = load i32*, i32** %4
%17 = call i32* @seqpart(i32* %15, i32* %16)
store i32* %17, i32** %5
%18 = load i32*, i32** %3
%19 = load i32*, i32** %5
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 1
store i32* %21, i32** %3
br label %6
22: ; preds = %6
%23 = load i32*, i32** %3
%24 = load i32*, i32** %4
%25 = call i32 @insertion_sort(i32* %23, i32* %24)
ret void
}

LLVM IR (-O2):
define void @seqquick(i32* %0, i32* %1) {
%3 = ptrtoint i32* %1 to i64
%4 = ptrtoint i32* %0 to i64
%5 = sub i64 %3, %4
%6 = icmp sgt i64 %5, 80
br i1 %6, label %7, label %14
7: ; preds = %2, %7
%8 = phi i32* [ %10, %7 ], [ %0, %2 ]
%9 = tail call i32* @seqpart(i32* %8, i32* %1)
tail call void @seqquick(i32* %8, i32* %9)
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = ptrtoint i32* %10 to i64
%12 = sub i64 %3, %11
%13 = icmp sgt i64 %12, 80
br i1 %13, label %7, label %14
14: ; preds = %7, %2
%15 = phi i32* [ %0, %2 ], [ %10, %7 ]
%16 = tail call i32 @insertion_sort(i32* %15, i32* %1)
ret void
}