void build_name_chanid(s0, name, comp) char *s0, *name, *comp;
{
  int l1, l2;
  char r1[9], s2[9], name8[9];
  strncpy(name8, s0, 8);
  name8[8] = 0;
  csplitstring(name8, r1, s2, ' ');
  l1 = strlen(r1);
  l2 = strlen(s2);
  if (l2 < 3) {
    if (s2[0] == 'S') {
      comp[0] = 'S';
      comp[1] = 'H';
      switch (s2[1]) {
      case 'S': {
        comp[1] = 'L';
        comp[2] = 'Z';
        break;
      }
      case 'M': {
        comp[1] = 'M';
        comp[2] = 'Z';
        break;
      }
      case 'G': {
        comp[1] = 'R';
        comp[2] = 'Z';
        break;
      }
      default: {
        comp[1] = 'H';
        comp[2] = s2[1];
      }
      }
    }
    if (s2[0] == 'B') {
      comp[0] = 'B';
      comp[1] = 'H';
      comp[2] = s2[1];
    }
    if (s2[0] == 'H') {
      comp[0] = 'H';
      comp[1] = 'H';
      comp[2] = s2[1];
    }
    if (s2[0] == 'L') {
      comp[0] = 'L';
      comp[1] = 'H';
      comp[2] = s2[1];
    }
    if (s2[0] == 'A') {
      comp[0] = 'S';
      comp[1] = 'G';
      comp[2] = s2[1];
    }
    comp[3] = 0;
    if (!strncmp(s2, "TC", 2)) {
      comp[0] = 'A';
      comp[1] = r1[0];
      comp[2] = ' ';
      comp[3] = 0;
    }
    if (l2 == 0) {
      comp[0] = 'A';
      if (l1 > 4) {
        if (strncmp(&r1[4], "TC", 2) == 0) {
          r1[4] = 0;
          strcpy(comp, "AD ");
        } else {
          strncpy(comp, &r1[5], 3);
          r1[5] = 0;
          if (strlen(comp) < 3) {
            comp[2] = comp[1];
            if (comp[2] != 'S')
              comp[1] = 'H';
            else {
              comp[1] = 'L';
              comp[2] = 'Z';
            }
          }
        }
      } else {
        comp[0] = 'A';
        if (strncmp(r1, "DCF", 3) == 0)
          comp[1] = 'D';
        if (strncmp(r1, "INT", 3) == 0)
          comp[1] = 'I';
        comp[2] = ' ';
      }
    }
    comp[3] = 0;
    strcpy(name, r1);
  } else {
    strcpy(name, r1);
    strcpy(comp, s2);
  }
}


