#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 */
char *strchr(char *, char);
int SplitIRCPrefix(char *strCommand, char **strPrefix) {
  ;
  ;
  if (!strCommand || !strPrefix)
    return 0;
  if (*strCommand == ':') {
    char *str = strchr(++strCommand, ' ');
    if (str) {
      *strPrefix = strCommand;
      *str = '\0';
      return 1;
    }
  }
  *strPrefix = 0;
  return 0;
}


x86 assembly (clang, -O0):
<SplitIRCPrefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <SplitIRCPrefix+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <SplitIRCPrefix+0x32>
movl   $0x0,-0x4(%rbp)
jmp    11ac <SplitIRCPrefix+0x9c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    119a <SplitIRCPrefix+0x8a>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x10(%rbp)
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1195 <SplitIRCPrefix+0x85>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11ac <SplitIRCPrefix+0x9c>
jmp    119a <SplitIRCPrefix+0x8a>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SplitIRCPrefix>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
test   %rdi,%rdi
je     1157 <SplitIRCPrefix+0x47>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1157 <SplitIRCPrefix+0x47>
mov    %rdi,%rbp
cmpb   $0x3a,(%rdi)
jne    1150 <SplitIRCPrefix+0x40>
add    $0x1,%rbp
mov    %rbp,%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1150 <SplitIRCPrefix+0x40>
mov    %rbp,(%rbx)
movb   $0x0,(%rax)
mov    $0x1,%r14d
jmp    1157 <SplitIRCPrefix+0x47>
movq   $0x0,(%rbx)
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SplitIRCPrefix(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = icmp ne i8** %10, null
br i1 %11, label %13, label %12
12: ; preds = %9, %2
store i32 0, i32* %3
br label %31
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 58
br i1 %17, label %18, label %29
18: ; preds = %13
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %4
%21 = call i8* @strchr(i8* %20, i8 signext 32)
store i8* %21, i8** %6
%22 = load i8*, i8** %6
%23 = icmp ne i8* %22, null
br i1 %23, label %24, label %28
24: ; preds = %18
%25 = load i8*, i8** %4
%26 = load i8**, i8*** %5
store i8* %25, i8** %26
%27 = load i8*, i8** %6
store i8 0, i8* %27
store i32 1, i32* %3
br label %31
28: ; preds = %18
br label %29
29: ; preds = %28, %13
%30 = load i8**, i8*** %5
store i8* null, i8** %30
store i32 0, i32* %3
br label %31
31: ; preds = %29, %24, %12
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @SplitIRCPrefix(i8* %0, i8** writeonly %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8** %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 58
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = tail call i8* @strchr(i8* %10, i8 signext 32)
%12 = icmp eq i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %9
store i8* %10, i8** %1
store i8 0, i8* %11
br label %15
14: ; preds = %9, %6
store i8* null, i8** %1
br label %15
15: ; preds = %13, %2, %14
%16 = phi i32 [ 1, %13 ], [ 0, %14 ], [ 0, %2 ]
ret i32 %16
}