#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);
char *strtok(int /*<<< orphan*/, char *);
int /*<<< orphan*/ strtolower(char *);
int /*<<< orphan*/ usercache_add(char *, char *);
void usercache_302(char *sender, char *cmd, char *args) {
  char *nick, *userhost;
  args = strchr(args, ':');
  if (!args || !args[1])
    return;
  nick = strtok(strtolower(args + 1), "=");
  userhost = strtok(0, " ") + 1;
  if (nick && userhost)
    usercache_add(nick, userhost);
}


x86 assembly (clang, -O0):
<usercache_302>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117f <usercache_302+0x3f>
mov    -0x18(%rbp),%rax
cmpb   $0x0,0x1(%rax)
jne    1184 <usercache_302+0x44>
jmp    11dc <usercache_302+0x9c>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1030 <strtolower@plt>
mov    %eax,%edi
lea    0xe66(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x20(%rbp)
xor    %edi,%edi
lea    0xe56(%rip),%rsi
call   1060 <strtok@plt>
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11dc <usercache_302+0x9c>
cmpq   $0x0,-0x28(%rbp)
je     11dc <usercache_302+0x9c>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <usercache_add@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usercache_302>:
push   %rbx
mov    %rdx,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1199 <usercache_302+0x59>
cmpb   $0x0,0x1(%rax)
je     1199 <usercache_302+0x59>
add    $0x1,%rax
mov    %rax,%rdi
call   1030 <strtolower@plt>
lea    0xe94(%rip),%rsi
mov    %eax,%edi
call   1060 <strtok@plt>
mov    %rax,%rbx
lea    0xe85(%rip),%rsi
xor    %edi,%edi
call   1060 <strtok@plt>
test   %rbx,%rbx
je     1199 <usercache_302+0x59>
add    $0x1,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <usercache_add@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
@.str.1 = [2 x i8] c" \00"
define void @usercache_302(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 58)
%5 = icmp eq i8* %4, null
br i1 %5, label %18, label %6
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = tail call i32 @strtolower(i8* %7)
%12 = tail call i8* @strtok(i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = tail call i8* @strtok(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i8* %12, null
br i1 %14, label %18, label %15
15: ; preds = %10
%16 = getelementptr inbounds i8, i8* %13, i64 1
%17 = tail call i32 @usercache_add(i8* %12, i8* %16)
br label %18
18: ; preds = %10, %15, %3, %6
ret void
}