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

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int gui_color_search(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, ...);
char *strchr(char const *, char);
char *strdup(char const *);
scalar_t__ string_strcasecmp(char const *, char *);
char *string_strndup(char const *, int);
const char *gui_color_get_custom(const char *color_name) {
  int fg, bg;
  static char color[20][16];
  static int index_color = 0;
  char *pos_comma, *str_fg, *pos_bg;
  index_color = (index_color + 1) % 20;
  color[index_color][0] = '\0';
  if (!color_name || !color_name[0])
    return color[index_color];
  if (string_strcasecmp(color_name, "reset") == 0) {
    snprintf(color[index_color], sizeof(color[index_color]), "%s", "\x1C");
  } else if (string_strcasecmp(color_name, "bold") == 0) {
    snprintf(color[index_color], sizeof(color[index_color]), "%s%s", "\x1A",
             "\x01");
  } else if (string_strcasecmp(color_name, "-bold") == 0) {
    snprintf(color[index_color], sizeof(color[index_color]), "%s%s", "\x1B",
             "\x01");
  } else if (string_strcasecmp(color_name, "reverse") == 0) {
    snprintf(color[index_color], sizeof(color[index_color]), "%s%s", "\x1A",
             "\x02");
  } else if (string_strcasecmp(color_name, "-reverse") == 0) {
    snprintf(color[index_color], sizeof(color[index_color]), "%s%s", "\x1B",
             "\x02");
  } else if (string_strcasecmp(color_name, "italic") == 0) {
    snprintf(color[index_color], sizeof(color[index_color]), "%s%s", "\x1A",
             "\x03");
  } else if (string_strcasecmp(color_name, "-italic") == 0) {
    snprintf(color[index_color], sizeof(color[index_color]), "%s%s", "\x1B",
             "\x03");
  } else if (string_strcasecmp(color_name, "underline") == 0) {
    snprintf(color[index_color], sizeof(color[index_color]), "%s%s", "\x1A",
             "\x04");
  } else if (string_strcasecmp(color_name, "-underline") == 0) {
    snprintf(color[index_color], sizeof(color[index_color]), "%s%s", "\x1B",
             "\x04");
  } else if (string_strcasecmp(color_name, "bar_fg") == 0) {
    snprintf(color[index_color], sizeof(color[index_color]), "%c%c%c", '\x19',
             'b', 'F');
  } else if (string_strcasecmp(color_name, "bar_delim") == 0) {
    snprintf(color[index_color], sizeof(color[index_color]), "%c%c%c", '\x19',
             'b', 'D');
  } else if (string_strcasecmp(color_name, "bar_bg") == 0) {
    snprintf(color[index_color], sizeof(color[index_color]), "%c%c%c", '\x19',
             'b', 'B');
  } else {
    pos_comma = strchr(color_name, ',');
    if (pos_comma) {
      if (pos_comma == color_name)
        str_fg = NULL;
      else
        str_fg = string_strndup(color_name, pos_comma - color_name);
      pos_bg = pos_comma + 1;
    } else {
      str_fg = strdup(color_name);
      pos_bg = NULL;
    }
    if (str_fg && pos_bg) {
      fg = gui_color_search(str_fg);
      bg = gui_color_search(pos_bg);
      snprintf(color[index_color], sizeof(color[index_color]), "%s*%02d,%02d",
               "\x19", fg, bg);
    } else if (str_fg && !pos_bg) {
      fg = gui_color_search(str_fg);
      snprintf(color[index_color], sizeof(color[index_color]), "%sF%02d",
               "\x19", fg);
    } else if (!str_fg && pos_bg) {
      bg = gui_color_search(pos_bg);
      snprintf(color[index_color], sizeof(color[index_color]), "%sB%02d",
               "\x19", bg);
    }
    if (str_fg)
      free(str_fg);
  }
  return color[index_color];
}


