#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 */
char *gui_color_decode_ansi(char const *, int);
scalar_t__ strcmp(char const *, char *);
char *plugin_api_modifier_color_decode_ansi_cb(const void *pointer, void *data,
                                               const char *modifier,
                                               const char *modifier_data,
                                               const char *string) {
  (void)pointer;
  (void)data;
  (void)modifier;
  return gui_color_decode_ansi(
      string, (modifier_data && (strcmp(modifier_data, "1") == 0)) ? 1 : 0);
}


x86 assembly (clang, -O0):
<plugin_api_modifier_color_decode_ansi_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x29(%rbp)
je     116e <plugin_api_modifier_color_decode_ansi_cb+0x4e>
mov    -0x20(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x29(%rbp),%cl
xor    %esi,%esi
mov    $0x1,%eax
test   $0x1,%cl
cmovne %eax,%esi
call   1040 <gui_color_decode_ansi@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_modifier_color_decode_ansi_cb>:
push   %rbx
mov    %r8,%rbx
test   %rcx,%rcx
je     1143 <plugin_api_modifier_color_decode_ansi_cb+0x23>
lea    0xed0(%rip),%rsi
mov    %rcx,%rdi
call   1030 <strcmp@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
jmp    1145 <plugin_api_modifier_color_decode_ansi_cb+0x25>
xor    %esi,%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <gui_color_decode_ansi@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
define i8* @plugin_api_modifier_color_decode_ansi_cb(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %10
%15 = load i8*, i8** %9
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %21
17: ; preds = %5
%18 = load i8*, i8** %9
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br label %21
21: ; preds = %17, %5
%22 = phi i1 [ false, %5 ], [ %20, %17 ]
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 0
%25 = call i8* @gui_color_decode_ansi(i8* %14, i32 %24)
ret i8* %25
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
define i8* @plugin_api_modifier_color_decode_ansi_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* %3, i8* %4) {
%6 = icmp eq i8* %3, null
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ 0, %5 ], [ %10, %7 ]
%13 = tail call i8* @gui_color_decode_ansi(i8* %4, i32 %12)
ret i8* %13
}