#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 /*<<< 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) {
  char *pos, suffix[512];
  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);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
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,-0x240(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     119c <irc_message_split_005+0x6c>
lea    -0x240(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    $0x200,%esi
lea    0xe73(%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),%r10
lea    -0x240(%rbp),%rax
xor    %r9d,%r9d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
movl   $0x20,0x10(%rsp)
movl   $0xffffffff,0x18(%rsp)
ff
call   1050 <irc_message_split_string@plt>
add    $0x260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x218,%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    $0x200,%esi
mov    %rax,%rcx
call   1030 <snprintf@plt>
movb   $0x0,(%r14)
lea    0x10(%rsp),%rax
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    0x8(%rsp),%r8
xor    %r9d,%r9d
push   $0xffffffffffffffff
push   $0x20
push   %rax
push   %rbx
call   1050 <irc_message_split_string@plt>
add    $0x238,%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) {
%7 = alloca %struct.t_hashtable*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca [512 x i8]
store %struct.t_hashtable* %0, %struct.t_hashtable** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %14, i64 0, i64 0
store i8 0, i8* %15
%16 = load i8*, i8** %12
%17 = call i8* @strstr(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %17, i8** %13
%18 = load i8*, i8** %13
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %26
20: ; preds = %6
%21 = getelementptr inbounds [512 x i8], [512 x i8]* %14, i64 0, i64 0
%22 = load i8*, i8** %13
%23 = call i32 @snprintf(i8* %21, i32 512, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = load i8*, i8** %13
%25 = getelementptr inbounds i8, i8* %24, i64 0
store i8 0, i8* %25
br label %26
26: ; preds = %20, %6
%27 = load %struct.t_hashtable*, %struct.t_hashtable** %7
%28 = load i8*, i8** %8
%29 = load i8*, i8** %9
%30 = load i8*, i8** %10
%31 = load i8*, i8** %11
%32 = load i8*, i8** %12
%33 = getelementptr inbounds [512 x i8], [512 x i8]* %14, i64 0, i64 0
%34 = call i32 @irc_message_split_string(%struct.t_hashtable* %27, i8* %28, i8* %29, i8* %30, i8* %31, i32* null, i8* %32, i8* %33, i8 signext 32, i32 -1)
ret i32 %34
}

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) {
%7 = alloca [512 x i8]
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
store i8 0, i8* %8
%9 = tail call i8* @strstr(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = call i32 @snprintf(i8* %8, i32 512, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
store i8 0, i8* %9
br label %13
13: ; preds = %11, %6
%14 = call i32 @irc_message_split_string(%struct.t_hashtable* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32* null, i8* %5, i8* %8, i8 signext 32, i32 -1)
ret i32 %14
}