#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 socket_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ botevent(int, struct socket_info *, int /*<<< orphan*/ *,
                            char *, char *);
int /*<<< orphan*/ strip_char_from_end(char, char *);
char *strtok(char *, char *);
void numeric_ready(struct socket_info *sinfo, char *params) {
  char *channel, *info;
  strtok(params, " ");
  channel = strtok(NULL, " ");
  info = strtok(NULL, "");
  strip_char_from_end(':', info);
  strip_char_from_end('\r', info);
  botevent(11, sinfo, NULL, channel, info);
}


x86 assembly (clang, -O0):
<numeric_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strtok@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xea5(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe92(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    $0x3a,%edi
call   1030 <strip_char_from_end@plt>
mov    -0x20(%rbp),%rsi
mov    $0xd,%edi
call   1030 <strip_char_from_end@plt>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0xb,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <botevent@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeric_ready>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0xec1(%rip),%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1040 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <strtok@plt>
mov    %rax,%r15
lea    0xea3(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
mov    %rax,%rbx
mov    $0x3a,%edi
mov    %rax,%rsi
call   1030 <strip_char_from_end@plt>
mov    $0xd,%edi
mov    %rbx,%rsi
call   1030 <strip_char_from_end@plt>
mov    $0xb,%edi
mov    %r14,%rsi
xor    %edx,%edx
mov    %r15,%rcx
mov    %rbx,%r8
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <botevent@plt>

LLVM IR (-O0):
%struct.socket_info = type { i32 }
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @numeric_ready(%struct.socket_info* %0, i8* %1) {
%3 = alloca %struct.socket_info*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store %struct.socket_info* %0, %struct.socket_info** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i8* @strtok(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %5
%10 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = call i32 @strip_char_from_end(i8 signext 58, i8* %11)
%13 = load i8*, i8** %6
%14 = call i32 @strip_char_from_end(i8 signext 13, i8* %13)
%15 = load %struct.socket_info*, %struct.socket_info** %3
%16 = load i8*, i8** %5
%17 = load i8*, i8** %6
%18 = call i32 @botevent(i32 11, %struct.socket_info* %15, i32* null, i8* %16, i8* %17)
ret void
}

LLVM IR (-O2):
%struct.socket_info = type { i32 }
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @numeric_ready(%struct.socket_info* %0, i8* %1) {
%3 = tail call i8* @strtok(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @strip_char_from_end(i8 signext 58, i8* %5)
%7 = tail call i32 @strip_char_from_end(i8 signext 13, i8* %5)
%8 = tail call i32 @botevent(i32 11, %struct.socket_info* %0, i32* null, i8* %4, i8* %5)
ret void
}