#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*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  char board[3][3] = {
      {'1', '2', '3'},
      {'4', '5', '6'},
      {'7', '8', '9'},
  };
  char *pboard = *board;
  printf("board address: %p\n", board);
  printf("pboard address: %p\n", pboard);
  int i = 0;
  for (i = 0; i < 9; i++)
    printf("%c address is ==> %p\n", *(pboard + i), (pboard + i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x19(%rbp)
mov    0xed1(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x19(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x19(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x9,-0x2c(%rbp)
jge    11b1 <main+0xa1>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
mov    -0x28(%rbp),%rdx
movslq -0x2c(%rbp),%rax
add    %rax,%rdx
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1174 <main+0x64>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0xee9(%rip),%al
mov    %al,0x8(%rsp)
mov    0xed6(%rip),%rax
mov    %rax,(%rsp)
lea    0x8(%rsp),%r14
lea    0xed0(%rip),%rdi
mov    %rsp,%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl (%rsp),%esi
lea    0xeba(%rip),%rbx
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1(%rsp),%rdx
movsbl 0x1(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x2(%rsp),%rdx
movsbl 0x2(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x3(%rsp),%rdx
movsbl 0x3(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rdx
movsbl 0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x5(%rsp),%rdx
movsbl 0x5(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x6(%rsp),%rdx
movsbl 0x6(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x7(%rsp),%rdx
movsbl 0x7(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x8(%rsp),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.board = [3 x [3 x i8]] [[3 x i8] c"123", [3 x i8] c"456", [3 x i8] c"789"]
@.str = [19 x i8] c"board address: %p\0A\00"
@.str.1 = [20 x i8] c"pboard address: %p\0A\00"
@.str.2 = [22 x i8] c"%c address is ==> %p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x [3 x i8]]
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [3 x [3 x i8]]* %6 to i8*
%10 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %6, i64 0, i64 0
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
store i8* %11, i8** %7
%12 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %6, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), [3 x i8]* %12)
%14 = load i8*, i8** %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %14)
store i32 0, i32* %8
store i32 0, i32* %8
br label %16
16: ; preds = %31, %2
%17 = load i32, i32* %8
%18 = icmp slt i32 %17, 9
br i1 %18, label %19, label %34
19: ; preds = %16
%20 = load i8*, i8** %7
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = load i8*, i8** %7
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %25, i8* %29)
br label %31
31: ; preds = %19
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %16
34: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@__const.main.board = [3 x [3 x i8]] [[3 x i8] c"123", [3 x i8] c"456", [3 x i8] c"789"]
@.str = [19 x i8] c"board address: %p\0A\00"
@.str.1 = [20 x i8] c"pboard address: %p\0A\00"
@.str.2 = [22 x i8] c"%c address is ==> %p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x [3 x i8]]
%4 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0, i64 0
%5 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), [3 x i8]* %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %9, i8* %4)
%11 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %13, i8* %11)
%15 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0, i64 2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %17, i8* %15)
%19 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0, i64 3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %21, i8* %19)
%23 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0, i64 4
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %25, i8* %23)
%27 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0, i64 5
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %29, i8* %27)
%31 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0, i64 6
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %33, i8* %31)
%35 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0, i64 7
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %37, i8* %35)
%39 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0, i64 8
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %41, i8* %39)
ret i32 0
}