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

/* Variables and functions */
int array_pointer_add(int **);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ strlen(char *);
int main() {
  int i;
  int a[5] = {1, 2, 3, 4, 5};
  int *p = (int *)(&a + 1);
  printf("%d,%d\n", *(a + 1), *(p - 1));
  int *q = &a[0];
  for (i = 0; i < 3; i++)
    printf("%d,", *q++);
  for (i = 0; i < 3; i++)
    printf("%d,", *p++);
  int arr[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
  int(*pp)[3] = arr;
  pp++;
  printf("\n sth: %d\n", *(*pp + 3));
  printf("\n%d, %d\n", arr[0][1] * arr[1][2], array_pointer_add(arr));
  char b[10] = "china\0cc";
  printf("%lu %lu %s\n", strlen(b), sizeof(b), b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea2(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%rax
mov    -0x4(%rax),%edx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11db <main+0x9b>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x30(%rbp)
mov    (%rax),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a4 <main+0x64>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1219 <main+0xd9>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e2 <main+0xa2>
lea    -0x60(%rbp),%rdi
lea    0xdfc(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    0xc(%rax),%esi
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x5c(%rbp),%eax
imul   -0x4c(%rbp),%eax
mov    %eax,-0x78(%rbp)
lea    -0x60(%rbp),%rdi
call   1060 <array_pointer_add@plt>
mov    -0x78(%rbp),%esi
mov    %eax,%edx
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0xdc0(%rip),%rax
mov    %rax,-0x72(%rbp)
mov    0xdbd(%rip),%ax
mov    %ax,-0x6a(%rbp)
lea    -0x72(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    -0x72(%rbp),%rcx
lea    0xdc4(%rip),%rdi
mov    $0xa,%edx
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rdi
mov    $0x2,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xeab(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xe90(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe74(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xe43(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rdi
call   1050 <array_pointer_add@plt>
lea    0xe31(%rip),%rdi
mov    $0xc,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movabs $0x636300616e696863,%rax
mov    %rax,(%rsp)
movw   $0x0,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xe05(%rip),%rdi
mov    $0xa,%edx
mov    %eax,%esi
mov    %rbx,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [7 x i8] c"%d,%d\0A\00"
@.str.1 = [4 x i8] c"%d,\00"
@__const.main.arr = [3 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6], [3 x i32] [i32 7, i32 8, i32 9]]
@.str.2 = [11 x i8] c"\0A sth: %d\0A\00"
@.str.3 = [9 x i8] c"\0A%d, %d\0A\00"
@__const.main.b = [10 x i8] c"china\00cc\00\00"
@.str.4 = [12 x i8] c"%lu %lu %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i32]
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca [3 x [3 x i32]]
%7 = alloca [3 x i32]*
%8 = alloca [10 x i8]
store i32 0, i32* %1
%9 = bitcast [5 x i32]* %3 to i8*
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 1
%11 = bitcast [5 x i32]* %10 to i32*
store i32* %11, i32** %4
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 -1
%17 = load i32, i32* %16
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %17)
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
store i32* %19, i32** %5
store i32 0, i32* %2
br label %20
20: ; preds = %28, %0
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 3
br i1 %22, label %23, label %31
23: ; preds = %20
%24 = load i32*, i32** %5
%25 = getelementptr inbounds i32, i32* %24, i32 1
store i32* %25, i32** %5
%26 = load i32, i32* %24
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %23
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %20
31: ; preds = %20
store i32 0, i32* %2
br label %32
32: ; preds = %40, %31
%33 = load i32, i32* %2
%34 = icmp slt i32 %33, 3
br i1 %34, label %35, label %43
35: ; preds = %32
%36 = load i32*, i32** %4
%37 = getelementptr inbounds i32, i32* %36, i32 1
store i32* %37, i32** %4
%38 = load i32, i32* %36
%39 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %35
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %32
43: ; preds = %32
%44 = bitcast [3 x [3 x i32]]* %6 to i8*
%45 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %6, i64 0, i64 0
store [3 x i32]* %45, [3 x i32]** %7
%46 = load [3 x i32]*, [3 x i32]** %7
%47 = getelementptr inbounds [3 x i32], [3 x i32]* %46, i32 1
store [3 x i32]* %47, [3 x i32]** %7
%48 = load [3 x i32]*, [3 x i32]** %7
%49 = getelementptr inbounds [3 x i32], [3 x i32]* %48, i64 0, i64 0
%50 = getelementptr inbounds i32, i32* %49, i64 3
%51 = load i32, i32* %50
%52 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %51)
%53 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %6, i64 0, i64 0
%54 = getelementptr inbounds [3 x i32], [3 x i32]* %53, i64 0, i64 1
%55 = load i32, i32* %54
%56 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %6, i64 0, i64 1
%57 = getelementptr inbounds [3 x i32], [3 x i32]* %56, i64 0, i64 2
%58 = load i32, i32* %57
%59 = mul nsw i32 %55, %58
%60 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %6, i64 0, i64 0
%61 = bitcast [3 x i32]* %60 to i32**
%62 = call i32 @array_pointer_add(i32** %61)
%63 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %59, i32 %62)
%64 = bitcast [10 x i8]* %8 to i8*
%65 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%66 = call i32 @strlen(i8* %65)
%67 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%68 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %66, i64 10, i8* %67)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d,%d\0A\00"
@.str.1 = [4 x i8] c"%d,\00"
@__const.main.arr = [3 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6], [3 x i32] [i32 7, i32 8, i32 9]]
@.str.2 = [11 x i8] c"\0A sth: %d\0A\00"
@.str.3 = [9 x i8] c"\0A%d, %d\0A\00"
@__const.main.b = [10 x i8] c"china\00cc\00\00"
@.str.4 = [12 x i8] c"%lu %lu %s\0A\00"
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = alloca [10 x i8]
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2, i32 5)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 poison)
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 poison)
%9 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 poison)
%10 = bitcast [3 x [3 x i32]]* %1 to i8*
%11 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 7)
%12 = bitcast [3 x [3 x i32]]* %1 to i32**
%13 = call i32 @array_pointer_add(i32** %12)
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 12, i32 %13)
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%16 = call i32 @strlen(i8* %15)
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %16, i64 10, i8* %15)
ret i32 0
}