#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 int u_char;

/* Variables and functions */
int /*<<< orphan*/ print_ext_speed(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void dump_device_desc(u_char *p, int len, const char *type) {
  static const char *un_name[] = {"512b",  "2Kb",   "8Kb", "32Kb",
                                  "128Kb", "512Kb", "2Mb", "reserved"};
  static const char *speed[] = {"No speed", "250nS",    "200nS",   "150nS",
                                "100nS",    "Reserved", "Reserved"};
  static const char *dev[] = {
      "No device", "Mask ROM",          "OTPROM",   "UV EPROM",
      "EEPROM",    "FLASH EEPROM",      "SRAM",     "DRAM",
      "Reserved",  "Reserved",          "Reserved", "Reserved",
      "Reserved",  "Function specific", "Extended", "Reserved"};
  int count = 0;
  while (*p != 0xFF && len > 0) {
    u_char x;
    x = *p++;
    len -= 2;
    if (count++ == 0)
      printf("\t%s memory device information:\n", type);
    printf("\t\tDevice number %d, type %s, WPS = %s\n", count, dev[x >> 4],
           (x & 0x8) ? "ON" : "OFF");
    if ((x & 7) == 7) {
      len--;
      if (*p) {
        printf("\t\t");
        print_ext_speed(*p, 0);
        while (*p & 0x80) {
          p++;
          len--;
        }
      }
      p++;
    } else
      printf("\t\tSpeed = %s", speed[x & 7]);
    printf(", Memory block size = %s, %d units\n", un_name[*p & 7],
           (*p >> 3) + 1);
    p++;
  }
}


x86 assembly (clang, -O0):
<dump_device_desc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0xff,(%rcx)
mov    %al,-0x21(%rbp)
je     1159 <dump_device_desc+0x39>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1169 <dump_device_desc+0x49>
jmp    12d4 <dump_device_desc+0x1b4>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
jne    11ac <dump_device_desc+0x8c>
mov    -0x18(%rbp),%rsi
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0x2f01(%rip),%rax
mov    (%rax,%rcx,8),%rdx
mov    -0x20(%rbp),%edi
and    $0x8,%edi
lea    0xf1c(%rip),%rcx
lea    0xf12(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%rcx
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
and    $0x7,%eax
cmp    $0x7,%eax
jne    1270 <dump_device_desc+0x150>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     125f <dump_device_desc+0x13f>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <print_ext_speed@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     125a <dump_device_desc+0x13a>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    122c <dump_device_desc+0x10c>
jmp    125f <dump_device_desc+0x13f>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1292 <dump_device_desc+0x172>
mov    -0x20(%rbp),%eax
and    $0x7,%eax
movslq %eax,%rcx
lea    0x2e00(%rip),%rax
mov    (%rax,%rcx,8),%rsi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x7,%eax
movslq %eax,%rcx
lea    0x2d9b(%rip),%rax
mov    (%rax,%rcx,8),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
sar    $0x3,%edx
add    $0x1,%edx
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    113a <dump_device_desc+0x1a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_device_desc>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,(%rsp)
mov    (%rdi),%r15d
cmp    $0xff,%r15d
je     1281 <dump_device_desc+0x161>
mov    %esi,%ebp
test   %esi,%esi
jle    1281 <dump_device_desc+0x161>
mov    %rdi,%r12
lea    0xead(%rip),%r13
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
mov    %r14d,%eax
lea    0x1(%rax),%r14d
test   %eax,%eax
jne    117d <dump_device_desc+0x5d>
lea    0xfac(%rip),%rdi
mov    (%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%r12),%rbx
mov    %r15d,%eax
sar    $0x4,%eax
cltq
lea    0xeab(%rip),%rcx
movslq (%rcx,%rax,4),%rdx
add    %rcx,%rdx
test   $0x8,%r15b
lea    0xfc2(%rip),%rcx
lea    0xfbe(%rip),%rax
cmove  %rax,%rcx
lea    0xf89(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
and    $0x7,%r15d
cmp    $0x7,%r15d
jne    1220 <dump_device_desc+0x100>
add    $0xfffffffd,%ebp
cmpl   $0x0,(%rbx)
je     11ed <dump_device_desc+0xcd>
lea    0xf94(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%edi
xor    %esi,%esi
call   1040 <print_ext_speed@plt>
testb  $0x80,(%rbx)
jne    1200 <dump_device_desc+0xe0>
mov    %r12,%rbx
jmp    1213 <dump_device_desc+0xf3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0xffffffff,%ebp
lea    0x4(%r12),%rbx
testb  $0x80,0x8(%r12)
mov    %rbx,%r12
jne    1200 <dump_device_desc+0xe0>
add    $0x8,%rbx
jmp    1242 <dump_device_desc+0x122>
nopl   0x0(%rax)
add    $0xfffffffe,%ebp
mov    %r15d,%eax
lea    0xdf3(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
lea    0xf34(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%edx
mov    %edx,%eax
and    $0x7,%eax
movslq 0x0(%r13,%rax,4),%rsi
add    %r13,%rsi
sar    $0x3,%edx
add    $0x1,%edx
lea    0xf1e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rbx),%r15d
cmp    $0xff,%r15d
je     1281 <dump_device_desc+0x161>
add    $0x4,%rbx
mov    %rbx,%r12
test   %ebp,%ebp
jg     1160 <dump_device_desc+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@dump_device_desc.un_name = internal global [8 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 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 = [5 x i8] c"512b\00"
@.str.1 = [4 x i8] c"2Kb\00"
@.str.2 = [4 x i8] c"8Kb\00"
@.str.3 = [5 x i8] c"32Kb\00"
@.str.4 = [6 x i8] c"128Kb\00"
@.str.5 = [6 x i8] c"512Kb\00"
@.str.6 = [4 x i8] c"2Mb\00"
@.str.7 = [9 x i8] c"reserved\00"
@dump_device_desc.speed = internal global [7 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 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 ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0)]
@.str.8 = [9 x i8] c"No speed\00"
@.str.9 = [6 x i8] c"250nS\00"
@.str.10 = [6 x i8] c"200nS\00"
@.str.11 = [6 x i8] c"150nS\00"
@.str.12 = [6 x i8] c"100nS\00"
@.str.13 = [9 x i8] c"Reserved\00"
@dump_device_desc.dev = internal global [16 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0)]
@.str.14 = [10 x i8] c"No device\00"
@.str.15 = [9 x i8] c"Mask ROM\00"
@.str.16 = [7 x i8] c"OTPROM\00"
@.str.17 = [9 x i8] c"UV EPROM\00"
@.str.18 = [7 x i8] c"EEPROM\00"
@.str.19 = [13 x i8] c"FLASH EEPROM\00"
@.str.20 = [5 x i8] c"SRAM\00"
@.str.21 = [5 x i8] c"DRAM\00"
@.str.22 = [18 x i8] c"Function specific\00"
@.str.23 = [9 x i8] c"Extended\00"
@.str.24 = [32 x i8] c"\09%s memory device information:\0A\00"
@.str.25 = [39 x i8] c"\09\09Device number %d, type %s, WPS = %s\0A\00"
@.str.26 = [3 x i8] c"ON\00"
@.str.27 = [4 x i8] c"OFF\00"
@.str.28 = [3 x i8] c"\09\09\00"
@.str.29 = [13 x i8] c"\09\09Speed = %s\00"
@.str.30 = [36 x i8] c", Memory block size = %s, %d units\0A\00"
define void @dump_device_desc(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i32 0, i32* %7
br label %9
9: ; preds = %78, %3
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 255
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %5
%15 = icmp sgt i32 %14, 0
br label %16
16: ; preds = %13, %9
%17 = phi i1 [ false, %9 ], [ %15, %13 ]
br i1 %17, label %18, label %92
18: ; preds = %16
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i32 1
store i32* %20, i32** %4
%21 = load i32, i32* %19
store i32 %21, i32* %8
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 2
store i32 %23, i32* %5
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
%26 = icmp eq i32 %24, 0
br i1 %26, label %27, label %30
27: ; preds = %18
%28 = load i8*, i8** %6
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.24, i64 0, i64 0), i8* %28)
br label %30
30: ; preds = %27, %18
%31 = load i32, i32* %7
%32 = load i32, i32* %8
%33 = ashr i32 %32, 4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [16 x i8*], [16 x i8*]* @dump_device_desc.dev, i64 0, i64 %34
%36 = load i8*, i8** %35
%37 = load i32, i32* %8
%38 = and i32 %37, 8
%39 = icmp ne i32 %38, 0
%40 = zext i1 %39 to i64
%41 = select i1 %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0)
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.25, i64 0, i64 0), i32 %31, i8* %36, i8* %41)
%43 = load i32, i32* %8
%44 = and i32 %43, 7
%45 = icmp eq i32 %44, 7
br i1 %45, label %46, label %71
46: ; preds = %30
%47 = load i32, i32* %5
%48 = add nsw i32 %47, -1
store i32 %48, i32* %5
%49 = load i32*, i32** %4
%50 = load i32, i32* %49
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %68
52: ; preds = %46
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i64 0, i64 0))
%54 = load i32*, i32** %4
%55 = load i32, i32* %54
%56 = call i32 @print_ext_speed(i32 %55, i32 0)
br label %57
57: ; preds = %62, %52
%58 = load i32*, i32** %4
%59 = load i32, i32* %58
%60 = and i32 %59, 128
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %67
62: ; preds = %57
%63 = load i32*, i32** %4
%64 = getelementptr inbounds i32, i32* %63, i32 1
store i32* %64, i32** %4
%65 = load i32, i32* %5
%66 = add nsw i32 %65, -1
store i32 %66, i32* %5
br label %57
67: ; preds = %57
br label %68
68: ; preds = %67, %46
%69 = load i32*, i32** %4
%70 = getelementptr inbounds i32, i32* %69, i32 1
store i32* %70, i32** %4
br label %78
71: ; preds = %30
%72 = load i32, i32* %8
%73 = and i32 %72, 7
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [7 x i8*], [7 x i8*]* @dump_device_desc.speed, i64 0, i64 %74
%76 = load i8*, i8** %75
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.29, i64 0, i64 0), i8* %76)
br label %78
78: ; preds = %71, %68
%79 = load i32*, i32** %4
%80 = load i32, i32* %79
%81 = and i32 %80, 7
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [8 x i8*], [8 x i8*]* @dump_device_desc.un_name, i64 0, i64 %82
%84 = load i8*, i8** %83
%85 = load i32*, i32** %4
%86 = load i32, i32* %85
%87 = ashr i32 %86, 3
%88 = add nsw i32 %87, 1
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.30, i64 0, i64 0), i8* %84, i32 %88)
%90 = load i32*, i32** %4
%91 = getelementptr inbounds i32, i32* %90, i32 1
store i32* %91, i32** %4
br label %9
92: ; preds = %16
ret void
}

