#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*/ exit(int /*<<< orphan*/);
int fnCheckIdentical(int *, int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int iaArr1[50], iaArr2[50], iLen1, iLen2, i, iFlag;
  int *iptr1, *iptr2;
  printf("\nEnter the no of elements in the 1st array\n");
  scanf("%d", &iLen1);
  printf("\nEnter the no of elements in the 2nd array\n");
  scanf("%d", &iLen2);
  if (iLen1 != iLen2) {
    printf("\nArrays are not Identical\n");
    exit(0);
  }
  printf("\nEnter elements of 1st Array\n");
  for (i = 0; i < iLen1; i++)
    scanf("%d", &iaArr1[i]);
  printf("\nEnter elements of 2nd Array\n");
  for (i = 0; i < iLen2; i++)
    scanf("%d", &iaArr2[i]);
  iptr1 = iaArr1;
  iptr2 = iaArr2;
  iFlag = fnCheckIdentical(iptr1, iptr2, iLen1);
  if (iFlag)
    printf("\nArrays are Identical\n");
  else
    printf("\nArrays are not Identical\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x1a4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
lea    -0x1a8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1a4(%rbp),%eax
cmp    -0x1a8(%rbp),%eax
je     11b5 <main+0x75>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
cmp    -0x1a4(%rbp),%eax
jge    1212 <main+0xd2>
movslq -0x1ac(%rbp),%rax
lea    -0xd0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe33(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    11cb <main+0x8b>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
cmp    -0x1a8(%rbp),%eax
jge    126f <main+0x12f>
movslq -0x1ac(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdd6(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    1228 <main+0xe8>
lea    -0xd0(%rbp),%rax
mov    %rax,-0x1b8(%rbp)
lea    -0x1a0(%rbp),%rax
mov    %rax,-0x1c0(%rbp)
mov    -0x1b8(%rbp),%rdi
mov    -0x1c0(%rbp),%rsi
mov    -0x1a4(%rbp),%edx
call   1060 <fnCheckIdentical@plt>
mov    %eax,-0x1b0(%rbp)
cmpl   $0x0,-0x1b0(%rbp)
je     12c8 <main+0x188>
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
jmp    12d4 <main+0x194>
lea    0xd8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1b0,%rsp
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
lea    0xea1(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
cmp    0xc(%rsp),%eax
jne    125b <main+0x11b>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0x8(%rsp)
jle    11dd <main+0x9d>
lea    0xe0(%rsp),%r15
xor    %ebx,%ebx
lea    0xe49(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     11c0 <main+0x80>
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0xc(%rsp)
jle    121d <main+0xdd>
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
lea    0xe02(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1200 <main+0xc0>
mov    0x8(%rsp),%edx
lea    0xe0(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1060 <fnCheckIdentical@plt>
test   %eax,%eax
lea    0xe6d(%rip),%rax
lea    0xe50(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"\0AEnter the no of elements in the 1st array\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [44 x i8] c"\0AEnter the no of elements in the 2nd array\0A\00"
@.str.3 = [27 x i8] c"\0AArrays are not Identical\0A\00"
@.str.4 = [30 x i8] c"\0AEnter elements of 1st Array\0A\00"
@.str.5 = [30 x i8] c"\0AEnter elements of 2nd Array\0A\00"
@.str.6 = [23 x i8] c"\0AArrays are Identical\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i32]
%3 = alloca [50 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
store i32 0, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%12 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %0
%18 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 @exit(i32 0)
unreachable
20: ; preds = %0
%21 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %6
br label %22
22: ; preds = %31, %20
%23 = load i32, i32* %6
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %34
26: ; preds = %22
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %28
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %29)
br label %31
31: ; preds = %26
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %22
34: ; preds = %22
%35 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %6
br label %36
36: ; preds = %45, %34
%37 = load i32, i32* %6
%38 = load i32, i32* %5
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %48
40: ; preds = %36
%41 = load i32, i32* %6
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 %42
%44 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %43)
br label %45
45: ; preds = %40
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
br label %36
48: ; preds = %36
%49 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
store i32* %49, i32** %8
%50 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 0
store i32* %50, i32** %9
%51 = load i32*, i32** %8
%52 = load i32*, i32** %9
%53 = load i32, i32* %4
%54 = call i32 @fnCheckIdentical(i32* %51, i32* %52, i32 %53)
store i32 %54, i32* %7
%55 = load i32, i32* %7
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %48
%58 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
br label %61
59: ; preds = %48
%60 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %61
61: ; preds = %59, %57
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [43 x i8] c"\0AEnter the no of elements in the 1st array\00"
@str.7 = [43 x i8] c"\0AEnter the no of elements in the 2nd array\00"
@str.8 = [29 x i8] c"\0AEnter elements of 1st Array\00"
@str.9 = [29 x i8] c"\0AEnter elements of 2nd Array\00"
@str.11 = [22 x i8] c"\0AArrays are Identical\00"
@str.12 = [26 x i8] c"\0AArrays are not Identical\00"
define i32 @main() {
%1 = alloca [50 x i32]
%2 = alloca [50 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [50 x i32]* %1 to i8*
%6 = bitcast [50 x i32]* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 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* %3)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.7, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp eq i32 %13, %14
br i1 %15, label %19, label %16
16: ; preds = %0
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.12, i64 0, i64 0))
%18 = call i32 @exit(i32 0)
unreachable
19: ; preds = %0
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.8, i64 0, i64 0))
%21 = load i32, i32* %3
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %31
23: ; preds = %19, %23
%24 = phi i64 [ %27, %23 ], [ 0, %19 ]
%25 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %24
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %25)
%27 = add nuw nsw i64 %24, 1
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = icmp slt i64 %27, %29
br i1 %30, label %23, label %31
31: ; preds = %23, %19
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.9, i64 0, i64 0))
%33 = load i32, i32* %4
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %43
35: ; preds = %31, %35
%36 = phi i64 [ %39, %35 ], [ 0, %31 ]
%37 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %36
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %37)
%39 = add nuw nsw i64 %36, 1
%40 = load i32, i32* %4
%41 = sext i32 %40 to i64
%42 = icmp slt i64 %39, %41
br i1 %42, label %35, label %43
43: ; preds = %35, %31
%44 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
%45 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
%46 = load i32, i32* %3
%47 = call i32 @fnCheckIdentical(i32* %44, i32* %45, i32 %46)
%48 = icmp eq i32 %47, 0
%49 = select i1 %48, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.12, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.11, i64 0, i64 0)
%50 = call i32 @puts(i8* dereferenceable(1) %49)
ret i32 0
}