#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 rand();
int main() {
  int arr1[50];
  int arr2[50];
  for (int i = 0; i < 50; i++) {
    arr1[i] = rand();
    arr2[i] = rand();
  }
  for (int i = 0; i < 50; i++) {
    if (arr1[i] != arr2[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1a4(%rbp)
cmpl   $0x32,-0x1a4(%rbp)
jge    117b <main+0x6b>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
movslq -0x1a4(%rbp),%rax
mov    %ecx,-0xd0(%rbp,%rax,4)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
movslq -0x1a4(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    112c <main+0x1c>
movl   $0x0,-0x1a8(%rbp)
cmpl   $0x32,-0x1a8(%rbp)
jge    11d9 <main+0xc9>
movslq -0x1a8(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%eax
movslq -0x1a8(%rbp),%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
je     11c0 <main+0xb0>
movl   $0x0,-0x4(%rbp)
jmp    11e0 <main+0xd0>
jmp    11c5 <main+0xb5>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    1185 <main+0x75>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1a0,%rsp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,0xd0(%rsp,%rbx,4)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x32,%rbx
jne    1120 <main+0x10>
mov    0xd0(%rsp),%ecx
mov    $0x1,%al
cmp    (%rsp),%ecx
jne    1198 <main+0x88>
mov    $0xffffffffffffffff,%rcx
nopw   0x0(%rax,%rax,1)
mov    0xd8(%rsp,%rcx,4),%edx
cmp    0x8(%rsp,%rcx,4),%edx
jne    1198 <main+0x88>
cmp    $0x2f,%rcx
je     118d <main+0x7d>
mov    0xdc(%rsp,%rcx,4),%esi
lea    0x2(%rcx),%rdx
cmp    0xc(%rsp,%rcx,4),%esi
mov    %rdx,%rcx
je     1160 <main+0x50>
cmp    $0x31,%rdx
jmp    1195 <main+0x85>
add    $0x2,%rcx
cmp    $0x31,%rcx
setb   %al
xor    $0x1,%al
movzbl %al,%eax
add    $0x1a0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @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*
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 0, %0 ], [ %11, %5 ]
%7 = tail call i32 (...) @rand()
%8 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %6
store i32 %7, i32* %8
%9 = tail call i32 (...) @rand()
%10 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %6
store i32 %9, i32* %10
%11 = add nuw nsw i64 %6, 1
%12 = icmp eq i64 %11, 50
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
%15 = load i32, i32* %14
%16 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
%17 = load i32, i32* %16
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %40
19: ; preds = %13, %30
%20 = phi i64 [ %28, %30 ], [ 0, %13 ]
%21 = or i64 %20, 1
%22 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %21
%25 = load i32, i32* %24
%26 = icmp eq i32 %23, %25
br i1 %26, label %27, label %40
27: ; preds = %19
%28 = add nuw nsw i64 %20, 2
%29 = icmp eq i64 %28, 50
br i1 %29, label %38, label %30
30: ; preds = %27
%31 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %28
%32 = load i32, i32* %31
%33 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %28
%34 = load i32, i32* %33
%35 = icmp eq i32 %32, %34
br i1 %35, label %19, label %36
36: ; preds = %30
%37 = icmp ult i64 %21, 49
br label %40
38: ; preds = %27
%39 = icmp ult i64 %21, 49
br label %40
40: ; preds = %36, %38, %19, %13
%41 = phi i1 [ true, %13 ], [ %37, %36 ], [ %39, %38 ], [ true, %19 ]
%42 = xor i1 %41, true
%43 = zext i1 %42 to i32
ret i32 %43
}