#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() {
  char c = 'a';
  printf("%c\n", c);
  char *string = "abc";
  printf("%c%c%c\n", string[0], string[1], string[2]);
  printf("%s\n", string);
  char **pString = &string;
  printf("%s\n", *pString);
  printf("%s\n", pString[0]);
  printf("%c\n", pString[0][0]);
  char ***pStr = NULL;
  pStr = &pString;
  printf("%s\n", pStr[0][0]);
  int arr[3][2] = {
      {10, 20},
      {30, 40},
      {50, 60},
  };
  printf("%d\n", arr[2][1]);
  printf("%d\n", *(arr[2] + 1));
  printf("%d\n", *(*(arr + 2) + 1));
  char *str[] = {"abc", "cbd", "def"};
  char *str2[3][4] = {"abc", "def", "123"};
  printf("%s\n", str[0]);
  char **pStr2 = str;
  char ***pStr3 = &pStr2;
  printf("%s\n", pStr3[0][0]);
  printf("%s\n", *(*(pStr3)));
  printf("%s\n", str2[0][0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edx
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%ecx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%esi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x20(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xe1d(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe1a(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe17(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2ba9(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2ba6(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0x2ba3(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    -0xc0(%rbp),%rdi
xor    %esi,%esi
mov    $0x60,%edx
call   1040 <memset@plt>
lea    0xd75(%rip),%rax
mov    %rax,-0xc0(%rbp)
lea    0xd7f(%rip),%rax
mov    %rax,-0xb8(%rbp)
lea    0xd75(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x60(%rbp),%rsi
lea    0xd53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rax
mov    %rax,-0xc8(%rbp)
lea    -0xc8(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
lea    0xd1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xd0(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc0(%rbp),%rsi
lea    0xcef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xedd(%rip),%r14
mov    %r14,%rdi
mov    $0x61,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x61,%esi
mov    $0x62,%edx
mov    $0x63,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea2(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    $0x61,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe78(%rip),%r14
mov    %r14,%rdi
mov    $0x3c,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x3c,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x3c,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [8 x i8] c"%c%c%c\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@__const.main.arr = [3 x [2 x i32]] [[2 x i32] [i32 10, i32 20], [2 x i32] [i32 30, i32 40], [2 x i32] [i32 50, i32 60]]
@.str.4 = [4 x i8] c"%d\0A\00"
@.str.5 = [4 x i8] c"cbd\00"
@.str.6 = [4 x i8] c"def\00"
@__const.main.str = [3 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0)]
@.str.7 = [4 x i8] c"123\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8***
%6 = alloca [3 x [2 x i32]]
%7 = alloca [3 x i8*]
%8 = alloca [3 x [4 x i8*]]
%9 = alloca i8**
%10 = alloca i8***
store i32 0, i32* %1
store i8 97, i8* %2
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %3
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 2
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %21, i32 %25)
%27 = load i8*, i8** %3
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %27)
store i8** %3, i8*** %4
%29 = load i8**, i8*** %4
%30 = load i8*, i8** %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %30)
%32 = load i8**, i8*** %4
%33 = getelementptr inbounds i8*, i8** %32, i64 0
%34 = load i8*, i8** %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %34)
%36 = load i8**, i8*** %4
%37 = getelementptr inbounds i8*, i8** %36, i64 0
%38 = load i8*, i8** %37
%39 = getelementptr inbounds i8, i8* %38, i64 0
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %41)
store i8*** null, i8**** %5
store i8*** %4, i8**** %5
%43 = load i8***, i8**** %5
%44 = getelementptr inbounds i8**, i8*** %43, i64 0
%45 = load i8**, i8*** %44
%46 = getelementptr inbounds i8*, i8** %45, i64 0
%47 = load i8*, i8** %46
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %47)
%49 = bitcast [3 x [2 x i32]]* %6 to i8*
%50 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %6, i64 0, i64 2
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %50, i64 0, i64 1
%52 = load i32, i32* %51
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %52)
%54 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %6, i64 0, i64 2
%55 = getelementptr inbounds [2 x i32], [2 x i32]* %54, i64 0, i64 0
%56 = getelementptr inbounds i32, i32* %55, i64 1
%57 = load i32, i32* %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %57)
%59 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %6, i64 0, i64 0
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %59, i64 2
%61 = getelementptr inbounds [2 x i32], [2 x i32]* %60, i64 0, i64 0
%62 = getelementptr inbounds i32, i32* %61, i64 1
%63 = load i32, i32* %62
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %63)
%65 = bitcast [3 x i8*]* %7 to i8*
%66 = bitcast [3 x [4 x i8*]]* %8 to i8*
%67 = bitcast i8* %66 to [3 x [4 x i8*]]*
%68 = getelementptr inbounds [3 x [4 x i8*]], [3 x [4 x i8*]]* %67, i32 0, i32 0
%69 = getelementptr inbounds [4 x i8*], [4 x i8*]* %68, i32 0, i32 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8** %69
%70 = getelementptr inbounds [4 x i8*], [4 x i8*]* %68, i32 0, i32 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8** %70
%71 = getelementptr inbounds [4 x i8*], [4 x i8*]* %68, i32 0, i32 2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8** %71
%72 = getelementptr inbounds [3 x i8*], [3 x i8*]* %7, i64 0, i64 0
%73 = load i8*, i8** %72
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %73)
%75 = getelementptr inbounds [3 x i8*], [3 x i8*]* %7, i64 0, i64 0
store i8** %75, i8*** %9
store i8*** %9, i8**** %10
%76 = load i8***, i8**** %10
%77 = getelementptr inbounds i8**, i8*** %76, i64 0
%78 = load i8**, i8*** %77
%79 = getelementptr inbounds i8*, i8** %78, i64 0
%80 = load i8*, i8** %79
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %80)
%82 = load i8***, i8**** %10
%83 = load i8**, i8*** %82
%84 = load i8*, i8** %83
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %84)
%86 = getelementptr inbounds [3 x [4 x i8*]], [3 x [4 x i8*]]* %8, i64 0, i64 0
%87 = getelementptr inbounds [4 x i8*], [4 x i8*]* %86, i64 0, i64 0
%88 = load i8*, i8** %87
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %88)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [8 x i8] c"%c%c%c\0A\00"
@.str.4 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 97)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 97, i32 98, i32 99)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 97)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 60)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 60)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 60)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}