#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() {
  char a[10] = "abcdefzuohui";
  char b[10] = "0123456789";
  char *p = b;
  int i;
  for (i = 0; i < 20; i++) {
    printf("%c\n", *(p + i));
    printf("%s\n", p + i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%ax
mov    %ax,-0x10(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x14,-0x24(%rbp)
jge    11a5 <main+0x95>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
movslq -0x24(%rbp),%rax
add    %rax,%rsi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115a <main+0x4a>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movabs $0x3736353433323130,%rax
35 36 37
mov    %rax,(%rsp)
movw   $0x3938,0x8(%rsp)
lea    0x8(%rsp),%r14
lea    0xec0(%rip),%rbx
mov    %rbx,%rdi
mov    $0x30,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rdi
call   1030 <puts@plt>
lea    0x1(%rsp),%r15
mov    %rbx,%rdi
mov    $0x31,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
lea    0x2(%rsp),%r15
mov    %rbx,%rdi
mov    $0x32,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
lea    0x3(%rsp),%r15
mov    %rbx,%rdi
mov    $0x33,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%r15
mov    %rbx,%rdi
mov    $0x34,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
lea    0x5(%rsp),%r15
mov    %rbx,%rdi
mov    $0x35,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
lea    0x6(%rsp),%r15
mov    %rbx,%rdi
mov    $0x36,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
lea    0x7(%rsp),%r15
mov    %rbx,%rdi
mov    $0x37,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x38,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0x9(%rsp),%r14
mov    %rbx,%rdi
mov    $0x39,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xa(%rsp),%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xb(%rsp),%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xd(%rsp),%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe(%rsp),%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xf(%rsp),%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0x11(%rsp),%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0x12(%rsp),%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0x13(%rsp),%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@__const.main.b = [10 x i8] c"0123456789"
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 48)
%4 = call i32 @puts(i8* %2)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 49)
%7 = call i32 @puts(i8* %5)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 50)
%10 = call i32 @puts(i8* %8)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 3
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 51)
%13 = call i32 @puts(i8* %11)
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 4
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 52)
%16 = call i32 @puts(i8* %14)
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 5
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 53)
%19 = call i32 @puts(i8* %17)
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 6
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 54)
%22 = call i32 @puts(i8* %20)
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 7
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 55)
%25 = call i32 @puts(i8* %23)
%26 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 8
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 56)
%28 = call i32 @puts(i8* %26)
%29 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 9
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 57)
%31 = call i32 @puts(i8* %29)
%32 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 10
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%34 = call i32 @puts(i8* %32)
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 11
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%37 = call i32 @puts(i8* %35)
%38 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 12
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%40 = call i32 @puts(i8* %38)
%41 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 13
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%43 = call i32 @puts(i8* %41)
%44 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 14
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%46 = call i32 @puts(i8* %44)
%47 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 15
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%49 = call i32 @puts(i8* %47)
%50 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 16
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%52 = call i32 @puts(i8* %50)
%53 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 17
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%55 = call i32 @puts(i8* %53)
%56 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 18
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%58 = call i32 @puts(i8* %56)
%59 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 19
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%61 = call i32 @puts(i8* %59)
ret i32 0
}