#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 */
int do_send(int, char *, char const *, char const *, ...);
int irc_kick(int fd, const char *channel, const char *nick,
             const char *comment) {
  if (comment)
    return do_send(fd, "KICK %s %s :%s", channel, nick, comment);
  else
    return do_send(fd, "KICK %s %s", channel, nick);
}


x86 assembly (clang, -O0):
<irc_kick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1157 <irc_kick+0x47>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1030 <do_send@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <irc_kick+0x63>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1030 <do_send@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_kick>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
test   %r8,%r8
je     112c <irc_kick+0x1c>
lea    0xedb(%rip),%rsi
xor    %eax,%eax
jmp    1030 <do_send@plt>
lea    0xedc(%rip),%rsi
xor    %eax,%eax
jmp    1030 <do_send@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"KICK %s %s :%s\00"
@.str.1 = [11 x i8] c"KICK %s %s\00"
define i32 @irc_kick(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %4
%13 = load i32, i32* %6
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = call i32 (i32, i8*, i8*, i8*, ...) @do_send(i32 %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15, i8* %16)
store i32 %17, i32* %5
br label %23
18: ; preds = %4
%19 = load i32, i32* %6
%20 = load i8*, i8** %7
%21 = load i8*, i8** %8
%22 = call i32 (i32, i8*, i8*, i8*, ...) @do_send(i32 %19, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %20, i8* %21)
store i32 %22, i32* %5
br label %23
23: ; preds = %18, %12
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
@.str = [15 x i8] c"KICK %s %s :%s\00"
@.str.1 = [11 x i8] c"KICK %s %s\00"
define i32 @irc_kick(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = icmp eq i8* %3, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 (i32, i8*, i8*, i8*, ...) @do_send(i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
br label %10
8: ; preds = %4
%9 = tail call i32 (i32, i8*, i8*, i8*, ...) @do_send(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %2)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}