#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 */
typedef size_t u_int;
typedef int u_char;

/* Variables and functions */
int /*<<< orphan*/ print_speed(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
void dump_network_ext(u_char *p, int len) {
  static const char *tech[] = {"Undefined",  "ARCnet",    "Ethernet",
                               "Token ring", "Localtalk", "FDDI/CDDI",
                               "ATM",        "Wireless"};
  static const char *media[] = {"Undefined",
                                "UTP",
                                "STP",
                                "Thin coax",
                                "THICK coax",
                                "Fiber",
                                "900 MHz",
                                "2.4 GHz",
                                "5.4 GHz",
                                "Diffuse Infrared",
                                "Point to point Infrared"};
  u_int i = 0;
  if (len < 1)
    return;
  switch (p[0]) {
  case 1:
    if (len < 2)
      goto err;
    printf("\tNetwork technology: %s\n", tech[p[1] & 7]);
    break;
  case 2:
    if (len < 5)
      goto err;
    printf("\tNetwork speed: ");
    print_speed(((*((p + 1) + 3) << 24) | (*((p + 1) + 2) << 16) |
                 (*((p + 1) + 1) << 8) | *(p + 1)));
    putchar('\n');
    break;
  case 3:
    if (len < 2)
      goto err;
    if (p[1] <= 10)
      i = p[1];
    printf("\tNetwork media: %s\n", media[i]);
    break;
  case 4:
    if (len <= 2 || len < p[1] + 2)
      goto err;
    printf("\tNetwork node ID:");
    for (i = 0; i < p[1]; i++)
      printf(" %02x", p[i + 2]);
    putchar('\n');
    break;
  case 5:
    if (len < 2)
      goto err;
    printf("\tNetwork connector: %s connector standard\n",
           (p[1] == 0) ? "open" : "closed");
    break;
  err:
    printf("\tWrong length for network extension tuple\n");
    return;
  }
}


x86 assembly (clang, -O0):
<dump_network_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    1156 <dump_network_ext+0x26>
jmp    1336 <dump_network_ext+0x206>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x4,%eax
ja     1336 <dump_network_ext+0x206>
mov    -0x20(%rbp),%rax
lea    0xe87(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x2,-0xc(%rbp)
jge    1191 <dump_network_ext+0x61>
jmp    1328 <dump_network_ext+0x1f8>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x7,%eax
movslq %eax,%rcx
lea    0x2e9b(%rip),%rax
mov    (%rax,%rcx,8),%rsi
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1336 <dump_network_ext+0x206>
cmpl   $0x5,-0xc(%rbp)
jge    11cb <dump_network_ext+0x9b>
jmp    1328 <dump_network_ext+0x1f8>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%edi
shl    $0x18,%edi
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x10,%eax
or     %eax,%edi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x8,%eax
or     %eax,%edi
mov    -0x8(%rbp),%rax
or     0x4(%rax),%edi
call   1030 <print_speed@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1336 <dump_network_ext+0x206>
cmpl   $0x2,-0xc(%rbp)
jge    1225 <dump_network_ext+0xf5>
jmp    1328 <dump_network_ext+0x1f8>
mov    -0x8(%rbp),%rax
cmpl   $0xa,0x4(%rax)
jg     123f <dump_network_ext+0x10f>
mov    -0x8(%rbp),%rax
movslq 0x4(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
lea    0x2e36(%rip),%rax
mov    (%rax,%rcx,8),%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1336 <dump_network_ext+0x206>
cmpl   $0x2,-0xc(%rbp)
jle    1280 <dump_network_ext+0x150>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    1285 <dump_network_ext+0x155>
jmp    1328 <dump_network_ext+0x1f8>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x4(%rcx),%rcx
cmp    %rcx,%rax
jae    12db <dump_network_ext+0x1ab>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    0x8(%rax,%rcx,4),%esi
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    129b <dump_network_ext+0x16b>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1336 <dump_network_ext+0x206>
cmpl   $0x2,-0xc(%rbp)
jge    12f9 <dump_network_ext+0x1c9>
jmp    1328 <dump_network_ext+0x1f8>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
lea    0xe3d(%rip),%rsi
lea    0xe31(%rip),%rax
cmp    $0x0,%ecx
cmove  %rax,%rsi
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1336 <dump_network_ext+0x206>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_network_ext>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1190 <dump_network_ext+0x50>
mov    %rdi,%r15
mov    (%rdi),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     1190 <dump_network_ext+0x50>
lea    0xea3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmp    $0x2,%esi
jb     1260 <dump_network_ext+0x120>
mov    0x4(%r15),%eax
and    $0x7,%eax
lea    0xe97(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
lea    0xf7f(%rip),%rdi
jmp    128f <dump_network_ext+0x14f>
pop    %rbx
pop    %r14
pop    %r15
ret
cmp    $0x5,%esi
jb     1260 <dump_network_ext+0x120>
lea    0xf7d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%r15),%eax
shl    $0x18,%eax
mov    0x8(%r15),%edi
mov    0xc(%r15),%ecx
shl    $0x10,%ecx
or     %eax,%ecx
shl    $0x8,%edi
or     %ecx,%edi
or     0x4(%r15),%edi
call   1030 <print_speed@plt>
jmp    124c <dump_network_ext+0x10c>
cmp    $0x2,%esi
jb     1260 <dump_network_ext+0x120>
mov    0x4(%r15),%eax
xor    %ecx,%ecx
cmp    $0xb,%eax
cmovge %ecx,%eax
cltq
lea    0xe45(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
lea    0xf37(%rip),%rdi
jmp    128f <dump_network_ext+0x14f>
cmp    $0x3,%esi
jb     1260 <dump_network_ext+0x120>
mov    0x4(%r15),%eax
add    $0x2,%eax
cmp    %esi,%eax
jg     1260 <dump_network_ext+0x120>
lea    0xf2f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,0x4(%r15)
je     124c <dump_network_ext+0x10c>
lea    0xf2c(%rip),%r14
xor    %ebx,%ebx
mov    0x8(%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbx
movslq 0x4(%r15),%rax
cmp    %rax,%rbx
jb     1230 <dump_network_ext+0xf0>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <putchar@plt>
cmp    $0x2,%esi
jae    1271 <dump_network_ext+0x131>
lea    0xf30(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <puts@plt>
cmpl   $0x0,0x4(%r15)
lea    0xf0e(%rip),%rax
lea    0xf0c(%rip),%rsi
cmove  %rax,%rsi
lea    0xed1(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <printf@plt>

LLVM IR (-O0):
@dump_network_ext.tech = internal global [8 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i32 0, i32 0)]
@.str = [10 x i8] c"Undefined\00"
@.str.1 = [7 x i8] c"ARCnet\00"
@.str.2 = [9 x i8] c"Ethernet\00"
@.str.3 = [11 x i8] c"Token ring\00"
@.str.4 = [10 x i8] c"Localtalk\00"
@.str.5 = [10 x i8] c"FDDI/CDDI\00"
@.str.6 = [4 x i8] c"ATM\00"
@.str.7 = [9 x i8] c"Wireless\00"
@dump_network_ext.media = internal global [11 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.17, i32 0, i32 0)]
@.str.8 = [4 x i8] c"UTP\00"
@.str.9 = [4 x i8] c"STP\00"
@.str.10 = [10 x i8] c"Thin coax\00"
@.str.11 = [11 x i8] c"THICK coax\00"
@.str.12 = [6 x i8] c"Fiber\00"
@.str.13 = [8 x i8] c"900 MHz\00"
@.str.14 = [8 x i8] c"2.4 GHz\00"
@.str.15 = [8 x i8] c"5.4 GHz\00"
@.str.16 = [17 x i8] c"Diffuse Infrared\00"
@.str.17 = [24 x i8] c"Point to point Infrared\00"
@.str.18 = [25 x i8] c"\09Network technology: %s\0A\00"
@.str.19 = [17 x i8] c"\09Network speed: \00"
@.str.20 = [20 x i8] c"\09Network media: %s\0A\00"
@.str.21 = [18 x i8] c"\09Network node ID:\00"
@.str.22 = [6 x i8] c" %02x\00"
@.str.23 = [43 x i8] c"\09Network connector: %s connector standard\0A\00"
@.str.24 = [5 x i8] c"open\00"
@.str.25 = [7 x i8] c"closed\00"
@.str.26 = [43 x i8] c"\09Wrong length for network extension tuple\0A\00"
define void @dump_network_ext(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
store i64 0, i64* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %120
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
switch i32 %12, label %120 [
i32 1, label %13
i32 2, label %26
i32 3, label %55
i32 4, label %74
i32 5, label %106
]
13: ; preds = %9
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 2
br i1 %15, label %16, label %17
16: ; preds = %13
br label %118
17: ; preds = %13
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
%21 = and i32 %20, 7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [8 x i8*], [8 x i8*]* @dump_network_ext.tech, i64 0, i64 %22
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i8* %24)
br label %120
26: ; preds = %9
%27 = load i32, i32* %4
%28 = icmp slt i32 %27, 5
br i1 %28, label %29, label %30
29: ; preds = %26
br label %118
30: ; preds = %26
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0))
%32 = load i32*, i32** %3
%33 = getelementptr inbounds i32, i32* %32, i64 1
%34 = getelementptr inbounds i32, i32* %33, i64 3
%35 = load i32, i32* %34
%36 = shl i32 %35, 24
%37 = load i32*, i32** %3
%38 = getelementptr inbounds i32, i32* %37, i64 1
%39 = getelementptr inbounds i32, i32* %38, i64 2
%40 = load i32, i32* %39
%41 = shl i32 %40, 16
%42 = or i32 %36, %41
%43 = load i32*, i32** %3
%44 = getelementptr inbounds i32, i32* %43, i64 1
%45 = getelementptr inbounds i32, i32* %44, i64 1
%46 = load i32, i32* %45
%47 = shl i32 %46, 8
%48 = or i32 %42, %47
%49 = load i32*, i32** %3
%50 = getelementptr inbounds i32, i32* %49, i64 1
%51 = load i32, i32* %50
%52 = or i32 %48, %51
%53 = call i32 @print_speed(i32 %52)
%54 = call i32 @putchar(i8 signext 10)
br label %120
55: ; preds = %9
%56 = load i32, i32* %4
%57 = icmp slt i32 %56, 2
br i1 %57, label %58, label %59
58: ; preds = %55
br label %118
59: ; preds = %55
%60 = load i32*, i32** %3
%61 = getelementptr inbounds i32, i32* %60, i64 1
%62 = load i32, i32* %61
%63 = icmp sle i32 %62, 10
br i1 %63, label %64, label %69
64: ; preds = %59
%65 = load i32*, i32** %3
%66 = getelementptr inbounds i32, i32* %65, i64 1
%67 = load i32, i32* %66
%68 = sext i32 %67 to i64
store i64 %68, i64* %5
br label %69
69: ; preds = %64, %59
%70 = load i64, i64* %5
%71 = getelementptr inbounds [11 x i8*], [11 x i8*]* @dump_network_ext.media, i64 0, i64 %70
%72 = load i8*, i8** %71
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0), i8* %72)
br label %120
74: ; preds = %9
%75 = load i32, i32* %4
%76 = icmp sle i32 %75, 2
br i1 %76, label %84, label %77
77: ; preds = %74
%78 = load i32, i32* %4
%79 = load i32*, i32** %3
%80 = getelementptr inbounds i32, i32* %79, i64 1
%81 = load i32, i32* %80
%82 = add nsw i32 %81, 2
%83 = icmp slt i32 %78, %82
br i1 %83, label %84, label %85
84: ; preds = %77, %74
br label %118
85: ; preds = %77
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0))
store i64 0, i64* %5
br label %87
87: ; preds = %101, %85
%88 = load i64, i64* %5
%89 = load i32*, i32** %3
%90 = getelementptr inbounds i32, i32* %89, i64 1
%91 = load i32, i32* %90
%92 = sext i32 %91 to i64
%93 = icmp ult i64 %88, %92
br i1 %93, label %94, label %104
94: ; preds = %87
%95 = load i32*, i32** %3
%96 = load i64, i64* %5
%97 = add i64 %96, 2
%98 = getelementptr inbounds i32, i32* %95, i64 %97
%99 = load i32, i32* %98
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0), i32 %99)
br label %101
101: ; preds = %94
%102 = load i64, i64* %5
%103 = add i64 %102, 1
store i64 %103, i64* %5
br label %87
104: ; preds = %87
%105 = call i32 @putchar(i8 signext 10)
br label %120
106: ; preds = %9
%107 = load i32, i32* %4
%108 = icmp slt i32 %107, 2
br i1 %108, label %109, label %110
109: ; preds = %106
br label %118
110: ; preds = %106
%111 = load i32*, i32** %3
%112 = getelementptr inbounds i32, i32* %111, i64 1
%113 = load i32, i32* %112
%114 = icmp eq i32 %113, 0
%115 = zext i1 %114 to i64
%116 = select i1 %114, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0)
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.23, i64 0, i64 0), i8* %116)
br label %120
118: ; preds = %109, %84, %58, %29, %16
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.26, i64 0, i64 0))
br label %120
120: ; preds = %8, %118, %9, %110, %104, %69, %30, %17
ret void
}

