#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 */
scalar_t__ equal_rows(int *, int *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int a1[10] = {0, 2, 2, 2, 5, 5, 8, 8, 8, 8};
  int a2[10] = {0, 2, 2, 2, 5, 5, 8, 8, 8, 8};
  printf("%s\n", equal_rows(a1, a2, 10) ? "De rijen zijn gelijk aan elkaar."
                                        : "De rijen zijn ongelijk aan elkaar.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xed1(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0xa,%edx
call   1040 <equal_rows@plt>
mov    %rax,%rcx
lea    0xef8(%rip),%rsi
lea    0xed0(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xebd(%rip),%xmm1
movaps %xmm1,0x30(%rsp)
mov    %rax,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm1,(%rsp)
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1040 <equal_rows@plt>
test   %rax,%rax
lea    0xedb(%rip),%rax
lea    0xeb3(%rip),%rsi
cmove  %rax,%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.a1 = [10 x i32] [i32 0, i32 2, i32 2, i32 2, i32 5, i32 5, i32 8, i32 8, i32 8, i32 8]
@__const.main.a2 = [10 x i32] [i32 0, i32 2, i32 2, i32 2, i32 5, i32 5, i32 8, i32 8, i32 8, i32 8]
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [33 x i8] c"De rijen zijn gelijk aan elkaar.\00"
@.str.2 = [35 x i8] c"De rijen zijn ongelijk aan elkaar.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = bitcast [10 x i32]* %3 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%8 = call i64 @equal_rows(i32* %6, i32* %7, i32 10)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a2 = [10 x i32] [i32 0, i32 2, i32 2, i32 2, i32 5, i32 5, i32 8, i32 8, i32 8, i32 8]
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [33 x i8] c"De rijen zijn gelijk aan elkaar.\00"
@.str.2 = [35 x i8] c"De rijen zijn ongelijk aan elkaar.\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i64 @equal_rows(i32* %5, i32* %6, i32 10)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}