#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(void *data, const char *modifier,
                                            const char *modifier_data,
                                            const char *string) {
  (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>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x21(%rbp)
je     116a <plugin_api_modifier_color_decode_ansi+0x4a>
mov    -0x18(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x21(%rbp),%cl
xor    %esi,%esi
mov    $0x1,%eax
test   $0x1,%cl
cmovne %eax,%esi
call   1040 <gui_color_decode_ansi@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_modifier_color_decode_ansi>:
push   %rbx
mov    %rcx,%rbx
test   %rdx,%rdx
je     1143 <plugin_api_modifier_color_decode_ansi+0x23>
lea    0xed0(%rip),%rsi
mov    %rdx,%rdi
call   1030 <strcmp@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
jmp    1145 <plugin_api_modifier_color_decode_ansi+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(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** %8
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %4
%15 = load i8*, i8** %7
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br label %18
18: ; preds = %14, %4
%19 = phi i1 [ false, %4 ], [ %17, %14 ]
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 1, i32 0
%22 = call i8* @gui_color_decode_ansi(i8* %11, i32 %21)
ret i8* %22
}

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