#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n1, n2, element, i;
  int a[100], b[100];
  printf("First array size:  ");
  scanf("%d", &n1);
  printf("Second array size:  ");
  scanf("%d", &n2);
  if (n1 != n2)
    printf("Arrays are equal\n");
  else {
    printf("Elements of the first array: \n");
    for (i = 0; i < n1; ++i) {
      printf("a[%d] = ", i);
      scanf("%d", &a[i]);
    }
    printf("Elements of the second array: \n");
    for (i = 0; i < n2; ++i) {
      printf("b[%d] = ", i);
      scanf("%d", &b[i]);
    }
    for (i = 0; i < n1; ++i)
      if (a[i] != b[i])
        break;
    if (i == n1)
      printf("Arrays are equal\n");
    else
      printf("Arrays are not equal\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     118d <main+0x6d>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12c2 <main+0x1a2>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11eb <main+0xcb>
mov    -0x14(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x14(%rbp),%rax
lea    -0x1b0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe3c(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a2 <main+0x82>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1249 <main+0x129>
mov    -0x14(%rbp),%esi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x14(%rbp),%rax
lea    -0x340(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdde(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1200 <main+0xe0>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1290 <main+0x170>
movslq -0x14(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%eax
movslq -0x14(%rbp),%rcx
cmp    -0x340(%rbp,%rcx,4),%eax
je     127d <main+0x15d>
jmp    1290 <main+0x170>
jmp    1282 <main+0x162>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1250 <main+0x130>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    12af <main+0x18f>
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12bd <main+0x19d>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12c2 <main+0x1a2>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x330,%rsp
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebf(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
lea    0xf08(%rip),%r14
cmp    0xc(%rsp),%eax
jne    128c <main+0x15c>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0x8(%rsp)
jle    11e9 <main+0xb9>
lea    0x1a0(%rsp),%r13
lea    0xe78(%rip),%r15
lea    0xe59(%rip),%r12
xor    %ebx,%ebx
nopl   (%rax)
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x4,%r13
cmp    %rax,%rbx
jl     11c0 <main+0x90>
lea    0xe6c(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0xc(%rsp)
jle    1249 <main+0x119>
lea    0x10(%rsp),%r13
lea    0xe2d(%rip),%r15
lea    0xe05(%rip),%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x4,%r13
cmp    %rax,%rbx
jl     1220 <main+0xf0>
mov    0x8(%rsp),%eax
xor    %ecx,%ecx
test   %eax,%eax
jle    1278 <main+0x148>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x1a0(%rsp,%rcx,4),%edx
cmp    0x10(%rsp,%rcx,4),%edx
jne    1278 <main+0x148>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1260 <main+0x130>
jmp    128c <main+0x15c>
cmp    %eax,%ecx
lea    0xe0f(%rip),%rax
lea    0xdf3(%rip),%r14
cmove  %rax,%r14
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x330,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"First array size: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Second array size: \00"
@.str.3 = [18 x i8] c"Arrays are equal\0A\00"
@.str.4 = [31 x i8] c"Elements of the first array: \0A\00"
@.str.5 = [9 x i8] c"a[%d] = \00"
@.str.6 = [32 x i8] c"Elements of the second array: \0A\00"
@.str.7 = [9 x i8] c"b[%d] = \00"
@.str.8 = [22 x i8] c"Arrays are not equal\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [100 x i32]
%7 = alloca [100 x i32]
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %78
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %5
br label %19
19: ; preds = %30, %17
%20 = load i32, i32* %5
%21 = load i32, i32* %2
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %33
23: ; preds = %19
%24 = load i32, i32* %5
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %27
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %28)
br label %30
30: ; preds = %23
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %19
33: ; preds = %19
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %5
br label %35
35: ; preds = %46, %33
%36 = load i32, i32* %5
%37 = load i32, i32* %3
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %49
39: ; preds = %35
%40 = load i32, i32* %5
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %40)
%42 = load i32, i32* %5
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [100 x i32], [100 x i32]* %7, i64 0, i64 %43
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %44)
br label %46
46: ; preds = %39
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 1
store i32 %48, i32* %5
br label %35
49: ; preds = %35
store i32 0, i32* %5
br label %50
50: ; preds = %66, %49
%51 = load i32, i32* %5
%52 = load i32, i32* %2
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %69
54: ; preds = %50
%55 = load i32, i32* %5
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = load i32, i32* %5
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [100 x i32], [100 x i32]* %7, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = icmp ne i32 %58, %62
br i1 %63, label %64, label %65
64: ; preds = %54
br label %69
65: ; preds = %54
br label %66
66: ; preds = %65
%67 = load i32, i32* %5
%68 = add nsw i32 %67, 1
store i32 %68, i32* %5
br label %50
69: ; preds = %64, %50
%70 = load i32, i32* %5
%71 = load i32, i32* %2
%72 = icmp eq i32 %70, %71
br i1 %72, label %73, label %75
73: ; preds = %69
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %77
75: ; preds = %69
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
br label %77
77: ; preds = %75, %73
br label %78
78: ; preds = %77, %15
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"First array size: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Second array size: \00"
@.str.5 = [9 x i8] c"a[%d] = \00"
@.str.7 = [9 x i8] c"b[%d] = \00"
@str = [30 x i8] c"Elements of the first array: \00"
@str.9 = [31 x i8] c"Elements of the second array: \00"
@str.10 = [21 x i8] c"Arrays are not equal\00"
@str.12 = [17 x i8] c"Arrays are equal\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 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %65
16: ; preds = %0
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%18 = load i32, i32* %1
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %30
20: ; preds = %16, %20
%21 = phi i64 [ %26, %20 ], [ 0, %16 ]
%22 = trunc i64 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %21
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %24)
%26 = add nuw nsw i64 %21, 1
%27 = load i32, i32* %1
%28 = sext i32 %27 to i64
%29 = icmp slt i64 %26, %28
br i1 %29, label %20, label %30
30: ; preds = %20, %16
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.9, i64 0, i64 0))
%32 = load i32, i32* %2
%33 = icmp sgt i32 %32, 0
br i1 %33, label %39, label %34
34: ; preds = %39, %30
%35 = load i32, i32* %1
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %61
37: ; preds = %34
%38 = zext i32 %35 to i64
br label %49
39: ; preds = %30, %39
%40 = phi i64 [ %45, %39 ], [ 0, %30 ]
%41 = trunc i64 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %40
%44 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %43)
%45 = add nuw nsw i64 %40, 1
%46 = load i32, i32* %2
%47 = sext i32 %46 to i64
%48 = icmp slt i64 %45, %47
br i1 %48, label %39, label %34
49: ; preds = %37, %56
%50 = phi i64 [ 0, %37 ], [ %57, %56 ]
%51 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %50
%54 = load i32, i32* %53
%55 = icmp eq i32 %52, %54
br i1 %55, label %56, label %59
56: ; preds = %49
%57 = add nuw nsw i64 %50, 1
%58 = icmp eq i64 %57, %38
br i1 %58, label %65, label %49
59: ; preds = %49
%60 = trunc i64 %50 to i32
br label %61
61: ; preds = %59, %34
%62 = phi i32 [ 0, %34 ], [ %60, %59 ]
%63 = icmp eq i32 %62, %35
%64 = select i1 %63, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.12, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.10, i64 0, i64 0)
br label %65
65: ; preds = %56, %61, %0
%66 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @str.12, i64 0, i64 0), %0 ], [ %64, %61 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @str.12, i64 0, i64 0), %56 ]
%67 = call i32 @puts(i8* dereferenceable(1) %66)
ret i32 0
}