#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 *, char *);
int /*<<< orphan*/ reset(char *, char *);
int /*<<< orphan*/ strsplit1(char *, char, char *, char *);
int /*<<< orphan*/ strsplit2(char *, char, char *, char *);
int /*<<< orphan*/ strsplit3(char *, char, char *, char *);
int /*<<< orphan*/ strsplit4(char *, char, char *, char *);
int /*<<< orphan*/ strsplit6(char *, char, char *, char *);
int /*<<< orphan*/ strsplit7(char *, char, char **, char **);
int main() {
  char string[] = "Hello World";
  char first[32] = "undefined";
  char second[32] = "undefined";
  strsplit1(string, ' ', first, second);
  printf("%s\n", first);
  printf("%s\n", second);
  printf("%s\n\n", string);
  reset(first, second);
  strsplit2(string, ' ', first, second);
  printf("%s\n", first);
  printf("%s\n", second);
  printf("%s\n\n", string);
  reset(first, second);
  strsplit3(string, ' ', first, second);
  printf("%s\n", first);
  printf("%s\n", second);
  printf("%s\n\n", string);
  reset(first, second);
  strsplit4(string, ' ', first, second);
  printf("%s\n", first);
  printf("%s\n", second);
  printf("%s\n\n", string);
  reset(first, second);
  strsplit6(string, ' ', first, second);
  printf("%s\n", first);
  printf("%s\n", second);
  printf("%s\n\n", string);
  reset(first, second);
  char *first_ptr;
  char *second_ptr;
  strsplit7(string, ' ', &first_ptr, &second_ptr);
  printf("%s\n", first_ptr);
  printf("%s\n", second_ptr);
  printf("%s\n\n", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe6a(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe68(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xe76(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe73(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe70(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe6d(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe4a(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe47(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe44(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe41(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x50(%rbp),%rcx
mov    $0x20,%esi
call   1040 <strsplit1@plt>
lea    -0x30(%rbp),%rsi
lea    0xdf0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xde0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xdd4(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1070 <reset@plt>
lea    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x50(%rbp),%rcx
mov    $0x20,%esi
call   1080 <strsplit2@plt>
lea    -0x30(%rbp),%rsi
lea    0xd9d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xd8d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xd81(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1070 <reset@plt>
lea    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x50(%rbp),%rcx
mov    $0x20,%esi
call   1060 <strsplit3@plt>
lea    -0x30(%rbp),%rsi
lea    0xd4a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xd3a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xd2e(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1070 <reset@plt>
lea    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x50(%rbp),%rcx
mov    $0x20,%esi
call   10a0 <strsplit4@plt>
lea    -0x30(%rbp),%rsi
lea    0xcf7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xce7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xcdb(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1070 <reset@plt>
lea    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x50(%rbp),%rcx
mov    $0x20,%esi
call   1090 <strsplit6@plt>
lea    -0x30(%rbp),%rsi
lea    0xca4(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xc94(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xc88(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1070 <reset@plt>
lea    -0x10(%rbp),%rdi
mov    $0x20,%esi
lea    -0x58(%rbp),%rdx
lea    -0x60(%rbp),%rcx
call   1050 <strsplit7@plt>
mov    -0x58(%rbp),%rsi
lea    0xc51(%rip),%rdi
call   1030 <printf@plt>
mov    -0x60(%rbp),%rsi
lea    0xc41(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xc35(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x60,%rsp
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,0x10(%rsp)
movl   $0x646c72,0x18(%rsp)
movaps 0xe85(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe69(%rip),%xmm1
movaps %xmm1,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm1,0x20(%rsp)
lea    0x10(%rsp),%r14
lea    0x40(%rsp),%rbx
lea    0x20(%rsp),%r13
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
mov    %r13,%rcx
call   1040 <strsplit1@plt>
lea    0xe1d(%rip),%r12
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1030 <printf@plt>
lea    0xe04(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1070 <reset@plt>
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
mov    %r13,%rcx
call   1080 <strsplit2@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1070 <reset@plt>
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
mov    %r13,%rcx
call   1060 <strsplit3@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1070 <reset@plt>
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
mov    %r13,%rcx
call   10a0 <strsplit4@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1070 <reset@plt>
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
mov    %r13,%rcx
call   1090 <strsplit6@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1070 <reset@plt>
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
mov    %r14,%rdi
mov    $0x20,%esi
call   1050 <strsplit7@plt>
mov    0x8(%rsp),%rsi
mov    %r12,%rdi
call   1030 <printf@plt>
mov    (%rsp),%rsi
mov    %r12,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.string = [12 x i8] c"Hello World\00"
@__const.main.first = [32 x i8] c"undefined\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.second = [32 x i8] c"undefined\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"%s\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca [32 x i8]
%4 = alloca [32 x i8]
%5 = alloca i8*
%6 = alloca i8*
store i32 0, i32* %1
%7 = bitcast [12 x i8]* %2 to i8*
%8 = bitcast [32 x i8]* %3 to i8*
%9 = bitcast [32 x i8]* %4 to i8*
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%13 = call i32 @strsplit1(i8* %10, i8 signext 32, i8* %11, i8* %12)
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%21 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%22 = call i32 @reset(i8* %20, i8* %21)
%23 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%24 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%25 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%26 = call i32 @strsplit2(i8* %23, i8 signext 32, i8* %24, i8* %25)
%27 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %27)
%29 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %29)
%31 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%32 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %31)
%33 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%34 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%35 = call i32 @reset(i8* %33, i8* %34)
%36 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%37 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%38 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%39 = call i32 @strsplit3(i8* %36, i8 signext 32, i8* %37, i8* %38)
%40 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %40)
%42 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %42)
%44 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%45 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %44)
%46 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%47 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%48 = call i32 @reset(i8* %46, i8* %47)
%49 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%50 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%51 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%52 = call i32 @strsplit4(i8* %49, i8 signext 32, i8* %50, i8* %51)
%53 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%54 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %53)
%55 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%56 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %55)
%57 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%58 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %57)
%59 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%60 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%61 = call i32 @reset(i8* %59, i8* %60)
%62 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%63 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%64 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%65 = call i32 @strsplit6(i8* %62, i8 signext 32, i8* %63, i8* %64)
%66 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%67 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %66)
%68 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%69 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %68)
%70 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%71 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %70)
%72 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%73 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%74 = call i32 @reset(i8* %72, i8* %73)
%75 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%76 = call i32 @strsplit7(i8* %75, i8 signext 32, i8** %5, i8** %6)
%77 = load i8*, i8** %5
%78 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %77)
%79 = load i8*, i8** %6
%80 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %79)
%81 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%82 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %81)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [12 x i8] c"Hello World\00"
@__const.main.second = [32 x i8] c"undefined\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"%s\0A\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca [32 x i8]
%3 = alloca [32 x i8]
%4 = alloca i8*
%5 = alloca i8*
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%9 = call i32 @strsplit1(i8* %6, i8 signext 32, i8* %7, i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%13 = call i32 @reset(i8* %7, i8* %8)
%14 = call i32 @strsplit2(i8* %6, i8 signext 32, i8* %7, i8* %8)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%18 = call i32 @reset(i8* %7, i8* %8)
%19 = call i32 @strsplit3(i8* %6, i8 signext 32, i8* %7, i8* %8)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%23 = call i32 @reset(i8* %7, i8* %8)
%24 = call i32 @strsplit4(i8* %6, i8 signext 32, i8* %7, i8* %8)
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%27 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%28 = call i32 @reset(i8* %7, i8* %8)
%29 = call i32 @strsplit6(i8* %6, i8 signext 32, i8* %7, i8* %8)
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%32 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%33 = call i32 @reset(i8* %7, i8* %8)
%34 = bitcast i8** %4 to i8*
%35 = bitcast i8** %5 to i8*
%36 = call i32 @strsplit7(i8* %6, i8 signext 32, i8** %4, i8** %5)
%37 = load i8*, i8** %4
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %37)
%39 = load i8*, i8** %5
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %39)
%41 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}