#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*/ assert(int);
int /*<<< orphan*/ mark(int **, int, int);
scalar_t__ memcmp(int *, int *, int);
int main() {
  int matrix[3][5] = {{1, 1, 1, 1, 1}, {1, 1, 0, 1, 1}, {1, 1, 1, 1, 1}};
  int expected[3][5] = {{1, 1, 0, 1, 1}, {0, 0, 0, 0, 0}, {1, 1, 0, 1, 1}};
  mark(matrix, 3, 5);
  for (int i = 0; i < 3; i++) {
    assert(memcmp(matrix[i], expected[i], 5) == 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0x3c,%edx
call   1050 <memcpy@plt>
lea    -0x80(%rbp),%rdi
lea    0xece(%rip),%rsi
mov    $0x3c,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
call   1060 <mark@plt>
movl   $0x0,-0x84(%rbp)
cmpl   $0x3,-0x84(%rbp)
jge    11f9 <main+0xb9>
movslq -0x84(%rbp),%rax
lea    -0x40(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
movslq -0x84(%rbp),%rax
lea    -0x80(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1199 <main+0x59>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
movups 0xeed(%rip),%xmm0
movups %xmm0,0x6c(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe9d(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movups 0xefd(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x5,%edx
call   1050 <mark@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <memcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0x54(%rsp),%rdi
lea    0x14(%rsp),%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0x68(%rsp),%rdi
lea    0x28(%rsp),%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.matrix = [3 x [5 x i32]] [[5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1], [5 x i32] [i32 1, i32 1, i32 0, i32 1, i32 1], [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1]]
@__const.main.expected = [3 x [5 x i32]] [[5 x i32] [i32 1, i32 1, i32 0, i32 1, i32 1], [5 x i32] zeroinitializer, [5 x i32] [i32 1, i32 1, i32 0, i32 1, i32 1]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [5 x i32]]
%3 = alloca [3 x [5 x i32]]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [3 x [5 x i32]]* %2 to i8*
%6 = bitcast [3 x [5 x i32]]* %3 to i8*
%7 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 0
%8 = bitcast [5 x i32]* %7 to i32**
%9 = call i32 @mark(i32** %8, i32 3, i32 5)
store i32 0, i32* %4
br label %10
10: ; preds = %26, %0
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %29
13: ; preds = %10
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 %15
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %16, i64 0, i64 0
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %3, i64 0, i64 %19
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %20, i64 0, i64 0
%22 = call i64 @memcmp(i32* %17, i32* %21, i32 5)
%23 = icmp eq i64 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
br label %26
26: ; preds = %13
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %10
29: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@__const.main.matrix = [3 x [5 x i32]] [[5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1], [5 x i32] [i32 1, i32 1, i32 0, i32 1, i32 1], [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1]]
@__const.main.expected = [3 x [5 x i32]] [[5 x i32] [i32 1, i32 1, i32 0, i32 1, i32 1], [5 x i32] zeroinitializer, [5 x i32] [i32 1, i32 1, i32 0, i32 1, i32 1]]
define i32 @main() {
%1 = alloca [3 x [5 x i32]]
%2 = alloca [3 x [5 x i32]]
%3 = bitcast [3 x [5 x i32]]* %1 to i8*
%4 = bitcast [3 x [5 x i32]]* %2 to i8*
%5 = bitcast [3 x [5 x i32]]* %1 to i32**
%6 = call i32 @mark(i32** %5, i32 3, i32 5)
%7 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 0
%8 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 0, i64 0
%9 = call i64 @memcmp(i32* %7, i32* %8, i32 5)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 1, i64 0
%14 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 1, i64 0
%15 = call i64 @memcmp(i32* %13, i32* %14, i32 5)
%16 = icmp eq i64 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 2, i64 0
%20 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 2, i64 0
%21 = call i64 @memcmp(i32* %19, i32* %20, i32 5)
%22 = icmp eq i64 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
ret i32 0
}