#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*/ print_matrix(int *, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_zero(int *, int, int);
void main() {
  int m1[][4] = {{0, 0, 0, 1}, {5, 6, 7, 8}, {9, 3, 1, 2}, {3, 4, 5, 6}};
  printf("Before setting zeroes...\n");
  print_matrix(&m1[0][0], 4, 4);
  set_zero(&m1[0][0], 4, 4);
  printf("After setting zeroes...\n");
  print_matrix(&m1[0][0], 4, 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x4,%edx
mov    %edx,%esi
call   1060 <print_matrix@plt>
lea    -0x40(%rbp),%rdi
mov    $0x4,%edx
mov    %edx,%esi
call   1050 <set_zero@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x4,%edx
mov    %edx,%esi
call   1060 <print_matrix@plt>
add    $0x40,%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)
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
call   1050 <print_matrix@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
call   1040 <set_zero@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
call   1050 <print_matrix@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.m1 = [4 x [4 x i32]] [[4 x i32] [i32 0, i32 0, i32 0, i32 1], [4 x i32] [i32 5, i32 6, i32 7, i32 8], [4 x i32] [i32 9, i32 3, i32 1, i32 2], [4 x i32] [i32 3, i32 4, i32 5, i32 6]]
@.str = [26 x i8] c"Before setting zeroes...\0A\00"
@.str.1 = [25 x i8] c"After setting zeroes...\0A\00"
define void @main() {
%1 = alloca [4 x [4 x i32]]
%2 = bitcast [4 x [4 x i32]]* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 0
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%6 = call i32 @print_matrix(i32* %5, i32 4, i32 4)
%7 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 0
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%9 = call i32 @set_zero(i32* %8, i32 4, i32 4)
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 0
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 0
%13 = call i32 @print_matrix(i32* %12, i32 4, i32 4)
ret void
}

LLVM IR (-O2):
@__const.main.m1 = [4 x [4 x i32]] [[4 x i32] [i32 0, i32 0, i32 0, i32 1], [4 x i32] [i32 5, i32 6, i32 7, i32 8], [4 x i32] [i32 9, i32 3, i32 1, i32 2], [4 x i32] [i32 3, i32 4, i32 5, i32 6]]
@str = [25 x i8] c"Before setting zeroes...\00"
@str.2 = [24 x i8] c"After setting zeroes...\00"
define void @main() {
%1 = alloca [4 x [4 x i32]]
%2 = bitcast [4 x [4 x i32]]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 0, i64 0
%5 = call i32 @print_matrix(i32* %4, i32 4, i32 4)
%6 = call i32 @set_zero(i32* %4, i32 4, i32 4)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0))
%8 = call i32 @print_matrix(i32* %4, i32 4, i32 4)
ret void
}