#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 */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ sameArray(int *, int *, int);
int main() {
  int a[] = {1, 2, 3, 4, 5, 6};
  printf("sizeof a: %d\n", sizeof(a) / sizeof(*a));
  int b[] = {1, 2, 3, 4, 5, 6};
  printf("sizeof b: %d\n", sizeof(b) / sizeof(*a));
  if (sameArray(a, b, sizeof(a) / sizeof(*a)) == 0) {
    printf("The arrays matched.");
  } else {
    printf("The arrays did not match.");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xee1(%rip),%rdi
mov    $0x6,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0xeb6(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xebb(%rip),%rdi
mov    $0x6,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x6,%edx
call   1030 <sameArray@plt>
cmp    $0x0,%rax
jne    11c6 <main+0xa6>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d4 <main+0xb4>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0xf34(%rip),%rbx
mov    %rbx,0x30(%rsp)
movaps 0xf18(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0xebc(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,0x10(%rsp)
movaps 0xef4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xea7(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x6,%edx
call   1030 <sameArray@plt>
test   %rax,%rax
lea    0xe8d(%rip),%rax
lea    0xe9a(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@.str = [14 x i8] c"sizeof a: %d\0A\00"
@__const.main.b = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@.str.1 = [14 x i8] c"sizeof b: %d\0A\00"
@.str.2 = [20 x i8] c"The arrays matched.\00"
@.str.3 = [26 x i8] c"The arrays did not match.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca [6 x i32]
store i32 0, i32* %1
%4 = bitcast [6 x i32]* %2 to i8*
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 6)
%6 = bitcast [6 x i32]* %3 to i8*
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i64 6)
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%10 = call i64 @sameArray(i32* %8, i32* %9, i32 6)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"sizeof a: %d\0A\00"
@__const.main.b = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@.str.1 = [14 x i8] c"sizeof b: %d\0A\00"
@.str.2 = [20 x i8] c"The arrays matched.\00"
@.str.3 = [26 x i8] c"The arrays did not match.\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca [6 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 6)
%5 = bitcast [6 x i32]* %2 to i8*
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i64 6)
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%9 = call i64 @sameArray(i32* %7, i32* %8, i32 6)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %11)
ret i32 0
}