#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 */
size_t fatten(int);
int myrand(int);
void fatShuffle(int X[((35 + 2) * (35 + 2))]) {
  int j, k, tmp;
  for (k = (35 * 35) - 1; k > 0; k--) {
    j = myrand(k + 1);
    tmp = X[fatten(j)];
    X[fatten(j)] = X[fatten(k)];
    X[fatten(k)] = tmp;
  }
}


x86 assembly (clang, -O0):
<fatShuffle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x4c8,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    11d3 <fatShuffle+0xb3>
mov    -0x10(%rbp),%edi
add    $0x1,%edi
call   1030 <myrand@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <fatten@plt>
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <fatten@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <fatten@plt>
mov    -0x34(%rbp),%edx
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <fatten@plt>
mov    -0x24(%rbp),%edx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <fatShuffle+0x13>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatShuffle>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r14
mov    $0x4c9,%edi
lea    -0x1(%rdi),%ebp
call   1030 <myrand@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <fatten@plt>
mov    (%r14,%rax,4),%r15d
mov    %ebp,%edi
call   1040 <fatten@plt>
mov    (%r14,%rax,4),%r12d
mov    %ebx,%edi
call   1040 <fatten@plt>
mov    %r12d,(%r14,%rax,4)
mov    %ebp,%edi
call   1040 <fatten@plt>
mov    %r15d,(%r14,%rax,4)
mov    %ebp,%edi
cmp    $0x1,%ebp
ja     1130 <fatShuffle+0x10>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @fatShuffle(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
store i32 1224, i32* %4
br label %6
6: ; preds = %32, %1
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %35
9: ; preds = %6
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
%12 = call i32 @myrand(i32 %11)
store i32 %12, i32* %3
%13 = load i32*, i32** %2
%14 = load i32, i32* %3
%15 = call i64 @fatten(i32 %14)
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
store i32 %17, i32* %5
%18 = load i32*, i32** %2
%19 = load i32, i32* %4
%20 = call i64 @fatten(i32 %19)
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = load i32*, i32** %2
%24 = load i32, i32* %3
%25 = call i64 @fatten(i32 %24)
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
%27 = load i32, i32* %5
%28 = load i32*, i32** %2
%29 = load i32, i32* %4
%30 = call i64 @fatten(i32 %29)
%31 = getelementptr inbounds i32, i32* %28, i64 %30
store i32 %27, i32* %31
br label %32
32: ; preds = %9
%33 = load i32, i32* %4
%34 = add nsw i32 %33, -1
store i32 %34, i32* %4
br label %6
35: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @fatShuffle(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 1224, %1 ], [ %16, %2 ]
%4 = add nuw nsw i32 %3, 1
%5 = tail call i32 @myrand(i32 %4)
%6 = tail call i64 @fatten(i32 %5)
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = tail call i64 @fatten(i32 %3)
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i64 @fatten(i32 %5)
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 %11, i32* %13
%14 = tail call i64 @fatten(i32 %3)
%15 = getelementptr inbounds i32, i32* %0, i64 %14
store i32 %8, i32* %15
%16 = add nsw i32 %3, -1
%17 = icmp ugt i32 %3, 1
br i1 %17, label %2, label %18
18: ; preds = %2
ret void
}