#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*/ mergeSort(int *, int *, int);
int /*<<< orphan*/ myprint(int *, int);
void main() {
  int temp[50];
  int buf[50];
  int *ptr = buf;
  unsigned int i, m_w, m_z;
  m_w = 17;
  m_z = 31;
  for (i = 0; i < 50; 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;
  }
  mergeSort(buf, temp, 50);
  myprint(buf, 50);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
lea    -0x1a0(%rbp),%rax
mov    %rax,-0x1a8(%rbp)
movl   $0x11,-0x1b0(%rbp)
movl   $0x1f,-0x1b4(%rbp)
movl   $0x0,-0x1ac(%rbp)
cmpl   $0x32,-0x1ac(%rbp)
jae    11e6 <main+0xc6>
mov    -0x1b4(%rbp),%eax
and    $0xffff,%eax
imul   $0x9069,%eax,%eax
mov    -0x1b4(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x1b4(%rbp)
mov    -0x1b0(%rbp),%eax
and    $0xffff,%eax
imul   $0x4650,%eax,%eax
mov    -0x1b0(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x1b0(%rbp)
mov    -0x1b4(%rbp),%ecx
shl    $0x10,%ecx
add    -0x1b0(%rbp),%ecx
mov    -0x1a8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
mov    -0x1a8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x1a8(%rbp)
jmp    1157 <main+0x37>
lea    -0x1a0(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
mov    $0x32,%edx
call   1040 <mergeSort@plt>
lea    -0x1a0(%rbp),%rdi
mov    $0x32,%esi
call   1030 <myprint@plt>
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1a0,%rsp
mov    $0x11,%eax
mov    $0x1f,%ecx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
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    $0x32,%edx
jne    1140 <main+0x20>
mov    %rsp,%rbx
lea    0xd0(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x32,%edx
call   1040 <mergeSort@plt>
mov    %rbx,%rdi
mov    $0x32,%esi
call   1030 <myprint@plt>
add    $0x1a0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca [50 x i32]
%2 = alloca [50 x i32]
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
store i32* %7, i32** %3
store i32 17, i32* %5
store i32 31, i32* %6
store i32 0, i32* %4
br label %8
8: ; preds = %29, %0
%9 = load i32, i32* %4
%10 = icmp ult i32 %9, 50
br i1 %10, label %11, label %34
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 = load i32*, i32** %3
store i32 %27, i32* %28
br label %29
29: ; preds = %11
%30 = load i32, i32* %4
%31 = add i32 %30, 1
store i32 %31, i32* %4
%32 = load i32*, i32** %3
%33 = getelementptr inbounds i32, i32* %32, i32 1
store i32* %33, i32** %3
br label %8
34: ; preds = %8
%35 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
%36 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
%37 = call i32 @mergeSort(i32* %35, i32* %36, i32 50)
%38 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
%39 = call i32 @myprint(i32* %38, i32 50)
ret void
}

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