#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*/ getchar();
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ shuffle(int *, int);
int main() {
  int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  printArray(A, 9);
  int i;
  for (i = 0; i < 10; i++) {
    shuffle(A, 9);
    printArray(A, 9);
  }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1060 <printArray@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11ad <main+0x6d>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1030 <shuffle@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1060 <printArray@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1179 <main+0x39>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeae(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <shuffle@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <shuffle@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <shuffle@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <shuffle@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <shuffle@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <shuffle@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <shuffle@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <shuffle@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <shuffle@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <shuffle@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.A = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [9 x i32]* %2 to i8*
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%6 = call i32 @printArray(i32* %5, i32 9)
store i32 0, i32* %3
br label %7
7: ; preds = %15, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%12 = call i32 @shuffle(i32* %11, i32 9)
%13 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%14 = call i32 @printArray(i32* %13, i32 9)
br label %15
15: ; preds = %10
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %7
18: ; preds = %7
%19 = call i32 (...) @getchar()
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@__const.main.A = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 9)
%5 = call i32 @shuffle(i32* %3, i32 9)
%6 = call i32 @printArray(i32* %3, i32 9)
%7 = call i32 @shuffle(i32* %3, i32 9)
%8 = call i32 @printArray(i32* %3, i32 9)
%9 = call i32 @shuffle(i32* %3, i32 9)
%10 = call i32 @printArray(i32* %3, i32 9)
%11 = call i32 @shuffle(i32* %3, i32 9)
%12 = call i32 @printArray(i32* %3, i32 9)
%13 = call i32 @shuffle(i32* %3, i32 9)
%14 = call i32 @printArray(i32* %3, i32 9)
%15 = call i32 @shuffle(i32* %3, i32 9)
%16 = call i32 @printArray(i32* %3, i32 9)
%17 = call i32 @shuffle(i32* %3, i32 9)
%18 = call i32 @printArray(i32* %3, i32 9)
%19 = call i32 @shuffle(i32* %3, i32 9)
%20 = call i32 @printArray(i32* %3, i32 9)
%21 = call i32 @shuffle(i32* %3, i32 9)
%22 = call i32 @printArray(i32* %3, i32 9)
%23 = call i32 @shuffle(i32* %3, i32 9)
%24 = call i32 @printArray(i32* %3, i32 9)
%25 = call i32 (...) @getchar()
ret i32 0
}