#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*/ suffix;
struct t_hashtable {
  int dummy;
};

/* Variables and functions */
int irc_message_split_string(struct t_hashtable *, char *, char *, char *,
                             char *, int /*<<< orphan*/ *, char *, char *, char,
                             int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
char *strstr(char *, char *);
int irc_message_split_005(struct t_hashtable *hashtable, char *tags, char *host,
                          char *command, char *target, char *arguments,
                          int max_length) {
  char *pos, suffix[4096];
  suffix[0] = '\0';
  pos = strstr(arguments, " :");
  if (pos) {
    snprintf(suffix, sizeof(suffix), "%s", pos);
    pos[0] = '\0';
  }
  return irc_message_split_string(hashtable, tags, host, command, target, NULL,
                                  arguments, suffix, ' ', -1, max_length);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x1070,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movb   $0x0,-0x1040(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     119f <irc_message_split_005+0x6f>
lea    -0x1040(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    $0x1000,%esi
lea    0xe70(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r11
lea    -0x1040(%rbp),%r10
mov    0x10(%rbp),%eax
xor    %r9d,%r9d
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
movl   $0x20,0x10(%rsp)
movl   $0xffffffff,0x18(%rsp)
ff
mov    %eax,0x20(%rsp)
call   1050 <irc_message_split_string@plt>
add    $0x1070,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1018,%rsp
mov    %r9,%rbx
mov    %r8,0x8(%rsp)
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbp
movb   $0x0,0x10(%rsp)
lea    0xe9f(%rip),%rsi
mov    %r9,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
je     118e <irc_message_split_005+0x5e>
mov    %rax,%r14
lea    0xe8b(%rip),%rdx
lea    0x10(%rsp),%rdi
mov    $0x1000,%esi
mov    %rax,%rcx
call   1030 <snprintf@plt>
movb   $0x0,(%r14)
sub    $0x8,%rsp
lea    0x18(%rsp),%rax
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    0x10(%rsp),%r8
xor    %r9d,%r9d
mov    0x1058(%rsp),%ebp
push   %rbp
push   $0xffffffffffffffff
push   $0x20
push   %rax
push   %rbx
call   1050 <irc_message_split_string@plt>
add    $0x1048,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.t_hashtable = type { i32 }
@.str = [3 x i8] c" :\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @irc_message_split_005(%struct.t_hashtable* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i32 %6) {
%8 = alloca [4096 x i8]
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
store i8 0, i8* %9
%10 = tail call i8* @strstr(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %7
%13 = call i32 @snprintf(i8* %9, i32 4096, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
store i8 0, i8* %10
br label %14
14: ; preds = %12, %7
%15 = call i32 @irc_message_split_string(%struct.t_hashtable* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32* null, i8* %5, i8* %9, i8 signext 32, i32 -1, i32 %6)
ret i32 %15
}