#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 */
typedef size_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, size_t, size_t, char);
int strlen(char *);
int main() {
  char s[] = "0123456789abcdefghijklmn";
  int j;
  uint32_t l, h, i = 0;
  i -= 10;
  l = i;
  for (j = 0; j < strlen(s); j++) {
    i++;
    printf("j:%02d i:%08x offset:%02d c:%c\n", j, i, i - l, s[i - l]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%al
mov    %al,-0x8(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
sub    $0xa,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x44(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
cmp    %ecx,%eax
jge    11db <main+0xbb>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    -0x40(%rbp),%rcx
sub    -0x30(%rbp),%rcx
mov    -0x40(%rbp),%rax
sub    -0x30(%rbp),%rax
lea    0xe57(%rip),%rdi
movsbl -0x20(%rbp,%rax,1),%r8d
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117c <main+0x5c>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movups 0xed9(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    118a <main+0x6a>
mov    $0x1,%ebx
lea    0xec1(%rip),%r14
mov    %rsp,%r15
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%esi
lea    -0xa(%rbx),%rdx
movsbl (%rsp,%rbx,1),%r8d
mov    %r14,%rdi
mov    %rbx,%rcx
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <strlen@plt>
add    $0x1,%rbx
lea    -0x1(%rbx),%ecx
cmp    %eax,%ecx
jl     1160 <main+0x40>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@__const.main.s = [25 x i8] c"0123456789abcdefghijklmn\00"
@.str = [32 x i8] c"j:%02d i:%08x offset:%02d c:%c\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %0, %5
%6 = phi i64 [ %8, %5 ], [ -10, %0 ]
%7 = phi i32 [ %13, %5 ], [ 0, %0 ]
%8 = add nsw i64 %6, 1
%9 = add nsw i64 %6, 11
%10 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %7, i64 %8, i64 %9, i8 signext %11)
%13 = add nuw nsw i32 %7, 1
%14 = call i32 @strlen(i8* %2)
%15 = icmp slt i32 %13, %14
br i1 %15, label %5, label %16
16: ; preds = %5, %0
ret i32 0
}