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

/* Variables and functions */
int /*<<< orphan*/ info_log(char *, char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ privmsg(int /*<<< orphan*/, char const *, char *, char *);
char *strtok(char *, char *);
int /*<<< orphan*/ unick(struct userlist *);
int /*<<< orphan*/ usinfo(struct userlist *);
int msg_say(const char *replyto, struct userlist *user, char *data) {
  char *message;
  if (data == NULL) {
    return (0);
  }
  message = strtok(data, "");
  info_log("Say %s on %s by %s\n", message, replyto, unick(user));
  privmsg(usinfo(user), replyto, "%s", message);
  return (0);
}


x86 assembly (clang, -O0):
<msg_say>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    117b <msg_say+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    11e4 <msg_say+0x94>
mov    -0x20(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <unick@plt>
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    %eax,%ecx
lea    0xe47(%rip),%rdi
call   1040 <info_log@plt>
mov    -0x18(%rbp),%rdi
call   1070 <usinfo@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rcx
lea    0xe3c(%rip),%rdx
call   1050 <privmsg@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_say>:
test   %rdx,%rdx
je     11af <msg_say+0x5f>
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xeac(%rip),%rsi
mov    %rdx,%rdi
call   1060 <strtok@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <unick@plt>
lea    0xe7f(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
call   1040 <info_log@plt>
mov    %rbx,%rdi
call   1070 <usinfo@plt>
lea    0xe77(%rip),%rdx
mov    %eax,%edi
mov    %r14,%rsi
mov    %r15,%rcx
call   1050 <privmsg@plt>
pop    %rbx
pop    %r14
pop    %r15
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.userlist = type { i32 }
@.str = [1 x i8] zeroinitializer
@.str.1 = [20 x i8] c"Say %s on %s by %s\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @msg_say(i8* %0, %struct.userlist* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.userlist*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store %struct.userlist* %1, %struct.userlist** %6
store i8* %2, i8** %7
%9 = load i8*, i8** %7
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %4
br label %25
12: ; preds = %3
%13 = load i8*, i8** %7
%14 = call i8* @strtok(i8* %13, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %14, i8** %8
%15 = load i8*, i8** %8
%16 = load i8*, i8** %5
%17 = load %struct.userlist*, %struct.userlist** %6
%18 = call i32 @unick(%struct.userlist* %17)
%19 = call i32 @info_log(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %15, i8* %16, i32 %18)
%20 = load %struct.userlist*, %struct.userlist** %6
%21 = call i32 @usinfo(%struct.userlist* %20)
%22 = load i8*, i8** %5
%23 = load i8*, i8** %8
%24 = call i32 @privmsg(i32 %21, i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %23)
store i32 0, i32* %4
br label %25
25: ; preds = %12, %11
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
%struct.userlist = type { i32 }
@.str = [1 x i8] zeroinitializer
@.str.1 = [20 x i8] c"Say %s on %s by %s\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @msg_say(i8* %0, %struct.userlist* %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = tail call i8* @strtok(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @unick(%struct.userlist* %1)
%8 = tail call i32 @info_log(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %0, i32 %7)
%9 = tail call i32 @usinfo(%struct.userlist* %1)
%10 = tail call i32 @privmsg(i32 %9, i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %11
11: ; preds = %3, %5
ret i32 0
}