x86 assembly (clang, -O0):
<gui_color_get_custom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x302e(%rip),%eax
add    $0x1,%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,0x301d(%rip)
movslq 0x3016(%rip),%rcx
lea    0x2ecf(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movb   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     11c3 <gui_color_get_custom+0x53>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    11e1 <gui_color_get_custom+0x71>
movslq 0x2fe6(%rip),%rcx
lea    0x2e9f(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    17e3 <gui_color_get_custom+0x673>
mov    -0x10(%rbp),%rdi
lea    0xe14(%rip),%rsi
call   1070 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    122f <gui_color_get_custom+0xbf>
movslq 0x2fae(%rip),%rax
lea    0x2e67(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x10,%esi
lea    0xdee(%rip),%rdx
lea    0xde3(%rip),%rcx
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    17ca <gui_color_get_custom+0x65a>
mov    -0x10(%rbp),%rdi
lea    0xdd8(%rip),%rsi
call   1070 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    1284 <gui_color_get_custom+0x114>
movslq 0x2f60(%rip),%rax
lea    0x2e19(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x10,%esi
lea    0xd9e(%rip),%rdx
lea    0xd9c(%rip),%rcx
lea    0xd97(%rip),%r8
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    17c5 <gui_color_get_custom+0x655>
mov    -0x10(%rbp),%rdi
lea    0xd82(%rip),%rsi
call   1070 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    12d9 <gui_color_get_custom+0x169>
movslq 0x2f0b(%rip),%rax
lea    0x2dc4(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x10,%esi
lea    0xd49(%rip),%rdx
lea    0xd51(%rip),%rcx
lea    0xd42(%rip),%r8
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    17c0 <gui_color_get_custom+0x650>
mov    -0x10(%rbp),%rdi
lea    0xd38(%rip),%rsi
call   1070 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    132e <gui_color_get_custom+0x1be>
movslq 0x2eb6(%rip),%rax
lea    0x2d6f(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x10,%esi
lea    0xcf4(%rip),%rdx
lea    0xcf2(%rip),%rcx
lea    0xcf7(%rip),%r8
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    17bb <gui_color_get_custom+0x64b>
mov    -0x10(%rbp),%rdi
lea    0xce2(%rip),%rsi
call   1070 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    1383 <gui_color_get_custom+0x213>
movslq 0x2e61(%rip),%rax
lea    0x2d1a(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x10,%esi
lea    0xc9f(%rip),%rdx
lea    0xca7(%rip),%rcx
lea    0xca2(%rip),%r8
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    17b6 <gui_color_get_custom+0x646>
mov    -0x10(%rbp),%rdi
lea    0xc99(%rip),%rsi
call   1070 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    13d8 <gui_color_get_custom+0x268>
movslq 0x2e0c(%rip),%rax
lea    0x2cc5(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x10,%esi
lea    0xc4a(%rip),%rdx
lea    0xc48(%rip),%rcx
lea    0xc58(%rip),%r8
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    17b1 <gui_color_get_custom+0x641>
mov    -0x10(%rbp),%rdi
lea    0xc43(%rip),%rsi
call   1070 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    142d <gui_color_get_custom+0x2bd>
movslq 0x2db7(%rip),%rax
lea    0x2c70(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x10,%esi
lea    0xbf5(%rip),%rdx
lea    0xbfd(%rip),%rcx
lea    0xc03(%rip),%r8
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    17ac <gui_color_get_custom+0x63c>
mov    -0x10(%rbp),%rdi
lea    0xbf9(%rip),%rsi
call   1070 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    1482 <gui_color_get_custom+0x312>
movslq 0x2d62(%rip),%rax
lea    0x2c1b(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x10,%esi
lea    0xba0(%rip),%rdx
lea    0xb9e(%rip),%rcx
lea    0xbb8(%rip),%r8
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    17a7 <gui_color_get_custom+0x637>
mov    -0x10(%rbp),%rdi
lea    0xba3(%rip),%rsi
call   1070 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    14d7 <gui_color_get_custom+0x367>
movslq 0x2d0d(%rip),%rax
lea    0x2bc6(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x10,%esi
lea    0xb4b(%rip),%rdx
lea    0xb53(%rip),%rcx
lea    0xb63(%rip),%r8
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    17a2 <gui_color_get_custom+0x632>
mov    -0x10(%rbp),%rdi
lea    0xb59(%rip),%rsi
call   1070 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    152f <gui_color_get_custom+0x3bf>
movslq 0x2cb8(%rip),%rax
lea    0x2b71(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x10,%esi
lea    0xb30(%rip),%rdx
mov    $0x19,%ecx
mov    $0x62,%r8d
mov    $0x46,%r9d
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    179d <gui_color_get_custom+0x62d>
mov    -0x10(%rbp),%rdi
lea    0xb0f(%rip),%rsi
call   1070 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    1587 <gui_color_get_custom+0x417>
movslq 0x2c60(%rip),%rax
lea    0x2b19(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x10,%esi
lea    0xad8(%rip),%rdx
mov    $0x19,%ecx
mov    $0x62,%r8d
mov    $0x44,%r9d
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    1798 <gui_color_get_custom+0x628>
mov    -0x10(%rbp),%rdi
lea    0xac1(%rip),%rsi
call   1070 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    15df <gui_color_get_custom+0x46f>
movslq 0x2c08(%rip),%rax
lea    0x2ac1(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x10,%esi
lea    0xa80(%rip),%rdx
mov    $0x19,%ecx
mov    $0x62,%r8d
mov    $0x42,%r9d
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    1793 <gui_color_get_custom+0x623>
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1642 <gui_color_get_custom+0x4d2>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1617 <gui_color_get_custom+0x4a7>
movq   $0x0,-0x28(%rbp)
jmp    1631 <gui_color_get_custom+0x4c1>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1080 <string_strndup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1657 <gui_color_get_custom+0x4e7>
mov    -0x10(%rbp),%rdi
call   1090 <strdup@plt>
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     16c1 <gui_color_get_custom+0x551>
cmpq   $0x0,-0x30(%rbp)
je     16c1 <gui_color_get_custom+0x551>
mov    -0x28(%rbp),%rdi
call   1060 <gui_color_search@plt>
mov    %eax,-0x14(%rbp)
mov    -0x30(%rbp),%rdi
call   1060 <gui_color_search@plt>
mov    %eax,-0x18(%rbp)
movslq 0x2b24(%rip),%rax
lea    0x29dd(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    $0x10,%esi
lea    0x9ac(%rip),%rdx
lea    0x9b2(%rip),%rcx
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    177a <gui_color_get_custom+0x60a>
cmpq   $0x0,-0x28(%rbp)
je     171b <gui_color_get_custom+0x5ab>
cmpq   $0x0,-0x30(%rbp)
jne    171b <gui_color_get_custom+0x5ab>
mov    -0x28(%rbp),%rdi
call   1060 <gui_color_search@plt>
mov    %eax,-0x14(%rbp)
movslq 0x2ac6(%rip),%rax
lea    0x297f(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    -0x14(%rbp),%r8d
mov    $0x10,%esi
lea    0x961(%rip),%rdx
lea    0x958(%rip),%rcx
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    1775 <gui_color_get_custom+0x605>
cmpq   $0x0,-0x28(%rbp)
jne    1770 <gui_color_get_custom+0x600>
cmpq   $0x0,-0x30(%rbp)
je     1770 <gui_color_get_custom+0x600>
mov    -0x30(%rbp),%rdi
call   1060 <gui_color_search@plt>
mov    %eax,-0x18(%rbp)
movslq 0x2a6c(%rip),%rax
lea    0x2925(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%r8d
mov    $0x10,%esi
lea    0x90f(%rip),%rdx
lea    0x8fe(%rip),%rcx
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    1775 <gui_color_get_custom+0x605>
jmp    177a <gui_color_get_custom+0x60a>
cmpq   $0x0,-0x28(%rbp)
je     178e <gui_color_get_custom+0x61e>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
jmp    1793 <gui_color_get_custom+0x623>
jmp    1798 <gui_color_get_custom+0x628>
jmp    179d <gui_color_get_custom+0x62d>
jmp    17a2 <gui_color_get_custom+0x632>
jmp    17a7 <gui_color_get_custom+0x637>
jmp    17ac <gui_color_get_custom+0x63c>
jmp    17b1 <gui_color_get_custom+0x641>
jmp    17b6 <gui_color_get_custom+0x646>
jmp    17bb <gui_color_get_custom+0x64b>
jmp    17c0 <gui_color_get_custom+0x650>
jmp    17c5 <gui_color_get_custom+0x655>
jmp    17ca <gui_color_get_custom+0x65a>
movslq 0x29df(%rip),%rcx
lea    0x2898(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_color_get_custom>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    0x3032(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x3003(%rip)
cltq
shl    $0x4,%rax
lea    0x2eb6(%rip),%r14
movb   $0x0,(%rax,%r14,1)
test   %rdi,%rdi
je     13f0 <gui_color_get_custom+0x280>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     13f0 <gui_color_get_custom+0x280>
lea    0xe25(%rip),%rsi
mov    %rbx,%rdi
call   1070 <string_strcasecmp@plt>
test   %rax,%rax
je     1379 <gui_color_get_custom+0x209>
lea    0xe1f(%rip),%rsi
mov    %rbx,%rdi
call   1070 <string_strcasecmp@plt>
test   %rax,%rax
je     13a3 <gui_color_get_custom+0x233>
lea    0xe06(%rip),%rsi
mov    %rbx,%rdi
call   1070 <string_strcasecmp@plt>
test   %rax,%rax
je     13c1 <gui_color_get_custom+0x251>
lea    0xdf9(%rip),%rsi
mov    %rbx,%rdi
call   1070 <string_strcasecmp@plt>
test   %rax,%rax
je     140a <gui_color_get_custom+0x29a>
lea    0xde0(%rip),%rsi
mov    %rbx,%rdi
call   1070 <string_strcasecmp@plt>
test   %rax,%rax
je     142f <gui_color_get_custom+0x2bf>
lea    0xdd4(%rip),%rsi
mov    %rbx,%rdi
call   1070 <string_strcasecmp@plt>
test   %rax,%rax
je     1454 <gui_color_get_custom+0x2e4>
lea    0xdbb(%rip),%rsi
mov    %rbx,%rdi
call   1070 <string_strcasecmp@plt>
test   %rax,%rax
je     147c <gui_color_get_custom+0x30c>
lea    0xdae(%rip),%rsi
mov    %rbx,%rdi
call   1070 <string_strcasecmp@plt>
test   %rax,%rax
je     14a4 <gui_color_get_custom+0x334>
lea    0xd95(%rip),%rsi
mov    %rbx,%rdi
call   1070 <string_strcasecmp@plt>
test   %rax,%rax
je     14cc <gui_color_get_custom+0x35c>
lea    0xd88(%rip),%rsi
mov    %rbx,%rdi
call   1070 <string_strcasecmp@plt>
test   %rax,%rax
je     14f4 <gui_color_get_custom+0x384>
lea    0xd7e(%rip),%rsi
mov    %rbx,%rdi
call   1070 <string_strcasecmp@plt>
test   %rax,%rax
je     1521 <gui_color_get_custom+0x3b1>
lea    0xd70(%rip),%rsi
mov    %rbx,%rdi
call   1070 <string_strcasecmp@plt>
test   %rax,%rax
je     154e <gui_color_get_custom+0x3de>
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1585 <gui_color_get_custom+0x415>
mov    %rax,%r12
cmp    %rbx,%rax
je     15dc <gui_color_get_custom+0x46c>
mov    %r12d,%esi
sub    %ebx,%esi
mov    %rbx,%rdi
call   1080 <string_strndup@plt>
lea    0x1(%r12),%rbx
test   %rax,%rax
je     15ec <gui_color_get_custom+0x47c>
mov    %rax,%r15
mov    %rax,%rdi
call   1060 <gui_color_search@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <gui_color_search@plt>
movslq 0x2e63(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xcff(%rip),%rdx
lea    0xd05(%rip),%rcx
mov    $0x10,%esi
mov    %ebp,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   1050 <snprintf@plt>
jmp    163f <gui_color_get_custom+0x4cf>
movslq 0x2e30(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xc7c(%rip),%rdx
lea    0xc71(%rip),%rcx
mov    $0x10,%esi
xor    %eax,%eax
call   1050 <snprintf@plt>
jmp    13f0 <gui_color_get_custom+0x280>
movslq 0x2e06(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xc50(%rip),%rdx
lea    0xc4e(%rip),%rcx
jmp    13dd <gui_color_get_custom+0x26d>
movslq 0x2de8(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xc32(%rip),%rdx
lea    0xc3a(%rip),%rcx
lea    0xc2b(%rip),%r8
mov    $0x10,%esi
xor    %eax,%eax
call   1050 <snprintf@plt>
movslq 0x2db9(%rip),%rax
shl    $0x4,%rax
add    %rax,%r14
mov    %r14,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
movslq 0x2d9f(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xbe9(%rip),%rdx
lea    0xbe7(%rip),%rcx
lea    0xbec(%rip),%r8
jmp    13e4 <gui_color_get_custom+0x274>
movslq 0x2d7a(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xbc4(%rip),%rdx
lea    0xbcc(%rip),%rcx
lea    0xbc7(%rip),%r8
jmp    13e4 <gui_color_get_custom+0x274>
movslq 0x2d55(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xb9f(%rip),%rdx
lea    0xb9d(%rip),%rcx
lea    0xbad(%rip),%r8
jmp    13e4 <gui_color_get_custom+0x274>
movslq 0x2d2d(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xb77(%rip),%rdx
lea    0xb7f(%rip),%rcx
lea    0xb85(%rip),%r8
jmp    13e4 <gui_color_get_custom+0x274>
movslq 0x2d05(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xb4f(%rip),%rdx
lea    0xb4d(%rip),%rcx
lea    0xb67(%rip),%r8
jmp    13e4 <gui_color_get_custom+0x274>
movslq 0x2cdd(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xb27(%rip),%rdx
lea    0xb2f(%rip),%rcx
lea    0xb3f(%rip),%r8
jmp    13e4 <gui_color_get_custom+0x274>
movslq 0x2cb5(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xb39(%rip),%rdx
mov    $0x10,%esi
mov    $0x19,%ecx
mov    $0x62,%r8d
mov    $0x46,%r9d
jmp    1579 <gui_color_get_custom+0x409>
movslq 0x2c88(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xb0c(%rip),%rdx
mov    $0x10,%esi
mov    $0x19,%ecx
mov    $0x62,%r8d
mov    $0x44,%r9d
jmp    1579 <gui_color_get_custom+0x409>
movslq 0x2c5b(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xadf(%rip),%rdx
mov    $0x10,%esi
mov    $0x19,%ecx
mov    $0x62,%r8d
mov    $0x42,%r9d
xor    %eax,%eax
call   1050 <snprintf@plt>
jmp    13f0 <gui_color_get_custom+0x280>
setne  %r12b
mov    %rbx,%rdi
call   1090 <strdup@plt>
mov    %rax,%r15
xor    %ebx,%ebx
test   %rax,%rax
setne  %bpl
sete   %al
je     15fa <gui_color_get_custom+0x48a>
test   %r12b,%r12b
jne    15fa <gui_color_get_custom+0x48a>
mov    %r15,%rdi
call   1060 <gui_color_search@plt>
movslq 0x2bfa(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xaa5(%rip),%rdx
lea    0xa9c(%rip),%rcx
mov    $0x10,%esi
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <snprintf@plt>
jmp    163f <gui_color_get_custom+0x4cf>
add    $0x1,%rbx
mov    $0x1,%al
xor    %r15d,%r15d
xor    %ebp,%ebp
mov    $0x1,%r12b
jmp    15fa <gui_color_get_custom+0x48a>
test   %r12,%r12
setne  %r12b
mov    $0x1,%al
xor    %r15d,%r15d
xor    %ebp,%ebp
test   %al,%al
je     1636 <gui_color_get_custom+0x4c6>
test   %r12b,%r12b
je     1636 <gui_color_get_custom+0x4c6>
mov    %rbx,%rdi
call   1060 <gui_color_search@plt>
movslq 0x2b9e(%rip),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xa51(%rip),%rdx
lea    0xa40(%rip),%rcx
mov    $0x10,%esi
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <snprintf@plt>
test   %bpl,%bpl
je     13f0 <gui_color_get_custom+0x280>
mov    %r15,%rdi
call   1030 <free@plt>
jmp    13f0 <gui_color_get_custom+0x280>

LLVM IR (-O0):
@gui_color_get_custom.color = internal global [20 x [16 x i8]] zeroinitializer
@gui_color_get_custom.index_color = internal global i32 0
@.str = [6 x i8] c"reset\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"\1C\00"
@.str.3 = [5 x i8] c"bold\00"
@.str.4 = [5 x i8] c"%s%s\00"
@.str.5 = [2 x i8] c"\1A\00"
@.str.6 = [2 x i8] c"\01\00"
@.str.7 = [6 x i8] c"-bold\00"
@.str.8 = [2 x i8] c"\1B\00"
@.str.9 = [8 x i8] c"reverse\00"
@.str.10 = [2 x i8] c"\02\00"
@.str.11 = [9 x i8] c"-reverse\00"
@.str.12 = [7 x i8] c"italic\00"
@.str.13 = [2 x i8] c"\03\00"
@.str.14 = [8 x i8] c"-italic\00"
@.str.15 = [10 x i8] c"underline\00"
@.str.16 = [2 x i8] c"\04\00"
@.str.17 = [11 x i8] c"-underline\00"
@.str.18 = [7 x i8] c"bar_fg\00"
@.str.19 = [7 x i8] c"%c%c%c\00"
@.str.20 = [10 x i8] c"bar_delim\00"
@.str.21 = [7 x i8] c"bar_bg\00"
@.str.22 = [13 x i8] c"%s*%02d,%02d\00"
@.str.23 = [2 x i8] c"\19\00"
@.str.24 = [8 x i8] c"%sF%02d\00"
@.str.25 = [8 x i8] c"%sB%02d\00"
define i8* @gui_color_get_custom(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %3
%9 = load i32, i32* @gui_color_get_custom.index_color
%10 = add nsw i32 %9, 1
%11 = srem i32 %10, 20
store i32 %11, i32* @gui_color_get_custom.index_color
%12 = load i32, i32* @gui_color_get_custom.index_color
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %13
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %14, i64 0, i64 0
store i8 0, i8* %15
%16 = load i8*, i8** %3
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %23
18: ; preds = %1
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = icmp ne i8 %21, 0
br i1 %22, label %28, label %23
23: ; preds = %18, %1
%24 = load i32, i32* @gui_color_get_custom.index_color
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %25
%27 = getelementptr inbounds [16 x i8], [16 x i8]* %26, i64 0, i64 0
store i8* %27, i8** %2
br label %246
28: ; preds = %18
%29 = load i8*, i8** %3
%30 = call i64 @string_strcasecmp(i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %38
32: ; preds = %28
%33 = load i32, i32* @gui_color_get_custom.index_color
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %34
%36 = getelementptr inbounds [16 x i8], [16 x i8]* %35, i64 0, i64 0
%37 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %36, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %241
38: ; preds = %28
%39 = load i8*, i8** %3
%40 = call i64 @string_strcasecmp(i8* %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %48
42: ; preds = %38
%43 = load i32, i32* @gui_color_get_custom.index_color
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %44
%46 = getelementptr inbounds [16 x i8], [16 x i8]* %45, i64 0, i64 0
%47 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %46, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %240
48: ; preds = %38
%49 = load i8*, i8** %3
%50 = call i64 @string_strcasecmp(i8* %49, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %58
52: ; preds = %48
%53 = load i32, i32* @gui_color_get_custom.index_color
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %54
%56 = getelementptr inbounds [16 x i8], [16 x i8]* %55, i64 0, i64 0
%57 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %56, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %239
58: ; preds = %48
%59 = load i8*, i8** %3
%60 = call i64 @string_strcasecmp(i8* %59, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %68
62: ; preds = %58
%63 = load i32, i32* @gui_color_get_custom.index_color
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %64
%66 = getelementptr inbounds [16 x i8], [16 x i8]* %65, i64 0, i64 0
%67 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %66, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %238
68: ; preds = %58
%69 = load i8*, i8** %3
%70 = call i64 @string_strcasecmp(i8* %69, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %78
72: ; preds = %68
%73 = load i32, i32* @gui_color_get_custom.index_color
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %74
%76 = getelementptr inbounds [16 x i8], [16 x i8]* %75, i64 0, i64 0
%77 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %76, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %237
78: ; preds = %68
%79 = load i8*, i8** %3
%80 = call i64 @string_strcasecmp(i8* %79, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %88
82: ; preds = %78
%83 = load i32, i32* @gui_color_get_custom.index_color
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %84
%86 = getelementptr inbounds [16 x i8], [16 x i8]* %85, i64 0, i64 0
%87 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %86, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %236
88: ; preds = %78
%89 = load i8*, i8** %3
%90 = call i64 @string_strcasecmp(i8* %89, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %98
92: ; preds = %88
%93 = load i32, i32* @gui_color_get_custom.index_color
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %94
%96 = getelementptr inbounds [16 x i8], [16 x i8]* %95, i64 0, i64 0
%97 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %96, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %235
98: ; preds = %88
%99 = load i8*, i8** %3
%100 = call i64 @string_strcasecmp(i8* %99, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
%101 = icmp eq i64 %100, 0
br i1 %101, label %102, label %108
102: ; preds = %98
%103 = load i32, i32* @gui_color_get_custom.index_color
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %104
%106 = getelementptr inbounds [16 x i8], [16 x i8]* %105, i64 0, i64 0
%107 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %106, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
br label %234
108: ; preds = %98
%109 = load i8*, i8** %3
%110 = call i64 @string_strcasecmp(i8* %109, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0))
%111 = icmp eq i64 %110, 0
br i1 %111, label %112, label %118
112: ; preds = %108
%113 = load i32, i32* @gui_color_get_custom.index_color
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %114
%116 = getelementptr inbounds [16 x i8], [16 x i8]* %115, i64 0, i64 0
%117 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %116, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
br label %233
118: ; preds = %108
%119 = load i8*, i8** %3
%120 = call i64 @string_strcasecmp(i8* %119, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0))
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %128
122: ; preds = %118
%123 = load i32, i32* @gui_color_get_custom.index_color
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %124
%126 = getelementptr inbounds [16 x i8], [16 x i8]* %125, i64 0, i64 0
%127 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %126, i32 16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i32 25, i32 98, i32 70)
br label %232
128: ; preds = %118
%129 = load i8*, i8** %3
%130 = call i64 @string_strcasecmp(i8* %129, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
%131 = icmp eq i64 %130, 0
br i1 %131, label %132, label %138
132: ; preds = %128
%133 = load i32, i32* @gui_color_get_custom.index_color
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %134
%136 = getelementptr inbounds [16 x i8], [16 x i8]* %135, i64 0, i64 0
%137 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %136, i32 16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i32 25, i32 98, i32 68)
br label %231
138: ; preds = %128
%139 = load i8*, i8** %3
%140 = call i64 @string_strcasecmp(i8* %139, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0))
%141 = icmp eq i64 %140, 0
br i1 %141, label %142, label %148
142: ; preds = %138
%143 = load i32, i32* @gui_color_get_custom.index_color
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %144
%146 = getelementptr inbounds [16 x i8], [16 x i8]* %145, i64 0, i64 0
%147 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %146, i32 16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i32 25, i32 98, i32 66)
br label %230
148: ; preds = %138
%149 = load i8*, i8** %3
%150 = call i8* @strchr(i8* %149, i8 signext 44)
store i8* %150, i8** %6
%151 = load i8*, i8** %6
%152 = icmp ne i8* %151, null
br i1 %152, label %153, label %170
153: ; preds = %148
%154 = load i8*, i8** %6
%155 = load i8*, i8** %3
%156 = icmp eq i8* %154, %155
br i1 %156, label %157, label %158
157: ; preds = %153
store i8* null, i8** %7
br label %167
158: ; preds = %153
%159 = load i8*, i8** %3
%160 = load i8*, i8** %6
%161 = load i8*, i8** %3
%162 = ptrtoint i8* %160 to i64
%163 = ptrtoint i8* %161 to i64
%164 = sub i64 %162, %163
%165 = trunc i64 %164 to i32
%166 = call i8* @string_strndup(i8* %159, i32 %165)
store i8* %166, i8** %7
br label %167
167: ; preds = %158, %157
%168 = load i8*, i8** %6
%169 = getelementptr inbounds i8, i8* %168, i64 1
store i8* %169, i8** %8
br label %173
170: ; preds = %148
%171 = load i8*, i8** %3
%172 = call i8* @strdup(i8* %171)
store i8* %172, i8** %7
store i8* null, i8** %8
br label %173
173: ; preds = %170, %167
%174 = load i8*, i8** %7
%175 = icmp ne i8* %174, null
br i1 %175, label %176, label %191
176: ; preds = %173
%177 = load i8*, i8** %8
%178 = icmp ne i8* %177, null
br i1 %178, label %179, label %191
179: ; preds = %176
%180 = load i8*, i8** %7
%181 = call i32 @gui_color_search(i8* %180)
store i32 %181, i32* %4
%182 = load i8*, i8** %8
%183 = call i32 @gui_color_search(i8* %182)
store i32 %183, i32* %5
%184 = load i32, i32* @gui_color_get_custom.index_color
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %185
%187 = getelementptr inbounds [16 x i8], [16 x i8]* %186, i64 0, i64 0
%188 = load i32, i32* %4
%189 = load i32, i32* %5
%190 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %187, i32 16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0), i32 %188, i32 %189)
br label %223
191: ; preds = %176, %173
%192 = load i8*, i8** %7
%193 = icmp ne i8* %192, null
br i1 %193, label %194, label %206
194: ; preds = %191
%195 = load i8*, i8** %8
%196 = icmp ne i8* %195, null
br i1 %196, label %206, label %197
197: ; preds = %194
%198 = load i8*, i8** %7
%199 = call i32 @gui_color_search(i8* %198)
store i32 %199, i32* %4
%200 = load i32, i32* @gui_color_get_custom.index_color
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %201
%203 = getelementptr inbounds [16 x i8], [16 x i8]* %202, i64 0, i64 0
%204 = load i32, i32* %4
%205 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %203, i32 16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0), i32 %204)
br label %222
206: ; preds = %194, %191
%207 = load i8*, i8** %7
%208 = icmp ne i8* %207, null
br i1 %208, label %221, label %209
209: ; preds = %206
%210 = load i8*, i8** %8
%211 = icmp ne i8* %210, null
br i1 %211, label %212, label %221
212: ; preds = %209
%213 = load i8*, i8** %8
%214 = call i32 @gui_color_search(i8* %213)
store i32 %214, i32* %5
%215 = load i32, i32* @gui_color_get_custom.index_color
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %216
%218 = getelementptr inbounds [16 x i8], [16 x i8]* %217, i64 0, i64 0
%219 = load i32, i32* %5
%220 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %218, i32 16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0), i32 %219)
br label %221
221: ; preds = %212, %209, %206
br label %222
222: ; preds = %221, %197
br label %223
223: ; preds = %222, %179
%224 = load i8*, i8** %7
%225 = icmp ne i8* %224, null
br i1 %225, label %226, label %229
226: ; preds = %223
%227 = load i8*, i8** %7
%228 = call i32 @free(i8* %227)
br label %229
229: ; preds = %226, %223
br label %230
230: ; preds = %229, %142
br label %231
231: ; preds = %230, %132
br label %232
232: ; preds = %231, %122
br label %233
233: ; preds = %232, %112
br label %234
234: ; preds = %233, %102
br label %235
235: ; preds = %234, %92
br label %236
236: ; preds = %235, %82
br label %237
237: ; preds = %236, %72
br label %238
238: ; preds = %237, %62
br label %239
239: ; preds = %238, %52
br label %240
240: ; preds = %239, %42
br label %241
241: ; preds = %240, %32
%242 = load i32, i32* @gui_color_get_custom.index_color
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %243
%245 = getelementptr inbounds [16 x i8], [16 x i8]* %244, i64 0, i64 0
store i8* %245, i8** %2
br label %246
246: ; preds = %241, %23
%247 = load i8*, i8** %2
ret i8* %247
}

LLVM IR (-O2):
@gui_color_get_custom.color = internal global [20 x [16 x i8]] zeroinitializer
@gui_color_get_custom.index_color = internal unnamed_addr global i32 0
@.str = [6 x i8] c"reset\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"\1C\00"
@.str.3 = [5 x i8] c"bold\00"
@.str.4 = [5 x i8] c"%s%s\00"
@.str.5 = [2 x i8] c"\1A\00"
@.str.6 = [2 x i8] c"\01\00"
@.str.7 = [6 x i8] c"-bold\00"
@.str.8 = [2 x i8] c"\1B\00"
@.str.9 = [8 x i8] c"reverse\00"
@.str.10 = [2 x i8] c"\02\00"
@.str.11 = [9 x i8] c"-reverse\00"
@.str.12 = [7 x i8] c"italic\00"
@.str.13 = [2 x i8] c"\03\00"
@.str.14 = [8 x i8] c"-italic\00"
@.str.15 = [10 x i8] c"underline\00"
@.str.16 = [2 x i8] c"\04\00"
@.str.17 = [11 x i8] c"-underline\00"
@.str.18 = [7 x i8] c"bar_fg\00"
@.str.19 = [7 x i8] c"%c%c%c\00"
@.str.20 = [10 x i8] c"bar_delim\00"
@.str.21 = [7 x i8] c"bar_bg\00"
@.str.22 = [13 x i8] c"%s*%02d,%02d\00"
@.str.23 = [2 x i8] c"\19\00"
@.str.24 = [8 x i8] c"%sF%02d\00"
@.str.25 = [8 x i8] c"%sB%02d\00"
define i8* @gui_color_get_custom(i8* %0) {
%2 = load i32, i32* @gui_color_get_custom.index_color
%3 = add nsw i32 %2, 1
%4 = srem i32 %3, 20
store i32 %4, i32* @gui_color_get_custom.index_color
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %5, i64 0
store i8 0, i8* %6
%7 = icmp eq i8* %0, null
br i1 %7, label %160, label %8
8: ; preds = %1
%9 = load i8, i8* %0
%10 = icmp eq i8 %9, 0
br i1 %10, label %160, label %11
11: ; preds = %8
%12 = tail call i64 @string_strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* @gui_color_get_custom.index_color
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %16, i64 0
%18 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %17, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %160
19: ; preds = %11
%20 = tail call i64 @string_strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i32, i32* @gui_color_get_custom.index_color
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %24, i64 0
%26 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %25, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %160
27: ; preds = %19
%28 = tail call i64 @string_strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %35
30: ; preds = %27
%31 = load i32, i32* @gui_color_get_custom.index_color
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %32, i64 0
%34 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %33, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %160
35: ; preds = %27
%36 = tail call i64 @string_strcasecmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %43
38: ; preds = %35
%39 = load i32, i32* @gui_color_get_custom.index_color
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %40, i64 0
%42 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %41, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %160
43: ; preds = %35
%44 = tail call i64 @string_strcasecmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %51
46: ; preds = %43
%47 = load i32, i32* @gui_color_get_custom.index_color
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %48, i64 0
%50 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %49, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %160
51: ; preds = %43
%52 = tail call i64 @string_strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %59
54: ; preds = %51
%55 = load i32, i32* @gui_color_get_custom.index_color
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %56, i64 0
%58 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %57, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %160
59: ; preds = %51
%60 = tail call i64 @string_strcasecmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %67
62: ; preds = %59
%63 = load i32, i32* @gui_color_get_custom.index_color
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %64, i64 0
%66 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %65, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %160
67: ; preds = %59
%68 = tail call i64 @string_strcasecmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %75
70: ; preds = %67
%71 = load i32, i32* @gui_color_get_custom.index_color
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %72, i64 0
%74 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %73, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
br label %160
75: ; preds = %67
%76 = tail call i64 @string_strcasecmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0))
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %83
78: ; preds = %75
%79 = load i32, i32* @gui_color_get_custom.index_color
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %80, i64 0
%82 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %81, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
br label %160
83: ; preds = %75
%84 = tail call i64 @string_strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0))
%85 = icmp eq i64 %84, 0
br i1 %85, label %86, label %91
86: ; preds = %83
%87 = load i32, i32* @gui_color_get_custom.index_color
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %88, i64 0
%90 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %89, i32 16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i32 25, i32 98, i32 70)
br label %160
91: ; preds = %83
%92 = tail call i64 @string_strcasecmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
%93 = icmp eq i64 %92, 0
br i1 %93, label %94, label %99
94: ; preds = %91
%95 = load i32, i32* @gui_color_get_custom.index_color
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %96, i64 0
%98 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %97, i32 16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i32 25, i32 98, i32 68)
br label %160
99: ; preds = %91
%100 = tail call i64 @string_strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0))
%101 = icmp eq i64 %100, 0
br i1 %101, label %102, label %107
102: ; preds = %99
%103 = load i32, i32* @gui_color_get_custom.index_color
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %104, i64 0
%106 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %105, i32 16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i32 25, i32 98, i32 66)
br label %160
107: ; preds = %99
%108 = tail call i8* @strchr(i8* %0, i8 signext 44)
%109 = icmp eq i8* %108, null
br i1 %109, label %131, label %110
110: ; preds = %107
%111 = icmp eq i8* %108, %0
br i1 %111, label %112, label %114
112: ; preds = %110
%113 = getelementptr inbounds i8, i8* %0, i64 1
br label %143
114: ; preds = %110
%115 = ptrtoint i8* %108 to i64
%116 = ptrtoint i8* %0 to i64
%117 = sub i64 %115, %116
%118 = trunc i64 %117 to i32
%119 = tail call i8* @string_strndup(i8* %0, i32 %118)
%120 = getelementptr inbounds i8, i8* %108, i64 1
%121 = icmp eq i8* %119, null
br i1 %121, label %122, label %124
122: ; preds = %114
%123 = xor i1 %109, true
br label %143
124: ; preds = %114
%125 = tail call i32 @gui_color_search(i8* %119)
%126 = tail call i32 @gui_color_search(i8* %120)
%127 = load i32, i32* @gui_color_get_custom.index_color
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %128, i64 0
%130 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %129, i32 16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0), i32 %125, i32 %126)
br label %157
131: ; preds = %107
%132 = tail call i8* @strdup(i8* %0)
%133 = icmp ne i8* %132, null
%134 = xor i1 %109, true
%135 = icmp eq i8* %132, null
%136 = select i1 %135, i1 true, i1 %134
br i1 %136, label %143, label %137
137: ; preds = %131
%138 = tail call i32 @gui_color_search(i8* %132)
%139 = load i32, i32* @gui_color_get_custom.index_color
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %140, i64 0
%142 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %141, i32 16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0), i32 %138)
br label %157
143: ; preds = %122, %112, %131
%144 = phi i1 [ true, %112 ], [ %135, %131 ], [ true, %122 ]
%145 = phi i8* [ null, %112 ], [ %132, %131 ], [ null, %122 ]
%146 = phi i8* [ %113, %112 ], [ null, %131 ], [ %120, %122 ]
%147 = phi i1 [ false, %112 ], [ %133, %131 ], [ false, %122 ]
%148 = phi i1 [ true, %112 ], [ %134, %131 ], [ %123, %122 ]
%149 = select i1 %144, i1 %148, i1 false
br i1 %149, label %150, label %156
150: ; preds = %143
%151 = tail call i32 @gui_color_search(i8* %146)
%152 = load i32, i32* @gui_color_get_custom.index_color
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %153, i64 0
%155 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %154, i32 16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0), i32 %151)
br i1 %147, label %157, label %160
156: ; preds = %143
br i1 %147, label %157, label %160
157: ; preds = %137, %124, %150, %156
%158 = phi i8* [ %132, %137 ], [ %145, %156 ], [ %145, %150 ], [ %119, %124 ]
%159 = tail call i32 @free(i8* %158)
br label %160
160: ; preds = %150, %14, %30, %46, %62, %78, %94, %156, %157, %102, %86, %70, %54, %38, %22, %1, %8
%161 = load i32, i32* @gui_color_get_custom.index_color
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* @gui_color_get_custom.color, i64 0, i64 %162, i64 0
ret i8* %163
}