#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 /*<<< orphan*/ show(int *, int);
int main(void) {
  int len = 7;
  int xs[len];
  xs[0] = 87;
  xs[1] = 77;
  xs[2] = 55;
  xs[3] = 99;
  xs[4] = 22;
  xs[5] = 33;
  xs[6] = 1;
  show(xs, len);
  insertion_sort(xs, len);
  show(xs, len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x57,(%rdi)
movl   $0x4d,0x4(%rdi)
movl   $0x37,0x8(%rdi)
movl   $0x63,0xc(%rdi)
movl   $0x16,0x10(%rdi)
movl   $0x21,0x14(%rdi)
movl   $0x1,0x18(%rdi)
mov    -0x8(%rbp),%esi
call   1030 <show@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <insertion_sort@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <show@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x2100000016,%rax
mov    %rax,0x10(%rsp)
movl   $0x1,0x18(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <show@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <insertion_sort@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <show@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
store i32 7, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 87, i32* %9
%10 = getelementptr inbounds i32, i32* %8, i64 1
store i32 77, i32* %10
%11 = getelementptr inbounds i32, i32* %8, i64 2
store i32 55, i32* %11
%12 = getelementptr inbounds i32, i32* %8, i64 3
store i32 99, i32* %12
%13 = getelementptr inbounds i32, i32* %8, i64 4
store i32 22, i32* %13
%14 = getelementptr inbounds i32, i32* %8, i64 5
store i32 33, i32* %14
%15 = getelementptr inbounds i32, i32* %8, i64 6
store i32 1, i32* %15
%16 = load i32, i32* %2
%17 = call i32 @show(i32* %8, i32 %16)
%18 = load i32, i32* %2
%19 = call i32 @insertion_sort(i32* %8, i32 %18)
%20 = load i32, i32* %2
%21 = call i32 @show(i32* %8, i32 %20)
store i32 0, i32* %1
%22 = load i8*, i8** %3
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [7 x i32]
%2 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%3 = bitcast [7 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 87, i32 77, i32 55, i32 99>, <4 x i32>* %3
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 4
store i32 22, i32* %4
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 5
store i32 33, i32* %5
%6 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 6
store i32 1, i32* %6
%7 = call i32 @show(i32* %2, i32 7)
%8 = call i32 @insertion_sort(i32* %2, i32 7)
%9 = call i32 @show(i32* %2, i32 7)
ret i32 0
}