#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 char2byte(char);
char *strtok(int /*<<< orphan*/ *, char *);
unsigned short parse_LD() {
  unsigned short instruction = 0x0000;
  char *arg;
  arg = strtok(NULL, " ,");
  switch (arg[0]) {
  case 'V':
    instruction |= (char2byte(arg[1]) & 0x0F) << 8;
    arg = strtok(NULL, " ,");
    switch (arg[0]) {
    case 'V':
      instruction |= 0x8000;
      instruction |= (char2byte(arg[1]) & 0x0F) << 4;
      break;
    case 'D':
      instruction |= 0xF007;
      break;
    case 'K':
      instruction |= 0xF00A;
      break;
    case '[':
      instruction |= 0xF065;
      break;
    default:
      instruction |= 0x6000;
      instruction |= (char2byte(arg[0]) & 0x0F) << 4;
      instruction |= (char2byte(arg[1]) & 0x0F) << 0;
    }
    break;
  case 'I':
    instruction = 0xA000;
    arg = strtok(NULL, " ,");
    instruction |= (char2byte(arg[0]) & 0x0F) << 8;
    instruction |= (char2byte(arg[1]) & 0x0F) << 4;
    instruction |= (char2byte(arg[2]) & 0x0F) << 0;
    break;
  case 'D':
    instruction |= 0xF015;
    arg = strtok(NULL, " ,");
    instruction |= (char2byte(arg[1]) & 0x0F) << 8;
    break;
  case 'S':
    instruction |= 0xF018;
    arg = strtok(NULL, " ,");
    instruction |= (char2byte(arg[1]) & 0x0F) << 8;
    break;
  case 'F':
    instruction |= 0xF029;
    arg = strtok(NULL, " ,");
    instruction |= (char2byte(arg[1]) & 0x0F) << 8;
    break;
  case 'B':
    instruction |= 0xF033;
    arg = strtok(NULL, " ,");
    instruction |= (char2byte(arg[1]) & 0x0F) << 8;
    break;
  case '[':
    instruction |= 0xF055;
    arg = strtok(NULL, " ,");
    instruction |= (char2byte(arg[1]) & 0x0F) << 8;
    break;
  default:
    return 0xFFFF;
  }
  return instruction;
}


