#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[] = "ABCDEFGHIJKLMNOPQRSTUVXYZ";
  int i = 0;
  char *pt1 = NULL;
  int size = 4;
  char word[size];
  for (i = size, pt1 = &str[size]; i < 10; i++, *(pt1++)) {
    printf("char: %s\n", pt1);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed1(%rip),%ax
mov    %ax,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0x4,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rax,-0x48(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x24(%rbp)
movslq -0x34(%rbp),%rcx
lea    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    11b8 <main+0xa8>
mov    -0x30(%rbp),%rsi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1184 <main+0x74>
mov    0x2e21(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsp,%r14
movups 0xee9(%rip),%xmm0
movups %xmm0,0xa(%rsp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x4(%rsp),%rsi
lea    0xedd(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x5(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x6(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x7(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x9(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%eax
mov    %r14,%rsp
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.str = [26 x i8] c"ABCDEFGHIJKLMNOPQRSTUVXYZ\00"
@.str = [10 x i8] c"char: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [26 x i8]
%2 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 0
%3 = tail call i8* @llvm.stacksave()
%4 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 4
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 5
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 6
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 7
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 8
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 9
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}