#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(void *data, const char *info_name,
                                              const char *arguments) {
  static char value[32];
  (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    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115c <plugin_api_info_color_term2rgb_cb+0x2c>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1169 <plugin_api_info_color_term2rgb_cb+0x39>
movq   $0x0,-0x8(%rbp)
jmp    119e <plugin_api_info_color_term2rgb_cb+0x6e>
mov    -0x20(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <gui_color_convert_term_to_rgb@plt>
mov    %eax,%ecx
lea    0x2ece(%rip),%rdi
mov    $0x20,%esi
lea    0xe72(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2eb6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_info_color_term2rgb_cb>:
push   %rbx
test   %rdx,%rdx
je     1169 <plugin_api_info_color_term2rgb_cb+0x39>
cmpb   $0x0,(%rdx)
je     1169 <plugin_api_info_color_term2rgb_cb+0x39>
mov    %rdx,%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) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i8*, i8** %7
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = icmp ne i8 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %12, %3
store i8* null, i8** %4
br label %23
18: ; preds = %12
%19 = load i8*, i8** %7
%20 = call i32 @atoi(i8* %19)
%21 = call i32 @gui_color_convert_term_to_rgb(i32 %20)
%22 = 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 %21)
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_color_term2rgb_cb.value, i64 0, i64 0), i8** %4
br label %23
23: ; preds = %18, %17
%24 = load i8*, i8** %4
ret i8* %24
}

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* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i32 @atoi(i8* %2)
%10 = tail call i32 @gui_color_convert_term_to_rgb(i32 %9)
%11 = 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 %10)
br label %12
12: ; preds = %3, %5, %8
%13 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_color_term2rgb_cb.value, i64 0, i64 0), %8 ], [ null, %5 ], [ null, %3 ]
ret i8* %13
}