#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 */
typedef int /*<<< orphan*/ version_number;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int util_version_number(int /*<<< orphan*/);
int /*<<< orphan*/ version_get_version();
const char *plugin_api_info_version_number_cb(void *data, const char *info_name,
                                              const char *arguments) {
  static char version_number[32] = {'\0'};
  (void)data;
  (void)info_name;
  (void)arguments;
  if (!version_number[0]) {
    snprintf(version_number, sizeof(version_number), "%d",
             util_version_number(version_get_version()));
  }
  return version_number;
}


x86 assembly (clang, -O0):
<plugin_api_info_version_number_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpb   $0x0,0x2f05(%rip)
jne    1179 <plugin_api_info_version_number_cb+0x49>
mov    $0x0,%al
call   1030 <version_get_version@plt>
mov    %eax,%edi
call   1050 <util_version_number@plt>
mov    %eax,%ecx
lea    0x2ee8(%rip),%rdi
mov    $0x20,%esi
lea    0xe8c(%rip),%rdx
call   1040 <snprintf@plt>
lea    0x2ed0(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_info_version_number_cb>:
push   %rax
cmpb   $0x0,0x2f18(%rip)
jne    1162 <plugin_api_info_version_number_cb+0x32>
xor    %eax,%eax
call   1030 <version_get_version@plt>
mov    %eax,%edi
call   1050 <util_version_number@plt>
lea    0x2f01(%rip),%rdi
lea    0xeaa(%rip),%rdx
mov    $0x20,%esi
mov    %eax,%ecx
call   1040 <snprintf@plt>
lea    0x2ee7(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@plugin_api_info_version_number_cb.version_number = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @plugin_api_info_version_number_cb(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** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_version_number_cb.version_number, i64 0, i64 0)
%11 = icmp ne i8 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %3
%13 = call i32 (...) @version_get_version()
%14 = call i32 @util_version_number(i32 %13)
%15 = call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_version_number_cb.version_number, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %12, %3
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_version_number_cb.version_number, i64 0, i64 0)
}

LLVM IR (-O2):
@plugin_api_info_version_number_cb.version_number = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @plugin_api_info_version_number_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = load i8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_version_number_cb.version_number, i64 0, i64 0)
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 (...) @version_get_version()
%8 = tail call i32 @util_version_number(i32 %7)
%9 = tail call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_version_number_cb.version_number, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %6, %3
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_version_number_cb.version_number, i64 0, i64 0)
}