#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*/ print_longs(long *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ shuffle(long *, int);
int main() {
  int n = 10;
  long A[10];
  for (int i = 0; i < n; i++)
    A[i] = i;
  print_longs(A, n);
  printf("\n");
  shuffle(A, n);
  print_longs(A, n);
  printf("\n");
  printf("DONE\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1174 <main+0x44>
movslq -0x64(%rbp),%rcx
movslq -0x64(%rbp),%rax
mov    %rcx,-0x60(%rbp,%rax,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    114d <main+0x1d>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <print_longs@plt>
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <shuffle@plt>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <print_longs@plt>
lea    0xe59(%rip),%rdi
call   1040 <printf@plt>
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <print_longs@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <shuffle@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <print_longs@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe8b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [6 x i8] c"DONE\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i64]
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 0, i32* %4
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i64], [10 x i64]* %3, i64 0, i64 %13
store i64 %11, i64* %14
br label %15
15: ; preds = %9
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = getelementptr inbounds [10 x i64], [10 x i64]* %3, i64 0, i64 0
%20 = load i32, i32* %2
%21 = call i32 @print_longs(i64* %19, i32 %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%23 = getelementptr inbounds [10 x i64], [10 x i64]* %3, i64 0, i64 0
%24 = load i32, i32* %2
%25 = call i32 @shuffle(i64* %23, i32 %24)
%26 = getelementptr inbounds [10 x i64], [10 x i64]* %3, i64 0, i64 0
%27 = load i32, i32* %2
%28 = call i32 @print_longs(i64* %26, i32 %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@str = [5 x i8] c"DONE\00"
define i32 @main() {
%1 = alloca [10 x i64]
%2 = bitcast [10 x i64]* %1 to i8*
%3 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 0
%4 = bitcast [10 x i64]* %1 to <2 x i64>*
store <2 x i64> <i64 0, i64 1>, <2 x i64>* %4
%5 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 2
%6 = bitcast i64* %5 to <2 x i64>*
store <2 x i64> <i64 2, i64 3>, <2 x i64>* %6
%7 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 4
%8 = bitcast i64* %7 to <2 x i64>*
store <2 x i64> <i64 4, i64 5>, <2 x i64>* %8
%9 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 6
%10 = bitcast i64* %9 to <2 x i64>*
store <2 x i64> <i64 6, i64 7>, <2 x i64>* %10
%11 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 8
%12 = bitcast i64* %11 to <2 x i64>*
store <2 x i64> <i64 8, i64 9>, <2 x i64>* %12
%13 = call i32 @print_longs(i64* %3, i32 10)
%14 = call i32 @putchar(i32 10)
%15 = call i32 @shuffle(i64* %3, i32 10)
%16 = call i32 @print_longs(i64* %3, i32 10)
%17 = call i32 @putchar(i32 10)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}