#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*/ value;

/* Variables and functions */
int /*<<< orphan*/ atoi(char const *);
int gui_color_convert_term_to_rgb(int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
const char *plugin_api_info_color_term2rgb_cb(const void *pointer, void *data,
                                              const char *info_name,
                                              const char *arguments) {
  static char value[32];
  (void)pointer;
  (void)data;
  (void)info_name;
  if (!arguments || !arguments[0])
    return NULL;
  snprintf(value, sizeof(value), "%d",
           gui_color_convert_term_to_rgb(atoi(arguments)));
  return value;
}


x86 assembly (clang, -O0):
<plugin_api_info_color_term2rgb_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1160 <plugin_api_info_color_term2rgb_cb+0x30>
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
jne    116d <plugin_api_info_color_term2rgb_cb+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    11a2 <plugin_api_info_color_term2rgb_cb+0x72>
mov    -0x28(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <gui_color_convert_term_to_rgb@plt>
mov    %eax,%ecx
lea    0x2eca(%rip),%rdi
mov    $0x20,%esi
lea    0xe6e(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2eb2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_info_color_term2rgb_cb>:
push   %rbx
test   %rcx,%rcx
je     1169 <plugin_api_info_color_term2rgb_cb+0x39>
cmpb   $0x0,(%rcx)
je     1169 <plugin_api_info_color_term2rgb_cb+0x39>
mov    %rcx,%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <gui_color_convert_term_to_rgb@plt>
lea    0x2eff(%rip),%rbx
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %eax,%ecx
call   1030 <snprintf@plt>
jmp    116b <plugin_api_info_color_term2rgb_cb+0x3b>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

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