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

/* Variables and functions */
scalar_t__ irc_channel_is_channel(char const *);
int /*<<< orphan*/ irc_server_sendf(struct t_irc_server *, int /*<<< orphan*/,
                                    char *, char const *);
void irc_command_join_server(struct t_irc_server *server,
                             const char *arguments) {
  if (irc_channel_is_channel(arguments))
    irc_server_sendf(server, 0, "JOIN %s", arguments);
  else
    irc_server_sendf(server, 0, "JOIN #%s", arguments);
}


x86 assembly (clang, -O0):
<irc_command_join_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <irc_channel_is_channel@plt>
cmp    $0x0,%rax
je     115e <irc_command_join_server+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
lea    0xeac(%rip),%rdx
call   1040 <irc_server_sendf@plt>
jmp    1174 <irc_command_join_server+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
lea    0xe99(%rip),%rdx
call   1040 <irc_server_sendf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_command_join_server>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <irc_channel_is_channel@plt>
test   %rax,%rax
lea    0xecc(%rip),%rax
lea    0xebd(%rip),%rdx
cmove  %rax,%rdx
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <irc_server_sendf@plt>

LLVM IR (-O0):
%struct.t_irc_server = type { i32 }
@.str = [8 x i8] c"JOIN %s\00"
@.str.1 = [9 x i8] c"JOIN #%s\00"
define void @irc_command_join_server(%struct.t_irc_server* %0, i8* %1) {
%3 = alloca %struct.t_irc_server*
%4 = alloca i8*
store %struct.t_irc_server* %0, %struct.t_irc_server** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i64 @irc_channel_is_channel(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load %struct.t_irc_server*, %struct.t_irc_server** %3
%10 = load i8*, i8** %4
%11 = call i32 @irc_server_sendf(%struct.t_irc_server* %9, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %16
12: ; preds = %2
%13 = load %struct.t_irc_server*, %struct.t_irc_server** %3
%14 = load i8*, i8** %4
%15 = call i32 @irc_server_sendf(%struct.t_irc_server* %13, i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
%struct.t_irc_server = type { i32 }
@.str = [8 x i8] c"JOIN %s\00"
@.str.1 = [9 x i8] c"JOIN #%s\00"
define void @irc_command_join_server(%struct.t_irc_server* %0, i8* %1) {
%3 = tail call i64 @irc_channel_is_channel(i8* %1)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @irc_server_sendf(%struct.t_irc_server* %0, i32 0, i8* %5, i8* %1)
ret void
}