#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 */
struct NetFrame {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FRAMERR(struct NetFrame *, char *, ...);
int /*<<< orphan*/ memcpy(char *, unsigned char const *, unsigned int);
int /*<<< orphan*/ strcpy_s(char *, unsigned int, char *);
unsigned dns_extract_name(struct NetFrame *frame, const unsigned char *px,
                          unsigned length, unsigned offset, char *name,
                          unsigned sizeof_name) {
  int recurse_count = 0;
  unsigned name_offset = 0;
  name[0] = '\0';
  while (offset < length) {
    unsigned len;
    if (px[offset] == 0x00)
      break;
    if (px[offset] & 0xC0) {
      if (recurse_count > 100) {
        FRAMERR(frame, "dns: name: recursion exceeded %d\n", recurse_count);
        break;
      }
      recurse_count++;
      if (offset + 2 > length) {
        FRAMERR(frame, "dns: name: not enough bytes\n");
        strcpy_s(name, sizeof_name, "(err)");
        return 5;
      }
      offset = (*((unsigned char *)(px + offset) + 0) << 8 |
                *((unsigned char *)(px + offset) + 1) << 0) &
               0x3FFF;
      continue;
    }
    len = px[offset++];
    if (offset >= length) {
      FRAMERR(frame, "dns: name: not enough bytes\n");
      strcpy_s(name, sizeof_name, "(err)");
      return 5;
    }
    if (offset + len > length) {
      FRAMERR(frame, "dns: name: not enough bytes\n");
      strcpy_s(name, sizeof_name, "(err)");
      return 5;
    }
    if (name_offset > 0) {
      if (name_offset + 1 >= sizeof_name) {
        FRAMERR(frame, "dns: name: too long\n");
        strcpy_s(name, sizeof_name, "(err)");
        return 5;
      }
      name[name_offset++] = '.';
    }
    if (name_offset + len + 1 >= sizeof_name) {
      FRAMERR(frame, "dns: name: too long\n");
      strcpy_s(name, sizeof_name, "(err)");
      return 5;
    }
    memcpy(name + name_offset, px + offset, len);
    name_offset += len;
    name[name_offset] = '\0';
    offset += len;
  }
  return name_offset;
}


x86 assembly (clang, -O0):
<dns_extract_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jae    13af <dns_extract_name+0x27f>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1188 <dns_extract_name+0x58>
jmp    13af <dns_extract_name+0x27f>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xc0,%eax
cmp    $0x0,%eax
je     123a <dns_extract_name+0x10a>
cmpl   $0x64,-0x30(%rbp)
jle    11c5 <dns_extract_name+0x95>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%edx
lea    0xe47(%rip),%rsi
mov    $0x0,%al
call   1040 <FRAMERR@plt>
jmp    13af <dns_extract_name+0x27f>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%eax
add    $0x2,%eax
cmp    -0x1c(%rbp),%eax
jbe    120e <dns_extract_name+0xde>
mov    -0x10(%rbp),%rdi
lea    0xe3a(%rip),%rsi
mov    $0x0,%al
call   1040 <FRAMERR@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
lea    0xe42(%rip),%rdx
call   1050 <strcpy_s@plt>
movl   $0x5,-0x4(%rbp)
jmp    13b5 <dns_extract_name+0x285>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%edx
movzbl 0x1(%rcx,%rdx,1),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
and    $0x3fff,%eax
mov    %eax,-0x20(%rbp)
jmp    1163 <dns_extract_name+0x33>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jb     128f <dns_extract_name+0x15f>
mov    -0x10(%rbp),%rdi
lea    0xdb9(%rip),%rsi
mov    $0x0,%al
call   1040 <FRAMERR@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
lea    0xdc1(%rip),%rdx
call   1050 <strcpy_s@plt>
movl   $0x5,-0x4(%rbp)
jmp    13b5 <dns_extract_name+0x285>
mov    -0x20(%rbp),%eax
add    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jbe    12cf <dns_extract_name+0x19f>
mov    -0x10(%rbp),%rdi
lea    0xd79(%rip),%rsi
mov    $0x0,%al
call   1040 <FRAMERR@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
lea    0xd81(%rip),%rdx
call   1050 <strcpy_s@plt>
movl   $0x5,-0x4(%rbp)
jmp    13b5 <dns_extract_name+0x285>
cmpl   $0x0,-0x34(%rbp)
jbe    132e <dns_extract_name+0x1fe>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cmp    -0x2c(%rbp),%eax
jb     1319 <dns_extract_name+0x1e9>
mov    -0x10(%rbp),%rdi
lea    0xd52(%rip),%rsi
mov    $0x0,%al
call   1040 <FRAMERR@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
lea    0xd37(%rip),%rdx
call   1050 <strcpy_s@plt>
movl   $0x5,-0x4(%rbp)
jmp    13b5 <dns_extract_name+0x285>
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x34(%rbp)
mov    %ecx,%ecx
movb   $0x2e,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    -0x38(%rbp),%eax
add    $0x1,%eax
cmp    -0x2c(%rbp),%eax
jb     1371 <dns_extract_name+0x241>
mov    -0x10(%rbp),%rdi
lea    0xcfa(%rip),%rsi
mov    $0x0,%al
call   1040 <FRAMERR@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
lea    0xcdf(%rip),%rdx
call   1050 <strcpy_s@plt>
movl   $0x5,-0x4(%rbp)
jmp    13b5 <dns_extract_name+0x285>
mov    -0x28(%rbp),%rdi
mov    -0x34(%rbp),%eax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%eax
add    %rax,%rsi
mov    -0x38(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x38(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x38(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1163 <dns_extract_name+0x33>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_extract_name>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9d,0x4(%rsp)
mov    %rdi,0x10(%rsp)
mov    %r8,0x8(%rsp)
movb   $0x0,(%r8)
xor    %ebx,%ebx
cmp    %edx,%ecx
jae    1271 <dns_extract_name+0x141>
mov    %ecx,%r15d
mov    %edx,%ebp
mov    %rsi,%r12
xor    %ebx,%ebx
xor    %r13d,%r13d
jmp    1179 <dns_extract_name+0x49>
nopw   0x0(%rax,%rax,1)
cmp    %ebp,%r15d
jae    1271 <dns_extract_name+0x141>
mov    %r15d,%eax
movzbl (%r12,%rax,1),%edx
test   %edx,%edx
je     1271 <dns_extract_name+0x141>
test   $0xc0,%dl
je     11c0 <dns_extract_name+0x90>
cmp    $0x65,%r13d
jge    122c <dns_extract_name+0xfc>
lea    0x2(%rax),%ecx
cmp    %ebp,%ecx
ja     1223 <dns_extract_name+0xf3>
add    $0x1,%r13d
movzbl 0x1(%r12,%rax,1),%eax
and    $0x3f,%edx
shl    $0x8,%edx
or     %eax,%edx
mov    %edx,%r15d
jmp    1170 <dns_extract_name+0x40>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmp    %ebp,%eax
jae    1223 <dns_extract_name+0xf3>
lea    (%rax,%rdx,1),%r15d
cmp    %ebp,%r15d
ja     1223 <dns_extract_name+0xf3>
test   %ebx,%ebx
je     11ec <dns_extract_name+0xbc>
lea    0x1(%rbx),%r14d
cmp    0x4(%rsp),%r14d
jae    1244 <dns_extract_name+0x114>
mov    %ebx,%ecx
mov    0x8(%rsp),%rsi
movb   $0x2e,(%rsi,%rcx,1)
jmp    11ef <dns_extract_name+0xbf>
xor    %r14d,%r14d
lea    (%r14,%rdx,1),%ecx
add    $0x1,%ecx
cmp    0x4(%rsp),%ecx
jae    1244 <dns_extract_name+0x114>
mov    %r14d,%edi
add    %edx,%r14d
mov    0x8(%rsp),%rbx
add    %rbx,%rdi
mov    %eax,%esi
add    %r12,%rsi
call   1030 <memcpy@plt>
mov    %r14d,%eax
movb   $0x0,(%rbx,%rax,1)
mov    %r14d,%ebx
jmp    1170 <dns_extract_name+0x40>
lea    0xdf8(%rip),%rsi
jmp    124b <dns_extract_name+0x11b>
lea    0xdcd(%rip),%rsi
mov    0x10(%rsp),%rdi
mov    %r13d,%edx
xor    %eax,%eax
call   1040 <FRAMERR@plt>
jmp    1271 <dns_extract_name+0x141>
lea    0xdfa(%rip),%rsi
mov    0x10(%rsp),%rdi
xor    %eax,%eax
call   1040 <FRAMERR@plt>
lea    0xde1(%rip),%rdx
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%esi
call   1050 <strcpy_s@plt>
mov    $0x5,%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.NetFrame = type { i32 }
@.str = [34 x i8] c"dns: name: recursion exceeded %d\0A\00"
@.str.1 = [29 x i8] c"dns: name: not enough bytes\0A\00"
@.str.2 = [6 x i8] c"(err)\00"
@.str.3 = [21 x i8] c"dns: name: too long\0A\00"
define i32 @dns_extract_name(%struct.NetFrame* %0, i8* %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca %struct.NetFrame*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store %struct.NetFrame* %0, %struct.NetFrame** %8
store i8* %1, i8** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
%17 = load i8*, i8** %12
%18 = getelementptr inbounds i8, i8* %17, i64 0
store i8 0, i8* %18
br label %19
19: ; preds = %142, %61, %6
%20 = load i32, i32* %11
%21 = load i32, i32* %10
%22 = icmp ult i32 %20, %21
br i1 %22, label %23, label %163
23: ; preds = %19
%24 = load i8*, i8** %9
%25 = load i32, i32* %11
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %23
br label %163
32: ; preds = %23
%33 = load i8*, i8** %9
%34 = load i32, i32* %11
%35 = zext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %33, i64 %35
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = and i32 %38, 192
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %80
41: ; preds = %32
%42 = load i32, i32* %14
%43 = icmp sgt i32 %42, 100
br i1 %43, label %44, label %48
44: ; preds = %41
%45 = load %struct.NetFrame*, %struct.NetFrame** %8
%46 = load i32, i32* %14
%47 = call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %45, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %46)
br label %163
48: ; preds = %41
%49 = load i32, i32* %14
%50 = add nsw i32 %49, 1
store i32 %50, i32* %14
%51 = load i32, i32* %11
%52 = add i32 %51, 2
%53 = load i32, i32* %10
%54 = icmp ugt i32 %52, %53
br i1 %54, label %55, label %61
55: ; preds = %48
%56 = load %struct.NetFrame*, %struct.NetFrame** %8
%57 = call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %56, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%58 = load i8*, i8** %12
%59 = load i32, i32* %13
%60 = call i32 @strcpy_s(i8* %58, i32 %59, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 5, i32* %7
br label %165
61: ; preds = %48
%62 = load i8*, i8** %9
%63 = load i32, i32* %11
%64 = zext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %62, i64 %64
%66 = getelementptr inbounds i8, i8* %65, i64 0
%67 = load i8, i8* %66
%68 = zext i8 %67 to i32
%69 = shl i32 %68, 8
%70 = load i8*, i8** %9
%71 = load i32, i32* %11
%72 = zext i32 %71 to i64
%73 = getelementptr inbounds i8, i8* %70, i64 %72
%74 = getelementptr inbounds i8, i8* %73, i64 1
%75 = load i8, i8* %74
%76 = zext i8 %75 to i32
%77 = shl i32 %76, 0
%78 = or i32 %69, %77
%79 = and i32 %78, 16383
store i32 %79, i32* %11
br label %19
80: ; preds = %32
%81 = load i8*, i8** %9
%82 = load i32, i32* %11
%83 = add i32 %82, 1
store i32 %83, i32* %11
%84 = zext i32 %82 to i64
%85 = getelementptr inbounds i8, i8* %81, i64 %84
%86 = load i8, i8* %85
%87 = zext i8 %86 to i32
store i32 %87, i32* %16
%88 = load i32, i32* %11
%89 = load i32, i32* %10
%90 = icmp uge i32 %88, %89
br i1 %90, label %91, label %97
91: ; preds = %80
%92 = load %struct.NetFrame*, %struct.NetFrame** %8
%93 = call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %92, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%94 = load i8*, i8** %12
%95 = load i32, i32* %13
%96 = call i32 @strcpy_s(i8* %94, i32 %95, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 5, i32* %7
br label %165
97: ; preds = %80
%98 = load i32, i32* %11
%99 = load i32, i32* %16
%100 = add i32 %98, %99
%101 = load i32, i32* %10
%102 = icmp ugt i32 %100, %101
br i1 %102, label %103, label %109
103: ; preds = %97
%104 = load %struct.NetFrame*, %struct.NetFrame** %8
%105 = call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %104, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%106 = load i8*, i8** %12
%107 = load i32, i32* %13
%108 = call i32 @strcpy_s(i8* %106, i32 %107, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 5, i32* %7
br label %165
109: ; preds = %97
%110 = load i32, i32* %15
%111 = icmp ugt i32 %110, 0
br i1 %111, label %112, label %129
112: ; preds = %109
%113 = load i32, i32* %15
%114 = add i32 %113, 1
%115 = load i32, i32* %13
%116 = icmp uge i32 %114, %115
br i1 %116, label %117, label %123
117: ; preds = %112
%118 = load %struct.NetFrame*, %struct.NetFrame** %8
%119 = call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %118, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%120 = load i8*, i8** %12
%121 = load i32, i32* %13
%122 = call i32 @strcpy_s(i8* %120, i32 %121, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 5, i32* %7
br label %165
123: ; preds = %112
%124 = load i8*, i8** %12
%125 = load i32, i32* %15
%126 = add i32 %125, 1
store i32 %126, i32* %15
%127 = zext i32 %125 to i64
%128 = getelementptr inbounds i8, i8* %124, i64 %127
store i8 46, i8* %128
br label %129
129: ; preds = %123, %109
%130 = load i32, i32* %15
%131 = load i32, i32* %16
%132 = add i32 %130, %131
%133 = add i32 %132, 1
%134 = load i32, i32* %13
%135 = icmp uge i32 %133, %134
br i1 %135, label %136, label %142
136: ; preds = %129
%137 = load %struct.NetFrame*, %struct.NetFrame** %8
%138 = call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %137, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%139 = load i8*, i8** %12
%140 = load i32, i32* %13
%141 = call i32 @strcpy_s(i8* %139, i32 %140, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 5, i32* %7
br label %165
142: ; preds = %129
%143 = load i8*, i8** %12
%144 = load i32, i32* %15
%145 = zext i32 %144 to i64
%146 = getelementptr inbounds i8, i8* %143, i64 %145
%147 = load i8*, i8** %9
%148 = load i32, i32* %11
%149 = zext i32 %148 to i64
%150 = getelementptr inbounds i8, i8* %147, i64 %149
%151 = load i32, i32* %16
%152 = call i32 @memcpy(i8* %146, i8* %150, i32 %151)
%153 = load i32, i32* %16
%154 = load i32, i32* %15
%155 = add i32 %154, %153
store i32 %155, i32* %15
%156 = load i8*, i8** %12
%157 = load i32, i32* %15
%158 = zext i32 %157 to i64
%159 = getelementptr inbounds i8, i8* %156, i64 %158
store i8 0, i8* %159
%160 = load i32, i32* %16
%161 = load i32, i32* %11
%162 = add i32 %161, %160
store i32 %162, i32* %11
br label %19
163: ; preds = %44, %31, %19
%164 = load i32, i32* %15
store i32 %164, i32* %7
br label %165
165: ; preds = %163, %136, %117, %103, %91, %55
%166 = load i32, i32* %7
ret i32 %166
}

LLVM IR (-O2):
%struct.NetFrame = type { i32 }
@.str = [34 x i8] c"dns: name: recursion exceeded %d\0A\00"
@.str.1 = [29 x i8] c"dns: name: not enough bytes\0A\00"
@.str.2 = [6 x i8] c"(err)\00"
@.str.3 = [21 x i8] c"dns: name: too long\0A\00"
define i32 @dns_extract_name(%struct.NetFrame* %0, i8* %1, i32 %2, i32 %3, i8* %4, i32 %5) {
store i8 0, i8* %4
%7 = icmp ult i32 %3, %2
br i1 %7, label %8, label %82
8: ; preds = %6, %77
%9 = phi i32 [ %80, %77 ], [ 0, %6 ]
%10 = phi i32 [ %79, %77 ], [ 0, %6 ]
%11 = phi i32 [ %78, %77 ], [ %3, %6 ]
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = icmp eq i8 %14, 0
br i1 %16, label %82, label %17
17: ; preds = %8
%18 = and i32 %15, 192
%19 = icmp eq i32 %18, 0
br i1 %19, label %38, label %20
20: ; preds = %17
%21 = icmp sgt i32 %10, 100
br i1 %21, label %22, label %24
22: ; preds = %20
%23 = tail call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %82
24: ; preds = %20
%25 = add i32 %11, 2
%26 = icmp ugt i32 %25, %2
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = tail call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%29 = tail call i32 @strcpy_s(i8* %4, i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %82
30: ; preds = %24
%31 = add nsw i32 %10, 1
%32 = shl nuw nsw i32 %15, 8
%33 = getelementptr inbounds i8, i8* %13, i64 1
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = and i32 %32, 16128
%37 = or i32 %36, %35
br label %77
38: ; preds = %17
%39 = add nuw i32 %11, 1
%40 = icmp ult i32 %39, %2
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = tail call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%43 = tail call i32 @strcpy_s(i8* %4, i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %82
44: ; preds = %38
%45 = add i32 %39, %15
%46 = icmp ugt i32 %45, %2
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = tail call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%49 = tail call i32 @strcpy_s(i8* %4, i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %82
50: ; preds = %44
%51 = icmp eq i32 %9, 0
br i1 %51, label %61, label %52
52: ; preds = %50
%53 = add i32 %9, 1
%54 = icmp ult i32 %53, %5
br i1 %54, label %58, label %55
55: ; preds = %52
%56 = tail call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%57 = tail call i32 @strcpy_s(i8* %4, i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %82
58: ; preds = %52
%59 = zext i32 %9 to i64
%60 = getelementptr inbounds i8, i8* %4, i64 %59
store i8 46, i8* %60
br label %61
61: ; preds = %58, %50
%62 = phi i32 [ %53, %58 ], [ 0, %50 ]
%63 = add i32 %62, %15
%64 = add i32 %63, 1
%65 = icmp ult i32 %64, %5
br i1 %65, label %69, label %66
66: ; preds = %61
%67 = tail call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%68 = tail call i32 @strcpy_s(i8* %4, i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %82
69: ; preds = %61
%70 = zext i32 %62 to i64
%71 = getelementptr inbounds i8, i8* %4, i64 %70
%72 = zext i32 %39 to i64
%73 = getelementptr inbounds i8, i8* %1, i64 %72
%74 = tail call i32 @memcpy(i8* %71, i8* %73, i32 %15)
%75 = zext i32 %63 to i64
%76 = getelementptr inbounds i8, i8* %4, i64 %75
store i8 0, i8* %76
br label %77
77: ; preds = %69, %30
%78 = phi i32 [ %37, %30 ], [ %45, %69 ]
%79 = phi i32 [ %31, %30 ], [ %10, %69 ]
%80 = phi i32 [ %9, %30 ], [ %63, %69 ]
%81 = icmp ult i32 %78, %2
br i1 %81, label %8, label %82
82: ; preds = %77, %8, %6, %22, %66, %55, %47, %41, %27
%83 = phi i32 [ 5, %27 ], [ 5, %41 ], [ 5, %47 ], [ 5, %55 ], [ 5, %66 ], [ %9, %22 ], [ 0, %6 ], [ %80, %77 ], [ %9, %8 ]
ret i32 %83
}