#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*/ printf(char *, ...);
void print_packet(unsigned char *h80211, int caplen) {
  int i, j;
  printf("        Size: %d, FromDS: %d, ToDS: %d", caplen, (h80211[1] & 2) >> 1,
         (h80211[1] & 1));
  if ((h80211[0] & 0x0C) == 8 && (h80211[1] & 0x40) != 0) {
    if ((h80211[27] & 0x20) == 0)
      printf(" (WEP)");
    else
      printf(" (WPA)");
  }
  for (i = 0; i < caplen; i++) {
    if ((i & 15) == 0) {
      if (i == 224) {
        printf("\n        --- CUT ---");
        break;
      }
      printf("\n        0x%04x:  ", i);
    }
    printf("%02x", h80211[i]);
    if ((i & 1) != 0)
      printf(" ");
    if (i == caplen - 1 && ((i + 1) & 15) != 0) {
      for (j = ((i + 1) & 15); j < 16; j++) {
        printf("  ");
        if ((j & 1) != 0)
          printf(" ");
      }
      printf(" ");
      for (j = 16 - ((i + 1) & 15); j < 16; j++)
        printf("%c", (h80211[i - 15 + j] < 32 || h80211[i - 15 + j] > 126)
                         ? '.'
                         : h80211[i - 15 + j]);
    }
    if (i > 0 && ((i + 1) & 15) == 0) {
      printf(" ");
      for (j = 0; j < 16; j++)
        printf("%c", (h80211[i - 15 + j] < 32 || h80211[i - 15 + j] > 127)
                         ? '.'
                         : h80211[i - 15 + j]);
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%edx
and    $0x2,%edx
sar    $0x1,%edx
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
and    $0x1,%ecx
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xc,%eax
cmp    $0x8,%eax
jne    11aa <print_packet+0x9a>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     11aa <print_packet+0x9a>
mov    -0x8(%rbp),%rax
movzbl 0x1b(%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    1197 <print_packet+0x87>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a5 <print_packet+0x95>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11aa <print_packet+0x9a>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1428 <print_packet+0x318>
mov    -0x10(%rbp),%eax
and    $0xf,%eax
cmp    $0x0,%eax
jne    11fd <print_packet+0xed>
cmpl   $0xe0,-0x10(%rbp)
jne    11ec <print_packet+0xdc>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1428 <print_packet+0x318>
mov    -0x10(%rbp),%esi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1234 <print_packet+0x124>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1358 <print_packet+0x248>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
and    $0xf,%eax
cmp    $0x0,%eax
je     1358 <print_packet+0x248>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
and    $0xf,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    12ab <print_packet+0x19b>
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1298 <print_packet+0x188>
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129d <print_packet+0x18d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1263 <print_packet+0x153>
lea    0xda9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
and    $0xf,%ecx
mov    $0x10,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    1353 <print_packet+0x243>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0xf,%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jl     1310 <print_packet+0x200>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0xf,%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x7e,%eax
jle    131d <print_packet+0x20d>
mov    $0x2e,%eax
mov    %eax,-0x18(%rbp)
jmp    1334 <print_packet+0x224>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0xf,%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12cc <print_packet+0x1bc>
jmp    1358 <print_packet+0x248>
cmpl   $0x0,-0x10(%rbp)
jle    1415 <print_packet+0x305>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
and    $0xf,%eax
cmp    $0x0,%eax
jne    1415 <print_packet+0x305>
lea    0xce0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    1410 <print_packet+0x300>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0xf,%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jl     13cd <print_packet+0x2bd>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0xf,%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x7f,%eax
jle    13da <print_packet+0x2ca>
mov    $0x2e,%eax
mov    %eax,-0x1c(%rbp)
jmp    13f1 <print_packet+0x2e1>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0xf,%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xc67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1389 <print_packet+0x279>
jmp    1415 <print_packet+0x305>
jmp    141a <print_packet+0x30a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b1 <print_packet+0xa1>
lea    0xc36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_packet>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %esi,%r15d
mov    %rdi,%rbx
movzbl 0x1(%rdi),%ecx
mov    %ecx,%edx
shr    %edx
and    $0x1,%edx
and    $0x1,%ecx
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%al
and    $0xc,%al
cmp    $0x8,%al
jne    117b <print_packet+0x5b>
testb  $0x40,0x1(%rbx)
je     117b <print_packet+0x5b>
testb  $0x20,0x1b(%rbx)
lea    0xebe(%rip),%rax
lea    0xebe(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r15d,%r15d
jle    141e <print_packet+0x2fe>
lea    -0x1(%r15),%eax
mov    %r15d,%ecx
mov    %rcx,0x18(%rsp)
and    $0xf,%r15d
mov    %rax,0x20(%rsp)
lea    (%rbx,%rax,1),%r12
movb   $0x1,0x7(%rsp)
mov    $0x2e,%r14d
lea    0xeab(%rip),%r13
xor    %ebp,%ebp
mov    %r15,0x8(%rsp)
mov    %rbx,0x10(%rsp)
jmp    11dd <print_packet+0xbd>
nopl   (%rax)
mov    $0x1,%ebx
addb   $0x1,0x7(%rsp)
mov    %rbx,%rbp
cmp    0x18(%rsp),%rbx
mov    0x10(%rsp),%rbx
je     141e <print_packet+0x2fe>
test   $0xf,%bpl
jne    1200 <print_packet+0xe0>
cmp    $0xe0,%rbp
je     1410 <print_packet+0x2f0>
lea    0xe53(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl (%rbx,%rbp,1),%esi
lea    0xe52(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x1,%bpl
je     1222 <print_packet+0x102>
mov    $0x20,%edi
call   1030 <putchar@plt>
cmp    0x20(%rsp),%rbp
jne    12a2 <print_packet+0x182>
test   %r15d,%r15d
je     12a2 <print_packet+0x182>
movzbl 0x7(%rsp),%ebx
not    %ebx
and    $0xf,%ebx
jmp    124a <print_packet+0x12a>
xchg   %ax,%ax
add    $0x1,%r15d
cmp    $0x10,%r15d
je     1270 <print_packet+0x150>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x1,%r15b
je     1240 <print_packet+0x120>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1240 <print_packet+0x120>
cs nopw 0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%r15
nop
movzbl -0xe(%r12,%rbx,1),%eax
lea    -0x7f(%rax),%ecx
cmp    $0xa1,%cl
cmovb  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0xf,%rbx
jb     1280 <print_packet+0x160>
test   %rbp,%rbp
je     11c0 <print_packet+0xa0>
lea    0x1(%rbp),%rbx
test   $0xf,%bl
jne    11c5 <print_packet+0xa5>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%r15
movzbl -0xf(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0xe(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0xd(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0xc(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0xb(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0xa(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0x9(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0x8(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0x7(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0x6(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0x5(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0x4(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0x3(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0x2(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl -0x1(%r15,%rbp,1),%eax
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl (%r15,%rbp,1),%eax
mov    0x8(%rsp),%r15
cmp    $0x20,%al
cmovl  %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
jmp    11c5 <print_packet+0xa5>
lea    0xc1e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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