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

/* Variables and functions */
int /*<<< orphan*/ evbuffer_add(struct evbuffer *, char *, int);
int /*<<< orphan*/ log_msg(char *, char *);
int strlen(char *);
void irc_cmd_part(struct evbuffer *out, char *channel) {
  evbuffer_add(out, "PART ", 5);
  log_msg("[i] leaving %s\n", channel);
  evbuffer_add(out, channel, strlen(channel));
  evbuffer_add(out, "\n", 1);
}


x86 assembly (clang, -O0):
<irc_cmd_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x5,%edx
call   1050 <evbuffer_add@plt>
mov    -0x10(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <log_msg@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1050 <evbuffer_add@plt>
mov    -0x8(%rbp),%rdi
lea    0xe7c(%rip),%rsi
mov    $0x1,%edx
call   1050 <evbuffer_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_cmd_part>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xebf(%rip),%rsi
mov    $0x5,%edx
call   1050 <evbuffer_add@plt>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <log_msg@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <evbuffer_add@plt>
lea    0xe9e(%rip),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <evbuffer_add@plt>

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
@.str = [6 x i8] c"PART \00"
@.str.1 = [16 x i8] c"[i] leaving %s\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @irc_cmd_part(%struct.evbuffer* %0, i8* %1) {
%3 = alloca %struct.evbuffer*
%4 = alloca i8*
store %struct.evbuffer* %0, %struct.evbuffer** %3
store i8* %1, i8** %4
%5 = load %struct.evbuffer*, %struct.evbuffer** %3
%6 = call i32 @evbuffer_add(%struct.evbuffer* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%7 = load i8*, i8** %4
%8 = call i32 @log_msg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load %struct.evbuffer*, %struct.evbuffer** %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @evbuffer_add(%struct.evbuffer* %9, i8* %10, i32 %12)
%14 = load %struct.evbuffer*, %struct.evbuffer** %3
%15 = call i32 @evbuffer_add(%struct.evbuffer* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
@.str = [6 x i8] c"PART \00"
@.str.1 = [16 x i8] c"[i] leaving %s\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @irc_cmd_part(%struct.evbuffer* %0, i8* %1) {
%3 = tail call i32 @evbuffer_add(%struct.evbuffer* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%4 = tail call i32 @log_msg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @evbuffer_add(%struct.evbuffer* %0, i8* %1, i32 %5)
%7 = tail call i32 @evbuffer_add(%struct.evbuffer* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret void
}