#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 *getenv(char *);
scalar_t__ strcmp(char *, char *);
scalar_t__ strncmp(char *, char *, int);
int DetectKanjiCode(unsigned char *str) {
  static int whatcode;
  int c, i;
  char *lang = NULL;
  c = '\1';
  i = 0;
  if (whatcode == 0)
    whatcode = 8;
  while ((whatcode == 7 || whatcode == 8) && c != '\0') {
    if ((c = str[i++]) != '\0') {
      if (c == 27) {
        c = str[i++];
        if (c == '$') {
          c = str[i++];
          if (c == 'B')
            whatcode = 1;
          else if (c == '@')
            whatcode = 2;
        } else if (c == '(') {
          c = str[i++];
          if (c == 'I')
            whatcode = 3;
        } else if (c == 'K')
          whatcode = 4;
      } else if ((c >= 129 && c <= 141) || (c >= 143 && c <= 159))
        whatcode = 6;
      else if (c == 142) {
        c = str[i++];
        if ((c >= 64 && c <= 126) || (c >= 128 && c <= 160) ||
            (c >= 224 && c <= 252))
          whatcode = 6;
        else if (c >= 161 && c <= 223)
          whatcode = 7;
      } else if (c >= 161 && c <= 223) {
        c = str[i++];
        if (c >= 240 && c <= 254)
          whatcode = 5;
        else if (c >= 161 && c <= 223)
          whatcode = 7;
        else if (c >= 224 && c <= 239) {
          whatcode = 7;
          while (c >= 64 && c != '\0' && whatcode == 7) {
            if (c >= 129) {
              if (c <= 141 || (c >= 143 && c <= 159))
                whatcode = 6;
              else if (c >= 253 && c <= 254)
                whatcode = 5;
            }
            c = str[i++];
          }
        } else if (c <= 159)
          whatcode = 6;
      } else if (c >= 240 && c <= 254)
        whatcode = 5;
      else if (c >= 224 && c <= 239) {
        c = str[i++];
        if ((c >= 64 && c <= 126) || (c >= 128 && c <= 160))
          whatcode = 6;
        else if (c >= 253 && c >= 254)
          whatcode = 5;
        else if (c >= 161 && c <= 252)
          whatcode = 7;
      }
    }
  }
  if (whatcode == 7) {
    if (getenv("LC_ALL"))
      lang = getenv("LC_ALL");
    else if (getenv("LC_CTYPE"))
      lang = getenv("LC_CTYPE");
    else if (getenv("LANG"))
      lang = getenv("LANG");
    if (lang) {
      if (strcmp(lang, "ja_JP.SJIS") == 0 ||
          strcmp(lang, "ja_JP.mscode") == 0 || strcmp(lang, "ja_JP.PCK") == 0)
        whatcode = 6;
      else if (strncmp(lang, "ja", 2) == 0)
        whatcode = 5;
    }
  }
  if (whatcode == 7)
    whatcode = 5;
  return whatcode;
}


