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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
movl   $0x11,-0x60(%rbp)
movl   $0x1f,-0x64(%rbp)
movl   $0x0,-0x5c(%rbp)
cmpl   $0x14,-0x5c(%rbp)
jae    11aa <main+0x8a>
mov    -0x64(%rbp),%eax
and    $0xffff,%eax
imul   $0x9069,%eax,%eax
mov    -0x64(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x64(%rbp)
mov    -0x60(%rbp),%eax
and    $0xffff,%eax
imul   $0x4650,%eax,%eax
mov    -0x60(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x60(%rbp)
mov    -0x64(%rbp),%ecx
shl    $0x10,%ecx
add    -0x60(%rbp),%ecx
mov    -0x58(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x58(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x58(%rbp)
jmp    1145 <main+0x25>
lea    -0x50(%rbp),%rdi
mov    $0x14,%esi
call   1040 <sort@plt>
lea    -0x50(%rbp),%rdi
mov    $0x14,%esi
call   1030 <myprint@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    $0x11,%eax
mov    $0x1f,%ecx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzwl %cx,%esi
imul   $0x9069,%esi,%esi
shr    $0x10,%ecx
add    %esi,%ecx
movzwl %ax,%esi
imul   $0x4650,%esi,%esi
shr    $0x10,%eax
add    %esi,%eax
mov    %ecx,%esi
shl    $0x10,%esi
add    %eax,%esi
mov    %esi,(%rsp,%rdx,4)
movzwl %cx,%esi
imul   $0x9069,%esi,%esi
shr    $0x10,%ecx
add    %esi,%ecx
movzwl %ax,%esi
imul   $0x4650,%esi,%esi
shr    $0x10,%eax
add    %esi,%eax
mov    %ecx,%esi
shl    $0x10,%esi
add    %eax,%esi
mov    %esi,0x4(%rsp,%rdx,4)
add    $0x2,%rdx
cmp    $0x14,%edx
jne    1140 <main+0x20>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <sort@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <myprint@plt>
add    $0x50,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
br label %4
4: ; preds = %4, %0
%5 = phi i32 [ 31, %0 ], [ %23, %4 ]
%6 = phi i32 [ 17, %0 ], [ %27, %4 ]
%7 = phi i32 [ 0, %0 ], [ %30, %4 ]
%8 = phi i32* [ %3, %0 ], [ %31, %4 ]
%9 = and i32 %5, 65535
%10 = mul nuw i32 %9, 36969
%11 = lshr i32 %5, 16
%12 = add nuw i32 %10, %11
%13 = and i32 %6, 65535
%14 = mul nuw nsw i32 %13, 18000
%15 = lshr i32 %6, 16
%16 = add nuw nsw i32 %14, %15
%17 = shl i32 %12, 16
%18 = add i32 %17, %16
store i32 %18, i32* %8
%19 = getelementptr inbounds i32, i32* %8, i64 1
%20 = and i32 %12, 65535
%21 = mul nuw i32 %20, 36969
%22 = lshr i32 %12, 16
%23 = add nuw i32 %21, %22
%24 = and i32 %16, 65535
%25 = mul nuw nsw i32 %24, 18000
%26 = lshr i32 %16, 16
%27 = add nuw nsw i32 %25, %26
%28 = shl i32 %23, 16
%29 = add i32 %28, %27
store i32 %29, i32* %19
%30 = add nuw nsw i32 %7, 2
%31 = getelementptr inbounds i32, i32* %8, i64 2
%32 = icmp eq i32 %30, 20
br i1 %32, label %33, label %4
33: ; preds = %4
%34 = call i32 @sort(i32* %3, i32 20)
%35 = call i32 @myprint(i32* %3, i32 20)
ret void
}