#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*/ p;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
void main() {
  int a[3][4] = {{1, 3, 5, 7}, {9, 11, 13, 15}, {17, 19, 21, 23}};
  int(*p)[4], i, j;
  p = a;
  printf("Enter the i and j:\n");
  scanf("%d %d", &i, &j);
  printf("array size = %d or %d,a[%d,%d]=%d\n", sizeof(p[i]), sizeof(*(p + i)),
         i, j, *(*(p + i) + j));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x3c(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%r8d
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rdx
shl    $0x4,%rdx
add    %rdx,%rax
movslq -0x40(%rbp),%rdx
mov    (%rax,%rdx,4),%r9d
lea    0xeae(%rip),%rdi
mov    $0x10,%edx
mov    %rdx,%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf21(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rcx
movslq (%rsp),%r8
mov    %rcx,%rax
shl    $0x4,%rax
lea    0xe98(%rip),%rdx
add    %rax,%rdx
mov    (%rdx,%r8,4),%r9d
lea    0xec0(%rip),%rdi
mov    $0x10,%esi
mov    $0x10,%edx
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.main.a = [3 x [4 x i32]] [[4 x i32] [i32 1, i32 3, i32 5, i32 7], [4 x i32] [i32 9, i32 11, i32 13, i32 15], [4 x i32] [i32 17, i32 19, i32 21, i32 23]]
@.str = [20 x i8] c"Enter the i and j:\0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [35 x i8] c"array size = %d or %d,a[%d,%d]=%d\0A\00"
define void @main() {
%1 = alloca [3 x [4 x i32]]
%2 = alloca [4 x i32]*
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [3 x [4 x i32]]* %1 to i8*
%6 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 0
store [4 x i32]* %6, [4 x i32]** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load [4 x i32]*, [4 x i32]** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 %13
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 0
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i64 16, i64 16, i32 %9, i32 %10, i32 %19)
ret void
}

LLVM IR (-O2):
@__const.main.a = [3 x [4 x i32]] [[4 x i32] [i32 1, i32 3, i32 5, i32 7], [4 x i32] [i32 9, i32 11, i32 13, i32 15], [4 x i32] [i32 17, i32 19, i32 21, i32 23]]
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [35 x i8] c"array size = %d or %d,a[%d,%d]=%d\0A\00"
@str = [19 x i8] c"Enter the i and j:\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = sext i32 %7 to i64
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* @__const.main.a, i64 0, i64 %9, i64 %10
%12 = load i32, i32* %11
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i64 16, i64 16, i32 %7, i32 %8, i32 %12)
ret void
}