#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() {
  int a = 100;
  char *test =
      "This might very well be a very long sentence of inordinate length.";
  char *test2 =
      "Hello again world its me just wondering about the last time we spoke.";
  printf("a     addr: %p\n", &a);
  printf("test  addr: %p\n", &test);
  printf("test2 addr: %p\n", &test2);
  for (int i = -100; i < 100; i++) {
    char *c = &a + i;
    printf("%p -> %c\n", c, *c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xf0b(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xf46(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf44(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf42(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffff9c,-0x1c(%rbp)
cmpl   $0x64,-0x1c(%rbp)
jge    11bd <main+0xad>
movslq -0x1c(%rbp),%rcx
lea    -0x8(%rbp),%rax
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x28(%rbp),%rax
movsbl (%rax),%edx
lea    0xf11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1179 <main+0x69>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movl   $0x64,0x4(%rsp)
lea    0xeda(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xf11(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xf4b(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf48(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf45(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xfffffffffffffe70,%rbx
lea    0xf3b(%rip),%r14
xchg   %ax,%ax
lea    (%rsp,%rbx,1),%rsi
add    $0x4,%rsi
movsbl 0x4(%rsp,%rbx,1),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x4,%rbx
cmp    $0x190,%rbx
jne    1180 <main+0x70>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [67 x i8] c"This might very well be a very long sentence of inordinate length.\00"
@.str.1 = [70 x i8] c"Hello again world its me just wondering about the last time we spoke.\00"
@.str.2 = [16 x i8] c"a addr: %p\0A\00"
@.str.3 = [16 x i8] c"test addr: %p\0A\00"
@.str.4 = [16 x i8] c"test2 addr: %p\0A\00"
@.str.5 = [10 x i8] c"%p -> %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i32 0, i32* %1
store i32 100, i32* %2
store i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0), i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8** %3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8** %4)
store i32 -100, i32* %5
br label %10
10: ; preds = %23, %0
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 100
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %2, i64 %15
%17 = bitcast i32* %16 to i8*
store i8* %17, i8** %6
%18 = load i8*, i8** %6
%19 = load i8*, i8** %6
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %18, i32 %21)
br label %23
23: ; preds = %13
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %10
26: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [67 x i8] c"This might very well be a very long sentence of inordinate length.\00"
@.str.1 = [70 x i8] c"Hello again world its me just wondering about the last time we spoke.\00"
@.str.2 = [16 x i8] c"a addr: %p\0A\00"
@.str.3 = [16 x i8] c"test addr: %p\0A\00"
@.str.4 = [16 x i8] c"test2 addr: %p\0A\00"
@.str.5 = [10 x i8] c"%p -> %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = bitcast i32* %1 to i8*
store i32 100, i32* %1
%5 = bitcast i8** %2 to i8*
store i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8** %2
%6 = bitcast i8** %3 to i8*
store i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0), i8** %3
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8** %2)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8** %3)
br label %11
10: ; preds = %11
ret i32 0
11: ; preds = %0, %11
%12 = phi i64 [ -100, %0 ], [ %18, %11 ]
%13 = getelementptr inbounds i32, i32* %1, i64 %12
%14 = bitcast i32* %13 to i8*
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32* %13, i32 %16)
%18 = add nsw i64 %12, 1
%19 = icmp eq i64 %18, 100
br i1 %19, label %10, label %11
}