#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(char *, int);
int /*<<< orphan*/ sort(char *, int);
int main() {
  char DATA[12];
  char *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 = (char)((m_z << 16) + m_w) & 0xff;
  }
  sort(DATA, 12);
  myprint(DATA, 12);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0xf4a3482ce84d0450,%rax
48 a3 f4
mov    %rax,0x4(%rsp)
movl   $0xead19b66,0xc(%rsp)
ea
lea    0x4(%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    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
store i8* %7, i8** %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 i8
%29 = sext i8 %28 to i32
%30 = and i32 %29, 255
%31 = trunc i32 %30 to i8
%32 = load i8*, i8** %3
store i8 %31, i8* %32
br label %33
33: ; preds = %11
%34 = load i32, i32* %4
%35 = add i32 %34, 1
store i32 %35, i32* %4
%36 = load i8*, i8** %3
%37 = getelementptr inbounds i8, i8* %36, i32 1
store i8* %37, i8** %3
br label %8
38: ; preds = %8
%39 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%40 = call i32 @sort(i8* %39, i32 12)
%41 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%42 = call i32 @myprint(i8* %41, i32 12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
store i8 80, i8* %2
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 1
store i8 4, i8* %3
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 2
store i8 77, i8* %4
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 3
store i8 -24, i8* %5
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 4
store i8 44, i8* %6
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 5
store i8 72, i8* %7
%8 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 6
store i8 -93, i8* %8
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 7
store i8 -12, i8* %9
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 8
store i8 102, i8* %10
%11 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 9
store i8 -101, i8* %11
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 10
store i8 -47, i8* %12
%13 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 11
store i8 -22, i8* %13
%14 = call i32 @sort(i8* %2, i32 12)
%15 = call i32 @myprint(i8* %2, i32 12)
ret i32 0
}