#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*/ fillZeroes(int **);
int /*<<< orphan*/ findZeros(int **);
int /*<<< orphan*/ printMatrix(int **);
int main(int argc, const char *argv[]) {
  int matrix[4][4] = {
      {1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}};
  printMatrix(matrix);
  matrix[2][1] = 0;
  findZeros(matrix);
  fillZeroes(matrix);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rdi
call   1050 <printMatrix@plt>
movl   $0x0,-0x2c(%rbp)
lea    -0x50(%rbp),%rdi
call   1060 <findZeros@plt>
lea    -0x50(%rbp),%rdi
call   1030 <fillZeroes@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea0(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <printMatrix@plt>
movl   $0x0,0x24(%rsp)
mov    %rbx,%rdi
call   1050 <findZeros@plt>
mov    %rbx,%rdi
call   1030 <fillZeroes@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.matrix = [4 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 3, i32 4], [4 x i32] [i32 5, i32 6, i32 7, i32 8], [4 x i32] [i32 9, i32 10, i32 11, i32 12], [4 x i32] [i32 13, i32 14, i32 15, i32 16]]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x [4 x i32]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [4 x [4 x i32]]* %6 to i8*
%8 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %6, i64 0, i64 0
%9 = bitcast [4 x i32]* %8 to i32**
%10 = call i32 @printMatrix(i32** %9)
%11 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %6, i64 0, i64 2
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 1
store i32 0, i32* %12
%13 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %6, i64 0, i64 0
%14 = bitcast [4 x i32]* %13 to i32**
%15 = call i32 @findZeros(i32** %14)
%16 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %6, i64 0, i64 0
%17 = bitcast [4 x i32]* %16 to i32**
%18 = call i32 @fillZeroes(i32** %17)
ret i32 0
}

LLVM IR (-O2):
@__const.main.matrix = [4 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 3, i32 4], [4 x i32] [i32 5, i32 6, i32 7, i32 8], [4 x i32] [i32 9, i32 10, i32 11, i32 12], [4 x i32] [i32 13, i32 14, i32 15, i32 16]]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x [4 x i32]]
%4 = bitcast [4 x [4 x i32]]* %3 to i8*
%5 = bitcast [4 x [4 x i32]]* %3 to i32**
%6 = call i32 @printMatrix(i32** %5)
%7 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %3, i64 0, i64 2, i64 1
store i32 0, i32* %7
%8 = call i32 @findZeros(i32** %5)
%9 = call i32 @fillZeroes(i32** %5)
ret i32 0
}