#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*/ show_array(int, int, int **);
int /*<<< orphan*/ zero_out(int, int, int **);
int main() {
  int matrix[6][5] = {{1, 2, 3, 4, 5},      {6, 0, 8, 9, 10},
                      {11, 12, 13, 14, 15}, {16, 0, 18, 19, 20},
                      {21, 22, 23, 0, 25},  {26, 27, 28, 29, 30}};
  show_array(6, 5, matrix);
  zero_out(6, 5, matrix);
  show_array(6, 5, matrix);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x78,%edx
call   1030 <memcpy@plt>
lea    -0x80(%rbp),%rdx
mov    $0x6,%edi
mov    $0x5,%esi
call   1040 <show_array@plt>
lea    -0x80(%rbp),%rdx
mov    $0x6,%edi
mov    $0x5,%esi
call   1050 <zero_out@plt>
lea    -0x80(%rbp),%rdx
mov    $0x6,%edi
mov    $0x5,%esi
call   1040 <show_array@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
mov    0xf41(%rip),%rax
mov    %rax,0x70(%rsp)
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe7d(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    $0x6,%edi
mov    $0x5,%esi
mov    %rbx,%rdx
call   1030 <show_array@plt>
mov    $0x6,%edi
mov    $0x5,%esi
mov    %rbx,%rdx
call   1040 <zero_out@plt>
mov    $0x6,%edi
mov    $0x5,%esi
mov    %rbx,%rdx
call   1030 <show_array@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.matrix = [6 x [5 x i32]] [[5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5], [5 x i32] [i32 6, i32 0, i32 8, i32 9, i32 10], [5 x i32] [i32 11, i32 12, i32 13, i32 14, i32 15], [5 x i32] [i32 16, i32 0, i32 18, i32 19, i32 20], [5 x i32] [i32 21, i32 22, i32 23, i32 0, i32 25], [5 x i32] [i32 26, i32 27, i32 28, i32 29, i32 30]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x [5 x i32]]
store i32 0, i32* %1
%3 = bitcast [6 x [5 x i32]]* %2 to i8*
%4 = getelementptr inbounds [6 x [5 x i32]], [6 x [5 x i32]]* %2, i64 0, i64 0
%5 = bitcast [5 x i32]* %4 to i32**
%6 = call i32 @show_array(i32 6, i32 5, i32** %5)
%7 = getelementptr inbounds [6 x [5 x i32]], [6 x [5 x i32]]* %2, i64 0, i64 0
%8 = bitcast [5 x i32]* %7 to i32**
%9 = call i32 @zero_out(i32 6, i32 5, i32** %8)
%10 = getelementptr inbounds [6 x [5 x i32]], [6 x [5 x i32]]* %2, i64 0, i64 0
%11 = bitcast [5 x i32]* %10 to i32**
%12 = call i32 @show_array(i32 6, i32 5, i32** %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.matrix = [6 x [5 x i32]] [[5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5], [5 x i32] [i32 6, i32 0, i32 8, i32 9, i32 10], [5 x i32] [i32 11, i32 12, i32 13, i32 14, i32 15], [5 x i32] [i32 16, i32 0, i32 18, i32 19, i32 20], [5 x i32] [i32 21, i32 22, i32 23, i32 0, i32 25], [5 x i32] [i32 26, i32 27, i32 28, i32 29, i32 30]]
define i32 @main() {
%1 = alloca [6 x [5 x i32]]
%2 = bitcast [6 x [5 x i32]]* %1 to i8*
%3 = bitcast [6 x [5 x i32]]* %1 to i32**
%4 = call i32 @show_array(i32 6, i32 5, i32** %3)
%5 = call i32 @zero_out(i32 6, i32 5, i32** %3)
%6 = call i32 @show_array(i32 6, i32 5, i32** %3)
ret i32 0
}