#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*/ lr_output_message(char *, ...);
int /*<<< orphan*/ sprintf(char ***, char *, char);
int strlen(char *);
Action() {
  char *chTemp = "StringToSplit";
  char *chX[100][1];
  int iX;
  lr_output_message("String: %s", chTemp);
  for (iX = 0; iX < strlen(chTemp); iX++) {
    sprintf(chX, "%c", chTemp[iX]);
    lr_output_message("Char at %d = %s", iX, chX);
  }
  return 0;
}


x86 assembly (clang, -O0):
<Action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <lr_output_message@plt>
movl   $0x0,-0x334(%rbp)
mov    -0x334(%rbp),%eax
mov    %eax,-0x338(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x338(%rbp),%eax
cmp    %ecx,%eax
jge    11d8 <Action+0xa8>
lea    -0x330(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x334(%rbp),%rcx
lea    0xe79(%rip),%rsi
movsbl (%rax,%rcx,1),%edx
call   1050 <sprintf@plt>
mov    -0x334(%rbp),%esi
lea    -0x330(%rbp),%rdx
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1040 <lr_output_message@plt>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    1162 <Action+0x32>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Action>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x328,%rsp
lea    0xed9(%rip),%rdi
lea    0xec4(%rip),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <lr_output_message@plt>
mov    %r12,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    118f <Action+0x6f>
lea    0xec0(%rip),%r14
mov    %rsp,%r15
xor    %ebx,%ebx
xchg   %ax,%ax
movzbl (%rbx,%r12,1),%eax
mov    %al,(%rsp)
movb   $0x0,0x1(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <lr_output_message@plt>
add    $0x1,%rbx
mov    %r12,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1160 <Action+0x40>
xor    %eax,%eax
add    $0x328,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"StringToSplit\00"
@.str.1 = [11 x i8] c"String: %s\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [16 x i8] c"Char at %d = %s\00"
define i32 @Action() {
%1 = alloca i8*
%2 = alloca [100 x [1 x i8*]]
%3 = alloca i32
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = load i8*, i8** %1
%5 = call i32 (i8*, ...) @lr_output_message(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %4)
store i32 0, i32* %3
br label %6
6: ; preds = %23, %0
%7 = load i32, i32* %3
%8 = load i8*, i8** %1
%9 = call i32 @strlen(i8* %8)
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %26
11: ; preds = %6
%12 = getelementptr inbounds [100 x [1 x i8*]], [100 x [1 x i8*]]* %2, i64 0, i64 0
%13 = bitcast [1 x i8*]* %12 to i8***
%14 = load i8*, i8** %1
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @sprintf(i8*** %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %18)
%20 = load i32, i32* %3
%21 = getelementptr inbounds [100 x [1 x i8*]], [100 x [1 x i8*]]* %2, i64 0, i64 0
%22 = call i32 (i8*, ...) @lr_output_message(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %20, [1 x i8*]* %21)
br label %23
23: ; preds = %11
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %6
26: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"StringToSplit\00"
@.str.1 = [11 x i8] c"String: %s\00"
@.str.3 = [16 x i8] c"Char at %d = %s\00"
define i32 @Action() {
%1 = alloca [100 x [1 x i8*]]
%2 = bitcast [100 x [1 x i8*]]* %1 to i8*
%3 = tail call i32 (i8*, ...) @lr_output_message(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %19
6: ; preds = %0
%7 = getelementptr inbounds [100 x [1 x i8*]], [100 x [1 x i8*]]* %1, i64 0, i64 0
%8 = getelementptr inbounds i8, i8* %2, i64 1
br label %9
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %15, %9 ]
%11 = getelementptr inbounds [14 x i8], [14 x i8]* @.str, i64 0, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %2
store i8 0, i8* %8
%13 = trunc i64 %10 to i32
%14 = call i32 (i8*, ...) @lr_output_message(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %13, [1 x i8*]* %7)
%15 = add nuw nsw i64 %10, 1
%16 = call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%17 = sext i32 %16 to i64
%18 = icmp slt i64 %15, %17
br i1 %18, label %9, label %19
19: ; preds = %9, %0
ret i32 0
}