#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*/ ircproto_notice(char *, char *, char *);
char *pref_get(char *);
void version(char *usr, char *src, char *msg, char **caps, int ncaps) {
  char *version = pref_get("version");
  if (version != NULL)
    ircproto_notice(src, "\001VERSION %s\001", version);
  else
    ircproto_notice(src, "\001VERSION yak %s\001", "0.2.6");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <pref_get@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1170 <version+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xea2(%rip),%rsi
call   1030 <ircproto_notice@plt>
jmp    1187 <version+0x67>
mov    -0x10(%rbp),%rdi
lea    0xe9a(%rip),%rsi
lea    0xea4(%rip),%rdx
call   1030 <ircproto_notice@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <pref_get@plt>
test   %rax,%rax
je     1148 <version+0x28>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <ircproto_notice@plt>
lea    0xec6(%rip),%rsi
lea    0xed0(%rip),%rdx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ircproto_notice@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"version\00"
@.str.1 = [13 x i8] c"\01VERSION %s\01\00"
@.str.2 = [17 x i8] c"\01VERSION yak %s\01\00"
@.str.3 = [6 x i8] c"0.2.6\00"
define void @version(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2, i8** nocapture readnone %3, i32 %4) {
%6 = tail call i8* @pref_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @ircproto_notice(i8* %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %12
10: ; preds = %5
%11 = tail call i32 @ircproto_notice(i8* %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret void
}