#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int array[3][3] = {{3, 4, 5}, {10, 5, 6}, {0, 1, 1}};
  int **p = NULL;
  int *l = NULL;
  p = (int **)array;
  l = *p + 1;
  printf("%p, %p, %p, %p\n", p, l, array, array[0]);
  int s = 3;
  printf("%d %d\n", (s << 1), (s << 2));
  int *head = NULL;
  head = (int *)malloc(100);
  if (NULL == head) {
    return -1;
  }
  memset(head, 0, 100);
  printf("address:%p\n", head);
  int(*pt)[3] = array;
  printf("%p, %p, %d, %d\n", pt + 1, *pt, *(*pt + 1), *(*pt + 2));
  int abc[4] = {1, 2, 0};
  printf("%p %p \n", abc, &abc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
add    $0x4,%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x40(%rbp),%r8
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3,-0x54(%rbp)
mov    -0x54(%rbp),%esi
shl    $0x1,%esi
mov    -0x54(%rbp),%edx
shl    $0x2,%edx
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x60(%rbp)
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,-0x60(%rbp)
xor    %eax,%eax
cmp    -0x60(%rbp),%rax
jne    1202 <main+0xc2>
movl   $0xffffffff,-0x4(%rbp)
jmp    1288 <main+0x148>
mov    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    -0x60(%rbp),%rsi
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rsi
add    $0xc,%rsi
mov    -0x68(%rbp),%rdx
mov    -0x68(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x68(%rbp),%rax
mov    0x8(%rax),%r8d
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xe04(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe01(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    -0x80(%rbp),%rsi
lea    0xde1(%rip),%rdi
lea    -0x80(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x48,%rsp
mov    0xee4(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec6(%rip),%rdi
xor    %ebp,%ebp
movabs $0x400000007,%rdx
mov    %rsp,%rcx
mov    %rcx,%rsi
mov    %rcx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x6,%esi
mov    $0xc,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1207 <main+0xd7>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
lea    0xe81(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    0x4(%rsp),%ecx
mov    0x8(%rsp),%r8d
lea    0xe6e(%rip),%rdi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
movaps 0xe76(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0xe61(%rip),%rdi
lea    0x30(%rsp),%rdx
mov    %rdx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    120c <main+0xdc>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.array = [3 x [3 x i32]] [[3 x i32] [i32 3, i32 4, i32 5], [3 x i32] [i32 10, i32 5, i32 6], [3 x i32] [i32 0, i32 1, i32 1]]
@.str = [16 x i8] c"%p, %p, %p, %p\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
@.str.2 = [12 x i8] c"address:%p\0A\00"
@.str.3 = [16 x i8] c"%p, %p, %d, %d\0A\00"
@__const.main.abc = [4 x i32] [i32 1, i32 2, i32 0, i32 0]
@.str.4 = [8 x i8] c"%p %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 i32]]
%7 = alloca i32**
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca [3 x i32]*
%12 = alloca [4 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = bitcast [3 x [3 x i32]]* %6 to i8*
store i32** null, i32*** %7
store i32* null, i32** %8
%14 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %6, i64 0, i64 0
%15 = bitcast [3 x i32]* %14 to i32**
store i32** %15, i32*** %7
%16 = load i32**, i32*** %7
%17 = load i32*, i32** %16
%18 = getelementptr inbounds i32, i32* %17, i64 1
store i32* %18, i32** %8
%19 = load i32**, i32*** %7
%20 = load i32*, i32** %8
%21 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %6, i64 0, i64 0
%22 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %6, i64 0, i64 0
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %22, i64 0, i64 0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32** %19, i32* %20, [3 x i32]* %21, i32* %23)
store i32 3, i32* %9
%25 = load i32, i32* %9
%26 = shl i32 %25, 1
%27 = load i32, i32* %9
%28 = shl i32 %27, 2
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %26, i32 %28)
store i32* null, i32** %10
%30 = call i64 @malloc(i32 100)
%31 = inttoptr i64 %30 to i32*
store i32* %31, i32** %10
%32 = load i32*, i32** %10
%33 = icmp eq i32* null, %32
br i1 %33, label %34, label %35
34: ; preds = %2
store i32 -1, i32* %3
br label %57
35: ; preds = %2
%36 = load i32*, i32** %10
%37 = call i32 @memset(i32* %36, i32 0, i32 100)
%38 = load i32*, i32** %10
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %38)
%40 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %6, i64 0, i64 0
store [3 x i32]* %40, [3 x i32]** %11
%41 = load [3 x i32]*, [3 x i32]** %11
%42 = getelementptr inbounds [3 x i32], [3 x i32]* %41, i64 1
%43 = load [3 x i32]*, [3 x i32]** %11
%44 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 0
%45 = load [3 x i32]*, [3 x i32]** %11
%46 = getelementptr inbounds [3 x i32], [3 x i32]* %45, i64 0, i64 0
%47 = getelementptr inbounds i32, i32* %46, i64 1
%48 = load i32, i32* %47
%49 = load [3 x i32]*, [3 x i32]** %11
%50 = getelementptr inbounds [3 x i32], [3 x i32]* %49, i64 0, i64 0
%51 = getelementptr inbounds i32, i32* %50, i64 2
%52 = load i32, i32* %51
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), [3 x i32]* %42, i32* %44, i32 %48, i32 %52)
%54 = bitcast [4 x i32]* %12 to i8*
%55 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 0
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32* %55, [4 x i32]* %12)
store i32 0, i32* %3
br label %57
57: ; preds = %35, %34
%58 = load i32, i32* %3
ret i32 %58
}

LLVM IR (-O2):
@__const.main.array = [3 x [3 x i32]] [[3 x i32] [i32 3, i32 4, i32 5], [3 x i32] [i32 10, i32 5, i32 6], [3 x i32] [i32 0, i32 1, i32 1]]
@.str = [16 x i8] c"%p, %p, %p, %p\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
@.str.2 = [12 x i8] c"address:%p\0A\00"
@.str.3 = [16 x i8] c"%p, %p, %d, %d\0A\00"
@__const.main.abc = [4 x i32] [i32 1, i32 2, i32 0, i32 0]
@.str.4 = [8 x i8] c"%p %p \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x [3 x i32]]
%4 = alloca [4 x i32]
%5 = bitcast [3 x [3 x i32]]* %3 to i8*
%6 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %3, i64 0, i64 0
%7 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %3, i64 0, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), [3 x [3 x i32]]* %3, i32* inttoptr (i64 17179869191 to i32*), [3 x i32]* %6, i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 12)
%10 = call i64 @malloc(i32 100)
%11 = inttoptr i64 %10 to i32*
%12 = icmp eq i64 %10, 0
br i1 %12, label %25, label %13
13: ; preds = %2
%14 = call i32 @memset(i32* %11, i32 0, i32 100)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %11)
%16 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %3, i64 0, i64 1
%17 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %3, i64 0, i64 0, i64 1
%18 = load i32, i32* %17
%19 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %3, i64 0, i64 0, i64 2
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), [3 x i32]* %16, i32* %7, i32 %18, i32 %20)
%22 = bitcast [4 x i32]* %4 to i8*
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32* %23, [4 x i32]* %4)
br label %25
25: ; preds = %2, %13
%26 = phi i32 [ 0, %13 ], [ -1, %2 ]
ret i32 %26
}