#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*/ printArray(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ shellSort(int *, int);
void test_shellSort(void) {
  printf("TEST: shellSort\n");
  int test[] = {81, 94, 11, 96, 12, 35, 17, 95, 28, 58, 41, 75, 15};
  printf("Befor shellSort: ");
  printArray(test, 13);
  shellSort(test, 13);
  printf("After shellSort: ");
  printArray(test, 13);
}


x86 assembly (clang, -O0):
<test_shellSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    0xee1(%rip),%rsi
mov    $0x34,%edx
call   1050 <memcpy@plt>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0xd,%esi
call   1060 <printArray@plt>
lea    -0x40(%rbp),%rdi
mov    $0xd,%esi
call   1030 <shellSort@plt>
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0xd,%esi
call   1060 <printArray@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_shellSort>:
push   %rbx
sub    $0x40,%rsp
lea    0xf0c(%rip),%rdi
call   1040 <puts@plt>
mov    0xed9(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe86(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeaf(%rip),%rdi
call   1050 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xd,%esi
call   1060 <printArray@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <shellSort@plt>
lea    0xe98(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1060 <printArray@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"TEST: shellSort\0A\00"
@__const.test_shellSort.test = [13 x i32] [i32 81, i32 94, i32 11, i32 96, i32 12, i32 35, i32 17, i32 95, i32 28, i32 58, i32 41, i32 75, i32 15]
@.str.1 = [18 x i8] c"Befor shellSort: \00"
@.str.2 = [18 x i8] c"After shellSort: \00"
define void @test_shellSort() {
%1 = alloca [13 x i32]
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = bitcast [13 x i32]* %1 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%6 = call i32 @printArray(i32* %5, i32 13)
%7 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%8 = call i32 @shellSort(i32* %7, i32 13)
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%11 = call i32 @printArray(i32* %10, i32 13)
ret void
}

LLVM IR (-O2):
@__const.test_shellSort.test = [13 x i32] [i32 81, i32 94, i32 11, i32 96, i32 12, i32 35, i32 17, i32 95, i32 28, i32 58, i32 41, i32 75, i32 15]
@.str.1 = [18 x i8] c"Befor shellSort: \00"
@.str.2 = [18 x i8] c"After shellSort: \00"
@str = [16 x i8] c"TEST: shellSort\00"
define void @test_shellSort() {
%1 = alloca [13 x i32]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = bitcast [13 x i32]* %1 to i8*
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%6 = call i32 @printArray(i32* %5, i32 13)
%7 = call i32 @shellSort(i32* %5, i32 13)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printArray(i32* %5, i32 13)
ret void
}