#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*/ abort();
int /*<<< orphan*/ f(int, int, int **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ g(int, int, int **);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int c[2 + 1][3 * 2] = {0};
  g(2, 3, c);
  if (c[1][2] != 3) {
    fprintf(stderr, "c[1][2] != 3\n");
    abort();
  }
  f(2, 3, c);
  if (c[1][2] != 4) {
    fprintf(stderr, "c[1][2] != 4\n");
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x48,%edx
call   1050 <memset@plt>
lea    -0x60(%rbp),%rdx
mov    $0x2,%edi
mov    $0x3,%esi
call   1070 <g@plt>
cmpl   $0x3,-0x40(%rbp)
je     11af <main+0x5f>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
lea    0xe5d(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
lea    -0x60(%rbp),%rdx
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <f@plt>
cmpl   $0x4,-0x40(%rbp)
je     11e8 <main+0x98>
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
lea    0xe32(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x40(%rsp)
mov    %rsp,%rdx
mov    $0x2,%edi
mov    $0x3,%esi
call   1060 <g@plt>
cmpl   $0x3,0x20(%rsp)
jne    119c <main+0x5c>
mov    %rsp,%rdx
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <f@plt>
cmpl   $0x4,0x20(%rsp)
jne    11ae <main+0x6e>
xor    %eax,%eax
add    $0x48,%rsp
ret
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
lea    0xe54(%rip),%rsi
jmp    11be <main+0x7e>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
lea    0xe50(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"c[1][2] != 3\0A\00"
@.str.1 = [14 x i8] c"c[1][2] != 4\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x [6 x i32]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [3 x [6 x i32]]* %6 to i8*
%8 = getelementptr inbounds [3 x [6 x i32]], [3 x [6 x i32]]* %6, i64 0, i64 0
%9 = bitcast [6 x i32]* %8 to i32**
%10 = call i32 @g(i32 2, i32 3, i32** %9)
%11 = getelementptr inbounds [3 x [6 x i32]], [3 x [6 x i32]]* %6, i64 0, i64 1
%12 = getelementptr inbounds [6 x i32], [6 x i32]* %11, i64 0, i64 2
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %2
%20 = getelementptr inbounds [3 x [6 x i32]], [3 x [6 x i32]]* %6, i64 0, i64 0
%21 = bitcast [6 x i32]* %20 to i32**
%22 = call i32 @f(i32 2, i32 3, i32** %21)
%23 = getelementptr inbounds [3 x [6 x i32]], [3 x [6 x i32]]* %6, i64 0, i64 1
%24 = getelementptr inbounds [6 x i32], [6 x i32]* %23, i64 0, i64 2
%25 = load i32, i32* %24
%26 = icmp ne i32 %25, 4
br i1 %26, label %27, label %31
27: ; preds = %19
%28 = load i32, i32* @stderr
%29 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%30 = call i32 (...) @abort()
unreachable
31: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"c[1][2] != 3\0A\00"
@.str.1 = [14 x i8] c"c[1][2] != 4\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x [6 x i32]]
%4 = bitcast [3 x [6 x i32]]* %3 to i8*
%5 = bitcast [3 x [6 x i32]]* %3 to i32**
%6 = call i32 @g(i32 2, i32 3, i32** %5)
%7 = getelementptr inbounds [3 x [6 x i32]], [3 x [6 x i32]]* %3, i64 0, i64 1, i64 2
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 3
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
%15 = call i32 @f(i32 2, i32 3, i32** %5)
%16 = load i32, i32* %7
%17 = icmp eq i32 %16, 4
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 (...) @abort()
unreachable
22: ; preds = %14
ret i32 0
}