#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 *, char *, ...);
int main(void) {
  char str[] = "zhangrongxiang";
  char *p = str;
  printf("str   = %p        p        = %p\n", str, p);
  printf("str+1 = %p        &str + 1 = %p\n", str + 1, &str + 1);
  printf("p+1   = %p\n", p + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x13(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x13(%rbp),%rsi
add    $0x1,%rsi
lea    -0x13(%rbp),%rdx
add    $0xf,%rdx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x676e616978676e,%rax
mov    %rax,0x7(%rsp)
movabs $0x6e6f72676e61687a,%rax
72 6f 6e
mov    %rax,(%rsp)
lea    0xed6(%rip),%rdi
mov    %rsp,%rdx
mov    %rdx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1(%rsp),%rbx
lea    0xf(%rsp),%rdx
lea    0xed9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [15 x i8] c"zhangrongxiang\00"
@.str = [33 x i8] c"str = %p p = %p\0A\00"
@.str.1 = [33 x i8] c"str+1 = %p &str + 1 = %p\0A\00"
@.str.2 = [12 x i8] c"p+1 = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [15 x i8]* %2 to i8*
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 1
%12 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %10, [15 x i8]* %11)
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [15 x i8] c"zhangrongxiang\00"
@.str = [33 x i8] c"str = %p p = %p\0A\00"
@.str.1 = [33 x i8] c"str+1 = %p &str + 1 = %p\0A\00"
@.str.2 = [12 x i8] c"p+1 = %p\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %2)
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 1
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 1
%6 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %4, [15 x i8]* %5)
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret i32 0
}