int main(void) {
  char vet[] = "Daniel";
  int i;
  char *p;
  p = &vet[0];
  printf("pointer it self -> %x\n", (p + 1));
  printf("pointer it self -> %d\n", (p + 2));
  printf("from array --> %c\n", *vet);
  for (i = 0; i < strlen3(vet); i++, p++)
    printf("%c", *p);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xb(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
add    $0x2,%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0xb(%rbp),%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0xb(%rbp),%rdi
mov    $0x0,%al
call   1030 <strlen3@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    11e6 <main+0xc6>
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1199 <main+0x79>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x6c6569,0x3(%rsp)
movl   $0x696e6144,(%rsp)
lea    0x1(%rsp),%rsi
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x2(%rsp),%rsi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl (%rsp),%esi
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <strlen3@plt>
test   %eax,%eax
jle    11ab <main+0x7b>
mov    %rsp,%r14
xor    %ebx,%ebx
xchg   %ax,%ax
movsbl (%rsp,%rbx,1),%edi
call   1040 <putchar@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <strlen3@plt>
add    $0x1,%rbx
cmp    %eax,%ebx
jl     1190 <main+0x60>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.vet = [7 x i8] c"Daniel\00"
@.str = [23 x i8] c"pointer it self -> %x\0A\00"
@.str.1 = [23 x i8] c"pointer it self -> %d\0A\00"
@.str.2 = [19 x i8] c"from array --> %c\0A\00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca i32
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [7 x i8]* %2 to i8*
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %15)
store i32 0, i32* %3
br label %17
17: ; preds = %27, %0
%18 = load i32, i32* %3
%19 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @strlen3 to i32 (i8*, ...)*)(i8* %19)
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %32
22: ; preds = %17
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %22
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %4
br label %17
32: ; preds = %17
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.vet = [7 x i8] c"Daniel\00"
@.str = [23 x i8] c"pointer it self -> %x\0A\00"
@.str.1 = [23 x i8] c"pointer it self -> %d\0A\00"
@.str.2 = [19 x i8] c"from array --> %c\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 1
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 2
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @strlen3 to i32 (i8*, ...)*)(i8* %2)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %0, %12
%13 = phi i8* [ %19, %12 ], [ %2, %0 ]
%14 = phi i32 [ %18, %12 ], [ 0, %0 ]
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = call i32 @putchar(i32 %16)
%18 = add nuw nsw i32 %14, 1
%19 = getelementptr inbounds i8, i8* %13, i64 1
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @strlen3 to i32 (i8*, ...)*)(i8* %2)
%21 = icmp slt i32 %18, %20
br i1 %21, label %12, label %22
22: ; preds = %12, %0
%23 = call i32 @putchar(i32 10)
ret i32 0
}