#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(char *, 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) {
    if (px[offset] == 0x00) {
      break;
    } else 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(name, "(err)");
        return 5;
      }
      offset = (*((unsigned char *)(px + offset) + 0) << 8 |
                *((unsigned char *)(px + offset) + 1) << 0) &
               0x3FF;
    } else {
      unsigned len = px[offset++];
      if (offset >= length) {
        FRAMERR(frame, "dns: name: not enough bytes\n");
        strcpy(name, "(err)");
        return 5;
      }
      if (offset + len > length) {
        FRAMERR(frame, "dns: name: not enough bytes\n");
        strcpy(name, "(err)");
        return 5;
      }
      if (name_offset > 0) {
        if (name_offset + 1 >= sizeof_name) {
          FRAMERR(frame, "dns: name: too long\n");
          strcpy(name, "(err)");
          return 5;
        }
        name[name_offset++] = '.';
      }
      if (name_offset + len + 1 >= sizeof_name) {
        FRAMERR(frame, "dns: name: too long\n");
        strcpy(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    13a5 <dns_extract_name+0x275>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1188 <dns_extract_name+0x58>
jmp    13a5 <dns_extract_name+0x275>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xc0,%eax
cmp    $0x0,%eax
je     1237 <dns_extract_name+0x107>
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   1050 <FRAMERR@plt>
jmp    13a5 <dns_extract_name+0x275>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%eax
add    $0x2,%eax
cmp    -0x1c(%rbp),%eax
jbe    120b <dns_extract_name+0xdb>
mov    -0x10(%rbp),%rdi
lea    0xe3a(%rip),%rsi
mov    $0x0,%al
call   1050 <FRAMERR@plt>
mov    -0x28(%rbp),%rdi
lea    0xe45(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x5,-0x4(%rbp)
jmp    13ab <dns_extract_name+0x27b>
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    $0x3ff,%eax
mov    %eax,-0x20(%rbp)
jmp    139b <dns_extract_name+0x26b>
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     1289 <dns_extract_name+0x159>
mov    -0x10(%rbp),%rdi
lea    0xdbc(%rip),%rsi
mov    $0x0,%al
call   1050 <FRAMERR@plt>
mov    -0x28(%rbp),%rdi
lea    0xdc7(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x5,-0x4(%rbp)
jmp    13ab <dns_extract_name+0x27b>
mov    -0x20(%rbp),%eax
add    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jbe    12c6 <dns_extract_name+0x196>
mov    -0x10(%rbp),%rdi
lea    0xd7f(%rip),%rsi
mov    $0x0,%al
call   1050 <FRAMERR@plt>
mov    -0x28(%rbp),%rdi
lea    0xd8a(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x5,-0x4(%rbp)
jmp    13ab <dns_extract_name+0x27b>
cmpl   $0x0,-0x34(%rbp)
jbe    1322 <dns_extract_name+0x1f2>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cmp    -0x2c(%rbp),%eax
jb     130d <dns_extract_name+0x1dd>
mov    -0x10(%rbp),%rdi
lea    0xd5b(%rip),%rsi
mov    $0x0,%al
call   1050 <FRAMERR@plt>
mov    -0x28(%rbp),%rdi
lea    0xd43(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x5,-0x4(%rbp)
jmp    13ab <dns_extract_name+0x27b>
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     1362 <dns_extract_name+0x232>
mov    -0x10(%rbp),%rdi
lea    0xd06(%rip),%rsi
mov    $0x0,%al
call   1050 <FRAMERR@plt>
mov    -0x28(%rbp),%rdi
lea    0xcee(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x5,-0x4(%rbp)
jmp    13ab <dns_extract_name+0x27b>
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   1040 <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    13a0 <dns_extract_name+0x270>
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    %rdi,0x8(%rsp)
mov    %r8,(%rsp)
movb   $0x0,(%r8)
xor    %ebx,%ebx
cmp    %edx,%ecx
jae    126d <dns_extract_name+0x13d>
mov    %ecx,%r15d
mov    %edx,%r13d
mov    %rsi,%rbp
xor    %ebx,%ebx
xor    %r12d,%r12d
mov    %r9d,0x14(%rsp)
jmp    1179 <dns_extract_name+0x49>
nopw   0x0(%rax,%rax,1)
cmp    %r13d,%r15d
jae    126d <dns_extract_name+0x13d>
mov    %r15d,%eax
movzbl 0x0(%rbp,%rax,1),%edx
test   %edx,%edx
je     126d <dns_extract_name+0x13d>
test   $0xc0,%dl
je     11c0 <dns_extract_name+0x90>
cmp    $0x65,%r12d
jge    122d <dns_extract_name+0xfd>
lea    0x2(%rax),%ecx
cmp    %r13d,%ecx
ja     1224 <dns_extract_name+0xf4>
add    $0x1,%r12d
movzbl 0x1(%rbp,%rax,1),%eax
and    $0x3,%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    %r13d,%eax
jae    1224 <dns_extract_name+0xf4>
lea    (%rax,%rdx,1),%r15d
cmp    %r13d,%r15d
ja     1224 <dns_extract_name+0xf4>
test   %ebx,%ebx
je     11ea <dns_extract_name+0xba>
lea    0x1(%rbx),%r14d
cmp    %r9d,%r14d
jae    1245 <dns_extract_name+0x115>
mov    %ebx,%ecx
mov    (%rsp),%rsi
movb   $0x2e,(%rsi,%rcx,1)
jmp    11ed <dns_extract_name+0xbd>
xor    %r14d,%r14d
lea    (%r14,%rdx,1),%ecx
add    $0x1,%ecx
cmp    %r9d,%ecx
jae    1245 <dns_extract_name+0x115>
mov    %r14d,%edi
add    %edx,%r14d
mov    (%rsp),%rbx
add    %rbx,%rdi
mov    %eax,%esi
add    %rbp,%rsi
call   1040 <memcpy@plt>
mov    0x14(%rsp),%r9d
mov    %r14d,%eax
movb   $0x0,(%rbx,%rax,1)
mov    %r14d,%ebx
jmp    1170 <dns_extract_name+0x40>
lea    0xdf7(%rip),%rsi
jmp    124c <dns_extract_name+0x11c>
lea    0xdcc(%rip),%rsi
mov    0x8(%rsp),%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1050 <FRAMERR@plt>
jmp    126d <dns_extract_name+0x13d>
lea    0xdf9(%rip),%rsi
mov    0x8(%rsp),%rdi
xor    %eax,%eax
call   1050 <FRAMERR@plt>
lea    0xde0(%rip),%rsi
mov    (%rsp),%rdi
call   1030 <strcpy@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 = %159, %6
%20 = load i32, i32* %11
%21 = load i32, i32* %10
%22 = icmp ult i32 %20, %21
br i1 %22, label %23, label %160
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 %160
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 %79
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 %160
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 %60
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 = call i32 @strcpy(i8* %58, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 5, i32* %7
br label %162
60: ; preds = %48
%61 = load i8*, i8** %9
%62 = load i32, i32* %11
%63 = zext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %61, i64 %63
%65 = getelementptr inbounds i8, i8* %64, i64 0
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = shl i32 %67, 8
%69 = load i8*, i8** %9
%70 = load i32, i32* %11
%71 = zext i32 %70 to i64
%72 = getelementptr inbounds i8, i8* %69, i64 %71
%73 = getelementptr inbounds i8, i8* %72, i64 1
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = shl i32 %75, 0
%77 = or i32 %68, %76
%78 = and i32 %77, 1023
store i32 %78, i32* %11
br label %158
79: ; preds = %32
%80 = load i8*, i8** %9
%81 = load i32, i32* %11
%82 = add i32 %81, 1
store i32 %82, i32* %11
%83 = zext i32 %81 to i64
%84 = getelementptr inbounds i8, i8* %80, i64 %83
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
store i32 %86, i32* %16
%87 = load i32, i32* %11
%88 = load i32, i32* %10
%89 = icmp uge i32 %87, %88
br i1 %89, label %90, label %95
90: ; preds = %79
%91 = load %struct.NetFrame*, %struct.NetFrame** %8
%92 = call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %91, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%93 = load i8*, i8** %12
%94 = call i32 @strcpy(i8* %93, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 5, i32* %7
br label %162
95: ; preds = %79
%96 = load i32, i32* %11
%97 = load i32, i32* %16
%98 = add i32 %96, %97
%99 = load i32, i32* %10
%100 = icmp ugt i32 %98, %99
br i1 %100, label %101, label %106
101: ; preds = %95
%102 = load %struct.NetFrame*, %struct.NetFrame** %8
%103 = call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %102, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%104 = load i8*, i8** %12
%105 = call i32 @strcpy(i8* %104, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 5, i32* %7
br label %162
106: ; preds = %95
%107 = load i32, i32* %15
%108 = icmp ugt i32 %107, 0
br i1 %108, label %109, label %125
109: ; preds = %106
%110 = load i32, i32* %15
%111 = add i32 %110, 1
%112 = load i32, i32* %13
%113 = icmp uge i32 %111, %112
br i1 %113, label %114, label %119
114: ; preds = %109
%115 = load %struct.NetFrame*, %struct.NetFrame** %8
%116 = call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %115, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%117 = load i8*, i8** %12
%118 = call i32 @strcpy(i8* %117, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 5, i32* %7
br label %162
119: ; preds = %109
%120 = load i8*, i8** %12
%121 = load i32, i32* %15
%122 = add i32 %121, 1
store i32 %122, i32* %15
%123 = zext i32 %121 to i64
%124 = getelementptr inbounds i8, i8* %120, i64 %123
store i8 46, i8* %124
br label %125
125: ; preds = %119, %106
%126 = load i32, i32* %15
%127 = load i32, i32* %16
%128 = add i32 %126, %127
%129 = add i32 %128, 1
%130 = load i32, i32* %13
%131 = icmp uge i32 %129, %130
br i1 %131, label %132, label %137
132: ; preds = %125
%133 = load %struct.NetFrame*, %struct.NetFrame** %8
%134 = call i32 (%struct.NetFrame*, i8*, ...) @FRAMERR(%struct.NetFrame* %133, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%135 = load i8*, i8** %12
%136 = call i32 @strcpy(i8* %135, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 5, i32* %7
br label %162
137: ; preds = %125
%138 = load i8*, i8** %12
%139 = load i32, i32* %15
%140 = zext i32 %139 to i64
%141 = getelementptr inbounds i8, i8* %138, i64 %140
%142 = load i8*, i8** %9
%143 = load i32, i32* %11
%144 = zext i32 %143 to i64
%145 = getelementptr inbounds i8, i8* %142, i64 %144
%146 = load i32, i32* %16
%147 = call i32 @memcpy(i8* %141, i8* %145, i32 %146)
%148 = load i32, i32* %16
%149 = load i32, i32* %15
%150 = add i32 %149, %148
store i32 %150, i32* %15
%151 = load i8*, i8** %12
%152 = load i32, i32* %15
%153 = zext i32 %152 to i64
%154 = getelementptr inbounds i8, i8* %151, i64 %153
store i8 0, i8* %154
%155 = load i32, i32* %16
%156 = load i32, i32* %11
%157 = add i32 %156, %155
store i32 %157, i32* %11
br label %158
158: ; preds = %137, %60
br label %159
159: ; preds = %158
br label %19
160: ; preds = %44, %31, %19
%161 = load i32, i32* %15
store i32 %161, i32* %7
br label %162
162: ; preds = %160, %132, %114, %101, %90, %55
%163 = load i32, i32* %7
ret i32 %163
}

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(i8* %4, 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, 768
%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(i8* %4, 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(i8* %4, 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(i8* %4, 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(i8* %4, 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 = %8, %77, %6, %66, %55, %47, %41, %22, %27
%83 = phi i32 [ 5, %27 ], [ %9, %22 ], [ 5, %41 ], [ 5, %47 ], [ 5, %55 ], [ 5, %66 ], [ 0, %6 ], [ %9, %8 ], [ %80, %77 ]
ret i32 %83
}