#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 */
int /*<<< orphan*/ safe_copy_chr(char, char *, char **, int);
int /*<<< orphan*/ safe_copy_esccode(char **, char *, char **);
int /*<<< orphan*/ safe_known_str(char *, int, char *, char **);
char *normal_to_white(const char *raw) {
  static char buf[8192];
  char *p = (char *)raw;
  char *q = buf;
  char *just_after_csi;
  char *just_after_esccode = p;
  unsigned int param_val;
  int has_zero;
  while (p && *p) {
    if (*p == '\033') {
      safe_known_str(just_after_esccode, p - just_after_esccode, buf, &q);
      if (p[1] == '[') {
        safe_copy_chr((*p), (buf), (&q), (8192 - 1));
        ++p;
        safe_copy_chr((*p), (buf), (&q), (8192 - 1));
        ++p;
        just_after_csi = p;
        has_zero = 0;
        while ((*p & 0xf0) == 0x30) {
          if (*p == '0') {
            has_zero = 1;
          }
          ++p;
        }
        while ((*p & 0xf0) == 0x20) {
          ++p;
        }
        if (*p == 'm' && has_zero) {
          p = just_after_csi;
          param_val = 0;
          while ((*p & 0xf0) == 0x30) {
            if (*p < 0x3a) {
              param_val <<= 1;
              param_val += (param_val << 2) + (*p & 0x0f);
              safe_copy_chr((*p), (buf), (&q), (8192 - 1));
            } else {
              if (param_val == 0) {
                safe_known_str("m\033[37m\033[", 8, buf, &q);
              } else {
                safe_copy_chr((*p), (buf), (&q), (8192 - 1));
              }
              param_val = 0;
            }
            ++p;
          }
          while ((*p & 0xf0) == 0x20) {
            ++p;
          }
          safe_copy_chr((*p), (buf), (&q), (8192 - 1));
          ++p;
          if (param_val == 0) {
            safe_known_str("\033[37m", 5, buf, &q);
          }
        } else {
          ++p;
          safe_known_str(just_after_csi, p - just_after_csi, buf, &q);
        }
      } else {
        safe_copy_esccode(&p, buf, &q);
      }
      just_after_esccode = p;
    } else {
      ++p;
    }
  }
  safe_known_str(just_after_esccode, p - just_after_esccode, buf, &q);
  return buf;
}


