#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(const void *pointer, void *data,
                                              const char *info_name,
                                              const char *arguments) {
  static char version_number[32] = {'\0'};
  (void)pointer;
  (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)
mov    %rcx,-0x20(%rbp)
cmpb   $0x0,0x2f01(%rip)
jne    117d <plugin_api_info_version_number_cb+0x4d>
mov    $0x0,%al
call   1030 <version_get_version@plt>
mov    %eax,%edi
call   1050 <util_version_number@plt>
mov    %eax,%ecx
lea    0x2ee4(%rip),%rdi
mov    $0x20,%esi
lea    0xe88(%rip),%rdx
call   1040 <snprintf@plt>
lea    0x2ecc(%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, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = load i8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_version_number_cb.version_number, i64 0, i64 0)
%14 = icmp ne i8 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %4
%16 = call i32 (...) @version_get_version()
%17 = call i32 @util_version_number(i32 %16)
%18 = 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 %17)
br label %19
19: ; preds = %15, %4
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, i8* nocapture readnone %3) {
%5 = load i8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_version_number_cb.version_number, i64 0, i64 0)
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 (...) @version_get_version()
%9 = tail call i32 @util_version_number(i32 %8)
%10 = 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 %9)
br label %11
11: ; preds = %7, %4
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_version_number_cb.version_number, i64 0, i64 0)
}