#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 int /*<<< orphan*/ subStr;

/* Variables and functions */
scalar_t__ ceil(double);
int /*<<< orphan*/ insertionsort(char **, int);
int /*<<< orphan*/ isalpha(char);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Please use only 1 argument.\ni.e. ./pointersorter "
           "\"the*string*of*some*sort\"\nExiting...\n");
    return 1;
  }
  char *input = argv[1];
  int maxSize = (int)ceil(((double)strlen(input)) / 2) + 1;
  char **strArray = (char **)malloc(maxSize * sizeof(char *));
  int currentstrArray = 0;
  int wordStart = 0;
  int wordEnd;
  for (wordEnd = 0; wordEnd <= strlen(input) - 1; wordEnd++) {
    if (!isalpha(input[wordEnd])) {
      if (wordEnd == 0) {
        wordStart = 1;
        continue;
      } else if ((!isalpha(input[wordEnd - 1])) &&
                 (wordEnd == strlen(input) - 1)) {
        currentstrArray--;
        break;
      } else if (!isalpha(input[wordEnd - 1])) {
        wordStart = wordEnd + 1;
        continue;
      } else if (wordEnd == strlen(input) - 1) {
        int subLength = wordEnd - wordStart + 1;
        char subStr[subLength];
        strncpy(subStr, &input[wordStart], subLength - 1);
        subStr[subLength - 1] = '\0';
        strArray[currentstrArray] = malloc(sizeof(subStr));
        strcpy(strArray[currentstrArray], subStr);
        break;
      }
      int subLength = wordEnd - wordStart + 1;
      char subStr[subLength];
      strncpy(subStr, &input[wordStart], subLength - 1);
      subStr[subLength - 1] = '\0';
      strArray[currentstrArray] = malloc(sizeof(subStr));
      strcpy(strArray[currentstrArray], subStr);
      currentstrArray++;
      wordStart = wordEnd + 1;
      continue;
    } else if (wordEnd == strlen(input) - 1) {
      int subLength = wordEnd - wordStart + 2;
      char subStr[subLength];
      strncpy(subStr, &input[wordStart], subLength - 1);
      subStr[subLength - 1] = '\0';
      strArray[currentstrArray] = malloc(sizeof(subStr));
      strcpy(strArray[currentstrArray], subStr);
      break;
    }
  }
  insertionsort(strArray, currentstrArray + 1);
  int i;
  for (i = 0; i <= currentstrArray; i++) {
    printf("%s\n", strArray[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11bd <main+0x3d>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15ab <main+0x42b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe22(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <ceil@plt>
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x80(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1561 <main+0x3e1>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   10a0 <isalpha@plt>
cmp    $0x0,%eax
jne    147b <main+0x2fb>
cmpl   $0x0,-0x34(%rbp)
jne    1264 <main+0xe4>
movl   $0x1,-0x30(%rbp)
jmp    1553 <main+0x3d3>
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   10a0 <isalpha@plt>
cmp    $0x0,%eax
jne    12b6 <main+0x136>
mov    -0x34(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    12b6 <main+0x136>
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    1561 <main+0x3e1>
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   10a0 <isalpha@plt>
cmp    $0x0,%eax
jne    12e3 <main+0x163>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1553 <main+0x3d3>
mov    -0x34(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x88(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    13b1 <main+0x231>
mov    -0x34(%rbp),%eax
mov    -0x30(%rbp),%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %rax,-0x98(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x90(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rsi
movslq -0x30(%rbp),%rax
add    %rax,%rsi
mov    -0x38(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x90(%rbp),%rcx
mov    -0x98(%rbp),%rax
mov    -0x38(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movb   $0x0,(%rcx,%rdx,1)
mov    %eax,%edi
call   1090 <malloc@plt>
mov    -0x90(%rbp),%rsi
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strcpy@plt>
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
jmp    1561 <main+0x3e1>
jmp    13b6 <main+0x236>
jmp    13bb <main+0x23b>
jmp    13c0 <main+0x240>
mov    -0x34(%rbp),%eax
mov    -0x30(%rbp),%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    %rax,-0xa8(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0xa0(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rsi
movslq -0x30(%rbp),%rax
add    %rax,%rsi
mov    -0x4c(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0xa0(%rbp),%rcx
mov    -0xa8(%rbp),%rax
mov    -0x4c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movb   $0x0,(%rcx,%rdx,1)
mov    %eax,%edi
call   1090 <malloc@plt>
mov    -0xa0(%rbp),%rsi
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strcpy@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,%rsp
jmp    1553 <main+0x3d3>
mov    -0x34(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0xac(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1549 <main+0x3c9>
mov    -0x34(%rbp),%eax
mov    -0x30(%rbp),%ecx
sub    %ecx,%eax
add    $0x2,%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    %rax,-0xc0(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0xb8(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x78(%rbp)
mov    -0x18(%rbp),%rsi
movslq -0x30(%rbp),%rax
add    %rax,%rsi
mov    -0x64(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0xb8(%rbp),%rcx
mov    -0xc0(%rbp),%rax
mov    -0x64(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movb   $0x0,(%rcx,%rdx,1)
mov    %eax,%edi
call   1090 <malloc@plt>
mov    -0xb8(%rbp),%rsi
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strcpy@plt>
mov    -0x70(%rbp),%rax
mov    %rax,%rsp
jmp    1561 <main+0x3e1>
jmp    154e <main+0x3ce>
jmp    1553 <main+0x3d3>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1215 <main+0x95>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
add    $0x1,%esi
call   1080 <insertionsort@plt>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jg     15ab <main+0x42b>
mov    -0x28(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xac9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1577 <main+0x3f7>
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x2,%edi
jne    1313 <main+0x193>
mov    0x8(%rsi),%r13
mov    %r13,%rdi
call   1070 <strlen@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xe4e(%rip),%xmm0
call   1060 <ceil@plt>
shl    $0x20,%rax
movabs $0x100000000,%rdi
add    %rax,%rdi
shr    $0x1d,%rdi
call   1090 <malloc@plt>
mov    %rax,%r14
mov    %r13,%rdi
call   1070 <strlen@plt>
test   %eax,%eax
jle    132a <main+0x1aa>
xor    %r12d,%r12d
xor    %r15d,%r15d
xor    %ebx,%ebx
mov    %r14,-0x48(%rbp)
jmp    122b <main+0xab>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13,%rdi
call   1070 <strlen@plt>
add    $0xffffffff,%eax
cmp    %rax,%r12
je     1341 <main+0x1c1>
add    $0x1,%r12
mov    %r13,%rdi
call   1070 <strlen@plt>
cltq
cmp    %rax,%r12
jge    13b4 <main+0x234>
movsbl 0x0(%r13,%r12,1),%edi
call   10a0 <isalpha@plt>
test   %eax,%eax
jne    1200 <main+0x80>
test   %r12,%r12
je     1309 <main+0x189>
movsbl -0x1(%r13,%r12,1),%edi
call   10a0 <isalpha@plt>
test   %eax,%eax
jne    1266 <main+0xe6>
mov    %r13,%rdi
call   1070 <strlen@plt>
add    $0xffffffff,%eax
cmp    %rax,%r12
je     1453 <main+0x2d3>
movsbl -0x1(%r13,%r12,1),%edi
call   10a0 <isalpha@plt>
test   %eax,%eax
je     12ff <main+0x17f>
mov    %r15,-0x38(%rbp)
mov    %r13,%rdi
call   1070 <strlen@plt>
add    $0xffffffff,%eax
cmp    %rax,%r12
je     13f9 <main+0x279>
mov    %rsp,-0x30(%rbp)
mov    %ebx,%eax
neg    %eax
lea    (%r12,%rax,1),%rdx
lea    (%r12,%rax,1),%r15
add    $0x1,%r15
mov    %r15d,%eax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %ebx,%ecx
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
movslq %ecx,%r14
lea    (%r14,%r13,1),%rsi
mov    %rbx,%rdi
call   1030 <strncpy@plt>
mov    %rbx,%rax
sub    %r14,%rax
mov    -0x48(%rbp),%r14
movb   $0x0,(%rax,%r12,1)
mov    %r15d,%edi
call   1090 <malloc@plt>
mov    -0x38(%rbp),%r15
movslq %r15d,%rcx
mov    %rax,(%r14,%rcx,8)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
add    $0x1,%r15d
mov    -0x30(%rbp),%rsp
lea    0x1(%r12),%ebx
jmp    1214 <main+0x94>
mov    $0x1,%ebx
jmp    1214 <main+0x94>
lea    0xcee(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%r15d
jmp    13e7 <main+0x267>
mov    $0x1,%ebx
mov    %r14,%rdi
mov    $0x1,%esi
call   1080 <insertionsort@plt>
jmp    13c7 <main+0x247>
mov    %rsp,-0x30(%rbp)
mov    %ebx,%eax
neg    %eax
lea    (%rax,%r12,1),%rcx
add    $0x2,%rcx
mov    %rcx,-0x40(%rbp)
mov    %ecx,%ecx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %ebx,%edx
mov    %rsp,%rbx
sub    %rcx,%rbx
mov    %rbx,%rsp
movslq %edx,%rcx
add    %rcx,%r13
mov    %r15,-0x38(%rbp)
lea    (%rax,%r12,1),%r15
add    $0x1,%r15
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r15d,%edx
call   1030 <strncpy@plt>
movslq %r15d,%rax
mov    -0x38(%rbp),%r15
movb   $0x0,(%rax,%rbx,1)
mov    -0x40(%rbp),%rdi
call   1090 <malloc@plt>
movslq %r15d,%rcx
mov    %rax,(%r14,%rcx,8)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    -0x30(%rbp),%rsp
lea    0x1(%r15),%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1080 <insertionsort@plt>
test   %r15d,%r15d
js     13e4 <main+0x264>
mov    %ebx,%r12d
xor    %r15d,%r15d
xor    %ebx,%ebx
nop
mov    (%r14,%rbx,8),%rdi
call   1050 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    13d0 <main+0x250>
jmp    13e7 <main+0x267>
xor    %r15d,%r15d
mov    %r15d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsp,-0x30(%rbp)
mov    %ebx,%edx
neg    %edx
lea    (%rdx,%r12,1),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
add    %r12,%rdx
mov    %eax,%eax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %ebx,%ecx
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
movslq %ecx,%r15
add    %r15,%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <strncpy@plt>
mov    %rbx,%rax
sub    %r15,%rax
movb   $0x0,(%rax,%r12,1)
mov    -0x40(%rbp),%rdi
call   1090 <malloc@plt>
mov    -0x38(%rbp),%r15
jmp    139e <main+0x21e>
add    $0xffffffff,%r15d
jmp    13b4 <main+0x234>

LLVM IR (-O0):
@.str = [87 x i8] c"Please use only 1 argument.\0Ai.e. ./pointersorter \22the*string*of*some*sort\22\0AExiting...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i64
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i64
%21 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = load i32, i32* %4
%23 = icmp ne i32 %22, 2
br i1 %23, label %24, label %26
24: ; preds = %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %233
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
store i8* %29, i8** %6
%30 = load i8*, i8** %6
%31 = call i32 @strlen(i8* %30)
%32 = sitofp i32 %31 to double
%33 = fdiv double %32, 2.000000e+00
%34 = call i64 @ceil(double %33)
%35 = trunc i64 %34 to i32
%36 = add nsw i32 %35, 1
store i32 %36, i32* %7
%37 = load i32, i32* %7
%38 = sext i32 %37 to i64
%39 = mul i64 %38, 8
%40 = trunc i64 %39 to i32
%41 = call i8* @malloc(i32 %40)
%42 = bitcast i8* %41 to i8**
store i8** %42, i8*** %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
br label %43
43: ; preds = %211, %26
%44 = load i32, i32* %11
%45 = load i8*, i8** %6
%46 = call i32 @strlen(i8* %45)
%47 = sub nsw i32 %46, 1
%48 = icmp sle i32 %44, %47
br i1 %48, label %49, label %214
49: ; preds = %43
%50 = load i8*, i8** %6
%51 = load i32, i32* %11
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %50, i64 %52
%54 = load i8, i8* %53
%55 = call i32 @isalpha(i8 signext %54)
%56 = icmp ne i32 %55, 0
br i1 %56, label %170, label %57
57: ; preds = %49
%58 = load i32, i32* %11
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %61
60: ; preds = %57
store i32 1, i32* %10
br label %211
61: ; preds = %57
%62 = load i8*, i8** %6
%63 = load i32, i32* %11
%64 = sub nsw i32 %63, 1
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %62, i64 %65
%67 = load i8, i8* %66
%68 = call i32 @isalpha(i8 signext %67)
%69 = icmp ne i32 %68, 0
br i1 %69, label %79, label %70
70: ; preds = %61
%71 = load i32, i32* %11
%72 = load i8*, i8** %6
%73 = call i32 @strlen(i8* %72)
%74 = sub nsw i32 %73, 1
%75 = icmp eq i32 %71, %74
br i1 %75, label %76, label %79
76: ; preds = %70
%77 = load i32, i32* %9
%78 = add nsw i32 %77, -1
store i32 %78, i32* %9
br label %214
79: ; preds = %70, %61
%80 = load i8*, i8** %6
%81 = load i32, i32* %11
%82 = sub nsw i32 %81, 1
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %80, i64 %83
%85 = load i8, i8* %84
%86 = call i32 @isalpha(i8 signext %85)
%87 = icmp ne i32 %86, 0
br i1 %87, label %91, label %88
88: ; preds = %79
%89 = load i32, i32* %11
%90 = add nsw i32 %89, 1
store i32 %90, i32* %10
br label %211
91: ; preds = %79
%92 = load i32, i32* %11
%93 = load i8*, i8** %6
%94 = call i32 @strlen(i8* %93)
%95 = sub nsw i32 %94, 1
%96 = icmp eq i32 %92, %95
br i1 %96, label %97, label %130
97: ; preds = %91
%98 = load i32, i32* %11
%99 = load i32, i32* %10
%100 = sub nsw i32 %98, %99
%101 = add nsw i32 %100, 1
store i32 %101, i32* %12
%102 = load i32, i32* %12
%103 = zext i32 %102 to i64
%104 = call i8* @llvm.stacksave()
store i8* %104, i8** %13
%105 = alloca i8, i64 %103
store i64 %103, i64* %14
%106 = load i8*, i8** %6
%107 = load i32, i32* %10
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i8, i8* %106, i64 %108
%110 = load i32, i32* %12
%111 = sub nsw i32 %110, 1
%112 = call i32 @strncpy(i8* %105, i8* %109, i32 %111)
%113 = load i32, i32* %12
%114 = sub nsw i32 %113, 1
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8, i8* %105, i64 %115
store i8 0, i8* %116
%117 = trunc i64 %103 to i32
%118 = call i8* @malloc(i32 %117)
%119 = load i8**, i8*** %8
%120 = load i32, i32* %9
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8*, i8** %119, i64 %121
store i8* %118, i8** %122
%123 = load i8**, i8*** %8
%124 = load i32, i32* %9
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds i8*, i8** %123, i64 %125
%127 = load i8*, i8** %126
%128 = call i32 @strcpy(i8* %127, i8* %105)
%129 = load i8*, i8** %13
br label %214
130: ; preds = %91
br label %131
131: ; preds = %130
br label %132
132: ; preds = %131
br label %133
133: ; preds = %132
%134 = load i32, i32* %11
%135 = load i32, i32* %10
%136 = sub nsw i32 %134, %135
%137 = add nsw i32 %136, 1
store i32 %137, i32* %15
%138 = load i32, i32* %15
%139 = zext i32 %138 to i64
%140 = call i8* @llvm.stacksave()
store i8* %140, i8** %16
%141 = alloca i8, i64 %139
store i64 %139, i64* %17
%142 = load i8*, i8** %6
%143 = load i32, i32* %10
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds i8, i8* %142, i64 %144
%146 = load i32, i32* %15
%147 = sub nsw i32 %146, 1
%148 = call i32 @strncpy(i8* %141, i8* %145, i32 %147)
%149 = load i32, i32* %15
%150 = sub nsw i32 %149, 1
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds i8, i8* %141, i64 %151
store i8 0, i8* %152
%153 = trunc i64 %139 to i32
%154 = call i8* @malloc(i32 %153)
%155 = load i8**, i8*** %8
%156 = load i32, i32* %9
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds i8*, i8** %155, i64 %157
store i8* %154, i8** %158
%159 = load i8**, i8*** %8
%160 = load i32, i32* %9
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds i8*, i8** %159, i64 %161
%163 = load i8*, i8** %162
%164 = call i32 @strcpy(i8* %163, i8* %141)
%165 = load i32, i32* %9
%166 = add nsw i32 %165, 1
store i32 %166, i32* %9
%167 = load i32, i32* %11
%168 = add nsw i32 %167, 1
store i32 %168, i32* %10
%169 = load i8*, i8** %16
br label %211
170: ; preds = %49
%171 = load i32, i32* %11
%172 = load i8*, i8** %6
%173 = call i32 @strlen(i8* %172)
%174 = sub nsw i32 %173, 1
%175 = icmp eq i32 %171, %174
br i1 %175, label %176, label %209
176: ; preds = %170
%177 = load i32, i32* %11
%178 = load i32, i32* %10
%179 = sub nsw i32 %177, %178
%180 = add nsw i32 %179, 2
store i32 %180, i32* %18
%181 = load i32, i32* %18
%182 = zext i32 %181 to i64
%183 = call i8* @llvm.stacksave()
store i8* %183, i8** %19
%184 = alloca i8, i64 %182
store i64 %182, i64* %20
%185 = load i8*, i8** %6
%186 = load i32, i32* %10
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds i8, i8* %185, i64 %187
%189 = load i32, i32* %18
%190 = sub nsw i32 %189, 1
%191 = call i32 @strncpy(i8* %184, i8* %188, i32 %190)
%192 = load i32, i32* %18
%193 = sub nsw i32 %192, 1
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds i8, i8* %184, i64 %194
store i8 0, i8* %195
%196 = trunc i64 %182 to i32
%197 = call i8* @malloc(i32 %196)
%198 = load i8**, i8*** %8
%199 = load i32, i32* %9
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds i8*, i8** %198, i64 %200
store i8* %197, i8** %201
%202 = load i8**, i8*** %8
%203 = load i32, i32* %9
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds i8*, i8** %202, i64 %204
%206 = load i8*, i8** %205
%207 = call i32 @strcpy(i8* %206, i8* %184)
%208 = load i8*, i8** %19
br label %214
209: ; preds = %170
br label %210
210: ; preds = %209
br label %211
211: ; preds = %210, %133, %88, %60
%212 = load i32, i32* %11
%213 = add nsw i32 %212, 1
store i32 %213, i32* %11
br label %43
214: ; preds = %176, %97, %76, %43
%215 = load i8**, i8*** %8
%216 = load i32, i32* %9
%217 = add nsw i32 %216, 1
%218 = call i32 @insertionsort(i8** %215, i32 %217)
store i32 0, i32* %21
br label %219
219: ; preds = %230, %214
%220 = load i32, i32* %21
%221 = load i32, i32* %9
%222 = icmp sle i32 %220, %221
br i1 %222, label %223, label %233
223: ; preds = %219
%224 = load i8**, i8*** %8
%225 = load i32, i32* %21
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds i8*, i8** %224, i64 %226
%228 = load i8*, i8** %227
%229 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %228)
br label %230
230: ; preds = %223
%231 = load i32, i32* %21
%232 = add nsw i32 %231, 1
store i32 %232, i32* %21
br label %219
233: ; preds = %24, %219
%234 = load i32, i32* %3
ret i32 %234
}

LLVM IR (-O2):
@str = [86 x i8] c"Please use only 1 argument.\0Ai.e. ./pointersorter \22the*string*of*some*sort\22\0AExiting...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str, i64 0, i64 0))
br label %136
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @strlen(i8* %8)
%10 = sitofp i32 %9 to double
%11 = fmul double %10, 5.000000e-01
%12 = tail call i64 @ceil(double %11)
%13 = shl i64 %12, 32
%14 = add i64 %13, 4294967296
%15 = lshr exact i64 %14, 29
%16 = trunc i64 %15 to i32
%17 = tail call i8* @malloc(i32 %16)
%18 = bitcast i8* %17 to i8**
%19 = call i32 @strlen(i8* %8)
%20 = icmp sgt i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %6
%22 = call i32 @insertionsort(i8** %18, i32 1)
br label %126
23: ; preds = %6, %114
%24 = phi i64 [ %117, %114 ], [ 0, %6 ]
%25 = phi i32 [ %116, %114 ], [ 0, %6 ]
%26 = phi i32 [ %115, %114 ], [ 0, %6 ]
%27 = trunc i64 %24 to i32
%28 = getelementptr inbounds i8, i8* %8, i64 %24
%29 = load i8, i8* %28
%30 = call i32 @isalpha(i8 signext %29)
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %92
32: ; preds = %23
%33 = icmp eq i64 %24, 0
br i1 %33, label %114, label %34
34: ; preds = %32
%35 = add nsw i64 %24, -1
%36 = getelementptr inbounds i8, i8* %8, i64 %35
%37 = load i8, i8* %36
%38 = call i32 @isalpha(i8 signext %37)
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %47
40: ; preds = %34
%41 = call i32 @strlen(i8* %8)
%42 = add nsw i32 %41, -1
%43 = zext i32 %42 to i64
%44 = icmp eq i64 %24, %43
br i1 %44, label %45, label %47
45: ; preds = %40
%46 = add nsw i32 %25, -1
br label %121
47: ; preds = %40, %34
%48 = load i8, i8* %36
%49 = call i32 @isalpha(i8 signext %48)
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = add nuw nsw i32 %27, 1
br label %114
53: ; preds = %47
%54 = call i32 @strlen(i8* %8)
%55 = add nsw i32 %54, -1
%56 = zext i32 %55 to i64
%57 = icmp eq i64 %24, %56
br i1 %57, label %58, label %74
58: ; preds = %53
%59 = trunc i64 %24 to i32
%60 = sub nsw i32 %59, %26
%61 = add nsw i32 %60, 1
%62 = zext i32 %61 to i64
%63 = call i8* @llvm.stacksave()
%64 = alloca i8, i64 %62
%65 = sext i32 %26 to i64
%66 = getelementptr inbounds i8, i8* %8, i64 %65
%67 = call i32 @strncpy(i8* %64, i8* %66, i32 %60)
%68 = sext i32 %60 to i64
%69 = getelementptr inbounds i8, i8* %64, i64 %68
store i8 0, i8* %69
%70 = call i8* @malloc(i32 %61)
%71 = sext i32 %25 to i64
%72 = getelementptr inbounds i8*, i8** %18, i64 %71
store i8* %70, i8** %72
%73 = call i32 @strcpy(i8* %70, i8* %64)
br label %121
74: ; preds = %53
%75 = sub nsw i32 %27, %26
%76 = add nsw i32 %75, 1
%77 = zext i32 %76 to i64
%78 = call i8* @llvm.stacksave()
%79 = alloca i8, i64 %77
%80 = sext i32 %26 to i64
%81 = getelementptr inbounds i8, i8* %8, i64 %80
%82 = call i32 @strncpy(i8* %79, i8* %81, i32 %75)
%83 = sext i32 %75 to i64
%84 = getelementptr inbounds i8, i8* %79, i64 %83
store i8 0, i8* %84
%85 = call i8* @malloc(i32 %76)
%86 = sext i32 %25 to i64
%87 = getelementptr inbounds i8*, i8** %18, i64 %86
store i8* %85, i8** %87
%88 = call i32 @strcpy(i8* %85, i8* %79)
%89 = add nsw i32 %25, 1
%90 = trunc i64 %24 to i32
%91 = add i32 %90, 1
br label %114
92: ; preds = %23
%93 = call i32 @strlen(i8* %8)
%94 = add nsw i32 %93, -1
%95 = zext i32 %94 to i64
%96 = icmp eq i64 %24, %95
br i1 %96, label %97, label %114
97: ; preds = %92
%98 = trunc i64 %24 to i32
%99 = sub nsw i32 %98, %26
%100 = add nsw i32 %99, 2
%101 = zext i32 %100 to i64
%102 = call i8* @llvm.stacksave()
%103 = alloca i8, i64 %101
%104 = sext i32 %26 to i64
%105 = getelementptr inbounds i8, i8* %8, i64 %104
%106 = add nsw i32 %99, 1
%107 = call i32 @strncpy(i8* %103, i8* %105, i32 %106)
%108 = sext i32 %106 to i64
%109 = getelementptr inbounds i8, i8* %103, i64 %108
store i8 0, i8* %109
%110 = call i8* @malloc(i32 %100)
%111 = sext i32 %25 to i64
%112 = getelementptr inbounds i8*, i8** %18, i64 %111
store i8* %110, i8** %112
%113 = call i32 @strcpy(i8* %110, i8* %103)
br label %121
114: ; preds = %32, %92, %74, %51
%115 = phi i32 [ %26, %92 ], [ %91, %74 ], [ %52, %51 ], [ 1, %32 ]
%116 = phi i32 [ %25, %92 ], [ %89, %74 ], [ %25, %51 ], [ %25, %32 ]
%117 = add nuw nsw i64 %24, 1
%118 = call i32 @strlen(i8* %8)
%119 = sext i32 %118 to i64
%120 = icmp slt i64 %117, %119
br i1 %120, label %23, label %121
121: ; preds = %114, %97, %58, %45
%122 = phi i32 [ %25, %97 ], [ %25, %58 ], [ %46, %45 ], [ %116, %114 ]
%123 = add i32 %122, 1
%124 = call i32 @insertionsort(i8** %18, i32 %123)
%125 = icmp slt i32 %122, 0
br i1 %125, label %136, label %126
126: ; preds = %21, %121
%127 = phi i32 [ 1, %21 ], [ %123, %121 ]
%128 = zext i32 %127 to i64
br label %129
129: ; preds = %126, %129
%130 = phi i64 [ 0, %126 ], [ %134, %129 ]
%131 = getelementptr inbounds i8*, i8** %18, i64 %130
%132 = load i8*, i8** %131
%133 = call i32 @puts(i8* dereferenceable(1) %132)
%134 = add nuw nsw i64 %130, 1
%135 = icmp eq i64 %134, %128
br i1 %135, label %136, label %129
136: ; preds = %129, %121, %4
%137 = phi i32 [ 1, %4 ], [ 0, %121 ], [ 0, %129 ]
ret i32 %137
}