LLVM IR (-O2):
@reltable.dump_device_desc = internal unnamed_addr constant [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_device_desc to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_device_desc to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_device_desc to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.3 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_device_desc to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.4 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_device_desc to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.5 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_device_desc to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_device_desc to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.7 to i64), i64 ptrtoint ([8 x i32]* @reltable.dump_device_desc to i64)) to i32)]
@.str = [5 x i8] c"512b\00"
@.str.1 = [4 x i8] c"2Kb\00"
@.str.2 = [4 x i8] c"8Kb\00"
@.str.3 = [5 x i8] c"32Kb\00"
@.str.4 = [6 x i8] c"128Kb\00"
@.str.5 = [6 x i8] c"512Kb\00"
@.str.6 = [4 x i8] c"2Mb\00"
@.str.7 = [9 x i8] c"reserved\00"
@reltable.dump_device_desc.31 = internal unnamed_addr constant [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.8 to i64), i64 ptrtoint ([7 x i32]* @reltable.dump_device_desc.31 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.9 to i64), i64 ptrtoint ([7 x i32]* @reltable.dump_device_desc.31 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.10 to i64), i64 ptrtoint ([7 x i32]* @reltable.dump_device_desc.31 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.11 to i64), i64 ptrtoint ([7 x i32]* @reltable.dump_device_desc.31 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.12 to i64), i64 ptrtoint ([7 x i32]* @reltable.dump_device_desc.31 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.13 to i64), i64 ptrtoint ([7 x i32]* @reltable.dump_device_desc.31 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.13 to i64), i64 ptrtoint ([7 x i32]* @reltable.dump_device_desc.31 to i64)) to i32)]
@.str.8 = [9 x i8] c"No speed\00"
@.str.9 = [6 x i8] c"250nS\00"
@.str.10 = [6 x i8] c"200nS\00"
@.str.11 = [6 x i8] c"150nS\00"
@.str.12 = [6 x i8] c"100nS\00"
@.str.13 = [9 x i8] c"Reserved\00"
@reltable.dump_device_desc.32 = internal unnamed_addr constant [16 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.14 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.15 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.16 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.17 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.18 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.19 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.20 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.21 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.13 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.13 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.13 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.13 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.13 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.22 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.23 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.13 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_device_desc.32 to i64)) to i32)]
@.str.14 = [10 x i8] c"No device\00"
@.str.15 = [9 x i8] c"Mask ROM\00"
@.str.16 = [7 x i8] c"OTPROM\00"
@.str.17 = [9 x i8] c"UV EPROM\00"
@.str.18 = [7 x i8] c"EEPROM\00"
@.str.19 = [13 x i8] c"FLASH EEPROM\00"
@.str.20 = [5 x i8] c"SRAM\00"
@.str.21 = [5 x i8] c"DRAM\00"
@.str.22 = [18 x i8] c"Function specific\00"
@.str.23 = [9 x i8] c"Extended\00"
@.str.24 = [32 x i8] c"\09%s memory device information:\0A\00"
@.str.25 = [39 x i8] c"\09\09Device number %d, type %s, WPS = %s\0A\00"
@.str.26 = [3 x i8] c"ON\00"
@.str.27 = [4 x i8] c"OFF\00"
@.str.28 = [3 x i8] c"\09\09\00"
@.str.29 = [13 x i8] c"\09\09Speed = %s\00"
@.str.30 = [36 x i8] c", Memory block size = %s, %d units\0A\00"
define void @dump_device_desc(i32* nocapture %0, i32 %1, i8* %2) {
%4 = load i32, i32* %0
%5 = icmp ne i32 %4, 255
%6 = icmp sgt i32 %1, 0
%7 = and i1 %5, %6
br i1 %7, label %8, label %74
8: ; preds = %3, %58
%9 = phi i32 [ %70, %58 ], [ %4, %3 ]
%10 = phi i32* [ %69, %58 ], [ %0, %3 ]
%11 = phi i32 [ %15, %58 ], [ 0, %3 ]
%12 = phi i32 [ %59, %58 ], [ %1, %3 ]
%13 = getelementptr inbounds i32, i32* %10, i64 1
%14 = add nsw i32 %12, -2
%15 = add nuw nsw i32 %11, 1
%16 = icmp eq i32 %11, 0
br i1 %16, label %17, label %19
17: ; preds = %8
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.24, i64 0, i64 0), i8* %2)
br label %19
19: ; preds = %17, %8
%20 = ashr i32 %9, 4
%21 = sext i32 %20 to i64
%22 = shl i64 %21, 2
%23 = call i8* @llvm.load.relative.i64(i8* bitcast ([16 x i32]* @reltable.dump_device_desc.32 to i8*), i64 %22)
%24 = and i32 %9, 8
%25 = icmp eq i32 %24, 0
%26 = select i1 %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.26, i64 0, i64 0)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.25, i64 0, i64 0), i32 %15, i8* %23, i8* %26)
%28 = and i32 %9, 7
%29 = icmp eq i32 %28, 7
br i1 %29, label %30, label %53
30: ; preds = %19
%31 = add nsw i32 %12, -3
%32 = load i32, i32* %13
%33 = icmp eq i32 %32, 0
br i1 %33, label %49, label %34
34: ; preds = %30
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i64 0, i64 0))
%36 = load i32, i32* %13
%37 = tail call i32 @print_ext_speed(i32 %36, i32 0)
%38 = load i32, i32* %13
%39 = and i32 %38, 128
%40 = icmp eq i32 %39, 0
br i1 %40, label %49, label %41
41: ; preds = %34, %41
%42 = phi i32* [ %44, %41 ], [ %13, %34 ]
%43 = phi i32 [ %45, %41 ], [ %31, %34 ]
%44 = getelementptr inbounds i32, i32* %42, i64 1
%45 = add nsw i32 %43, -1
%46 = load i32, i32* %44
%47 = and i32 %46, 128
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %41
49: ; preds = %41, %34, %30
%50 = phi i32 [ %31, %30 ], [ %31, %34 ], [ %45, %41 ]
%51 = phi i32* [ %10, %30 ], [ %10, %34 ], [ %42, %41 ]
%52 = getelementptr inbounds i32, i32* %51, i64 2
br label %58
53: ; preds = %19
%54 = zext i32 %28 to i64
%55 = shl i64 %54, 2
%56 = call i8* @llvm.load.relative.i64(i8* bitcast ([7 x i32]* @reltable.dump_device_desc.31 to i8*), i64 %55)
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.29, i64 0, i64 0), i8* %56)
br label %58
58: ; preds = %53, %49
%59 = phi i32 [ %50, %49 ], [ %14, %53 ]
%60 = phi i32* [ %52, %49 ], [ %13, %53 ]
%61 = load i32, i32* %60
%62 = and i32 %61, 7
%63 = zext i32 %62 to i64
%64 = shl i64 %63, 2
%65 = call i8* @llvm.load.relative.i64(i8* bitcast ([8 x i32]* @reltable.dump_device_desc to i8*), i64 %64)
%66 = ashr i32 %61, 3
%67 = add nsw i32 %66, 1
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.30, i64 0, i64 0), i8* %65, i32 %67)
%69 = getelementptr inbounds i32, i32* %60, i64 1
%70 = load i32, i32* %69
%71 = icmp ne i32 %70, 255
%72 = icmp sgt i32 %59, 0
%73 = select i1 %71, i1 %72, i1 false
br i1 %73, label %8, label %74
74: ; preds = %58, %3
ret void
}