#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*/ assertorder(int *, int);
int /*<<< orphan*/ bubblesort(int *, int);
int /*<<< orphan*/ printarr(int *, int);
int main() {
  int arr[6] = {1, 10, 3, 6, 4, 7};
  bubblesort(arr, 6);
  assertorder(arr, 6);
  printarr(arr, 6);
  int arr1[1] = {1};
  bubblesort(arr1, 1);
  assertorder(arr1, 1);
  printarr(arr1, 1);
  int arr2[2] = {2, -12};
  bubblesort(arr2, 2);
  assertorder(arr2, 2);
  printarr(arr2, 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1040 <bubblesort@plt>
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1050 <assertorder@plt>
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1030 <printarr@plt>
mov    0xe8f(%rip),%eax
mov    %eax,-0x24(%rbp)
lea    -0x24(%rbp),%rdi
mov    $0x1,%esi
call   1040 <bubblesort@plt>
lea    -0x24(%rbp),%rdi
mov    $0x1,%esi
call   1050 <assertorder@plt>
lea    -0x24(%rbp),%rdi
mov    $0x1,%esi
call   1030 <printarr@plt>
mov    0xe5f(%rip),%rax
mov    %rax,-0x2c(%rbp)
lea    -0x2c(%rbp),%rdi
mov    $0x2,%esi
call   1040 <bubblesort@plt>
lea    -0x2c(%rbp),%rdi
mov    $0x2,%esi
call   1050 <assertorder@plt>
lea    -0x2c(%rbp),%rdi
mov    $0x2,%esi
call   1030 <printarr@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xed4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <bubblesort@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1050 <assertorder@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printarr@plt>
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <bubblesort@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <assertorder@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printarr@plt>
movabs $0xfffffff400000002,%rax
ff ff ff
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <bubblesort@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <assertorder@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printarr@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [6 x i32] [i32 1, i32 10, i32 3, i32 6, i32 4, i32 7]
@__const.main.arr1 = [1 x i32] [i32 1]
@__const.main.arr2 = [2 x i32] [i32 2, i32 -12]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca [1 x i32]
%3 = alloca [2 x i32]
%4 = bitcast [6 x i32]* %1 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = call i32 @bubblesort(i32* %5, i32 6)
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%8 = call i32 @assertorder(i32* %7, i32 6)
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%10 = call i32 @printarr(i32* %9, i32 6)
%11 = bitcast [1 x i32]* %2 to i8*
%12 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%13 = call i32 @bubblesort(i32* %12, i32 1)
%14 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%15 = call i32 @assertorder(i32* %14, i32 1)
%16 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%17 = call i32 @printarr(i32* %16, i32 1)
%18 = bitcast [2 x i32]* %3 to i8*
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%20 = call i32 @bubblesort(i32* %19, i32 2)
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%22 = call i32 @assertorder(i32* %21, i32 2)
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%24 = call i32 @printarr(i32* %23, i32 2)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [6 x i32] [i32 1, i32 10, i32 3, i32 6, i32 4, i32 7]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca [1 x i32]
%3 = alloca i64
%4 = bitcast [6 x i32]* %1 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = call i32 @bubblesort(i32* %5, i32 6)
%7 = call i32 @assertorder(i32* %5, i32 6)
%8 = call i32 @printarr(i32* %5, i32 6)
%9 = bitcast [1 x i32]* %2 to i8*
%10 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 1, i32* %10
%11 = call i32 @bubblesort(i32* %10, i32 1)
%12 = call i32 @assertorder(i32* %10, i32 1)
%13 = call i32 @printarr(i32* %10, i32 1)
%14 = bitcast i64* %3 to i8*
store i64 -51539607550, i64* %3
%15 = bitcast i64* %3 to i32*
%16 = call i32 @bubblesort(i32* %15, i32 2)
%17 = call i32 @assertorder(i32* %15, i32 2)
%18 = call i32 @printarr(i32* %15, i32 2)
ret i32 0
}