x86 assembly (clang, -O0):
<normal_to_white>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0x2f05(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x31(%rbp)
je     1177 <normal_to_white+0x47>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    1187 <normal_to_white+0x57>
jmp    1461 <normal_to_white+0x331>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1b,%eax
jne    1450 <normal_to_white+0x320>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
lea    0x2ea1(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <safe_known_str@plt>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x5b,%eax
jne    142f <normal_to_white+0x2ff>
mov    -0x10(%rbp),%rax
lea    0x2e7c(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x1fff,%ecx
movsbl (%rax),%edi
call   1050 <safe_copy_chr@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0x2e54(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x1fff,%ecx
movsbl (%rax),%edi
call   1050 <safe_copy_chr@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xf0,%eax
cmp    $0x30,%eax
jne    1265 <normal_to_white+0x135>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1254 <normal_to_white+0x124>
movl   $0x1,-0x30(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1228 <normal_to_white+0xf8>
jmp    126a <normal_to_white+0x13a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xf0,%eax
cmp    $0x20,%eax
jne    1290 <normal_to_white+0x160>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    126a <normal_to_white+0x13a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6d,%eax
jne    13fd <normal_to_white+0x2cd>
cmpl   $0x0,-0x30(%rbp)
je     13fd <normal_to_white+0x2cd>
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xf0,%eax
cmp    $0x30,%eax
jne    137f <normal_to_white+0x24f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jge    1320 <normal_to_white+0x1f0>
mov    -0x2c(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
shl    $0x2,%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
and    $0xf,%ecx
add    %ecx,%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
lea    0x2d46(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x1fff,%ecx
movsbl (%rax),%edi
call   1050 <safe_copy_chr@plt>
jmp    136e <normal_to_white+0x23e>
cmpl   $0x0,-0x2c(%rbp)
jne    134b <normal_to_white+0x21b>
lea    0xccf(%rip),%rdi
mov    $0x8,%esi
lea    0x2d13(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <safe_known_str@plt>
jmp    1367 <normal_to_white+0x237>
mov    -0x10(%rbp),%rax
lea    0x2cfa(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x1fff,%ecx
movsbl (%rax),%edi
call   1050 <safe_copy_chr@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    12b9 <normal_to_white+0x189>
jmp    1384 <normal_to_white+0x254>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xf0,%eax
cmp    $0x20,%eax
jne    13aa <normal_to_white+0x27a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1384 <normal_to_white+0x254>
mov    -0x10(%rbp),%rax
lea    0x2c9b(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x1fff,%ecx
movsbl (%rax),%edi
call   1050 <safe_copy_chr@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    13f8 <normal_to_white+0x2c8>
lea    0xc26(%rip),%rdi
mov    $0x5,%esi
lea    0x2c61(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <safe_known_str@plt>
jmp    142a <normal_to_white+0x2fa>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
lea    0x2c2f(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <safe_known_str@plt>
jmp    1443 <normal_to_white+0x313>
lea    -0x10(%rbp),%rdi
lea    0x2c16(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <safe_copy_esccode@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    145c <normal_to_white+0x32c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1157 <normal_to_white+0x27>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
lea    0x2bd7(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <safe_known_str@plt>
lea    0x2bc7(%rip),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal_to_white>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
lea    0x2f06(%rip),%rax
mov    %rax,0x10(%rsp)
test   %rdi,%rdi
je     13a4 <normal_to_white+0x274>
lea    0x2ef1(%rip),%r14
lea    0x10(%rsp),%rbx
mov    $0x1,%ebp
lea    0xe90(%rip),%r15
lea    0x8(%rsp),%r13
mov    %rdi,%rsi
jmp    119f <normal_to_white+0x6f>
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <safe_copy_esccode@plt>
mov    0x8(%rsp),%rsi
mov    %rsi,%rdi
test   %rsi,%rsi
je     13aa <normal_to_white+0x27a>
mov    (%rsi),%al
cmp    $0x1b,%al
je     11c0 <normal_to_white+0x90>
test   %al,%al
je     13ac <normal_to_white+0x27c>
add    $0x1,%rsi
mov    %rsi,0x8(%rsp)
test   %rsi,%rsi
jne    119f <normal_to_white+0x6f>
jmp    13aa <normal_to_white+0x27a>
sub    %edi,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1030 <safe_known_str@plt>
mov    0x8(%rsp),%rax
cmpb   $0x5b,0x1(%rax)
jne    1180 <normal_to_white+0x50>
movsbl (%rax),%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    $0x1fff,%ecx
call   1050 <safe_copy_chr@plt>
mov    0x8(%rsp),%rax
lea    0x1(%rax),%rcx
mov    %rcx,0x8(%rsp)
movsbl 0x1(%rax),%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    $0x1fff,%ecx
call   1050 <safe_copy_chr@plt>
mov    0x8(%rsp),%rsi
lea    0x1(%rsi),%rdi
mov    %rdi,0x8(%rsp)
mov    0x1(%rsi),%cl
mov    %ecx,%edx
and    $0xf0,%dl
xor    %eax,%eax
cmp    $0x30,%dl
jne    1252 <normal_to_white+0x122>
add    $0x2,%rsi
xor    %eax,%eax
cmp    $0x30,%cl
cmove  %ebp,%eax
mov    %rsi,0x8(%rsp)
movzbl (%rsi),%ecx
mov    %ecx,%edx
and    $0xf0,%dl
add    $0x1,%rsi
cmp    $0x30,%dl
je     1230 <normal_to_white+0x100>
add    $0xffffffffffffffff,%rsi
jmp    1255 <normal_to_white+0x125>
mov    %rdi,%rsi
mov    %ecx,%edx
and    $0xf0,%dl
cmp    $0x20,%dl
jne    128a <normal_to_white+0x15a>
add    $0x1,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rsi,0x8(%rsp)
movzbl (%rsi),%ecx
mov    %ecx,%edx
and    $0xf0,%dl
add    $0x1,%rsi
cmp    $0x20,%dl
je     1270 <normal_to_white+0x140>
add    $0xffffffffffffffff,%rsi
cmp    $0x6d,%cl
jne    1333 <normal_to_white+0x203>
test   %eax,%eax
je     1333 <normal_to_white+0x203>
mov    %rdi,0x8(%rsp)
mov    (%rdi),%al
movzbl %al,%ecx
mov    %ecx,%edx
and    $0xfffffff0,%edx
xor    %r12d,%r12d
cmp    $0x30,%edx
jne    1340 <normal_to_white+0x210>
xor    %r12d,%r12d
jmp    12fd <normal_to_white+0x1cd>
nopl   0x0(%rax,%rax,1)
and    $0xf,%ecx
lea    (%r12,%r12,4),%edx
lea    (%rcx,%rdx,2),%r12d
movsbl %al,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    $0x1fff,%ecx
call   1050 <safe_copy_chr@plt>
mov    0x8(%rsp),%rax
lea    0x1(%rax),%rdi
mov    %rdi,0x8(%rsp)
movzbl 0x1(%rax),%eax
movzbl %al,%ecx
mov    %ecx,%edx
and    $0xfffffff0,%edx
cmp    $0x30,%edx
jne    1340 <normal_to_white+0x210>
cmp    $0x39,%al
jle    12c0 <normal_to_white+0x190>
test   %r12d,%r12d
jne    131b <normal_to_white+0x1eb>
mov    %r15,%rdi
mov    $0x8,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1030 <safe_known_str@plt>
jmp    132e <normal_to_white+0x1fe>
movsbl %al,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    $0x1fff,%ecx
call   1050 <safe_copy_chr@plt>
xor    %r12d,%r12d
jmp    12de <normal_to_white+0x1ae>
add    $0x1,%rsi
mov    %rsi,0x8(%rsp)
sub    %edi,%esi
jmp    1394 <normal_to_white+0x264>
mov    %eax,%ecx
and    $0xf0,%cl
cmp    $0x20,%cl
jne    1366 <normal_to_white+0x236>
add    $0x1,%rdi
xchg   %ax,%ax
mov    %rdi,0x8(%rsp)
movzbl (%rdi),%eax
mov    %eax,%ecx
and    $0xf0,%cl
add    $0x1,%rdi
cmp    $0x20,%cl
je     1350 <normal_to_white+0x220>
movsbl %al,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    $0x1fff,%ecx
call   1050 <safe_copy_chr@plt>
addq   $0x1,0x8(%rsp)
test   %r12d,%r12d
jne    118e <normal_to_white+0x5e>
lea    0xc7a(%rip),%rdi
mov    $0x5,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1030 <safe_known_str@plt>
jmp    118e <normal_to_white+0x5e>
xor    %esi,%esi
xor    %edi,%edi
jmp    13ac <normal_to_white+0x27c>
xor    %esi,%esi
sub    %edi,%esi
lea    0x2c9b(%rip),%rbx
lea    0x10(%rsp),%rcx
mov    %rbx,%rdx
call   1030 <safe_known_str@plt>
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@normal_to_white.buf = internal global [8192 x i8] zeroinitializer
@.str = [9 x i8] c"m\1B[37m\1B[\00"
@.str.1 = [6 x i8] c"\1B[37m\00"
define i8* @normal_to_white(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %2
%9 = load i8*, i8** %2
store i8* %9, i8** %3
store i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %4
%10 = load i8*, i8** %3
store i8* %10, i8** %6
br label %11
11: ; preds = %166, %1
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 0
br label %19
19: ; preds = %14, %11
%20 = phi i1 [ false, %11 ], [ %18, %14 ]
br i1 %20, label %21, label %167
21: ; preds = %19
%22 = load i8*, i8** %3
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 27
br i1 %25, label %26, label %163
26: ; preds = %21
%27 = load i8*, i8** %6
%28 = load i8*, i8** %3
%29 = load i8*, i8** %6
%30 = ptrtoint i8* %28 to i64
%31 = ptrtoint i8* %29 to i64
%32 = sub i64 %30, %31
%33 = trunc i64 %32 to i32
%34 = call i32 @safe_known_str(i8* %27, i32 %33, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %4)
%35 = load i8*, i8** %3
%36 = getelementptr inbounds i8, i8* %35, i64 1
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 91
br i1 %39, label %40, label %159
40: ; preds = %26
%41 = load i8*, i8** %3
%42 = load i8, i8* %41
%43 = call i32 @safe_copy_chr(i8 signext %42, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %4, i32 8191)
%44 = load i8*, i8** %3
%45 = getelementptr inbounds i8, i8* %44, i32 1
store i8* %45, i8** %3
%46 = load i8*, i8** %3
%47 = load i8, i8* %46
%48 = call i32 @safe_copy_chr(i8 signext %47, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %4, i32 8191)
%49 = load i8*, i8** %3
%50 = getelementptr inbounds i8, i8* %49, i32 1
store i8* %50, i8** %3
%51 = load i8*, i8** %3
store i8* %51, i8** %5
store i32 0, i32* %8
br label %52
52: ; preds = %64, %40
%53 = load i8*, i8** %3
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = and i32 %55, 240
%57 = icmp eq i32 %56, 48
br i1 %57, label %58, label %67
58: ; preds = %52
%59 = load i8*, i8** %3
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 48
br i1 %62, label %63, label %64
63: ; preds = %58
store i32 1, i32* %8
br label %64
64: ; preds = %63, %58
%65 = load i8*, i8** %3
%66 = getelementptr inbounds i8, i8* %65, i32 1
store i8* %66, i8** %3
br label %52
67: ; preds = %52
br label %68
68: ; preds = %74, %67
%69 = load i8*, i8** %3
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = and i32 %71, 240
%73 = icmp eq i32 %72, 32
br i1 %73, label %74, label %77
74: ; preds = %68
%75 = load i8*, i8** %3
%76 = getelementptr inbounds i8, i8* %75, i32 1
store i8* %76, i8** %3
br label %68
77: ; preds = %68
%78 = load i8*, i8** %3
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = icmp eq i32 %80, 109
br i1 %81, label %82, label %147
82: ; preds = %77
%83 = load i32, i32* %8
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %147
85: ; preds = %82
%86 = load i8*, i8** %5
store i8* %86, i8** %3
store i32 0, i32* %7
br label %87
87: ; preds = %123, %85
%88 = load i8*, i8** %3
%89 = load i8, i8* %88
%90 = sext i8 %89 to i32
%91 = and i32 %90, 240
%92 = icmp eq i32 %91, 48
br i1 %92, label %93, label %126
93: ; preds = %87
%94 = load i8*, i8** %3
%95 = load i8, i8* %94
%96 = sext i8 %95 to i32
%97 = icmp slt i32 %96, 58
br i1 %97, label %98, label %113
98: ; preds = %93
%99 = load i32, i32* %7
%100 = shl i32 %99, 1
store i32 %100, i32* %7
%101 = load i32, i32* %7
%102 = shl i32 %101, 2
%103 = load i8*, i8** %3
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = and i32 %105, 15
%107 = add i32 %102, %106
%108 = load i32, i32* %7
%109 = add i32 %108, %107
store i32 %109, i32* %7
%110 = load i8*, i8** %3
%111 = load i8, i8* %110
%112 = call i32 @safe_copy_chr(i8 signext %111, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %4, i32 8191)
br label %123
113: ; preds = %93
%114 = load i32, i32* %7
%115 = icmp eq i32 %114, 0
br i1 %115, label %116, label %118
116: ; preds = %113
%117 = call i32 @safe_known_str(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %4)
br label %122
118: ; preds = %113
%119 = load i8*, i8** %3
%120 = load i8, i8* %119
%121 = call i32 @safe_copy_chr(i8 signext %120, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %4, i32 8191)
br label %122
122: ; preds = %118, %116
store i32 0, i32* %7
br label %123
123: ; preds = %122, %98
%124 = load i8*, i8** %3
%125 = getelementptr inbounds i8, i8* %124, i32 1
store i8* %125, i8** %3
br label %87
126: ; preds = %87
br label %127
127: ; preds = %133, %126
%128 = load i8*, i8** %3
%129 = load i8, i8* %128
%130 = sext i8 %129 to i32
%131 = and i32 %130, 240
%132 = icmp eq i32 %131, 32
br i1 %132, label %133, label %136
133: ; preds = %127
%134 = load i8*, i8** %3
%135 = getelementptr inbounds i8, i8* %134, i32 1
store i8* %135, i8** %3
br label %127
136: ; preds = %127
%137 = load i8*, i8** %3
%138 = load i8, i8* %137
%139 = call i32 @safe_copy_chr(i8 signext %138, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %4, i32 8191)
%140 = load i8*, i8** %3
%141 = getelementptr inbounds i8, i8* %140, i32 1
store i8* %141, i8** %3
%142 = load i32, i32* %7
%143 = icmp eq i32 %142, 0
br i1 %143, label %144, label %146
144: ; preds = %136
%145 = call i32 @safe_known_str(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %4)
br label %146
146: ; preds = %144, %136
br label %158
147: ; preds = %82, %77
%148 = load i8*, i8** %3
%149 = getelementptr inbounds i8, i8* %148, i32 1
store i8* %149, i8** %3
%150 = load i8*, i8** %5
%151 = load i8*, i8** %3
%152 = load i8*, i8** %5
%153 = ptrtoint i8* %151 to i64
%154 = ptrtoint i8* %152 to i64
%155 = sub i64 %153, %154
%156 = trunc i64 %155 to i32
%157 = call i32 @safe_known_str(i8* %150, i32 %156, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %4)
br label %158
158: ; preds = %147, %146
br label %161
159: ; preds = %26
%160 = call i32 @safe_copy_esccode(i8** %3, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %4)
br label %161
161: ; preds = %159, %158
%162 = load i8*, i8** %3
store i8* %162, i8** %6
br label %166
163: ; preds = %21
%164 = load i8*, i8** %3
%165 = getelementptr inbounds i8, i8* %164, i32 1
store i8* %165, i8** %3
br label %166
166: ; preds = %163, %161
br label %11
167: ; preds = %19
%168 = load i8*, i8** %6
%169 = load i8*, i8** %3
%170 = load i8*, i8** %6
%171 = ptrtoint i8* %169 to i64
%172 = ptrtoint i8* %170 to i64
%173 = sub i64 %171, %172
%174 = trunc i64 %173 to i32
%175 = call i32 @safe_known_str(i8* %168, i32 %174, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %4)
ret i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@normal_to_white.buf = internal global [8192 x i8] zeroinitializer
@.str = [9 x i8] c"m\1B[37m\1B[\00"
@.str.1 = [6 x i8] c"\1B[37m\00"
define i8* @normal_to_white(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
%5 = bitcast i8** %3 to i8*
store i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %3
%6 = icmp eq i8* %0, null
br i1 %6, label %129, label %7
7: ; preds = %1, %125
%8 = phi i8* [ %127, %125 ], [ %0, %1 ]
%9 = phi i8* [ %126, %125 ], [ %0, %1 ]
%10 = load i8, i8* %9
switch i8 %10, label %123 [
i8 0, label %129
i8 27, label %11
]
11: ; preds = %7
%12 = ptrtoint i8* %9 to i64
%13 = ptrtoint i8* %8 to i64
%14 = sub i64 %12, %13
%15 = trunc i64 %14 to i32
%16 = call i32 @safe_known_str(i8* %8, i32 %15, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %3)
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 91
br i1 %20, label %21, label %119
21: ; preds = %11
%22 = load i8, i8* %17
%23 = call i32 @safe_copy_chr(i8 signext %22, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %3, i32 8191)
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 1
store i8* %25, i8** %2
%26 = load i8, i8* %25
%27 = call i32 @safe_copy_chr(i8 signext %26, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %3, i32 8191)
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i64 1
store i8* %29, i8** %2
%30 = load i8, i8* %29
%31 = and i8 %30, -16
%32 = icmp eq i8 %31, 48
br i1 %32, label %39, label %33
33: ; preds = %39, %21
%34 = phi i8 [ %30, %21 ], [ %46, %39 ]
%35 = phi i8* [ %29, %21 ], [ %45, %39 ]
%36 = phi i32 [ 0, %21 ], [ %44, %39 ]
%37 = and i8 %34, -16
%38 = icmp eq i8 %37, 32
br i1 %38, label %49, label %55
39: ; preds = %21, %39
%40 = phi i8 [ %46, %39 ], [ %30, %21 ]
%41 = phi i32 [ %44, %39 ], [ 0, %21 ]
%42 = phi i8* [ %45, %39 ], [ %29, %21 ]
%43 = icmp eq i8 %40, 48
%44 = select i1 %43, i32 1, i32 %41
%45 = getelementptr inbounds i8, i8* %42, i64 1
store i8* %45, i8** %2
%46 = load i8, i8* %45
%47 = and i8 %46, -16
%48 = icmp eq i8 %47, 48
br i1 %48, label %39, label %33
49: ; preds = %33, %49
%50 = phi i8* [ %51, %49 ], [ %35, %33 ]
%51 = getelementptr inbounds i8, i8* %50, i64 1
store i8* %51, i8** %2
%52 = load i8, i8* %51
%53 = and i8 %52, -16
%54 = icmp eq i8 %53, 32
br i1 %54, label %49, label %55
55: ; preds = %49, %33
%56 = phi i8* [ %35, %33 ], [ %51, %49 ]
%57 = phi i8 [ %34, %33 ], [ %52, %49 ]
%58 = icmp eq i8 %57, 109
%59 = icmp ne i32 %36, 0
%60 = select i1 %58, i1 %59, i1 false
br i1 %60, label %61, label %112
61: ; preds = %55
store i8* %29, i8** %2
%62 = load i8, i8* %29
%63 = zext i8 %62 to i32
%64 = and i32 %63, 240
%65 = icmp eq i32 %64, 48
br i1 %65, label %74, label %68
66: ; preds = %90
%67 = getelementptr inbounds i8, i8* %92, i64 1
br label %68
68: ; preds = %66, %61
%69 = phi i8 [ %62, %61 ], [ %94, %66 ]
%70 = phi i8* [ %29, %61 ], [ %67, %66 ]
%71 = phi i32 [ 0, %61 ], [ %91, %66 ]
%72 = and i8 %69, -16
%73 = icmp eq i8 %72, 32
br i1 %73, label %98, label %104
74: ; preds = %61, %90
%75 = phi i32 [ %95, %90 ], [ %63, %61 ]
%76 = phi i8 [ %94, %90 ], [ %62, %61 ]
%77 = phi i32 [ %91, %90 ], [ 0, %61 ]
%78 = icmp slt i8 %76, 58
br i1 %78, label %79, label %84
79: ; preds = %74
%80 = and i32 %75, 15
%81 = mul i32 %77, 10
%82 = add i32 %80, %81
%83 = call i32 @safe_copy_chr(i8 signext %76, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %3, i32 8191)
br label %90
84: ; preds = %74
%85 = icmp eq i32 %77, 0
br i1 %85, label %86, label %88
86: ; preds = %84
%87 = call i32 @safe_known_str(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %3)
br label %90
88: ; preds = %84
%89 = call i32 @safe_copy_chr(i8 signext %76, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %3, i32 8191)
br label %90
90: ; preds = %86, %88, %79
%91 = phi i32 [ %82, %79 ], [ 0, %88 ], [ 0, %86 ]
%92 = load i8*, i8** %2
%93 = getelementptr inbounds i8, i8* %92, i64 1
store i8* %93, i8** %2
%94 = load i8, i8* %93
%95 = zext i8 %94 to i32
%96 = and i32 %95, 240
%97 = icmp eq i32 %96, 48
br i1 %97, label %74, label %66
98: ; preds = %68, %98
%99 = phi i8* [ %100, %98 ], [ %70, %68 ]
%100 = getelementptr inbounds i8, i8* %99, i64 1
store i8* %100, i8** %2
%101 = load i8, i8* %100
%102 = and i8 %101, -16
%103 = icmp eq i8 %102, 32
br i1 %103, label %98, label %104
104: ; preds = %98, %68
%105 = phi i8 [ %69, %68 ], [ %101, %98 ]
%106 = call i32 @safe_copy_chr(i8 signext %105, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %3, i32 8191)
%107 = load i8*, i8** %2
%108 = getelementptr inbounds i8, i8* %107, i64 1
store i8* %108, i8** %2
%109 = icmp eq i32 %71, 0
br i1 %109, label %110, label %121
110: ; preds = %104
%111 = call i32 @safe_known_str(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %3)
br label %121
112: ; preds = %55
%113 = getelementptr inbounds i8, i8* %56, i64 1
store i8* %113, i8** %2
%114 = ptrtoint i8* %113 to i64
%115 = ptrtoint i8* %29 to i64
%116 = sub i64 %114, %115
%117 = trunc i64 %116 to i32
%118 = call i32 @safe_known_str(i8* %29, i32 %117, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %3)
br label %121
119: ; preds = %11
%120 = call i32 @safe_copy_esccode(i8** %2, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %3)
br label %121
121: ; preds = %112, %110, %104, %119
%122 = load i8*, i8** %2
br label %125
123: ; preds = %7
%124 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %124, i8** %2
br label %125
125: ; preds = %123, %121
%126 = phi i8* [ %122, %121 ], [ %124, %123 ]
%127 = phi i8* [ %122, %121 ], [ %8, %123 ]
%128 = icmp eq i8* %126, null
br i1 %128, label %129, label %7
129: ; preds = %125, %7, %1
%130 = phi i8* [ null, %1 ], [ %9, %7 ], [ null, %125 ]
%131 = phi i8* [ null, %1 ], [ %8, %7 ], [ %127, %125 ]
%132 = ptrtoint i8* %130 to i64
%133 = ptrtoint i8* %131 to i64
%134 = sub i64 %132, %133
%135 = trunc i64 %134 to i32
%136 = call i32 @safe_known_str(i8* %131, i32 %135, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0), i8** %3)
ret i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @normal_to_white.buf, i64 0, i64 0)
}