x86 assembly (clang, -O0):
<build_name_chanid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x3b(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x33(%rbp)
lea    -0x3b(%rbp),%rdi
lea    -0x29(%rbp),%rsi
lea    -0x32(%rbp),%rdx
mov    $0x20,%ecx
mov    $0x0,%al
call   1070 <csplitstring@plt>
lea    -0x29(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x32(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    1484 <build_name_chanid+0x334>
movsbl -0x32(%rbp),%eax
cmp    $0x53,%eax
jne    125d <build_name_chanid+0x10d>
mov    -0x18(%rbp),%rax
movb   $0x53,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x48,0x1(%rax)
movsbl -0x31(%rbp),%eax
mov    %eax,-0x40(%rbp)
sub    $0x47,%eax
je     1231 <build_name_chanid+0xe1>
jmp    11e5 <build_name_chanid+0x95>
mov    -0x40(%rbp),%eax
sub    $0x4d,%eax
je     121c <build_name_chanid+0xcc>
jmp    11f6 <build_name_chanid+0xa6>
mov    -0x40(%rbp),%eax
sub    $0x53,%eax
jne    1246 <build_name_chanid+0xf6>
jmp    1207 <build_name_chanid+0xb7>
mov    -0x18(%rbp),%rax
movb   $0x4c,0x1(%rax)
mov    -0x18(%rbp),%rax
movb   $0x5a,0x2(%rax)
jmp    1258 <build_name_chanid+0x108>
mov    -0x18(%rbp),%rax
movb   $0x4d,0x1(%rax)
mov    -0x18(%rbp),%rax
movb   $0x5a,0x2(%rax)
jmp    1258 <build_name_chanid+0x108>
mov    -0x18(%rbp),%rax
movb   $0x52,0x1(%rax)
mov    -0x18(%rbp),%rax
movb   $0x5a,0x2(%rax)
jmp    1258 <build_name_chanid+0x108>
mov    -0x18(%rbp),%rax
movb   $0x48,0x1(%rax)
mov    -0x31(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
jmp    125d <build_name_chanid+0x10d>
movsbl -0x32(%rbp),%eax
cmp    $0x42,%eax
jne    1283 <build_name_chanid+0x133>
mov    -0x18(%rbp),%rax
movb   $0x42,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x48,0x1(%rax)
mov    -0x31(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
movsbl -0x32(%rbp),%eax
cmp    $0x48,%eax
jne    12a9 <build_name_chanid+0x159>
mov    -0x18(%rbp),%rax
movb   $0x48,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x48,0x1(%rax)
mov    -0x31(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
movsbl -0x32(%rbp),%eax
cmp    $0x4c,%eax
jne    12cf <build_name_chanid+0x17f>
mov    -0x18(%rbp),%rax
movb   $0x4c,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x48,0x1(%rax)
mov    -0x31(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
movsbl -0x32(%rbp),%eax
cmp    $0x41,%eax
jne    12f5 <build_name_chanid+0x1a5>
mov    -0x18(%rbp),%rax
movb   $0x53,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x47,0x1(%rax)
mov    -0x31(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,0x3(%rax)
lea    -0x32(%rbp),%rdi
lea    0xcf8(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    133c <build_name_chanid+0x1ec>
mov    -0x18(%rbp),%rax
movb   $0x41,(%rax)
mov    -0x29(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
movb   $0x20,0x2(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,0x3(%rax)
cmpl   $0x0,-0x20(%rbp)
jne    146a <build_name_chanid+0x31a>
mov    -0x18(%rbp),%rax
movb   $0x41,(%rax)
cmpl   $0x4,-0x1c(%rbp)
jle    140a <build_name_chanid+0x2ba>
lea    -0x29(%rbp),%rdi
add    $0x4,%rdi
lea    0xc9a(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1392 <build_name_chanid+0x242>
movb   $0x0,-0x25(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xc7b(%rip),%rsi
call   1050 <strcpy@plt>
jmp    1405 <build_name_chanid+0x2b5>
mov    -0x18(%rbp),%rdi
lea    -0x29(%rbp),%rsi
add    $0x5,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x3,%rax
jae    1400 <build_name_chanid+0x2b0>
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x53,%eax
je     13eb <build_name_chanid+0x29b>
mov    -0x18(%rbp),%rax
movb   $0x48,0x1(%rax)
jmp    13fb <build_name_chanid+0x2ab>
mov    -0x18(%rbp),%rax
movb   $0x4c,0x1(%rax)
mov    -0x18(%rbp),%rax
movb   $0x5a,0x2(%rax)
jmp    1400 <build_name_chanid+0x2b0>
jmp    1405 <build_name_chanid+0x2b5>
jmp    1465 <build_name_chanid+0x315>
mov    -0x18(%rbp),%rax
movb   $0x41,(%rax)
lea    -0x29(%rbp),%rdi
lea    0xbeb(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1437 <build_name_chanid+0x2e7>
mov    -0x18(%rbp),%rax
movb   $0x44,0x1(%rax)
lea    -0x29(%rbp),%rdi
lea    0xbc9(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    145d <build_name_chanid+0x30d>
mov    -0x18(%rbp),%rax
movb   $0x49,0x1(%rax)
mov    -0x18(%rbp),%rax
movb   $0x20,0x2(%rax)
jmp    146a <build_name_chanid+0x31a>
mov    -0x18(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x29(%rbp),%rsi
call   1050 <strcpy@plt>
jmp    149e <build_name_chanid+0x34e>
mov    -0x10(%rbp),%rdi
lea    -0x29(%rbp),%rsi
call   1050 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    -0x32(%rbp),%rsi
call   1050 <strcpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_name_chanid>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%rsi
lea    0x17(%rsp),%r15
mov    $0x8,%edx
mov    %r15,%rdi
call   1030 <strncpy@plt>
movb   $0x0,0x1f(%rsp)
lea    0x5(%rsp),%rbx
lea    0xe(%rsp),%r13
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    $0x20,%ecx
xor    %eax,%eax
call   1060 <csplitstring@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rax,%r15
mov    %r13,%rdi
call   1050 <strlen@plt>
cmp    $0x2,%eax
jg     11cc <build_name_chanid+0x8c>
mov    0xe(%rsp),%cl
add    $0xbf,%cl
cmp    $0x12,%cl
ja     1208 <build_name_chanid+0xc8>
movzbl %cl,%ecx
lea    0xe46(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
movw   $0x4753,(%r12)
jmp    11ff <build_name_chanid+0xbf>
lea    0x5(%rsp),%rsi
mov    %r14,%rdi
call   1040 <strcpy@plt>
lea    0xe(%rsp),%rsi
mov    %r12,%rdi
jmp    1356 <build_name_chanid+0x216>
movw   $0x4842,(%r12)
jmp    11ff <build_name_chanid+0xbf>
movw   $0x4848,(%r12)
jmp    11ff <build_name_chanid+0xbf>
movw   $0x484c,(%r12)
mov    0xf(%rsp),%cl
mov    %cl,0x2(%r12)
movb   $0x0,0x3(%r12)
movzwl 0xe(%rsp),%ecx
cmp    $0x4354,%ecx
je     1225 <build_name_chanid+0xe5>
test   %eax,%eax
jne    1348 <build_name_chanid+0x208>
jmp    1241 <build_name_chanid+0x101>
movb   $0x41,(%r12)
mov    0x5(%rsp),%cl
mov    %cl,0x1(%r12)
movb   $0x20,0x2(%r12)
test   %eax,%eax
jne    1348 <build_name_chanid+0x208>
movb   $0x41,(%r12)
cmp    $0x5,%r15d
jl     12a4 <build_name_chanid+0x164>
movzwl 0x9(%rsp),%eax
cmp    $0x4354,%eax
je     130e <build_name_chanid+0x1ce>
lea    0xa(%rsp),%rsi
mov    $0x3,%edx
mov    %r12,%rdi
call   1030 <strncpy@plt>
movb   $0x0,0xa(%rsp)
mov    %r12,%rdi
call   1050 <strlen@plt>
cmp    $0x2,%rax
ja     1348 <build_name_chanid+0x208>
mov    0x1(%r12),%al
mov    %al,0x2(%r12)
cmp    $0x53,%al
jne    1342 <build_name_chanid+0x202>
movw   $0x5a4c,0x1(%r12)
5a
jmp    1348 <build_name_chanid+0x208>
movzwl 0x5(%rsp),%eax
xor    $0x4344,%eax
movzbl 0x7(%rsp),%ecx
xor    $0x46,%ecx
or     %ax,%cx
jne    12c1 <build_name_chanid+0x181>
movb   $0x44,0x1(%r12)
movzwl 0x5(%rsp),%eax
xor    $0x4e49,%eax
movzbl 0x7(%rsp),%ecx
xor    $0x54,%ecx
or     %ax,%cx
jne    12de <build_name_chanid+0x19e>
movb   $0x49,0x1(%r12)
movb   $0x20,0x2(%r12)
jmp    1348 <build_name_chanid+0x208>
movb   $0x53,(%r12)
mov    0xf(%rsp),%cl
movsbl %cl,%edx
cmp    $0x47,%edx
je     131d <build_name_chanid+0x1dd>
cmp    $0x4d,%edx
je     132a <build_name_chanid+0x1ea>
cmp    $0x53,%edx
jne    1337 <build_name_chanid+0x1f7>
movb   $0x4c,0x1(%r12)
mov    $0x5a,%cl
jmp    1203 <build_name_chanid+0xc3>
movb   $0x0,0x9(%rsp)
movl   $0x204441,(%r12)
jmp    1348 <build_name_chanid+0x208>
movb   $0x52,0x1(%r12)
mov    $0x5a,%cl
jmp    1203 <build_name_chanid+0xc3>
movb   $0x4d,0x1(%r12)
mov    $0x5a,%cl
jmp    1203 <build_name_chanid+0xc3>
movb   $0x48,0x1(%r12)
jmp    1203 <build_name_chanid+0xc3>
movb   $0x48,0x1(%r12)
movb   $0x0,0x3(%r12)
lea    0x5(%rsp),%rsi
mov    %r14,%rdi
call   1040 <strcpy@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"TC\00"
@.str.1 = [4 x i8] c"AD \00"
@.str.2 = [4 x i8] c"DCF\00"
@.str.3 = [4 x i8] c"INT\00"
define void @build_name_chanid(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [9 x i8]
%10 = alloca [9 x i8]
%11 = alloca [9 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 0
%13 = load i8*, i8** %4
%14 = call i8* @strncpy(i8* %12, i8* %13, i64 8)
%15 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 8
store i8 0, i8* %15
%16 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 0
%17 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 0
%18 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%19 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @csplitstring to i32 (i8*, i8*, i8*, i32, ...)*)(i8* %16, i8* %17, i8* %18, i32 32)
%20 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 0
%21 = call i64 @strlen(i8* %20)
%22 = trunc i64 %21 to i32
store i32 %22, i32* %7
%23 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%24 = call i64 @strlen(i8* %23)
%25 = trunc i64 %24 to i32
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = icmp slt i32 %26, 3
br i1 %27, label %28, label %209
28: ; preds = %3
%29 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 83
br i1 %32, label %33, label %64
33: ; preds = %28
%34 = load i8*, i8** %6
%35 = getelementptr inbounds i8, i8* %34, i64 0
store i8 83, i8* %35
%36 = load i8*, i8** %6
%37 = getelementptr inbounds i8, i8* %36, i64 1
store i8 72, i8* %37
%38 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 1
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
switch i32 %40, label %56 [
i32 83, label %41
i32 77, label %46
i32 71, label %51
]
41: ; preds = %33
%42 = load i8*, i8** %6
%43 = getelementptr inbounds i8, i8* %42, i64 1
store i8 76, i8* %43
%44 = load i8*, i8** %6
%45 = getelementptr inbounds i8, i8* %44, i64 2
store i8 90, i8* %45
br label %63
46: ; preds = %33
%47 = load i8*, i8** %6
%48 = getelementptr inbounds i8, i8* %47, i64 1
store i8 77, i8* %48
%49 = load i8*, i8** %6
%50 = getelementptr inbounds i8, i8* %49, i64 2
store i8 90, i8* %50
br label %63
51: ; preds = %33
%52 = load i8*, i8** %6
%53 = getelementptr inbounds i8, i8* %52, i64 1
store i8 82, i8* %53
%54 = load i8*, i8** %6
%55 = getelementptr inbounds i8, i8* %54, i64 2
store i8 90, i8* %55
br label %63
56: ; preds = %33
%57 = load i8*, i8** %6
%58 = getelementptr inbounds i8, i8* %57, i64 1
store i8 72, i8* %58
%59 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 1
%60 = load i8, i8* %59
%61 = load i8*, i8** %6
%62 = getelementptr inbounds i8, i8* %61, i64 2
store i8 %60, i8* %62
br label %63
63: ; preds = %56, %51, %46, %41
br label %64
64: ; preds = %63, %28
%65 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 66
br i1 %68, label %69, label %78
69: ; preds = %64
%70 = load i8*, i8** %6
%71 = getelementptr inbounds i8, i8* %70, i64 0
store i8 66, i8* %71
%72 = load i8*, i8** %6
%73 = getelementptr inbounds i8, i8* %72, i64 1
store i8 72, i8* %73
%74 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 1
%75 = load i8, i8* %74
%76 = load i8*, i8** %6
%77 = getelementptr inbounds i8, i8* %76, i64 2
store i8 %75, i8* %77
br label %78
78: ; preds = %69, %64
%79 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 72
br i1 %82, label %83, label %92
83: ; preds = %78
%84 = load i8*, i8** %6
%85 = getelementptr inbounds i8, i8* %84, i64 0
store i8 72, i8* %85
%86 = load i8*, i8** %6
%87 = getelementptr inbounds i8, i8* %86, i64 1
store i8 72, i8* %87
%88 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 1
%89 = load i8, i8* %88
%90 = load i8*, i8** %6
%91 = getelementptr inbounds i8, i8* %90, i64 2
store i8 %89, i8* %91
br label %92
92: ; preds = %83, %78
%93 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 76
br i1 %96, label %97, label %106
97: ; preds = %92
%98 = load i8*, i8** %6
%99 = getelementptr inbounds i8, i8* %98, i64 0
store i8 76, i8* %99
%100 = load i8*, i8** %6
%101 = getelementptr inbounds i8, i8* %100, i64 1
store i8 72, i8* %101
%102 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 1
%103 = load i8, i8* %102
%104 = load i8*, i8** %6
%105 = getelementptr inbounds i8, i8* %104, i64 2
store i8 %103, i8* %105
br label %106
106: ; preds = %97, %92
%107 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%108 = load i8, i8* %107
%109 = sext i8 %108 to i32
%110 = icmp eq i32 %109, 65
br i1 %110, label %111, label %120
111: ; preds = %106
%112 = load i8*, i8** %6
%113 = getelementptr inbounds i8, i8* %112, i64 0
store i8 83, i8* %113
%114 = load i8*, i8** %6
%115 = getelementptr inbounds i8, i8* %114, i64 1
store i8 71, i8* %115
%116 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 1
%117 = load i8, i8* %116
%118 = load i8*, i8** %6
%119 = getelementptr inbounds i8, i8* %118, i64 2
store i8 %117, i8* %119
br label %120
120: ; preds = %111, %106
%121 = load i8*, i8** %6
%122 = getelementptr inbounds i8, i8* %121, i64 3
store i8 0, i8* %122
%123 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%124 = call i32 @strncmp(i8* %123, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2)
%125 = icmp ne i32 %124, 0
br i1 %125, label %137, label %126
126: ; preds = %120
%127 = load i8*, i8** %6
%128 = getelementptr inbounds i8, i8* %127, i64 0
store i8 65, i8* %128
%129 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 0
%130 = load i8, i8* %129
%131 = load i8*, i8** %6
%132 = getelementptr inbounds i8, i8* %131, i64 1
store i8 %130, i8* %132
%133 = load i8*, i8** %6
%134 = getelementptr inbounds i8, i8* %133, i64 2
store i8 32, i8* %134
%135 = load i8*, i8** %6
%136 = getelementptr inbounds i8, i8* %135, i64 3
store i8 0, i8* %136
br label %137
137: ; preds = %126, %120
%138 = load i32, i32* %8
%139 = icmp eq i32 %138, 0
br i1 %139, label %140, label %203
140: ; preds = %137
%141 = load i8*, i8** %6
%142 = getelementptr inbounds i8, i8* %141, i64 0
store i8 65, i8* %142
%143 = load i32, i32* %7
%144 = icmp sgt i32 %143, 4
br i1 %144, label %145, label %183
145: ; preds = %140
%146 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 4
%147 = call i32 @strncmp(i8* %146, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2)
%148 = icmp eq i32 %147, 0
br i1 %148, label %149, label %153
149: ; preds = %145
%150 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 4
store i8 0, i8* %150
%151 = load i8*, i8** %6
%152 = call i8* @strcpy(i8* %151, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %182
153: ; preds = %145
%154 = load i8*, i8** %6
%155 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 5
%156 = call i8* @strncpy(i8* %154, i8* %155, i64 3)
%157 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 5
store i8 0, i8* %157
%158 = load i8*, i8** %6
%159 = call i64 @strlen(i8* %158)
%160 = icmp ult i64 %159, 3
br i1 %160, label %161, label %181
161: ; preds = %153
%162 = load i8*, i8** %6
%163 = getelementptr inbounds i8, i8* %162, i64 1
%164 = load i8, i8* %163
%165 = load i8*, i8** %6
%166 = getelementptr inbounds i8, i8* %165, i64 2
store i8 %164, i8* %166
%167 = load i8*, i8** %6
%168 = getelementptr inbounds i8, i8* %167, i64 2
%169 = load i8, i8* %168
%170 = sext i8 %169 to i32
%171 = icmp ne i32 %170, 83
br i1 %171, label %172, label %175
172: ; preds = %161
%173 = load i8*, i8** %6
%174 = getelementptr inbounds i8, i8* %173, i64 1
store i8 72, i8* %174
br label %180
175: ; preds = %161
%176 = load i8*, i8** %6
%177 = getelementptr inbounds i8, i8* %176, i64 1
store i8 76, i8* %177
%178 = load i8*, i8** %6
%179 = getelementptr inbounds i8, i8* %178, i64 2
store i8 90, i8* %179
br label %180
180: ; preds = %175, %172
br label %181
181: ; preds = %180, %153
br label %182
182: ; preds = %181, %149
br label %202
183: ; preds = %140
%184 = load i8*, i8** %6
%185 = getelementptr inbounds i8, i8* %184, i64 0
store i8 65, i8* %185
%186 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 0
%187 = call i32 @strncmp(i8* %186, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 3)
%188 = icmp eq i32 %187, 0
br i1 %188, label %189, label %192
189: ; preds = %183
%190 = load i8*, i8** %6
%191 = getelementptr inbounds i8, i8* %190, i64 1
store i8 68, i8* %191
br label %192
192: ; preds = %189, %183
%193 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 0
%194 = call i32 @strncmp(i8* %193, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 3)
%195 = icmp eq i32 %194, 0
br i1 %195, label %196, label %199
196: ; preds = %192
%197 = load i8*, i8** %6
%198 = getelementptr inbounds i8, i8* %197, i64 1
store i8 73, i8* %198
br label %199
199: ; preds = %196, %192
%200 = load i8*, i8** %6
%201 = getelementptr inbounds i8, i8* %200, i64 2
store i8 32, i8* %201
br label %202
202: ; preds = %199, %182
br label %203
203: ; preds = %202, %137
%204 = load i8*, i8** %6
%205 = getelementptr inbounds i8, i8* %204, i64 3
store i8 0, i8* %205
%206 = load i8*, i8** %5
%207 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 0
%208 = call i8* @strcpy(i8* %206, i8* %207)
br label %216
209: ; preds = %3
%210 = load i8*, i8** %5
%211 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 0
%212 = call i8* @strcpy(i8* %210, i8* %211)
%213 = load i8*, i8** %6
%214 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%215 = call i8* @strcpy(i8* %213, i8* %214)
br label %216
216: ; preds = %209, %203
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"TC\00"
@.str.2 = [4 x i8] c"DCF\00"
@.str.3 = [4 x i8] c"INT\00"
define void @build_name_chanid(i8* nocapture %0, i8* %1, i8* %2) {
%4 = alloca [9 x i8]
%5 = alloca [9 x i8]
%6 = alloca [9 x i8]
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%10 = call i8* @strncpy(i8* %9, i8* dereferenceable(1) %0, i64 8)
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 8
store i8 0, i8* %11
%12 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @csplitstring to i32 (i8*, i8*, i8*, i32, ...)*)(i8* %9, i8* %7, i8* %8, i32 32)
%13 = call i64 @strlen(i8* %7)
%14 = trunc i64 %13 to i32
%15 = call i64 @strlen(i8* %8)
%16 = trunc i64 %15 to i32
%17 = icmp slt i32 %16, 3
br i1 %17, label %18, label %92
18: ; preds = %3
%19 = load i8, i8* %8
switch i8 %19, label %48 [
i8 83, label %20
i8 66, label %29
i8 72, label %33
i8 76, label %37
i8 65, label %41
]
20: ; preds = %18
store i8 83, i8* %2
%21 = getelementptr inbounds i8, i8* %2, i64 1
%22 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 1
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
switch i32 %24, label %28 [
i32 83, label %25
i32 77, label %26
i32 71, label %27
]
25: ; preds = %20
store i8 76, i8* %21
br label %45
26: ; preds = %20
store i8 77, i8* %21
br label %45
27: ; preds = %20
store i8 82, i8* %21
br label %45
28: ; preds = %20
store i8 72, i8* %21
br label %45
29: ; preds = %18
store i8 66, i8* %2
%30 = getelementptr inbounds i8, i8* %2, i64 1
store i8 72, i8* %30
%31 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 1
%32 = load i8, i8* %31
br label %45
33: ; preds = %18
store i8 72, i8* %2
%34 = getelementptr inbounds i8, i8* %2, i64 1
store i8 72, i8* %34
%35 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 1
%36 = load i8, i8* %35
br label %45
37: ; preds = %18
store i8 76, i8* %2
%38 = getelementptr inbounds i8, i8* %2, i64 1
store i8 72, i8* %38
%39 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 1
%40 = load i8, i8* %39
br label %45
41: ; preds = %18
store i8 83, i8* %2
%42 = getelementptr inbounds i8, i8* %2, i64 1
store i8 71, i8* %42
%43 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 1
%44 = load i8, i8* %43
br label %45
45: ; preds = %41, %33, %37, %29, %25, %26, %27, %28
%46 = phi i8 [ %23, %28 ], [ 90, %27 ], [ 90, %26 ], [ 90, %25 ], [ %32, %29 ], [ %40, %37 ], [ %36, %33 ], [ %44, %41 ]
%47 = getelementptr inbounds i8, i8* %2, i64 2
store i8 %46, i8* %47
br label %48
48: ; preds = %45, %18
%49 = getelementptr inbounds i8, i8* %2, i64 3
store i8 0, i8* %49
%50 = call i32 @bcmp(i8* dereferenceable(2) %8, i8* dereferenceable(2) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2)
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %48
store i8 65, i8* %2
%53 = load i8, i8* %7
%54 = getelementptr inbounds i8, i8* %2, i64 1
store i8 %53, i8* %54
%55 = getelementptr inbounds i8, i8* %2, i64 2
store i8 32, i8* %55
br label %56
56: ; preds = %52, %48
%57 = icmp eq i32 %16, 0
br i1 %57, label %58, label %90
58: ; preds = %56
store i8 65, i8* %2
%59 = icmp sgt i32 %14, 4
br i1 %59, label %60, label %78
60: ; preds = %58
%61 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 4
%62 = call i32 @bcmp(i8* dereferenceable(2) %61, i8* dereferenceable(2) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2)
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %60
store i8 0, i8* %61
%65 = bitcast i8* %2 to i32*
store i32 2114625, i32* %65
br label %90
66: ; preds = %60
%67 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 5
%68 = call i8* @strncpy(i8* %2, i8* %67, i64 3)
store i8 0, i8* %67
%69 = call i64 @strlen(i8* %2)
%70 = icmp ult i64 %69, 3
br i1 %70, label %71, label %90
71: ; preds = %66
%72 = getelementptr inbounds i8, i8* %2, i64 1
%73 = load i8, i8* %72
%74 = getelementptr inbounds i8, i8* %2, i64 2
store i8 %73, i8* %74
%75 = icmp eq i8 %73, 83
br i1 %75, label %77, label %76
76: ; preds = %71
store i8 72, i8* %72
br label %90
77: ; preds = %71
store i8 76, i8* %72
store i8 90, i8* %74
br label %90
78: ; preds = %58
%79 = call i32 @bcmp(i8* dereferenceable(3) %7, i8* dereferenceable(3) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 3)
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %83
81: ; preds = %78
%82 = getelementptr inbounds i8, i8* %2, i64 1
store i8 68, i8* %82
br label %83
83: ; preds = %81, %78
%84 = call i32 @bcmp(i8* dereferenceable(3) %7, i8* dereferenceable(3) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 3)
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %83
%87 = getelementptr inbounds i8, i8* %2, i64 1
store i8 73, i8* %87
br label %88
88: ; preds = %86, %83
%89 = getelementptr inbounds i8, i8* %2, i64 2
store i8 32, i8* %89
br label %90
90: ; preds = %88, %66, %77, %76, %64, %56
store i8 0, i8* %49
%91 = call i8* @strcpy(i8* dereferenceable(1) %1, i8* %7)
br label %95
92: ; preds = %3
%93 = call i8* @strcpy(i8* dereferenceable(1) %1, i8* %7)
%94 = call i8* @strcpy(i8* dereferenceable(1) %2, i8* %8)
br label %95
95: ; preds = %92, %90
ret void
}