#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*/ ssiBubbleSort(short *, int);
int /*<<< orphan*/ usiBubbleSort(unsigned short *, int);
int main() {
  signed short int ssiinput[21];
  unsigned short int usiinput[21];
  signed char i;
  unsigned char j;
  int count, errorssi, errorusi;
  ssiinput[0] = 0xF5DF;
  ssiinput[1] = 0x2444;
  ssiinput[2] = 0x5612;
  ssiinput[3] = 0xF645;
  ssiinput[4] = 0xFF80;
  ssiinput[5] = 0x12DD;
  ssiinput[6] = 0x4343;
  ssiinput[7] = 0xF167;
  ssiinput[8] = 0x0000;
  ssiinput[9] = 0x0123;
  ssiinput[10] = 0x3301;
  ssiinput[11] = 0x12F7;
  ssiinput[12] = 0x8745;
  ssiinput[13] = 0x8286;
  ssiinput[14] = 0x1296;
  ssiinput[15] = 0x3452;
  ssiinput[16] = 0xE3FF;
  ssiinput[17] = 0x2456;
  ssiinput[18] = 0x6723;
  ssiinput[19] = 0x7510;
  ssiinput[20] = 0x0005;
  usiinput[0] = 0xF5DF;
  usiinput[1] = 0x2444;
  usiinput[2] = 0x5612;
  usiinput[3] = 0xF645;
  usiinput[4] = 0xFF80;
  usiinput[5] = 0x12DD;
  usiinput[6] = 0x4343;
  usiinput[7] = 0xF167;
  usiinput[8] = 0x0000;
  usiinput[9] = 0x0123;
  usiinput[10] = 0x3301;
  usiinput[11] = 0x12F7;
  usiinput[12] = 0x8745;
  usiinput[13] = 0x8286;
  usiinput[14] = 0x1296;
  usiinput[15] = 0x3452;
  usiinput[16] = 0xE3FF;
  usiinput[17] = 0x2456;
  usiinput[18] = 0x6723;
  usiinput[19] = 0x7510;
  usiinput[20] = 0x0005;
  ssiBubbleSort(ssiinput, 21);
  usiBubbleSort(usiinput, 21);
  errorssi = 0;
  for (count = 0; count < 20; count++)
    if (ssiinput[count] > ssiinput[count + 1])
      errorusi = 1;
  errorusi = 0;
  for (count = 0; count < 20; count++)
    if (usiinput[count] > usiinput[count + 1])
      errorusi = 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xf5df,-0x30(%rbp)
movw   $0x2444,-0x2e(%rbp)
movw   $0x5612,-0x2c(%rbp)
movw   $0xf645,-0x2a(%rbp)
movw   $0xff80,-0x28(%rbp)
movw   $0x12dd,-0x26(%rbp)
movw   $0x4343,-0x24(%rbp)
movw   $0xf167,-0x22(%rbp)
movw   $0x0,-0x20(%rbp)
movw   $0x123,-0x1e(%rbp)
movw   $0x3301,-0x1c(%rbp)
movw   $0x12f7,-0x1a(%rbp)
movw   $0x8745,-0x18(%rbp)
movw   $0x8286,-0x16(%rbp)
movw   $0x1296,-0x14(%rbp)
movw   $0x3452,-0x12(%rbp)
movw   $0xe3ff,-0x10(%rbp)
movw   $0x2456,-0xe(%rbp)
movw   $0x6723,-0xc(%rbp)
movw   $0x7510,-0xa(%rbp)
movw   $0x5,-0x8(%rbp)
movw   $0xf5df,-0x60(%rbp)
movw   $0x2444,-0x5e(%rbp)
movw   $0x5612,-0x5c(%rbp)
movw   $0xf645,-0x5a(%rbp)
movw   $0xff80,-0x58(%rbp)
movw   $0x12dd,-0x56(%rbp)
movw   $0x4343,-0x54(%rbp)
movw   $0xf167,-0x52(%rbp)
movw   $0x0,-0x50(%rbp)
movw   $0x123,-0x4e(%rbp)
movw   $0x3301,-0x4c(%rbp)
movw   $0x12f7,-0x4a(%rbp)
movw   $0x8745,-0x48(%rbp)
movw   $0x8286,-0x46(%rbp)
movw   $0x1296,-0x44(%rbp)
movw   $0x3452,-0x42(%rbp)
movw   $0xe3ff,-0x40(%rbp)
movw   $0x2456,-0x3e(%rbp)
movw   $0x6723,-0x3c(%rbp)
movw   $0x7510,-0x3a(%rbp)
movw   $0x5,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x15,%esi
call   1040 <ssiBubbleSort@plt>
lea    -0x60(%rbp),%rdi
mov    $0x15,%esi
call   1030 <usiBubbleSort@plt>
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0x68(%rbp)
cmpl   $0x14,-0x68(%rbp)
jge    1298 <main+0x178>
movslq -0x68(%rbp),%rax
movswl -0x30(%rbp,%rax,2),%eax
mov    -0x68(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movswl -0x30(%rbp,%rcx,2),%ecx
cmp    %ecx,%eax
jle    1285 <main+0x165>
movl   $0x1,-0x70(%rbp)
jmp    128a <main+0x16a>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1255 <main+0x135>
movl   $0x0,-0x70(%rbp)
movl   $0x0,-0x68(%rbp)
cmpl   $0x14,-0x68(%rbp)
jge    12e9 <main+0x1c9>
movslq -0x68(%rbp),%rax
movzwl -0x60(%rbp,%rax,2),%eax
mov    -0x68(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzwl -0x60(%rbp,%rcx,2),%ecx
cmp    %ecx,%eax
jle    12d6 <main+0x1b6>
movl   $0x1,-0x70(%rbp)
jmp    12db <main+0x1bb>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    12a6 <main+0x186>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed9(%rip),%xmm1
movaps %xmm1,0x40(%rsp)
movabs $0x751067232456e3ff,%rax
67 10 75
mov    %rax,0x50(%rsp)
movw   $0x5,0x58(%rsp)
movaps %xmm0,(%rsp)
movaps %xmm1,0x10(%rsp)
mov    %rax,0x20(%rsp)
movw   $0x5,0x28(%rsp)
lea    0x30(%rsp),%rdi
mov    $0x15,%esi
call   1040 <ssiBubbleSort@plt>
mov    %rsp,%rdi
mov    $0x15,%esi
call   1030 <usiBubbleSort@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i16]
%3 = alloca [21 x i16]
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 0
store i16 -2593, i16* %9
%10 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 1
store i16 9284, i16* %10
%11 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 2
store i16 22034, i16* %11
%12 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 3
store i16 -2491, i16* %12
%13 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 4
store i16 -128, i16* %13
%14 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 5
store i16 4829, i16* %14
%15 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 6
store i16 17219, i16* %15
%16 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 7
store i16 -3737, i16* %16
%17 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 8
store i16 0, i16* %17
%18 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 9
store i16 291, i16* %18
%19 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 10
store i16 13057, i16* %19
%20 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 11
store i16 4855, i16* %20
%21 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 12
store i16 -30907, i16* %21
%22 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 13
store i16 -32122, i16* %22
%23 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 14
store i16 4758, i16* %23
%24 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 15
store i16 13394, i16* %24
%25 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 16
store i16 -7169, i16* %25
%26 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 17
store i16 9302, i16* %26
%27 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 18
store i16 26403, i16* %27
%28 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 19
store i16 29968, i16* %28
%29 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 20
store i16 5, i16* %29
%30 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 0
store i16 -2593, i16* %30
%31 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 1
store i16 9284, i16* %31
%32 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 2
store i16 22034, i16* %32
%33 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 3
store i16 -2491, i16* %33
%34 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 4
store i16 -128, i16* %34
%35 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 5
store i16 4829, i16* %35
%36 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 6
store i16 17219, i16* %36
%37 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 7
store i16 -3737, i16* %37
%38 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 8
store i16 0, i16* %38
%39 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 9
store i16 291, i16* %39
%40 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 10
store i16 13057, i16* %40
%41 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 11
store i16 4855, i16* %41
%42 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 12
store i16 -30907, i16* %42
%43 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 13
store i16 -32122, i16* %43
%44 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 14
store i16 4758, i16* %44
%45 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 15
store i16 13394, i16* %45
%46 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 16
store i16 -7169, i16* %46
%47 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 17
store i16 9302, i16* %47
%48 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 18
store i16 26403, i16* %48
%49 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 19
store i16 29968, i16* %49
%50 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 20
store i16 5, i16* %50
%51 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 0
%52 = call i32 @ssiBubbleSort(i16* %51, i32 21)
%53 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 0
%54 = call i32 @usiBubbleSort(i16* %53, i32 21)
store i32 0, i32* %7
store i32 0, i32* %6
br label %55
55: ; preds = %73, %0
%56 = load i32, i32* %6
%57 = icmp slt i32 %56, 20
br i1 %57, label %58, label %76
58: ; preds = %55
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 %60
%62 = load i16, i16* %61
%63 = sext i16 %62 to i32
%64 = load i32, i32* %6
%65 = add nsw i32 %64, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 %66
%68 = load i16, i16* %67
%69 = sext i16 %68 to i32
%70 = icmp sgt i32 %63, %69
br i1 %70, label %71, label %72
71: ; preds = %58
store i32 1, i32* %8
br label %72
72: ; preds = %71, %58
br label %73
73: ; preds = %72
%74 = load i32, i32* %6
%75 = add nsw i32 %74, 1
store i32 %75, i32* %6
br label %55
76: ; preds = %55
store i32 0, i32* %8
store i32 0, i32* %6
br label %77
77: ; preds = %95, %76
%78 = load i32, i32* %6
%79 = icmp slt i32 %78, 20
br i1 %79, label %80, label %98
80: ; preds = %77
%81 = load i32, i32* %6
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 %82
%84 = load i16, i16* %83
%85 = zext i16 %84 to i32
%86 = load i32, i32* %6
%87 = add nsw i32 %86, 1
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [21 x i16], [21 x i16]* %3, i64 0, i64 %88
%90 = load i16, i16* %89
%91 = zext i16 %90 to i32
%92 = icmp sgt i32 %85, %91
br i1 %92, label %93, label %94
93: ; preds = %80
store i32 1, i32* %8
br label %94
94: ; preds = %93, %80
br label %95
95: ; preds = %94
%96 = load i32, i32* %6
%97 = add nsw i32 %96, 1
store i32 %97, i32* %6
br label %77
98: ; preds = %77
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [21 x i16]
%2 = alloca [21 x i16]
%3 = bitcast [21 x i16]* %1 to i8*
%4 = bitcast [21 x i16]* %2 to i8*
%5 = getelementptr inbounds [21 x i16], [21 x i16]* %1, i64 0, i64 0
%6 = bitcast [21 x i16]* %1 to <8 x i16>*
store <8 x i16> <i16 -2593, i16 9284, i16 22034, i16 -2491, i16 -128, i16 4829, i16 17219, i16 -3737>, <8 x i16>* %6
%7 = getelementptr inbounds [21 x i16], [21 x i16]* %1, i64 0, i64 8
%8 = bitcast i16* %7 to <8 x i16>*
store <8 x i16> <i16 0, i16 291, i16 13057, i16 4855, i16 -30907, i16 -32122, i16 4758, i16 13394>, <8 x i16>* %8
%9 = getelementptr inbounds [21 x i16], [21 x i16]* %1, i64 0, i64 16
store i16 -7169, i16* %9
%10 = getelementptr inbounds [21 x i16], [21 x i16]* %1, i64 0, i64 17
store i16 9302, i16* %10
%11 = getelementptr inbounds [21 x i16], [21 x i16]* %1, i64 0, i64 18
store i16 26403, i16* %11
%12 = getelementptr inbounds [21 x i16], [21 x i16]* %1, i64 0, i64 19
store i16 29968, i16* %12
%13 = getelementptr inbounds [21 x i16], [21 x i16]* %1, i64 0, i64 20
store i16 5, i16* %13
%14 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 0
%15 = bitcast [21 x i16]* %2 to <8 x i16>*
store <8 x i16> <i16 -2593, i16 9284, i16 22034, i16 -2491, i16 -128, i16 4829, i16 17219, i16 -3737>, <8 x i16>* %15
%16 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 8
%17 = bitcast i16* %16 to <8 x i16>*
store <8 x i16> <i16 0, i16 291, i16 13057, i16 4855, i16 -30907, i16 -32122, i16 4758, i16 13394>, <8 x i16>* %17
%18 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 16
store i16 -7169, i16* %18
%19 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 17
store i16 9302, i16* %19
%20 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 18
store i16 26403, i16* %20
%21 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 19
store i16 29968, i16* %21
%22 = getelementptr inbounds [21 x i16], [21 x i16]* %2, i64 0, i64 20
store i16 5, i16* %22
%23 = call i32 @ssiBubbleSort(i16* %5, i32 21)
%24 = call i32 @usiBubbleSort(i16* %14, i32 21)
ret i32 0
}