x86 assembly (clang, -O0):
<DetectKanjiCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,0x2ee3(%rip)
jne    1169 <DetectKanjiCode+0x39>
movl   $0x8,0x2ed3(%rip)
jmp    116e <DetectKanjiCode+0x3e>
cmpl   $0x7,0x2ec7(%rip)
je     118d <DetectKanjiCode+0x5d>
xor    %eax,%eax
cmpl   $0x8,0x2eb8(%rip)
mov    %al,-0x19(%rbp)
jne    1197 <DetectKanjiCode+0x67>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    11a7 <DetectKanjiCode+0x77>
jmp    164e <DetectKanjiCode+0x51e>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1649 <DetectKanjiCode+0x519>
cmpl   $0x1b,-0xc(%rbp)
jne    12a5 <DetectKanjiCode+0x175>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x24,-0xc(%rbp)
jne    1246 <DetectKanjiCode+0x116>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x42,-0xc(%rbp)
jne    1228 <DetectKanjiCode+0xf8>
movl   $0x1,0x2e19(%rip)
jmp    1241 <DetectKanjiCode+0x111>
cmpl   $0x40,-0xc(%rbp)
jne    123c <DetectKanjiCode+0x10c>
movl   $0x2,0x2e00(%rip)
jmp    1241 <DetectKanjiCode+0x111>
jmp    12a0 <DetectKanjiCode+0x170>
cmpl   $0x28,-0xc(%rbp)
jne    1282 <DetectKanjiCode+0x152>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x49,-0xc(%rbp)
jne    127d <DetectKanjiCode+0x14d>
movl   $0x3,0x2dbf(%rip)
jmp    129b <DetectKanjiCode+0x16b>
cmpl   $0x4b,-0xc(%rbp)
jne    1296 <DetectKanjiCode+0x166>
movl   $0x4,0x2da6(%rip)
jmp    129b <DetectKanjiCode+0x16b>
jmp    12a0 <DetectKanjiCode+0x170>
jmp    1644 <DetectKanjiCode+0x514>
cmpl   $0x81,-0xc(%rbp)
jl     12bf <DetectKanjiCode+0x18f>
cmpl   $0x8d,-0xc(%rbp)
jle    12d9 <DetectKanjiCode+0x1a9>
cmpl   $0x8f,-0xc(%rbp)
jl     12e8 <DetectKanjiCode+0x1b8>
cmpl   $0x9f,-0xc(%rbp)
jg     12e8 <DetectKanjiCode+0x1b8>
movl   $0x6,0x2d59(%rip)
jmp    163f <DetectKanjiCode+0x50f>
cmpl   $0x8e,-0xc(%rbp)
jne    1393 <DetectKanjiCode+0x263>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jl     1322 <DetectKanjiCode+0x1f2>
cmpl   $0x7e,-0xc(%rbp)
jle    1356 <DetectKanjiCode+0x226>
cmpl   $0x80,-0xc(%rbp)
jl     133c <DetectKanjiCode+0x20c>
cmpl   $0xa0,-0xc(%rbp)
jle    1356 <DetectKanjiCode+0x226>
cmpl   $0xe0,-0xc(%rbp)
jl     1365 <DetectKanjiCode+0x235>
cmpl   $0xfc,-0xc(%rbp)
jg     1365 <DetectKanjiCode+0x235>
movl   $0x6,0x2cdc(%rip)
jmp    138e <DetectKanjiCode+0x25e>
cmpl   $0xa1,-0xc(%rbp)
jl     1389 <DetectKanjiCode+0x259>
cmpl   $0xdf,-0xc(%rbp)
jg     1389 <DetectKanjiCode+0x259>
movl   $0x7,0x2cb3(%rip)
jmp    138e <DetectKanjiCode+0x25e>
jmp    163a <DetectKanjiCode+0x50a>
cmpl   $0xa1,-0xc(%rbp)
jl     1536 <DetectKanjiCode+0x406>
cmpl   $0xdf,-0xc(%rbp)
jg     1536 <DetectKanjiCode+0x406>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xf0,-0xc(%rbp)
jl     13ef <DetectKanjiCode+0x2bf>
cmpl   $0xfe,-0xc(%rbp)
jg     13ef <DetectKanjiCode+0x2bf>
movl   $0x5,0x2c52(%rip)
jmp    1531 <DetectKanjiCode+0x401>
cmpl   $0xa1,-0xc(%rbp)
jl     1418 <DetectKanjiCode+0x2e8>
cmpl   $0xdf,-0xc(%rbp)
jg     1418 <DetectKanjiCode+0x2e8>
movl   $0x7,0x2c29(%rip)
jmp    152c <DetectKanjiCode+0x3fc>
cmpl   $0xe0,-0xc(%rbp)
jl     150b <DetectKanjiCode+0x3db>
cmpl   $0xef,-0xc(%rbp)
jg     150b <DetectKanjiCode+0x3db>
movl   $0x7,0x2c00(%rip)
xor    %eax,%eax
cmpl   $0x40,-0xc(%rbp)
mov    %al,-0x1a(%rbp)
jl     1467 <DetectKanjiCode+0x337>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x1a(%rbp)
je     1467 <DetectKanjiCode+0x337>
cmpl   $0x7,0x2bdb(%rip)
sete   %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
test   $0x1,%al
jne    1477 <DetectKanjiCode+0x347>
jmp    1506 <DetectKanjiCode+0x3d6>
cmpl   $0x81,-0xc(%rbp)
jl     14e8 <DetectKanjiCode+0x3b8>
cmpl   $0x8d,-0xc(%rbp)
jle    14ab <DetectKanjiCode+0x37b>
cmpl   $0x8f,-0xc(%rbp)
jl     14ba <DetectKanjiCode+0x38a>
cmpl   $0x9f,-0xc(%rbp)
jg     14ba <DetectKanjiCode+0x38a>
movl   $0x6,0x2b87(%rip)
jmp    14e3 <DetectKanjiCode+0x3b3>
cmpl   $0xfd,-0xc(%rbp)
jl     14de <DetectKanjiCode+0x3ae>
cmpl   $0xfe,-0xc(%rbp)
jg     14de <DetectKanjiCode+0x3ae>
movl   $0x5,0x2b5e(%rip)
jmp    14e3 <DetectKanjiCode+0x3b3>
jmp    14e8 <DetectKanjiCode+0x3b8>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0xc(%rbp)
jmp    143c <DetectKanjiCode+0x30c>
jmp    1527 <DetectKanjiCode+0x3f7>
cmpl   $0x9f,-0xc(%rbp)
jg     1522 <DetectKanjiCode+0x3f2>
movl   $0x6,0x2b1a(%rip)
jmp    1527 <DetectKanjiCode+0x3f7>
jmp    152c <DetectKanjiCode+0x3fc>
jmp    1531 <DetectKanjiCode+0x401>
jmp    1635 <DetectKanjiCode+0x505>
cmpl   $0xf0,-0xc(%rbp)
jl     155f <DetectKanjiCode+0x42f>
cmpl   $0xfe,-0xc(%rbp)
jg     155f <DetectKanjiCode+0x42f>
movl   $0x5,0x2ae2(%rip)
jmp    1630 <DetectKanjiCode+0x500>
cmpl   $0xe0,-0xc(%rbp)
jl     162b <DetectKanjiCode+0x4fb>
cmpl   $0xef,-0xc(%rbp)
jg     162b <DetectKanjiCode+0x4fb>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jl     15a6 <DetectKanjiCode+0x476>
cmpl   $0x7e,-0xc(%rbp)
jle    15c0 <DetectKanjiCode+0x490>
cmpl   $0x80,-0xc(%rbp)
jl     15cf <DetectKanjiCode+0x49f>
cmpl   $0xa0,-0xc(%rbp)
jg     15cf <DetectKanjiCode+0x49f>
movl   $0x6,0x2a72(%rip)
jmp    1626 <DetectKanjiCode+0x4f6>
cmpl   $0xfd,-0xc(%rbp)
jl     15f8 <DetectKanjiCode+0x4c8>
cmpl   $0xfe,-0xc(%rbp)
jl     15f8 <DetectKanjiCode+0x4c8>
movl   $0x5,0x2a49(%rip)
jmp    1621 <DetectKanjiCode+0x4f1>
cmpl   $0xa1,-0xc(%rbp)
jl     161c <DetectKanjiCode+0x4ec>
cmpl   $0xfc,-0xc(%rbp)
jg     161c <DetectKanjiCode+0x4ec>
movl   $0x7,0x2a20(%rip)
jmp    1621 <DetectKanjiCode+0x4f1>
jmp    1626 <DetectKanjiCode+0x4f6>
jmp    162b <DetectKanjiCode+0x4fb>
jmp    1630 <DetectKanjiCode+0x500>
jmp    1635 <DetectKanjiCode+0x505>
jmp    163a <DetectKanjiCode+0x50a>
jmp    163f <DetectKanjiCode+0x50f>
jmp    1644 <DetectKanjiCode+0x514>
jmp    1649 <DetectKanjiCode+0x519>
jmp    116e <DetectKanjiCode+0x3e>
cmpl   $0x7,0x29e7(%rip)
jne    1781 <DetectKanjiCode+0x651>
lea    0x99e(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     1686 <DetectKanjiCode+0x556>
lea    0x988(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
jmp    16e1 <DetectKanjiCode+0x5b1>
lea    0x97a(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     16b1 <DetectKanjiCode+0x581>
lea    0x964(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
jmp    16dc <DetectKanjiCode+0x5ac>
lea    0x958(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     16d7 <DetectKanjiCode+0x5a7>
lea    0x942(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
jmp    16dc <DetectKanjiCode+0x5ac>
jmp    16e1 <DetectKanjiCode+0x5b1>
cmpq   $0x0,-0x18(%rbp)
je     177c <DetectKanjiCode+0x64c>
mov    -0x18(%rbp),%rdi
lea    0x91e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     173a <DetectKanjiCode+0x60a>
mov    -0x18(%rbp),%rdi
lea    0x90f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     173a <DetectKanjiCode+0x60a>
mov    -0x18(%rbp),%rdi
lea    0x902(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1749 <DetectKanjiCode+0x619>
movl   $0x6,0x28f8(%rip)
jmp    1777 <DetectKanjiCode+0x647>
mov    -0x18(%rbp),%rdi
lea    0x8e3(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1772 <DetectKanjiCode+0x642>
movl   $0x5,0x28ca(%rip)
jmp    1777 <DetectKanjiCode+0x647>
jmp    177c <DetectKanjiCode+0x64c>
jmp    1781 <DetectKanjiCode+0x651>
cmpl   $0x7,0x28b4(%rip)
jne    1798 <DetectKanjiCode+0x668>
movl   $0x5,0x28a4(%rip)
mov    0x289e(%rip),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DetectKanjiCode>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x2efe(%rip),%r15d
test   %r15d,%r15d
je     1151 <DetectKanjiCode+0x21>
lea    -0x7(%r15),%eax
cmp    $0x1,%eax
jbe    1161 <DetectKanjiCode+0x31>
jmp    1446 <DetectKanjiCode+0x316>
movl   $0x8,0x2ee1(%rip)
mov    $0x8,%r15d
xor    %ebx,%ebx
mov    %r15d,%edx
cs nopw 0x0(%rax,%rax,1)
movslq %ebx,%rax
lea    0x1(%rax),%rsi
movzbl (%rdi,%rax,1),%ecx
cmp    $0x1b,%ecx
je     11e0 <DetectKanjiCode+0xb0>
test   %cl,%cl
je     1369 <DetectKanjiCode+0x239>
lea    0x7f(%rcx),%eax
mov    $0x6,%ebp
cmp    $0xd,%al
jb     143d <DetectKanjiCode+0x30d>
lea    0x71(%rcx),%eax
cmp    $0x11,%al
jb     143d <DetectKanjiCode+0x30d>
cmp    $0x8e,%cl
jne    1200 <DetectKanjiCode+0xd0>
mov    (%rdi,%rsi,1),%al
lea    0x20(%rax),%ecx
cmp    $0x1d,%cl
jb     143d <DetectKanjiCode+0x30d>
cmp    $0xa1,%al
jl     143d <DetectKanjiCode+0x30d>
lea    -0x40(%rax),%ecx
cmp    $0x3f,%cl
jb     143d <DetectKanjiCode+0x30d>
add    $0x2,%ebx
movzbl %al,%ecx
add    $0x5f,%al
cmp    $0x3e,%al
jbe    1224 <DetectKanjiCode+0xf4>
jmp    1262 <DetectKanjiCode+0x132>
nopl   0x0(%rax)
add    $0x2,%rax
movzbl (%rdi,%rsi,1),%ecx
cmp    $0x24,%ecx
je     123b <DetectKanjiCode+0x10b>
cmp    $0x28,%cl
je     1252 <DetectKanjiCode+0x122>
mov    %eax,%ebx
cmp    $0x4b,%cl
jne    1262 <DetectKanjiCode+0x132>
jmp    1423 <DetectKanjiCode+0x2f3>
xchg   %ax,%ax
lea    0x5f(%rcx),%eax
cmp    $0x3e,%al
ja     127b <DetectKanjiCode+0x14b>
movzbl (%rdi,%rsi,1),%ecx
lea    0x10(%rcx),%eax
cmp    $0xf,%al
jb     141c <DetectKanjiCode+0x2ec>
add    $0x2,%ebx
lea    0x5f(%rcx),%eax
cmp    $0x3e,%al
ja     12d9 <DetectKanjiCode+0x1a9>
movl   $0x7,0x2e0e(%rip)
mov    $0x7,%r15d
mov    $0x7,%edx
jmp    1262 <DetectKanjiCode+0x132>
movzbl (%rdi,%rax,1),%ecx
cmp    $0x42,%ecx
je     142a <DetectKanjiCode+0x2fa>
cmp    $0x40,%cl
jne    125f <DetectKanjiCode+0x12f>
jmp    1431 <DetectKanjiCode+0x301>
movzbl (%rdi,%rax,1),%ecx
cmp    $0x49,%ecx
je     1438 <DetectKanjiCode+0x308>
add    $0x3,%ebx
lea    -0x7(%rdx),%eax
cmp    $0x1,%eax
ja     1369 <DetectKanjiCode+0x239>
test   %ecx,%ecx
jne    1170 <DetectKanjiCode+0x40>
jmp    1369 <DetectKanjiCode+0x239>
lea    0x10(%rcx),%eax
cmp    $0xf,%al
jb     141c <DetectKanjiCode+0x2ec>
mov    %ecx,%eax
and    $0xf0,%al
cmp    $0xe0,%al
jne    1343 <DetectKanjiCode+0x213>
movzbl (%rdi,%rsi,1),%ecx
cmp    $0xa1,%cl
jl     143d <DetectKanjiCode+0x30d>
lea    -0x40(%rcx),%eax
cmp    $0x3f,%al
jb     143d <DetectKanjiCode+0x30d>
mov    $0x5,%ebp
cmp    $0xfd,%cl
ja     143d <DetectKanjiCode+0x30d>
add    $0x2,%ebx
cmp    $0xa1,%cl
jb     1262 <DetectKanjiCode+0x132>
cmp    $0xfd,%cl
je     1262 <DetectKanjiCode+0x132>
movl   $0x7,0x2d6d(%rip)
mov    $0x42,%ecx
jmp    122e <DetectKanjiCode+0xfe>
mov    %ecx,%eax
and    $0xf0,%al
cmp    $0xe0,%al
jne    134a <DetectKanjiCode+0x21a>
movl   $0x7,0x2d51(%rip)
movslq %ebx,%rbx
jmp    12fd <DetectKanjiCode+0x1cd>
movzbl (%rdi,%rbx,1),%ecx
add    $0x1,%rbx
cmp    $0x3f,%ecx
jbe    1358 <DetectKanjiCode+0x228>
cmp    $0x81,%ecx
jb     12f0 <DetectKanjiCode+0x1c0>
mov    $0x6,%r15d
cmp    $0x8e,%ecx
jb     1333 <DetectKanjiCode+0x203>
je     131d <DetectKanjiCode+0x1ed>
cmp    $0xa0,%ecx
jb     1333 <DetectKanjiCode+0x203>
cmp    $0xfd,%ecx
jb     12f0 <DetectKanjiCode+0x1c0>
cmp    $0xff,%ecx
je     12f0 <DetectKanjiCode+0x1c0>
mov    $0x5,%r15d
mov    %r15d,0x2d02(%rip)
mov    (%rdi,%rbx,1),%cl
add    $0x1,%rbx
jmp    135e <DetectKanjiCode+0x22e>
mov    %esi,%ebx
jmp    1262 <DetectKanjiCode+0x132>
cmp    $0xa0,%cl
jae    1262 <DetectKanjiCode+0x132>
jmp    143d <DetectKanjiCode+0x30d>
mov    $0x7,%r15d
movzbl %cl,%ecx
mov    %r15d,%edx
jmp    1262 <DetectKanjiCode+0x132>
cmp    $0x7,%edx
jne    140f <DetectKanjiCode+0x2df>
lea    0xc87(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r14
test   %rax,%rax
jne    13ae <DetectKanjiCode+0x27e>
lea    0xc7a(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r14
test   %rax,%rax
jne    13ae <DetectKanjiCode+0x27e>
lea    0xc6f(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r14
test   %rax,%rax
je     140f <DetectKanjiCode+0x2df>
lea    0xc60(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
mov    $0x6,%ebp
test   %rax,%rax
je     143d <DetectKanjiCode+0x30d>
lea    0xc52(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     143d <DetectKanjiCode+0x30d>
lea    0xc4b(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     143d <DetectKanjiCode+0x30d>
lea    0xc41(%rip),%rsi
mov    %r14,%rdi
mov    $0x2,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     141c <DetectKanjiCode+0x2ec>
mov    0x2c2d(%rip),%r15d
mov    $0x5,%ebp
cmp    $0x7,%r15d
je     143d <DetectKanjiCode+0x30d>
jmp    1446 <DetectKanjiCode+0x316>
mov    $0x5,%ebp
jmp    143d <DetectKanjiCode+0x30d>
mov    $0x4,%ebp
jmp    143d <DetectKanjiCode+0x30d>
mov    $0x1,%ebp
jmp    143d <DetectKanjiCode+0x30d>
mov    $0x2,%ebp
jmp    143d <DetectKanjiCode+0x30d>
mov    $0x3,%ebp
mov    %ebp,0x2bf9(%rip)
mov    %ebp,%r15d
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@DetectKanjiCode.whatcode = internal global i32 0
@.str = [7 x i8] c"LC_ALL\00"
@.str.1 = [9 x i8] c"LC_CTYPE\00"
@.str.2 = [5 x i8] c"LANG\00"
@.str.3 = [11 x i8] c"ja_JP.SJIS\00"
@.str.4 = [13 x i8] c"ja_JP.mscode\00"
@.str.5 = [10 x i8] c"ja_JP.PCK\00"
@.str.6 = [3 x i8] c"ja\00"
define i32 @DetectKanjiCode(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %5
store i32 1, i32* %3
store i32 0, i32* %4
%6 = load i32, i32* @DetectKanjiCode.whatcode
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 8, i32* @DetectKanjiCode.whatcode
br label %9
9: ; preds = %8, %1
br label %10
10: ; preds = %273, %9
%11 = load i32, i32* @DetectKanjiCode.whatcode
%12 = icmp eq i32 %11, 7
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* @DetectKanjiCode.whatcode
%15 = icmp eq i32 %14, 8
br i1 %15, label %16, label %19
16: ; preds = %13, %10
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 0
br label %19
19: ; preds = %16, %13
%20 = phi i1 [ false, %13 ], [ %18, %16 ]
br i1 %20, label %21, label %274
21: ; preds = %19
%22 = load i8*, i8** %2
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
%25 = sext i32 %23 to i64
%26 = getelementptr inbounds i8, i8* %22, i64 %25
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
store i32 %28, i32* %3
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %273
30: ; preds = %21
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 27
br i1 %32, label %33, label %82
33: ; preds = %30
%34 = load i8*, i8** %2
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
%37 = sext i32 %35 to i64
%38 = getelementptr inbounds i8, i8* %34, i64 %37
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
store i32 %40, i32* %3
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, 36
br i1 %42, label %43, label %60
43: ; preds = %33
%44 = load i8*, i8** %2
%45 = load i32, i32* %4
%46 = add nsw i32 %45, 1
store i32 %46, i32* %4
%47 = sext i32 %45 to i64
%48 = getelementptr inbounds i8, i8* %44, i64 %47
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
store i32 %50, i32* %3
%51 = load i32, i32* %3
%52 = icmp eq i32 %51, 66
br i1 %52, label %53, label %54
53: ; preds = %43
store i32 1, i32* @DetectKanjiCode.whatcode
br label %59
54: ; preds = %43
%55 = load i32, i32* %3
%56 = icmp eq i32 %55, 64
br i1 %56, label %57, label %58
57: ; preds = %54
store i32 2, i32* @DetectKanjiCode.whatcode
br label %58
58: ; preds = %57, %54
br label %59
59: ; preds = %58, %53
br label %81
60: ; preds = %33
%61 = load i32, i32* %3
%62 = icmp eq i32 %61, 40
br i1 %62, label %63, label %75
63: ; preds = %60
%64 = load i8*, i8** %2
%65 = load i32, i32* %4
%66 = add nsw i32 %65, 1
store i32 %66, i32* %4
%67 = sext i32 %65 to i64
%68 = getelementptr inbounds i8, i8* %64, i64 %67
%69 = load i8, i8* %68
%70 = zext i8 %69 to i32
store i32 %70, i32* %3
%71 = load i32, i32* %3
%72 = icmp eq i32 %71, 73
br i1 %72, label %73, label %74
73: ; preds = %63
store i32 3, i32* @DetectKanjiCode.whatcode
br label %74
74: ; preds = %73, %63
br label %80
75: ; preds = %60
%76 = load i32, i32* %3
%77 = icmp eq i32 %76, 75
br i1 %77, label %78, label %79
78: ; preds = %75
store i32 4, i32* @DetectKanjiCode.whatcode
br label %79
79: ; preds = %78, %75
br label %80
80: ; preds = %79, %74
br label %81
81: ; preds = %80, %59
br label %272
82: ; preds = %30
%83 = load i32, i32* %3
%84 = icmp sge i32 %83, 129
br i1 %84, label %85, label %88
85: ; preds = %82
%86 = load i32, i32* %3
%87 = icmp sle i32 %86, 141
br i1 %87, label %94, label %88
88: ; preds = %85, %82
%89 = load i32, i32* %3
%90 = icmp sge i32 %89, 143
br i1 %90, label %91, label %95
91: ; preds = %88
%92 = load i32, i32* %3
%93 = icmp sle i32 %92, 159
br i1 %93, label %94, label %95
94: ; preds = %91, %85
store i32 6, i32* @DetectKanjiCode.whatcode
br label %271
95: ; preds = %91, %88
%96 = load i32, i32* %3
%97 = icmp eq i32 %96, 142
br i1 %97, label %98, label %133
98: ; preds = %95
%99 = load i8*, i8** %2
%100 = load i32, i32* %4
%101 = add nsw i32 %100, 1
store i32 %101, i32* %4
%102 = sext i32 %100 to i64
%103 = getelementptr inbounds i8, i8* %99, i64 %102
%104 = load i8, i8* %103
%105 = zext i8 %104 to i32
store i32 %105, i32* %3
%106 = load i32, i32* %3
%107 = icmp sge i32 %106, 64
br i1 %107, label %108, label %111
108: ; preds = %98
%109 = load i32, i32* %3
%110 = icmp sle i32 %109, 126
br i1 %110, label %123, label %111
111: ; preds = %108, %98
%112 = load i32, i32* %3
%113 = icmp sge i32 %112, 128
br i1 %113, label %114, label %117
114: ; preds = %111
%115 = load i32, i32* %3
%116 = icmp sle i32 %115, 160
br i1 %116, label %123, label %117
117: ; preds = %114, %111
%118 = load i32, i32* %3
%119 = icmp sge i32 %118, 224
br i1 %119, label %120, label %124
120: ; preds = %117
%121 = load i32, i32* %3
%122 = icmp sle i32 %121, 252
br i1 %122, label %123, label %124
123: ; preds = %120, %114, %108
store i32 6, i32* @DetectKanjiCode.whatcode
br label %132
124: ; preds = %120, %117
%125 = load i32, i32* %3
%126 = icmp sge i32 %125, 161
br i1 %126, label %127, label %131
127: ; preds = %124
%128 = load i32, i32* %3
%129 = icmp sle i32 %128, 223
br i1 %129, label %130, label %131
130: ; preds = %127
store i32 7, i32* @DetectKanjiCode.whatcode
br label %131
131: ; preds = %130, %127, %124
br label %132
132: ; preds = %131, %123
br label %270
133: ; preds = %95
%134 = load i32, i32* %3
%135 = icmp sge i32 %134, 161
br i1 %135, label %136, label %217
136: ; preds = %133
%137 = load i32, i32* %3
%138 = icmp sle i32 %137, 223
br i1 %138, label %139, label %217
139: ; preds = %136
%140 = load i8*, i8** %2
%141 = load i32, i32* %4
%142 = add nsw i32 %141, 1
store i32 %142, i32* %4
%143 = sext i32 %141 to i64
%144 = getelementptr inbounds i8, i8* %140, i64 %143
%145 = load i8, i8* %144
%146 = zext i8 %145 to i32
store i32 %146, i32* %3
%147 = load i32, i32* %3
%148 = icmp sge i32 %147, 240
br i1 %148, label %149, label %153
149: ; preds = %139
%150 = load i32, i32* %3
%151 = icmp sle i32 %150, 254
br i1 %151, label %152, label %153
152: ; preds = %149
store i32 5, i32* @DetectKanjiCode.whatcode
br label %216
153: ; preds = %149, %139
%154 = load i32, i32* %3
%155 = icmp sge i32 %154, 161
br i1 %155, label %156, label %160
156: ; preds = %153
%157 = load i32, i32* %3
%158 = icmp sle i32 %157, 223
br i1 %158, label %159, label %160
159: ; preds = %156
store i32 7, i32* @DetectKanjiCode.whatcode
br label %215
160: ; preds = %156, %153
%161 = load i32, i32* %3
%162 = icmp sge i32 %161, 224
br i1 %162, label %163, label %209
163: ; preds = %160
%164 = load i32, i32* %3
%165 = icmp sle i32 %164, 239
br i1 %165, label %166, label %209
166: ; preds = %163
store i32 7, i32* @DetectKanjiCode.whatcode
br label %167
167: ; preds = %200, %166
%168 = load i32, i32* %3
%169 = icmp sge i32 %168, 64
br i1 %169, label %170, label %176
170: ; preds = %167
%171 = load i32, i32* %3
%172 = icmp ne i32 %171, 0
br i1 %172, label %173, label %176
173: ; preds = %170
%174 = load i32, i32* @DetectKanjiCode.whatcode
%175 = icmp eq i32 %174, 7
br label %176
176: ; preds = %173, %170, %167
%177 = phi i1 [ false, %170 ], [ false, %167 ], [ %175, %173 ]
br i1 %177, label %178, label %208
178: ; preds = %176
%179 = load i32, i32* %3
%180 = icmp sge i32 %179, 129
br i1 %180, label %181, label %200
181: ; preds = %178
%182 = load i32, i32* %3
%183 = icmp sle i32 %182, 141
br i1 %183, label %190, label %184
184: ; preds = %181
%185 = load i32, i32* %3
%186 = icmp sge i32 %185, 143
br i1 %186, label %187, label %191
187: ; preds = %184
%188 = load i32, i32* %3
%189 = icmp sle i32 %188, 159
br i1 %189, label %190, label %191
190: ; preds = %187, %181
store i32 6, i32* @DetectKanjiCode.whatcode
br label %199
191: ; preds = %187, %184
%192 = load i32, i32* %3
%193 = icmp sge i32 %192, 253
br i1 %193, label %194, label %198
194: ; preds = %191
%195 = load i32, i32* %3
%196 = icmp sle i32 %195, 254
br i1 %196, label %197, label %198
197: ; preds = %194
store i32 5, i32* @DetectKanjiCode.whatcode
br label %198
198: ; preds = %197, %194, %191
br label %199
199: ; preds = %198, %190
br label %200
200: ; preds = %199, %178
%201 = load i8*, i8** %2
%202 = load i32, i32* %4
%203 = add nsw i32 %202, 1
store i32 %203, i32* %4
%204 = sext i32 %202 to i64
%205 = getelementptr inbounds i8, i8* %201, i64 %204
%206 = load i8, i8* %205
%207 = zext i8 %206 to i32
store i32 %207, i32* %3
br label %167
208: ; preds = %176
br label %214
209: ; preds = %163, %160
%210 = load i32, i32* %3
%211 = icmp sle i32 %210, 159
br i1 %211, label %212, label %213
212: ; preds = %209
store i32 6, i32* @DetectKanjiCode.whatcode
br label %213
213: ; preds = %212, %209
br label %214
214: ; preds = %213, %208
br label %215
215: ; preds = %214, %159
br label %216
216: ; preds = %215, %152
br label %269
217: ; preds = %136, %133
%218 = load i32, i32* %3
%219 = icmp sge i32 %218, 240
br i1 %219, label %220, label %224
220: ; preds = %217
%221 = load i32, i32* %3
%222 = icmp sle i32 %221, 254
br i1 %222, label %223, label %224
223: ; preds = %220
store i32 5, i32* @DetectKanjiCode.whatcode
br label %268
224: ; preds = %220, %217
%225 = load i32, i32* %3
%226 = icmp sge i32 %225, 224
br i1 %226, label %227, label %267
227: ; preds = %224
%228 = load i32, i32* %3
%229 = icmp sle i32 %228, 239
br i1 %229, label %230, label %267
230: ; preds = %227
%231 = load i8*, i8** %2
%232 = load i32, i32* %4
%233 = add nsw i32 %232, 1
store i32 %233, i32* %4
%234 = sext i32 %232 to i64
%235 = getelementptr inbounds i8, i8* %231, i64 %234
%236 = load i8, i8* %235
%237 = zext i8 %236 to i32
store i32 %237, i32* %3
%238 = load i32, i32* %3
%239 = icmp sge i32 %238, 64
br i1 %239, label %240, label %243
240: ; preds = %230
%241 = load i32, i32* %3
%242 = icmp sle i32 %241, 126
br i1 %242, label %249, label %243
243: ; preds = %240, %230
%244 = load i32, i32* %3
%245 = icmp sge i32 %244, 128
br i1 %245, label %246, label %250
246: ; preds = %243
%247 = load i32, i32* %3
%248 = icmp sle i32 %247, 160
br i1 %248, label %249, label %250
249: ; preds = %246, %240
store i32 6, i32* @DetectKanjiCode.whatcode
br label %266
250: ; preds = %246, %243
%251 = load i32, i32* %3
%252 = icmp sge i32 %251, 253
br i1 %252, label %253, label %257
253: ; preds = %250
%254 = load i32, i32* %3
%255 = icmp sge i32 %254, 254
br i1 %255, label %256, label %257
256: ; preds = %253
store i32 5, i32* @DetectKanjiCode.whatcode
br label %265
257: ; preds = %253, %250
%258 = load i32, i32* %3
%259 = icmp sge i32 %258, 161
br i1 %259, label %260, label %264
260: ; preds = %257
%261 = load i32, i32* %3
%262 = icmp sle i32 %261, 252
br i1 %262, label %263, label %264
263: ; preds = %260
store i32 7, i32* @DetectKanjiCode.whatcode
br label %264
264: ; preds = %263, %260, %257
br label %265
265: ; preds = %264, %256
br label %266
266: ; preds = %265, %249
br label %267
267: ; preds = %266, %227, %224
br label %268
268: ; preds = %267, %223
br label %269
269: ; preds = %268, %216
br label %270
270: ; preds = %269, %132
br label %271
271: ; preds = %270, %94
br label %272
272: ; preds = %271, %81
br label %273
273: ; preds = %272, %21
br label %10
274: ; preds = %19
%275 = load i32, i32* @DetectKanjiCode.whatcode
%276 = icmp eq i32 %275, 7
br i1 %276, label %277, label %318
277: ; preds = %274
%278 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%279 = icmp ne i8* %278, null
br i1 %279, label %280, label %282
280: ; preds = %277
%281 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* %281, i8** %5
br label %294
282: ; preds = %277
%283 = call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%284 = icmp ne i8* %283, null
br i1 %284, label %285, label %287
285: ; preds = %282
%286 = call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i8* %286, i8** %5
br label %293
287: ; preds = %282
%288 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%289 = icmp ne i8* %288, null
br i1 %289, label %290, label %292
290: ; preds = %287
%291 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i8* %291, i8** %5
br label %292
292: ; preds = %290, %287
br label %293
293: ; preds = %292, %285
br label %294
294: ; preds = %293, %280
%295 = load i8*, i8** %5
%296 = icmp ne i8* %295, null
br i1 %296, label %297, label %317
297: ; preds = %294
%298 = load i8*, i8** %5
%299 = call i64 @strcmp(i8* %298, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%300 = icmp eq i64 %299, 0
br i1 %300, label %309, label %301
301: ; preds = %297
%302 = load i8*, i8** %5
%303 = call i64 @strcmp(i8* %302, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%304 = icmp eq i64 %303, 0
br i1 %304, label %309, label %305
305: ; preds = %301
%306 = load i8*, i8** %5
%307 = call i64 @strcmp(i8* %306, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%308 = icmp eq i64 %307, 0
br i1 %308, label %309, label %310
309: ; preds = %305, %301, %297
store i32 6, i32* @DetectKanjiCode.whatcode
br label %316
310: ; preds = %305
%311 = load i8*, i8** %5
%312 = call i64 @strncmp(i8* %311, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%313 = icmp eq i64 %312, 0
br i1 %313, label %314, label %315
314: ; preds = %310
store i32 5, i32* @DetectKanjiCode.whatcode
br label %315
315: ; preds = %314, %310
br label %316
316: ; preds = %315, %309
br label %317
317: ; preds = %316, %294
br label %318
318: ; preds = %317, %274
%319 = load i32, i32* @DetectKanjiCode.whatcode
%320 = icmp eq i32 %319, 7
br i1 %320, label %321, label %322
321: ; preds = %318
store i32 5, i32* @DetectKanjiCode.whatcode
br label %322
322: ; preds = %321, %318
%323 = load i32, i32* @DetectKanjiCode.whatcode
ret i32 %323
}

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