#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*/ *strchr(char *, char);
char *strtok(char *, char *);
void PrintOutput(char *szOutput) {
  char *ptr;
  if (strchr(szOutput, ' ') == NULL)
    printf("%s\n", szOutput);
  else {
    ptr = strtok(szOutput, " ");
    while (ptr != NULL) {
      printf("Candidate %s:", ptr);
      ptr = strtok(NULL, " ");
      if (ptr != NULL) {
        printf("\t%s", ptr);
        ptr = strtok(NULL, " ");
        if (ptr != NULL) {
          printf("\t%s\n", ptr);
          ptr = strtok(NULL, " ");
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<PrintOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    1169 <PrintOutput+0x39>
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
jmp    1219 <PrintOutput+0xe9>
mov    -0x8(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1214 <PrintOutput+0xe4>
mov    -0x10(%rbp),%rsi
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe5d(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     120f <PrintOutput+0xdf>
mov    -0x10(%rbp),%rsi
lea    0xe4e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe2e(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     120a <PrintOutput+0xda>
mov    -0x10(%rbp),%rsi
lea    0xe23(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xdff(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x10(%rbp)
jmp    120f <PrintOutput+0xdf>
jmp    117d <PrintOutput+0x4d>
jmp    1219 <PrintOutput+0xe9>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintOutput>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x20,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     11da <PrintOutput+0xaa>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strtok@plt>
test   %rax,%rax
je     11ce <PrintOutput+0x9e>
lea    0xe99(%rip),%r14
lea    0xe90(%rip),%rbx
lea    0xe99(%rip),%r15
lea    0xe96(%rip),%r12
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     11ce <PrintOutput+0x9e>
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     11ce <PrintOutput+0x9e>
mov    %r12,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
jne    1180 <PrintOutput+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xe34(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [14 x i8] c"Candidate %s:\00"
@.str.3 = [4 x i8] c"\09%s\00"
@.str.4 = [5 x i8] c"\09%s\0A\00"
define void @PrintOutput(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @strchr(i8* %4, i8 signext 32)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %35
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i8* @strtok(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %12, i8** %3
br label %13
13: ; preds = %33, %10
%14 = load i8*, i8** %3
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %34
16: ; preds = %13
%17 = load i8*, i8** %3
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %19, i8** %3
%20 = load i8*, i8** %3
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %33
22: ; preds = %16
%23 = load i8*, i8** %3
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %23)
%25 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %25, i8** %3
%26 = load i8*, i8** %3
%27 = icmp ne i8* %26, null
br i1 %27, label %28, label %32
28: ; preds = %22
%29 = load i8*, i8** %3
%30 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %29)
%31 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %31, i8** %3
br label %32
32: ; preds = %28, %22
br label %33
33: ; preds = %32, %16
br label %13
34: ; preds = %13
br label %35
35: ; preds = %34, %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [14 x i8] c"Candidate %s:\00"
@.str.3 = [4 x i8] c"\09%s\00"
@.str.4 = [5 x i8] c"\09%s\0A\00"
define void @PrintOutput(i8* %0) {
%2 = tail call i32* @strchr(i8* %0, i8 signext 32)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %22
6: ; preds = %1
%7 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %22, label %9
9: ; preds = %6, %18
%10 = phi i8* [ %20, %18 ], [ %7, %6 ]
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i8* %12, null
br i1 %13, label %22, label %14
14: ; preds = %9
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%16 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i8* %16, null
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%20 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %9
22: ; preds = %9, %14, %18, %6, %4
ret void
}