#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*/ int_arr_assign(int *, int *, int);
int /*<<< orphan*/ print_random(int *, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(int);
int main() {
  int num, seed, var[100], out[100];
  scanf("%d", &num);
  for (int i = 0; i < num; i++)
    scanf("%d", &var[i]);
  scanf("%d", &seed);
  srand(seed);
  for (int i = 0; i < 2; i++) {
    int_arr_assign(var, out, num);
    print_random(out, num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x334(%rbp)
mov    -0x334(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b0 <main+0x70>
movslq -0x334(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe69(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    116c <main+0x2c>
lea    0xe49(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1040 <srand@plt>
movl   $0x0,-0x338(%rbp)
cmpl   $0x2,-0x338(%rbp)
jge    1218 <main+0xd8>
lea    -0x1a0(%rbp),%rdi
lea    -0x330(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1030 <int_arr_assign@plt>
lea    -0x330(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1060 <print_random@plt>
mov    -0x338(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x338(%rbp)
jmp    11d2 <main+0x92>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x330,%rsp
lea    0xead(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    119d <main+0x5d>
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
lea    0xe8e(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1180 <main+0x40>
lea    0xe5c(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <srand@plt>
mov    0x8(%rsp),%edx
lea    0x10(%rsp),%r14
lea    0x1a0(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <int_arr_assign@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1060 <print_random@plt>
mov    0x8(%rsp),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <int_arr_assign@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1060 <print_random@plt>
xor    %eax,%eax
add    $0x330,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i32]
%4 = alloca [100 x i32]
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast [100 x i32]* %3 to i8*
%8 = bitcast [100 x i32]* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %26, label %12
12: ; preds = %26, %0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = call i32 @srand(i32 %14)
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%17 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%18 = load i32, i32* %1
%19 = call i32 @int_arr_assign(i32* %16, i32* %17, i32 %18)
%20 = load i32, i32* %1
%21 = call i32 @print_random(i32* %17, i32 %20)
%22 = load i32, i32* %1
%23 = call i32 @int_arr_assign(i32* %16, i32* %17, i32 %22)
%24 = load i32, i32* %1
%25 = call i32 @print_random(i32* %17, i32 %24)
ret i32 0
26: ; preds = %0, %26
%27 = phi i64 [ %30, %26 ], [ 0, %0 ]
%28 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %27
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %28)
%30 = add nuw nsw i64 %27, 1
%31 = load i32, i32* %1
%32 = sext i32 %31 to i64
%33 = icmp slt i64 %30, %32
br i1 %33, label %26, label %12
}