#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 */
typedef int /*<<< orphan*/ c;

/* 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*/ memset(int **, int /*<<< orphan*/, int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int c[2 + 1][3 * 2];
  memset(c, 0, sizeof(c));
  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>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x48,%edx
call   1050 <memset@plt>
mov    $0x2,%edi
mov    $0x3,%esi
mov    %rbx,%rdx
call   1070 <g@plt>
cmpl   $0x3,0x20(%rsp)
jne    11a1 <main+0x51>
mov    %rsp,%rdx
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <f@plt>
cmpl   $0x4,0x20(%rsp)
jne    11b3 <main+0x63>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
lea    0xe4f(%rip),%rsi
jmp    11c3 <main+0x73>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
lea    0xe4b(%rip),%rsi
call   1060 <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 = getelementptr inbounds [3 x [6 x i32]], [3 x [6 x i32]]* %6, i64 0, i64 0
%8 = bitcast [6 x i32]* %7 to i32**
%9 = call i32 @memset(i32** %8, i32 0, i32 72)
%10 = getelementptr inbounds [3 x [6 x i32]], [3 x [6 x i32]]* %6, i64 0, i64 0
%11 = bitcast [6 x i32]* %10 to i32**
%12 = call i32 @g(i32 2, i32 3, i32** %11)
%13 = getelementptr inbounds [3 x [6 x i32]], [3 x [6 x i32]]* %6, i64 0, i64 1
%14 = getelementptr inbounds [6 x i32], [6 x i32]* %13, i64 0, i64 2
%15 = load i32, i32* %14
%16 = icmp ne i32 %15, 3
br i1 %16, label %17, label %21
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %2
%22 = getelementptr inbounds [3 x [6 x i32]], [3 x [6 x i32]]* %6, i64 0, i64 0
%23 = bitcast [6 x i32]* %22 to i32**
%24 = call i32 @f(i32 2, i32 3, i32** %23)
%25 = getelementptr inbounds [3 x [6 x i32]], [3 x [6 x i32]]* %6, i64 0, i64 1
%26 = getelementptr inbounds [6 x i32], [6 x i32]* %25, i64 0, i64 2
%27 = load i32, i32* %26
%28 = icmp ne i32 %27, 4
br i1 %28, label %29, label %33
29: ; preds = %21
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%32 = call i32 (...) @abort()
unreachable
33: ; preds = %21
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 @memset(i32** %5, i32 0, i32 72)
%7 = call i32 @g(i32 2, i32 3, i32** %5)
%8 = getelementptr inbounds [3 x [6 x i32]], [3 x [6 x i32]]* %3, i64 0, i64 1, i64 2
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 3
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
%16 = call i32 @f(i32 2, i32 3, i32** %5)
%17 = load i32, i32* %8
%18 = icmp eq i32 %17, 4
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 (...) @abort()
unreachable
23: ; preds = %15
ret i32 0
}