#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 /*<<< orphan*/ _irc_queue_insert(int, char *, char *, ...);
int irc_mode(char *chan, char *mode, char *param) {
  if (mode && param)
    _irc_queue_insert(5, "MODE %s %s %s", chan, mode, param);
  else if (mode)
    _irc_queue_insert(5, "MODE %s %s", chan, mode);
  else
    _irc_queue_insert(5, "MODE %s", chan);
  return 0;
}


x86 assembly (clang, -O0):
<irc_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <irc_mode+0x4e>
cmpq   $0x0,-0x18(%rbp)
je     115e <irc_mode+0x4e>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x5,%edi
lea    0xeae(%rip),%rsi
mov    $0x0,%al
call   1030 <_irc_queue_insert@plt>
jmp    11a5 <irc_mode+0x95>
cmpq   $0x0,-0x10(%rbp)
je     1189 <irc_mode+0x79>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x5,%edi
lea    0xe91(%rip),%rsi
mov    $0x0,%al
call   1030 <_irc_queue_insert@plt>
jmp    11a0 <irc_mode+0x90>
mov    -0x8(%rbp),%rdx
mov    $0x5,%edi
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1030 <_irc_queue_insert@plt>
jmp    11a5 <irc_mode+0x95>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_mode>:
push   %rax
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
test   %rsi,%rsi
je     1139 <irc_mode+0x29>
test   %r8,%r8
je     1139 <irc_mode+0x29>
lea    0xed5(%rip),%rsi
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <_irc_queue_insert@plt>
jmp    1166 <irc_mode+0x56>
test   %rcx,%rcx
je     1153 <irc_mode+0x43>
lea    0xec9(%rip),%rsi
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <_irc_queue_insert@plt>
jmp    1166 <irc_mode+0x56>
lea    0xebf(%rip),%rsi
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <_irc_queue_insert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"MODE %s %s %s\00"
@.str.1 = [11 x i8] c"MODE %s %s\00"
@.str.2 = [8 x i8] c"MODE %s\00"
define i32 @irc_mode(i8* %0, i8* %1, i8* %2) {
%4 = icmp ne i8* %1, null
%5 = icmp ne i8* %2, null
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (i32, i8*, i8*, ...) @_irc_queue_insert(i32 5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
br label %14
9: ; preds = %3
br i1 %4, label %10, label %12
10: ; preds = %9
%11 = tail call i32 (i32, i8*, i8*, ...) @_irc_queue_insert(i32 5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
br label %14
12: ; preds = %9
%13 = tail call i32 (i32, i8*, i8*, ...) @_irc_queue_insert(i32 5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %14
14: ; preds = %10, %12, %7
ret i32 0
}