x86 assembly (clang, -O0):
<parse_LD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movw   $0x0,-0x4(%rbp)
lea    0xf93(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffbe,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x19,%eax
ja     1459 <parse_LD+0x339>
mov    -0x18(%rbp),%rax
lea    0xe9a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ecx
and    $0xf,%ecx
shl    $0x8,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
lea    0xf33(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffbc,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x17,%eax
ja     1236 <parse_LD+0x116>
mov    -0x20(%rbp),%rax
lea    0xea2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movzwl -0x4(%rbp),%eax
or     $0x8000,%eax
mov    %ax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ecx
and    $0xf,%ecx
shl    $0x4,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
jmp    1280 <parse_LD+0x160>
movzwl -0x4(%rbp),%eax
or     $0xf007,%eax
mov    %ax,-0x4(%rbp)
jmp    1280 <parse_LD+0x160>
movzwl -0x4(%rbp),%eax
or     $0xf00a,%eax
mov    %ax,-0x4(%rbp)
jmp    1280 <parse_LD+0x160>
movzwl -0x4(%rbp),%eax
or     $0xf065,%eax
mov    %ax,-0x4(%rbp)
jmp    1280 <parse_LD+0x160>
movzwl -0x4(%rbp),%eax
or     $0x6000,%eax
mov    %ax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ecx
and    $0xf,%ecx
shl    $0x4,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ecx
and    $0xf,%ecx
shl    $0x0,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
jmp    1464 <parse_LD+0x344>
movw   $0xa000,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe32(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ecx
and    $0xf,%ecx
shl    $0x8,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ecx
and    $0xf,%ecx
shl    $0x4,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ecx
and    $0xf,%ecx
shl    $0x0,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
jmp    1464 <parse_LD+0x344>
movzwl -0x4(%rbp),%eax
or     $0xf015,%eax
mov    %ax,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xdb0(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ecx
and    $0xf,%ecx
shl    $0x8,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
jmp    1464 <parse_LD+0x344>
movzwl -0x4(%rbp),%eax
or     $0xf018,%eax
mov    %ax,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xd6b(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ecx
and    $0xf,%ecx
shl    $0x8,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
jmp    1464 <parse_LD+0x344>
movzwl -0x4(%rbp),%eax
or     $0xf029,%eax
mov    %ax,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xd26(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ecx
and    $0xf,%ecx
shl    $0x8,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
jmp    1464 <parse_LD+0x344>
movzwl -0x4(%rbp),%eax
or     $0xf033,%eax
mov    %ax,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xce1(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ecx
and    $0xf,%ecx
shl    $0x8,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
jmp    1464 <parse_LD+0x344>
movzwl -0x4(%rbp),%eax
or     $0xf055,%eax
mov    %ax,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc9c(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ecx
and    $0xf,%ecx
shl    $0x8,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
jmp    1464 <parse_LD+0x344>
movw   $0xffff,-0x2(%rbp)
jmp    146c <parse_LD+0x34c>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_LD>:
push   %rbp
push   %r14
push   %rbx
lea    0xf9d(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
movsbl (%rax),%ecx
mov    $0xffff,%bx
add    $0xffffffbe,%ecx
cmp    $0x19,%ecx
ja     12a7 <parse_LD+0x187>
lea    0xeb4(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf6c(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
or     $0xf033,%ebx
jmp    12a7 <parse_LD+0x187>
lea    0xf45(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
or     $0xf015,%ebx
jmp    12a7 <parse_LD+0x187>
lea    0xf1e(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
or     $0xf029,%ebx
jmp    12a7 <parse_LD+0x187>
lea    0xef7(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
mov    %rax,%r14
movsbl (%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ebp
and    $0xf,%ebp
shl    $0x8,%ebp
movsbl 0x1(%r14),%edi
call   1030 <char2byte@plt>
shl    $0x4,%eax
movzbl %al,%ebx
or     %ebp,%ebx
movsbl 0x2(%r14),%edi
call   1030 <char2byte@plt>
and    $0xf,%eax
add    %eax,%ebx
add    $0xa000,%ebx
jmp    12a7 <parse_LD+0x187>
lea    0xeaa(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
or     $0xf018,%ebx
jmp    12a7 <parse_LD+0x187>
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
mov    %ebx,%ebp
and    $0xf00,%ebp
lea    0xe70(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
mov    %rax,%r14
movsbl (%rax),%eax
lea    -0x44(%rax),%ecx
cmp    $0x17,%ecx
ja     12db <parse_LD+0x1bb>
lea    0xdf4(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
or     $0xf007,%ebx
jmp    12a7 <parse_LD+0x187>
lea    0xe3c(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
movsbl 0x1(%rax),%edi
call   1030 <char2byte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
or     $0xf055,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
or     $0xf00a,%ebx
jmp    12a7 <parse_LD+0x187>
movsbl 0x1(%r14),%edi
call   1030 <char2byte@plt>
shl    $0x4,%eax
movzbl %al,%eax
movzwl %bp,%ebx
or     %eax,%ebx
or     $0x8000,%ebx
jmp    12a7 <parse_LD+0x187>
or     $0xf065,%ebx
jmp    12a7 <parse_LD+0x187>
movsbl %al,%edi
call   1030 <char2byte@plt>
shl    $0x4,%eax
movzbl %al,%eax
movzwl %bp,%ebp
or     %eax,%ebp
movsbl 0x1(%r14),%edi
call   1030 <char2byte@plt>
mov    %eax,%ebx
and    $0xf,%ebx
or     %ebp,%ebx
or     $0x6000,%ebx
jmp    12a7 <parse_LD+0x187>

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

LLVM IR (-O2):
@.str = [3 x i8] c" ,\00"
define zeroext i16 @parse_LD() {
%1 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
switch i32 %3, label %101 [
i32 86, label %4
i32 73, label %42
i32 68, label %61
i32 83, label %69
i32 70, label %77
i32 66, label %85
i32 91, label %93
]
4: ; preds = %0
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = load i8, i8* %5
%7 = tail call i32 @char2byte(i8 signext %6)
%8 = trunc i32 %7 to i16
%9 = shl i16 %8, 8
%10 = and i16 %9, 3840
%11 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
switch i32 %13, label %29 [
i32 86, label %14
i32 68, label %23
i32 75, label %25
i32 91, label %27
]
14: ; preds = %4
%15 = getelementptr inbounds i8, i8* %11, i64 1
%16 = load i8, i8* %15
%17 = tail call i32 @char2byte(i8 signext %16)
%18 = trunc i32 %17 to i16
%19 = shl i16 %18, 4
%20 = and i16 %19, 240
%21 = or i16 %10, %20
%22 = or i16 %21, -32768
br label %101
23: ; preds = %4
%24 = or i16 %9, -4089
br label %101
25: ; preds = %4
%26 = or i16 %9, -4086
br label %101
27: ; preds = %4
%28 = or i16 %9, -3995
br label %101
29: ; preds = %4
%30 = tail call i32 @char2byte(i8 signext %12)
%31 = trunc i32 %30 to i16
%32 = shl i16 %31, 4
%33 = and i16 %32, 240
%34 = or i16 %10, %33
%35 = getelementptr inbounds i8, i8* %11, i64 1
%36 = load i8, i8* %35
%37 = tail call i32 @char2byte(i8 signext %36)
%38 = trunc i32 %37 to i16
%39 = and i16 %38, 15
%40 = or i16 %34, %39
%41 = or i16 %40, 24576
br label %101
42: ; preds = %0
%43 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%44 = load i8, i8* %43
%45 = tail call i32 @char2byte(i8 signext %44)
%46 = shl i32 %45, 8
%47 = and i32 %46, 3840
%48 = getelementptr inbounds i8, i8* %43, i64 1
%49 = load i8, i8* %48
%50 = tail call i32 @char2byte(i8 signext %49)
%51 = shl i32 %50, 4
%52 = and i32 %51, 240
%53 = or i32 %52, %47
%54 = getelementptr inbounds i8, i8* %43, i64 2
%55 = load i8, i8* %54
%56 = tail call i32 @char2byte(i8 signext %55)
%57 = and i32 %56, 15
%58 = or i32 %53, %57
%59 = trunc i32 %58 to i16
%60 = or i16 %59, -24576
br label %101
61: ; preds = %0
%62 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%63 = getelementptr inbounds i8, i8* %62, i64 1
%64 = load i8, i8* %63
%65 = tail call i32 @char2byte(i8 signext %64)
%66 = trunc i32 %65 to i16
%67 = shl i16 %66, 8
%68 = or i16 %67, -4075
br label %101
69: ; preds = %0
%70 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%71 = getelementptr inbounds i8, i8* %70, i64 1
%72 = load i8, i8* %71
%73 = tail call i32 @char2byte(i8 signext %72)
%74 = trunc i32 %73 to i16
%75 = shl i16 %74, 8
%76 = or i16 %75, -4072
br label %101
77: ; preds = %0
%78 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%79 = getelementptr inbounds i8, i8* %78, i64 1
%80 = load i8, i8* %79
%81 = tail call i32 @char2byte(i8 signext %80)
%82 = trunc i32 %81 to i16
%83 = shl i16 %82, 8
%84 = or i16 %83, -4055
br label %101
85: ; preds = %0
%86 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%87 = getelementptr inbounds i8, i8* %86, i64 1
%88 = load i8, i8* %87
%89 = tail call i32 @char2byte(i8 signext %88)
%90 = trunc i32 %89 to i16
%91 = shl i16 %90, 8
%92 = or i16 %91, -4045
br label %101
93: ; preds = %0
%94 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%95 = getelementptr inbounds i8, i8* %94, i64 1
%96 = load i8, i8* %95
%97 = tail call i32 @char2byte(i8 signext %96)
%98 = trunc i32 %97 to i16
%99 = shl i16 %98, 8
%100 = or i16 %99, -4011
br label %101
101: ; preds = %42, %61, %69, %77, %85, %93, %29, %27, %25, %23, %14, %0
%102 = phi i16 [ -1, %0 ], [ %100, %93 ], [ %92, %85 ], [ %84, %77 ], [ %76, %69 ], [ %68, %61 ], [ %60, %42 ], [ %41, %29 ], [ %28, %27 ], [ %26, %25 ], [ %24, %23 ], [ %22, %14 ]
ret i16 %102
}