LLVM IR (-O2):
@reltable.dump_network_ext = internal unnamed_addr constant [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_network_ext to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_network_ext to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.2 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_network_ext to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.3 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_network_ext to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.4 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_network_ext to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.5 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_network_ext to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_network_ext to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.7 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_network_ext to i64)) to i32)]
@.str = [10 x i8] c"Undefined\00"
@.str.1 = [7 x i8] c"ARCnet\00"
@.str.2 = [9 x i8] c"Ethernet\00"
@.str.3 = [11 x i8] c"Token ring\00"
@.str.4 = [10 x i8] c"Localtalk\00"
@.str.5 = [10 x i8] c"FDDI/CDDI\00"
@.str.6 = [4 x i8] c"ATM\00"
@.str.7 = [9 x i8] c"Wireless\00"
@reltable.dump_network_ext.27 = internal unnamed_addr constant [11 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([11 x i32]* @reltable.dump_network_ext.27 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.8 to i64), i64 ptrtoint ([11 x i32]* @reltable.dump_network_ext.27 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.9 to i64), i64 ptrtoint ([11 x i32]* @reltable.dump_network_ext.27 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.10 to i64), i64 ptrtoint ([11 x i32]* @reltable.dump_network_ext.27 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.11 to i64), i64 ptrtoint ([11 x i32]* @reltable.dump_network_ext.27 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.12 to i64), i64 ptrtoint ([11 x i32]* @reltable.dump_network_ext.27 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.13 to i64), i64 ptrtoint ([11 x i32]* @reltable.dump_network_ext.27 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.14 to i64), i64 ptrtoint ([11 x i32]* @reltable.dump_network_ext.27 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.15 to i64), i64 ptrtoint ([11 x i32]* @reltable.dump_network_ext.27 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.16 to i64), i64 ptrtoint ([11 x i32]* @reltable.dump_network_ext.27 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.17 to i64), i64 ptrtoint ([11 x i32]* @reltable.dump_network_ext.27 to i64)) to i32)]
@.str.8 = [4 x i8] c"UTP\00"
@.str.9 = [4 x i8] c"STP\00"
@.str.10 = [10 x i8] c"Thin coax\00"
@.str.11 = [11 x i8] c"THICK coax\00"
@.str.12 = [6 x i8] c"Fiber\00"
@.str.13 = [8 x i8] c"900 MHz\00"
@.str.14 = [8 x i8] c"2.4 GHz\00"
@.str.15 = [8 x i8] c"5.4 GHz\00"
@.str.16 = [17 x i8] c"Diffuse Infrared\00"
@.str.17 = [24 x i8] c"Point to point Infrared\00"
@.str.18 = [25 x i8] c"\09Network technology: %s\0A\00"
@.str.19 = [17 x i8] c"\09Network speed: \00"
@.str.20 = [20 x i8] c"\09Network media: %s\0A\00"
@.str.21 = [18 x i8] c"\09Network node ID:\00"
@.str.22 = [6 x i8] c" %02x\00"
@.str.23 = [43 x i8] c"\09Network connector: %s connector standard\0A\00"
@.str.24 = [5 x i8] c"open\00"
@.str.25 = [7 x i8] c"closed\00"
@str = [42 x i8] c"\09Wrong length for network extension tuple\00"
define void @dump_network_ext(i32* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %80, label %4
4: ; preds = %2
%5 = load i32, i32* %0
switch i32 %5, label %80 [
i32 1, label %6
i32 2, label %16
i32 3, label %36
i32 4, label %47
i32 5, label %70
]
6: ; preds = %4
%7 = icmp ult i32 %1, 2
br i1 %7, label %78, label %8
8: ; preds = %6
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = load i32, i32* %9
%11 = and i32 %10, 7
%12 = zext i32 %11 to i64
%13 = shl i64 %12, 2
%14 = call i8* @llvm.load.relative.i64(i8* bitcast ([8 x i32]* @reltable.dump_network_ext to i8*), i64 %13)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i8* %14)
br label %80
16: ; preds = %4
%17 = icmp ult i32 %1, 5
br i1 %17, label %78, label %18
18: ; preds = %16
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0))
%20 = getelementptr inbounds i32, i32* %0, i64 1
%21 = getelementptr inbounds i32, i32* %0, i64 4
%22 = load i32, i32* %21
%23 = shl i32 %22, 24
%24 = getelementptr inbounds i32, i32* %0, i64 3
%25 = load i32, i32* %24
%26 = shl i32 %25, 16
%27 = or i32 %26, %23
%28 = getelementptr inbounds i32, i32* %0, i64 2
%29 = load i32, i32* %28
%30 = shl i32 %29, 8
%31 = or i32 %27, %30
%32 = load i32, i32* %20
%33 = or i32 %31, %32
%34 = tail call i32 @print_speed(i32 %33)
%35 = tail call i32 @putchar(i8 signext 10)
br label %80
36: ; preds = %4
%37 = icmp ult i32 %1, 2
br i1 %37, label %78, label %38
38: ; preds = %36
%39 = getelementptr inbounds i32, i32* %0, i64 1
%40 = load i32, i32* %39
%41 = icmp slt i32 %40, 11
%42 = select i1 %41, i32 %40, i32 0
%43 = sext i32 %42 to i64
%44 = shl i64 %43, 2
%45 = call i8* @llvm.load.relative.i64(i8* bitcast ([11 x i32]* @reltable.dump_network_ext.27 to i8*), i64 %44)
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0), i8* %45)
br label %80
47: ; preds = %4
%48 = icmp ult i32 %1, 3
br i1 %48, label %78, label %49
49: ; preds = %47
%50 = getelementptr inbounds i32, i32* %0, i64 1
%51 = load i32, i32* %50
%52 = add nsw i32 %51, 2
%53 = icmp sgt i32 %52, %1
br i1 %53, label %78, label %54
54: ; preds = %49
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0))
%56 = load i32, i32* %50
%57 = icmp eq i32 %56, 0
br i1 %57, label %68, label %58
58: ; preds = %54, %58
%59 = phi i64 [ %64, %58 ], [ 0, %54 ]
%60 = add i64 %59, 2
%61 = getelementptr inbounds i32, i32* %0, i64 %60
%62 = load i32, i32* %61
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0), i32 %62)
%64 = add nuw i64 %59, 1
%65 = load i32, i32* %50
%66 = sext i32 %65 to i64
%67 = icmp ult i64 %64, %66
br i1 %67, label %58, label %68
68: ; preds = %58, %54
%69 = tail call i32 @putchar(i8 signext 10)
br label %80
70: ; preds = %4
%71 = icmp ult i32 %1, 2
br i1 %71, label %78, label %72
72: ; preds = %70
%73 = getelementptr inbounds i32, i32* %0, i64 1
%74 = load i32, i32* %73
%75 = icmp eq i32 %74, 0
%76 = select i1 %75, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0)
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.23, i64 0, i64 0), i8* %76)
br label %80
78: ; preds = %70, %47, %49, %36, %16, %6
%79 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
br label %80
80: ; preds = %8, %18, %38, %68, %72, %4, %2, %78
ret void
}