#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*/ byte_copy(char *, int, char *);
int /*<<< orphan*/ case_diffs(char *, char *);
size_t scan_ulong(char *, unsigned long *);
int /*<<< orphan*/ uint16_pack_big(char *, unsigned long);
int parsetype(char *s, char type[2]) {
  unsigned long u = 0;
  if (!s[scan_ulong(s, &u)])
    uint16_pack_big(type, u);
  else if ((!case_diffs((s), ("any"))))
    byte_copy(type, 2, "\0\377");
  else if ((!case_diffs((s), ("a"))))
    byte_copy(type, 2, "\0\1");
  else if ((!case_diffs((s), ("ns"))))
    byte_copy(type, 2, "\0\2");
  else if ((!case_diffs((s), ("mx"))))
    byte_copy(type, 2, "\0\17");
  else if ((!case_diffs((s), ("ptr"))))
    byte_copy(type, 2, "\0\14");
  else if ((!case_diffs((s), ("txt"))))
    byte_copy(type, 2, "\0\20");
  else if ((!case_diffs((s), ("cname"))))
    byte_copy(type, 2, "\0\5");
  else if ((!case_diffs((s), ("soa"))))
    byte_copy(type, 2, "\0\6");
  else if ((!case_diffs((s), ("hinfo"))))
    byte_copy(type, 2, "\0\15");
  else if ((!case_diffs((s), ("rp"))))
    byte_copy(type, 2, "\0\21");
  else if ((!case_diffs((s), ("sig"))))
    byte_copy(type, 2, "\0\30");
  else if ((!case_diffs((s), ("key"))))
    byte_copy(type, 2, "\0\31");
  else if ((!case_diffs((s), ("aaaa"))))
    byte_copy(type, 2, "\0\34");
  else if ((!case_diffs((s), ("axfr"))))
    byte_copy(type, 2, "\0\374");
  else
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<parsetype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scan_ulong@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax,%rcx,1)
jne    1190 <parsetype+0x50>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <uint16_pack_big@plt>
jmp    14ac <parsetype+0x36c>
mov    -0x10(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    11c3 <parsetype+0x83>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xe7e(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    14a7 <parsetype+0x367>
mov    -0x10(%rbp),%rdi
lea    0xe62(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    11f6 <parsetype+0xb6>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xe4e(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    14a2 <parsetype+0x362>
mov    -0x10(%rbp),%rdi
lea    0xe03(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    1229 <parsetype+0xe9>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xe1e(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    149d <parsetype+0x35d>
mov    -0x10(%rbp),%rdi
lea    0xdd3(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    125c <parsetype+0x11c>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xdee(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    1498 <parsetype+0x358>
mov    -0x10(%rbp),%rdi
lea    0xda3(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    128f <parsetype+0x14f>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xdbe(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    1493 <parsetype+0x353>
mov    -0x10(%rbp),%rdi
lea    0xd74(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    12c2 <parsetype+0x182>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xd8e(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    148e <parsetype+0x34e>
mov    -0x10(%rbp),%rdi
lea    0xd45(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    12f5 <parsetype+0x1b5>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xd5e(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    1489 <parsetype+0x349>
mov    -0x10(%rbp),%rdi
lea    0xd18(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    1328 <parsetype+0x1e8>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xd2e(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    1484 <parsetype+0x344>
mov    -0x10(%rbp),%rdi
lea    0xce9(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    135b <parsetype+0x21b>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xcfe(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    147f <parsetype+0x33f>
mov    -0x10(%rbp),%rdi
lea    0xcbc(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    138e <parsetype+0x24e>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xcce(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    147a <parsetype+0x33a>
mov    -0x10(%rbp),%rdi
lea    0xc8c(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    13c1 <parsetype+0x281>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xc9e(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    1475 <parsetype+0x335>
mov    -0x10(%rbp),%rdi
lea    0xc5d(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    13f4 <parsetype+0x2b4>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xc6e(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    1470 <parsetype+0x330>
mov    -0x10(%rbp),%rdi
lea    0xc2e(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    1427 <parsetype+0x2e7>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xc3e(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    146b <parsetype+0x32b>
mov    -0x10(%rbp),%rdi
lea    0xc00(%rip),%rsi
call   1040 <case_diffs@plt>
cmp    $0x0,%eax
jne    145a <parsetype+0x31a>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
lea    0xc0e(%rip),%rdx
call   1060 <byte_copy@plt>
jmp    1466 <parsetype+0x326>
movl   $0x0,-0x4(%rbp)
jmp    14b3 <parsetype+0x373>
jmp    146b <parsetype+0x32b>
jmp    1470 <parsetype+0x330>
jmp    1475 <parsetype+0x335>
jmp    147a <parsetype+0x33a>
jmp    147f <parsetype+0x33f>
jmp    1484 <parsetype+0x344>
jmp    1489 <parsetype+0x349>
jmp    148e <parsetype+0x34e>
jmp    1493 <parsetype+0x353>
jmp    1498 <parsetype+0x358>
jmp    149d <parsetype+0x35d>
jmp    14a2 <parsetype+0x362>
jmp    14a7 <parsetype+0x367>
jmp    14ac <parsetype+0x36c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsetype>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1050 <scan_ulong@plt>
cmpb   $0x0,(%rbx,%rax,1)
je     12b6 <parsetype+0x176>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     12c7 <parsetype+0x187>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     12d0 <parsetype+0x190>
lea    0xe6b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     12d9 <parsetype+0x199>
lea    0xe57(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     12e2 <parsetype+0x1a2>
lea    0xe43(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     12eb <parsetype+0x1ab>
lea    0xe30(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     12f4 <parsetype+0x1b4>
lea    0xe1d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     12fd <parsetype+0x1bd>
lea    0xe0c(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     1306 <parsetype+0x1c6>
lea    0xdf9(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     130f <parsetype+0x1cf>
lea    0xde8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     1318 <parsetype+0x1d8>
lea    0xdd4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     1321 <parsetype+0x1e1>
lea    0xdc1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     132a <parsetype+0x1ea>
lea    0xdae(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
test   %eax,%eax
je     1333 <parsetype+0x1f3>
lea    0xd9c(%rip),%rsi
mov    %rbx,%rdi
call   1040 <case_diffs@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jne    134c <parsetype+0x20c>
lea    0xdad(%rip),%rdx
jmp    133a <parsetype+0x1fa>
mov    (%rsp),%rsi
mov    %r14,%rdi
call   1030 <uint16_pack_big@plt>
jmp    1347 <parsetype+0x207>
lea    0xd69(%rip),%rdx
jmp    133a <parsetype+0x1fa>
lea    0xd63(%rip),%rdx
jmp    133a <parsetype+0x1fa>
lea    0xd5d(%rip),%rdx
jmp    133a <parsetype+0x1fa>
lea    0xd57(%rip),%rdx
jmp    133a <parsetype+0x1fa>
lea    0xd51(%rip),%rdx
jmp    133a <parsetype+0x1fa>
lea    0xd4b(%rip),%rdx
jmp    133a <parsetype+0x1fa>
lea    0xd45(%rip),%rdx
jmp    133a <parsetype+0x1fa>
lea    0xd3f(%rip),%rdx
jmp    133a <parsetype+0x1fa>
lea    0xd39(%rip),%rdx
jmp    133a <parsetype+0x1fa>
lea    0xd33(%rip),%rdx
jmp    133a <parsetype+0x1fa>
lea    0xd2d(%rip),%rdx
jmp    133a <parsetype+0x1fa>
lea    0xd27(%rip),%rdx
jmp    133a <parsetype+0x1fa>
lea    0xd21(%rip),%rdx
mov    %r14,%rdi
mov    $0x2,%esi
call   1060 <byte_copy@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"any\00"
@.str.1 = [3 x i8] c"\00\FF\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [3 x i8] c"\00\01\00"
@.str.4 = [3 x i8] c"ns\00"
@.str.5 = [3 x i8] c"\00\02\00"
@.str.6 = [3 x i8] c"mx\00"
@.str.7 = [3 x i8] c"\00\0F\00"
@.str.8 = [4 x i8] c"ptr\00"
@.str.9 = [3 x i8] c"\00\0C\00"
@.str.10 = [4 x i8] c"txt\00"
@.str.11 = [3 x i8] c"\00\10\00"
@.str.12 = [6 x i8] c"cname\00"
@.str.13 = [3 x i8] c"\00\05\00"
@.str.14 = [4 x i8] c"soa\00"
@.str.15 = [3 x i8] c"\00\06\00"
@.str.16 = [6 x i8] c"hinfo\00"
@.str.17 = [3 x i8] c"\00\0D\00"
@.str.18 = [3 x i8] c"rp\00"
@.str.19 = [3 x i8] c"\00\11\00"
@.str.20 = [4 x i8] c"sig\00"
@.str.21 = [3 x i8] c"\00\18\00"
@.str.22 = [4 x i8] c"key\00"
@.str.23 = [3 x i8] c"\00\19\00"
@.str.24 = [5 x i8] c"aaaa\00"
@.str.25 = [3 x i8] c"\00\1C\00"
@.str.26 = [5 x i8] c"axfr\00"
@.str.27 = [3 x i8] c"\00\FC\00"
define i32 @parsetype(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 0, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i64 @scan_ulong(i8* %8, i64* %6)
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = call i32 @uint16_pack_big(i8* %14, i64 %15)
br label %130
17: ; preds = %2
%18 = load i8*, i8** %4
%19 = call i32 @case_diffs(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%20 = icmp ne i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %17
%22 = load i8*, i8** %5
%23 = call i32 @byte_copy(i8* %22, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %129
24: ; preds = %17
%25 = load i8*, i8** %4
%26 = call i32 @case_diffs(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %24
%29 = load i8*, i8** %5
%30 = call i32 @byte_copy(i8* %29, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %128
31: ; preds = %24
%32 = load i8*, i8** %4
%33 = call i32 @case_diffs(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%34 = icmp ne i32 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %31
%36 = load i8*, i8** %5
%37 = call i32 @byte_copy(i8* %36, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %127
38: ; preds = %31
%39 = load i8*, i8** %4
%40 = call i32 @case_diffs(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%41 = icmp ne i32 %40, 0
br i1 %41, label %45, label %42
42: ; preds = %38
%43 = load i8*, i8** %5
%44 = call i32 @byte_copy(i8* %43, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %126
45: ; preds = %38
%46 = load i8*, i8** %4
%47 = call i32 @case_diffs(i8* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%48 = icmp ne i32 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %45
%50 = load i8*, i8** %5
%51 = call i32 @byte_copy(i8* %50, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %125
52: ; preds = %45
%53 = load i8*, i8** %4
%54 = call i32 @case_diffs(i8* %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%55 = icmp ne i32 %54, 0
br i1 %55, label %59, label %56
56: ; preds = %52
%57 = load i8*, i8** %5
%58 = call i32 @byte_copy(i8* %57, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %124
59: ; preds = %52
%60 = load i8*, i8** %4
%61 = call i32 @case_diffs(i8* %60, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%62 = icmp ne i32 %61, 0
br i1 %62, label %66, label %63
63: ; preds = %59
%64 = load i8*, i8** %5
%65 = call i32 @byte_copy(i8* %64, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %123
66: ; preds = %59
%67 = load i8*, i8** %4
%68 = call i32 @case_diffs(i8* %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%69 = icmp ne i32 %68, 0
br i1 %69, label %73, label %70
70: ; preds = %66
%71 = load i8*, i8** %5
%72 = call i32 @byte_copy(i8* %71, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
br label %122
73: ; preds = %66
%74 = load i8*, i8** %4
%75 = call i32 @case_diffs(i8* %74, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%76 = icmp ne i32 %75, 0
br i1 %76, label %80, label %77
77: ; preds = %73
%78 = load i8*, i8** %5
%79 = call i32 @byte_copy(i8* %78, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
br label %121
80: ; preds = %73
%81 = load i8*, i8** %4
%82 = call i32 @case_diffs(i8* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
%83 = icmp ne i32 %82, 0
br i1 %83, label %87, label %84
84: ; preds = %80
%85 = load i8*, i8** %5
%86 = call i32 @byte_copy(i8* %85, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0))
br label %120
87: ; preds = %80
%88 = load i8*, i8** %4
%89 = call i32 @case_diffs(i8* %88, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0))
%90 = icmp ne i32 %89, 0
br i1 %90, label %94, label %91
91: ; preds = %87
%92 = load i8*, i8** %5
%93 = call i32 @byte_copy(i8* %92, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0))
br label %119
94: ; preds = %87
%95 = load i8*, i8** %4
%96 = call i32 @case_diffs(i8* %95, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i64 0, i64 0))
%97 = icmp ne i32 %96, 0
br i1 %97, label %101, label %98
98: ; preds = %94
%99 = load i8*, i8** %5
%100 = call i32 @byte_copy(i8* %99, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.23, i64 0, i64 0))
br label %118
101: ; preds = %94
%102 = load i8*, i8** %4
%103 = call i32 @case_diffs(i8* %102, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0))
%104 = icmp ne i32 %103, 0
br i1 %104, label %108, label %105
105: ; preds = %101
%106 = load i8*, i8** %5
%107 = call i32 @byte_copy(i8* %106, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0))
br label %117
108: ; preds = %101
%109 = load i8*, i8** %4
%110 = call i32 @case_diffs(i8* %109, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i64 0, i64 0))
%111 = icmp ne i32 %110, 0
br i1 %111, label %115, label %112
112: ; preds = %108
%113 = load i8*, i8** %5
%114 = call i32 @byte_copy(i8* %113, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0))
br label %116
115: ; preds = %108
store i32 0, i32* %3
br label %131
116: ; preds = %112
br label %117
117: ; preds = %116, %105
br label %118
118: ; preds = %117, %98
br label %119
119: ; preds = %118, %91
br label %120
120: ; preds = %119, %84
br label %121
121: ; preds = %120, %77
br label %122
122: ; preds = %121, %70
br label %123
123: ; preds = %122, %63
br label %124
124: ; preds = %123, %56
br label %125
125: ; preds = %124, %49
br label %126
126: ; preds = %125, %42
br label %127
127: ; preds = %126, %35
br label %128
128: ; preds = %127, %28
br label %129
129: ; preds = %128, %21
br label %130
130: ; preds = %129, %13
store i32 1, i32* %3
br label %131
131: ; preds = %130, %115
%132 = load i32, i32* %3
ret i32 %132
}

LLVM IR (-O2):
@.str = [4 x i8] c"any\00"
@.str.1 = [3 x i8] c"\00\FF\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [3 x i8] c"\00\01\00"
@.str.4 = [3 x i8] c"ns\00"
@.str.5 = [3 x i8] c"\00\02\00"
@.str.6 = [3 x i8] c"mx\00"
@.str.7 = [3 x i8] c"\00\0F\00"
@.str.8 = [4 x i8] c"ptr\00"
@.str.9 = [3 x i8] c"\00\0C\00"
@.str.10 = [4 x i8] c"txt\00"
@.str.11 = [3 x i8] c"\00\10\00"
@.str.12 = [6 x i8] c"cname\00"
@.str.13 = [3 x i8] c"\00\05\00"
@.str.14 = [4 x i8] c"soa\00"
@.str.15 = [3 x i8] c"\00\06\00"
@.str.16 = [6 x i8] c"hinfo\00"
@.str.17 = [3 x i8] c"\00\0D\00"
@.str.18 = [3 x i8] c"rp\00"
@.str.19 = [3 x i8] c"\00\11\00"
@.str.20 = [4 x i8] c"sig\00"
@.str.21 = [3 x i8] c"\00\18\00"
@.str.22 = [4 x i8] c"key\00"
@.str.23 = [3 x i8] c"\00\19\00"
@.str.24 = [5 x i8] c"aaaa\00"
@.str.25 = [3 x i8] c"\00\1C\00"
@.str.26 = [5 x i8] c"axfr\00"
@.str.27 = [3 x i8] c"\00\FC\00"
define i32 @parsetype(i8* %0, i8* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%5 = call i64 @scan_ulong(i8* %0, i64* %3)
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i64, i64* %3
%11 = call i32 @uint16_pack_big(i8* %1, i64 %10)
br label %82
12: ; preds = %2
%13 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %82
17: ; preds = %12
%18 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %82
22: ; preds = %17
%23 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %82
27: ; preds = %22
%28 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %82
32: ; preds = %27
%33 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %82
37: ; preds = %32
%38 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %82
42: ; preds = %37
%43 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %82
47: ; preds = %42
%48 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
br label %82
52: ; preds = %47
%53 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
br label %82
57: ; preds = %52
%58 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0))
br label %82
62: ; preds = %57
%63 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0))
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0))
br label %82
67: ; preds = %62
%68 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i64 0, i64 0))
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %72
70: ; preds = %67
%71 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.23, i64 0, i64 0))
br label %82
72: ; preds = %67
%73 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0))
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %72
%76 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0))
br label %82
77: ; preds = %72
%78 = call i32 @case_diffs(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i64 0, i64 0))
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %82
80: ; preds = %77
%81 = call i32 @byte_copy(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0))
br label %82
82: ; preds = %9, %20, %30, %40, %50, %60, %70, %80, %75, %65, %55, %45, %35, %25, %15, %77
%83 = phi i32 [ 0, %77 ], [ 1, %15 ], [ 1, %25 ], [ 1, %35 ], [ 1, %45 ], [ 1, %55 ], [ 1, %65 ], [ 1, %75 ], [ 1, %80 ], [ 1, %70 ], [ 1, %60 ], [ 1, %50 ], [ 1, %40 ], [ 1, %30 ], [ 1, %20 ], [ 1, %9 ]
ret i32 %83
}