#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 *, ...);
void two() {
  char str[3][10] = {
      {'a', 'b', 'c', 'd'}, {'A', 'B', 'C', 'D'}, {'\\', '\'', '\n', '\a'}};
  char *p1 = (char *)str;
  char *p2 = (char *)str[1];
  char *p3 = (char *)str[2];
  printf("p1 --> %s\n", p1);
  printf("p2 --> %s\n", p2);
  printf("p3 --> %s\n", p3);
  char *p4 = &str[0][0];
  printf("p4 --> %c\n", (char)*p4);
  char *p5 = (char *)&str;
  printf("p5 --> %c\n", (char)*(++p5));
}


x86 assembly (clang, -O0):
<two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed9(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xed3(%rip),%ax
mov    %ax,-0x4(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rax
add    $0xa,%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%esi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x48(%rbp)
movsbl 0x1(%rax),%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movups 0xef0(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xa(%rsp),%rbx
lea    0x14(%rsp),%r14
lea    0xedf(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl (%rsp),%esi
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x1(%rsp),%esi
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.two.str = [3 x [10 x i8]] [[10 x i8] c"abcd\00\00\00\00\00\00", [10 x i8] c"ABCD\00\00\00\00\00\00", [10 x i8] c"\\'\0A\07\00\00\00\00\00\00"]
@.str = [11 x i8] c"p1 --> %s\0A\00"
@.str.1 = [11 x i8] c"p2 --> %s\0A\00"
@.str.2 = [11 x i8] c"p3 --> %s\0A\00"
@.str.3 = [11 x i8] c"p4 --> %c\0A\00"
@.str.4 = [11 x i8] c"p5 --> %c\0A\00"
define void @two() {
%1 = alloca [3 x [10 x i8]]
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = bitcast [3 x [10 x i8]]* %1 to i8*
%8 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %1, i64 0, i64 0
%9 = bitcast [10 x i8]* %8 to i8*
store i8* %9, i8** %2
%10 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %1, i64 0, i64 1
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
store i8* %11, i8** %3
%12 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %1, i64 0, i64 2
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
store i8* %13, i8** %4
%14 = load i8*, i8** %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = load i8*, i8** %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %1, i64 0, i64 0
%21 = getelementptr inbounds [10 x i8], [10 x i8]* %20, i64 0, i64 0
store i8* %21, i8** %5
%22 = load i8*, i8** %5
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%26 = bitcast [3 x [10 x i8]]* %1 to i8*
store i8* %26, i8** %6
%27 = load i8*, i8** %6
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %6
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %30)
ret void
}

LLVM IR (-O2):
@__const.two.str = [3 x [10 x i8]] [[10 x i8] c"abcd\00\00\00\00\00\00", [10 x i8] c"ABCD\00\00\00\00\00\00", [10 x i8] c"\\'\0A\07\00\00\00\00\00\00"]
@.str = [11 x i8] c"p1 --> %s\0A\00"
@.str.1 = [11 x i8] c"p2 --> %s\0A\00"
@.str.2 = [11 x i8] c"p3 --> %s\0A\00"
@.str.3 = [11 x i8] c"p4 --> %c\0A\00"
@.str.4 = [11 x i8] c"p5 --> %c\0A\00"
define void @two() {
%1 = alloca [3 x [10 x i8]]
%2 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %1, i64 0, i64 0, i64 0
%3 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %1, i64 0, i64 1, i64 0
%4 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %1, i64 0, i64 2, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %1, 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 ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %13)
ret void
}