#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*/ myprint(short *, int);
int /*<<< orphan*/ sort(short *, int);
int main() {
  short DATA[12];
  short *ptr = DATA;
  unsigned int i, m_w, m_z;
  m_w = 17;
  m_z = 31;
  for (i = 0; i < 12; i++, ptr++) {
    m_z = 36969 * (m_z & 65535) + (m_z >> 16);
    m_w = 18000 * (m_w & 65535) + (m_w >> 16);
    *ptr = (short)((m_z << 16) + m_w) & 0xffff;
  }
  sort(DATA, 12);
  myprint(DATA, 12);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x11,-0x30(%rbp)
movl   $0x1f,-0x34(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0xc,-0x2c(%rbp)
jae    11bb <main+0x9b>
mov    -0x34(%rbp),%eax
and    $0xffff,%eax
imul   $0x9069,%eax,%eax
mov    -0x34(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
and    $0xffff,%eax
imul   $0x4650,%eax,%eax
mov    -0x30(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x34(%rbp),%eax
shl    $0x10,%eax
add    -0x30(%rbp),%eax
cwtl
and    $0xffff,%eax
mov    %ax,%cx
mov    -0x28(%rbp),%rax
mov    %cx,(%rax)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
jmp    114c <main+0x2c>
lea    -0x20(%rbp),%rdi
mov    $0xc,%esi
call   1040 <sort@plt>
lea    -0x20(%rbp),%rdi
mov    $0xc,%esi
call   1030 <myprint@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x11eab2d1269bea66,%rax
b2 ea 11
mov    %rax,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1040 <sort@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <myprint@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i16]
%3 = alloca i16*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = getelementptr inbounds [12 x i16], [12 x i16]* %2, i64 0, i64 0
store i16* %7, i16** %3
store i32 17, i32* %5
store i32 31, i32* %6
store i32 0, i32* %4
br label %8
8: ; preds = %33, %0
%9 = load i32, i32* %4
%10 = icmp ult i32 %9, 12
br i1 %10, label %11, label %38
11: ; preds = %8
%12 = load i32, i32* %6
%13 = and i32 %12, 65535
%14 = mul i32 36969, %13
%15 = load i32, i32* %6
%16 = lshr i32 %15, 16
%17 = add i32 %14, %16
store i32 %17, i32* %6
%18 = load i32, i32* %5
%19 = and i32 %18, 65535
%20 = mul i32 18000, %19
%21 = load i32, i32* %5
%22 = lshr i32 %21, 16
%23 = add i32 %20, %22
store i32 %23, i32* %5
%24 = load i32, i32* %6
%25 = shl i32 %24, 16
%26 = load i32, i32* %5
%27 = add i32 %25, %26
%28 = trunc i32 %27 to i16
%29 = sext i16 %28 to i32
%30 = and i32 %29, 65535
%31 = trunc i32 %30 to i16
%32 = load i16*, i16** %3
store i16 %31, i16* %32
br label %33
33: ; preds = %11
%34 = load i32, i32* %4
%35 = add i32 %34, 1
store i32 %35, i32* %4
%36 = load i16*, i16** %3
%37 = getelementptr inbounds i16, i16* %36, i32 1
store i16* %37, i16** %3
br label %8
38: ; preds = %8
%39 = getelementptr inbounds [12 x i16], [12 x i16]* %2, i64 0, i64 0
%40 = call i32 @sort(i16* %39, i32 12)
%41 = getelementptr inbounds [12 x i16], [12 x i16]* %2, i64 0, i64 0
%42 = call i32 @myprint(i16* %41, i32 12)
%43 = load i32, i32* %1
ret i32 %43
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [12 x i16]
%2 = bitcast [12 x i16]* %1 to i8*
%3 = getelementptr inbounds [12 x i16], [12 x i16]* %1, i64 0, i64 0
%4 = bitcast [12 x i16]* %1 to <8 x i16>*
store <8 x i16> <i16 -21680, i16 26884, i16 6221, i16 -15640, i16 24364, i16 -1208, i16 20643, i16 2548>, <8 x i16>* %4
%5 = getelementptr inbounds [12 x i16], [12 x i16]* %1, i64 0, i64 8
store i16 -5530, i16* %5
%6 = getelementptr inbounds [12 x i16], [12 x i16]* %1, i64 0, i64 9
store i16 9883, i16* %6
%7 = getelementptr inbounds [12 x i16], [12 x i16]* %1, i64 0, i64 10
store i16 -19759, i16* %7
%8 = getelementptr inbounds [12 x i16], [12 x i16]* %1, i64 0, i64 11
store i16 4586, i16* %8
%9 = call i32 @sort(i16* %3, i32 12)
%10 = call i32 @myprint(i16* %3, i32 12)
ret i32 0
}