#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 uint8_t;
typedef int uint32_t;
struct usb_handle {
  int dummy;
};
typedef int /*<<< orphan*/ msg_getid;
typedef int /*<<< orphan*/ id;

/* Variables and functions */
int /*<<< orphan*/ memset(int *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int usb_read(struct usb_handle *, int *, int);
int usb_write(struct usb_handle *, int const *, int);
int read_asic_id(struct usb_handle *usb) {
  const uint32_t msg_getid = 0xF0030003;
  int i, j, k, ret;
  uint8_t id[81];
  char line[16 * 3 + 5];
  printf("reading ASIC ID\n");
  memset(id, 0xee, sizeof(id));
  if (usb_write(usb, &msg_getid, sizeof(msg_getid)) != sizeof(msg_getid)) {
    printf("Could not send msg_getid request\n");
    return -1;
  }
  if (usb_read(usb, id, sizeof(id)) != sizeof(id)) {
    printf("Could not read msg_getid answer\n");
    return -1;
  }
  for (i = 0; i < sizeof(id); i += 16) {
    sprintf(line, "%02X: ", i);
    for (j = 0; j < 16 && j < sizeof(id) - i; j++)
      sprintf(line + 4 + j * 3, "%02X ", id[i + j]);
    line[4 + j * 3] = 0;
    puts(line);
  }
  ret = 0;
  for (i = 1, j = 0; i < sizeof(id) && j < id[0]; i += 2 + id[i + 1], j++) {
    if (i + 2 + id[i + 1] > sizeof(id)) {
      printf("Truncated subblock\n");
      ret++;
      continue;
    }
    switch (id[i]) {
    case 0x01:
      if (id[i + 1] != 0x05) {
        printf("Unexpected ID subblock size\n");
        ret++;
        continue;
      }
      if (id[i + 2] != 0x01)
        printf("Unexpected fixed value\n");
      k = (id[i + 3] << 8) | id[i + 4];
      switch (k) {
      case 0x4440:
        printf("OMAP 4460 Device\n");
        break;
      default:
        printf("Unknown Device\n");
        break;
      }
      switch (id[i + 5]) {
      case 0x07:
        printf("CH enabled (read from eFuse)\n");
        break;
      case 0x17:
        printf("CH disabled (read from eFuse)\n");
        break;
      default:
        printf("Unknown CH setting\n");
        break;
      }
      printf("Rom version: %hhu\n", id[i + 6]);
      break;
    case 0x15:
      if (id[i + 1] != 0x09) {
        printf("Unexpected Checksum subblock size\n");
        ret++;
        continue;
      }
      if (id[i + 2] != 0x01)
        printf("Unexpected fixed value\n");
      k = (id[i + 3] << 24) | (id[i + 4] << 16) | (id[i + 5] << 8) | id[i + 6];
      printf("Rom CRC: 0x%08X\n", k);
      k = (id[i + 7] << 24) | (id[i + 8] << 16) | (id[i + 9] << 8) | id[i + 10];
      switch (k) {
      case 0:
        printf("A GP device\n");
        break;
      default:
        printf("Unknown device\n");
        break;
      }
      break;
    }
  }
  if (i != sizeof(id) || j != id[0]) {
    printf("Unexpected ASIC ID structure size.\n");
    ret++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<read_asic_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0xf0030003,-0x14(%rbp)
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x170(%rbp),%rdi
mov    $0xee,%esi
mov    $0x144,%edx
call   1060 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <usb_write@plt>
cltq
cmp    $0x4,%rax
je     11d2 <read_asic_id+0x72>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1647 <read_asic_id+0x4e7>
mov    -0x10(%rbp),%rdi
lea    -0x170(%rbp),%rsi
mov    $0x144,%edx
call   1070 <usb_read@plt>
cltq
cmp    $0x144,%rax
je     120f <read_asic_id+0xaf>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1647 <read_asic_id+0x4e7>
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmp    $0x144,%rax
jae    12ec <read_asic_id+0x18c>
lea    -0x1b0(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xe1d(%rip),%rsi
call   1080 <sprintf@plt>
movl   $0x0,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x10,-0x1c(%rbp)
mov    %al,-0x1b1(%rbp)
jge    1271 <read_asic_id+0x111>
movslq -0x1c(%rbp),%rax
movslq -0x18(%rbp),%rdx
mov    $0x144,%ecx
sub    %rdx,%rcx
cmp    %rcx,%rax
setb   %al
mov    %al,-0x1b1(%rbp)
mov    -0x1b1(%rbp),%al
test   $0x1,%al
jne    1284 <read_asic_id+0x124>
jmp    12c1 <read_asic_id+0x161>
lea    -0x1b0(%rbp),%rdi
add    $0x4,%rdi
imul   $0x3,-0x1c(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
cltq
mov    -0x170(%rbp,%rax,4),%edx
lea    0xdad(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1243 <read_asic_id+0xe3>
imul   $0x3,-0x1c(%rbp),%eax
add    $0x4,%eax
cltq
movb   $0x0,-0x1b0(%rbp,%rax,1)
lea    -0x1b0(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x18(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x18(%rbp)
jmp    1216 <read_asic_id+0xb6>
movl   $0x0,-0x24(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    $0x144,%rcx
mov    %al,-0x1b2(%rbp)
jae    132c <read_asic_id+0x1cc>
mov    -0x1c(%rbp),%eax
cmp    -0x170(%rbp),%eax
setl   %al
mov    %al,-0x1b2(%rbp)
mov    -0x1b2(%rbp),%al
test   $0x1,%al
jne    133f <read_asic_id+0x1df>
jmp    160b <read_asic_id+0x4ab>
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
add    -0x170(%rbp,%rcx,4),%eax
cltq
cmp    $0x144,%rax
jbe    137f <read_asic_id+0x21f>
lea    0xcf7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    15e5 <read_asic_id+0x485>
movslq -0x18(%rbp),%rax
mov    -0x170(%rbp,%rax,4),%eax
mov    %eax,-0x1b8(%rbp)
sub    $0x1,%eax
je     13b2 <read_asic_id+0x252>
jmp    139e <read_asic_id+0x23e>
mov    -0x1b8(%rbp),%eax
sub    $0x15,%eax
je     14df <read_asic_id+0x37f>
jmp    15e0 <read_asic_id+0x480>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cltq
cmpl   $0x5,-0x170(%rbp,%rax,4)
05
je     13e4 <read_asic_id+0x284>
lea    0xca6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    15e5 <read_asic_id+0x485>
mov    -0x18(%rbp),%eax
add    $0x2,%eax
cltq
cmpl   $0x1,-0x170(%rbp,%rax,4)
01
je     1408 <read_asic_id+0x2a8>
lea    0xc91(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movslq -0x18(%rbp),%rcx
mov    -0x164(%rbp,%rcx,4),%eax
mov    -0x160(%rbp,%rcx,4),%ecx
shl    $0x8,%eax
or     %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
sub    $0x4440,%eax
jne    1448 <read_asic_id+0x2e8>
jmp    1435 <read_asic_id+0x2d5>
lea    0xc6e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1456 <read_asic_id+0x2f6>
lea    0xc6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movslq -0x18(%rbp),%rax
mov    -0x15c(%rbp,%rax,4),%eax
mov    %eax,-0x1bc(%rbp)
sub    $0x7,%eax
je     1489 <read_asic_id+0x329>
jmp    1475 <read_asic_id+0x315>
mov    -0x1bc(%rbp),%eax
sub    $0x17,%eax
je     149c <read_asic_id+0x33c>
jmp    14af <read_asic_id+0x34f>
lea    0xc3c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14bd <read_asic_id+0x35d>
lea    0xc47(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14bd <read_asic_id+0x35d>
lea    0xc53(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x6,%eax
cltq
mov    -0x170(%rbp,%rax,4),%esi
lea    0xc4a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15e0 <read_asic_id+0x480>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cltq
cmpl   $0x9,-0x170(%rbp,%rax,4)
09
je     1511 <read_asic_id+0x3b1>
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    15e5 <read_asic_id+0x485>
mov    -0x18(%rbp),%eax
add    $0x2,%eax
cltq
cmpl   $0x1,-0x170(%rbp,%rax,4)
01
je     1535 <read_asic_id+0x3d5>
lea    0xb64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movslq -0x18(%rbp),%rcx
mov    -0x164(%rbp,%rcx,4),%eax
mov    -0x160(%rbp,%rcx,4),%edx
shl    $0x18,%eax
shl    $0x10,%edx
or     %edx,%eax
mov    -0x15c(%rbp,%rcx,4),%edx
shl    $0x8,%edx
or     %edx,%eax
mov    -0x158(%rbp,%rcx,4),%ecx
or     %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xbe2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movslq -0x18(%rbp),%rcx
mov    -0x154(%rbp,%rcx,4),%eax
mov    -0x150(%rbp,%rcx,4),%edx
shl    $0x18,%eax
shl    $0x10,%edx
or     %edx,%eax
mov    -0x14c(%rbp,%rcx,4),%edx
shl    $0x8,%edx
or     %edx,%eax
mov    -0x148(%rbp,%rcx,4),%ecx
or     %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
test   %eax,%eax
jne    15cd <read_asic_id+0x46d>
jmp    15ba <read_asic_id+0x45a>
lea    0xba3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15db <read_asic_id+0x47b>
lea    0xb9d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15e0 <read_asic_id+0x480>
jmp    15e5 <read_asic_id+0x485>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x170(%rbp,%rax,4),%eax
add    $0x2,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1301 <read_asic_id+0x1a1>
movslq -0x18(%rbp),%rax
cmp    $0x144,%rax
jne    162a <read_asic_id+0x4ca>
mov    -0x1c(%rbp),%eax
cmp    -0x170(%rbp),%eax
je     1641 <read_asic_id+0x4e1>
lea    0xb50(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_asic_id>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
mov    %rdi,%rbp
movl   $0xf0030003,0xc(%rsp)
f0
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
lea    0x10(%rsp),%rdi
mov    $0xee,%esi
mov    $0x144,%edx
call   1060 <memset@plt>
lea    0xc(%rsp),%rsi
mov    %rbp,%rdi
mov    $0x4,%edx
call   1030 <usb_write@plt>
cmp    $0x4,%eax
jne    1264 <read_asic_id+0x104>
lea    0x10(%rsp),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x144,%edx
call   1070 <usb_read@plt>
cmp    $0x144,%eax
jne    126d <read_asic_id+0x10d>
xor    %r12d,%r12d
lea    0x160(%rsp),%rbp
lea    0xe1e(%rip),%r13
jmp    1219 <read_asic_id+0xb9>
nopl   0x0(%rax,%rax,1)
movb   $0x0,0x0(%rbp)
lea    0x160(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <puts@plt>
lea    0x10(%r12),%rax
add    $0x40,%rbx
cmp    $0x134,%r12
mov    %rax,%r12
jae    1292 <read_asic_id+0x132>
mov    %rbp,%rdi
lea    0xddd(%rip),%rsi
mov    %r12d,%edx
call   1080 <sprintf@plt>
mov    $0x144,%r14d
sub    %r12,%r14
lea    0x164(%rsp),%rbp
xor    %r15d,%r15d
nop
mov    (%rbx,%r15,4),%edx
mov    %rbp,%rdi
mov    %r13,%rsi
call   1080 <sprintf@plt>
add    $0x3,%rbp
cmp    $0xe,%r15
ja     11f0 <read_asic_id+0x90>
add    $0x1,%r15
cmp    %r15,%r14
ja     1240 <read_asic_id+0xe0>
jmp    11f0 <read_asic_id+0x90>
lea    0xf0a(%rip),%rdi
jmp    1274 <read_asic_id+0x114>
lea    0xee1(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmpl   $0x0,0x10(%rsp)
jle    1471 <read_asic_id+0x311>
mov    $0x1,%r12d
mov    $0x1,%eax
lea    0xe93(%rip),%r14
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12d,%edx
mov    %r12d,%r15d
mov    0x14(%rsp,%r15,4),%ecx
lea    (%rcx,%rdx,1),%esi
add    $0x2,%esi
lea    0x2(%rdx),%r12d
lea    0x1(%r15),%r13
cmp    $0x145,%esi
jb     1320 <read_asic_id+0x1c0>
mov    %r14,%rdi
call   1040 <puts@plt>
add    $0x1,%ebx
add    0x10(%rsp,%r13,4),%r12d
add    $0x1,%ebp
mov    0x10(%rsp),%ecx
cmp    $0x143,%r12d
ja     145e <read_asic_id+0x2fe>
movslq %r12d,%rax
cmp    %ecx,%ebp
jl     12c0 <read_asic_id+0x160>
jmp    145e <read_asic_id+0x2fe>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rax,4),%eax
cmp    $0x15,%eax
je     13bf <read_asic_id+0x25f>
cmp    $0x1,%eax
jne    12ec <read_asic_id+0x18c>
cmp    $0x5,%ecx
jne    1435 <read_asic_id+0x2d5>
mov    %r12d,%eax
cmpl   $0x1,0x10(%rsp,%rax,4)
je     1351 <read_asic_id+0x1f1>
lea    0xdc3(%rip),%rdi
call   1040 <puts@plt>
mov    0x1c(%rsp,%r15,4),%eax
shl    $0x8,%eax
or     0x20(%rsp,%r15,4),%eax
cmp    $0x4440,%eax
lea    0xd37(%rip),%rdi
lea    0xd8d(%rip),%rax
cmove  %rax,%rdi
call   1040 <puts@plt>
mov    0x24(%rsp,%r15,4),%eax
cmp    $0x17,%eax
lea    0xd62(%rip),%rdi
lea    0xd20(%rip),%rcx
cmove  %rcx,%rdi
cmp    $0x7,%eax
lea    0xd30(%rip),%rax
cmove  %rax,%rdi
call   1040 <puts@plt>
mov    0x28(%rsp,%r15,4),%esi
lea    0xc5a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    12ec <read_asic_id+0x18c>
cmp    $0x9,%ecx
jne    1441 <read_asic_id+0x2e1>
mov    %r12d,%eax
cmpl   $0x1,0x10(%rsp,%rax,4)
je     13da <read_asic_id+0x27a>
lea    0xd3a(%rip),%rdi
call   1040 <puts@plt>
mov    0x1c(%rsp,%r15,4),%eax
mov    0x20(%rsp,%r15,4),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x24(%rsp,%r15,4),%esi
shl    $0x8,%esi
or     %ecx,%esi
or     0x28(%rsp,%r15,4),%esi
lea    0xc1e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2c(%rsp,%r15,4),%eax
mov    0x30(%rsp,%r15,4),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x34(%rsp,%r15,4),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x38(%rsp,%r15,4),%eax
je     144d <read_asic_id+0x2ed>
lea    0xc31(%rip),%rdi
jmp    1454 <read_asic_id+0x2f4>
lea    0xcea(%rip),%rdi
jmp    12e4 <read_asic_id+0x184>
lea    0xc37(%rip),%rdi
jmp    12e4 <read_asic_id+0x184>
lea    0xc1f(%rip),%rdi
call   1040 <puts@plt>
jmp    12ec <read_asic_id+0x18c>
cmp    $0x144,%r12d
jne    1473 <read_asic_id+0x313>
cmp    %ecx,%ebp
je     127e <read_asic_id+0x11e>
jmp    1473 <read_asic_id+0x313>
xor    %ebx,%ebx
lea    0xbc7(%rip),%rdi
call   1040 <puts@plt>
add    $0x1,%ebx
jmp    127e <read_asic_id+0x11e>

LLVM IR (-O0):
%struct.usb_handle = type { i32 }
@.str = [17 x i8] c"reading ASIC ID\0A\00"
@.str.1 = [34 x i8] c"Could not send msg_getid request\0A\00"
@.str.2 = [33 x i8] c"Could not read msg_getid answer\0A\00"
@.str.3 = [7 x i8] c"%02X: \00"
@.str.4 = [6 x i8] c"%02X \00"
@.str.5 = [20 x i8] c"Truncated subblock\0A\00"
@.str.6 = [29 x i8] c"Unexpected ID subblock size\0A\00"
@.str.7 = [24 x i8] c"Unexpected fixed value\0A\00"
@.str.8 = [18 x i8] c"OMAP 4460 Device\0A\00"
@.str.9 = [16 x i8] c"Unknown Device\0A\00"
@.str.10 = [30 x i8] c"CH enabled (read from eFuse)\0A\00"
@.str.11 = [31 x i8] c"CH disabled (read from eFuse)\0A\00"
@.str.12 = [20 x i8] c"Unknown CH setting\0A\00"
@.str.13 = [19 x i8] c"Rom version: %hhu\0A\00"
@.str.14 = [35 x i8] c"Unexpected Checksum subblock size\0A\00"
@.str.15 = [17 x i8] c"Rom CRC: 0x%08X\0A\00"
@.str.16 = [13 x i8] c"A GP device\0A\00"
@.str.17 = [16 x i8] c"Unknown device\0A\00"
@.str.18 = [36 x i8] c"Unexpected ASIC ID structure size.\0A\00"
define i32 @read_asic_id(%struct.usb_handle* %0) {
%2 = alloca i32
%3 = alloca %struct.usb_handle*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [81 x i32]
%10 = alloca [53 x i8]
store %struct.usb_handle* %0, %struct.usb_handle** %3
store i32 -268238845, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 0
%13 = call i32 @memset(i32* %12, i32 238, i32 324)
%14 = load %struct.usb_handle*, %struct.usb_handle** %3
%15 = call i32 @usb_write(%struct.usb_handle* %14, i32* %4, i32 4)
%16 = sext i32 %15 to i64
%17 = icmp ne i64 %16, 4
br i1 %17, label %18, label %20
18: ; preds = %1
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %274
20: ; preds = %1
%21 = load %struct.usb_handle*, %struct.usb_handle** %3
%22 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 0
%23 = call i32 @usb_read(%struct.usb_handle* %21, i32* %22, i32 324)
%24 = sext i32 %23 to i64
%25 = icmp ne i64 %24, 324
br i1 %25, label %26, label %28
26: ; preds = %20
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %2
br label %274
28: ; preds = %20
store i32 0, i32* %5
br label %29
29: ; preds = %74, %28
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = icmp ult i64 %31, 324
br i1 %32, label %33, label %77
33: ; preds = %29
%34 = getelementptr inbounds [53 x i8], [53 x i8]* %10, i64 0, i64 0
%35 = load i32, i32* %5
%36 = call i32 @sprintf(i8* %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %35)
store i32 0, i32* %6
br label %37
37: ; preds = %63, %33
%38 = load i32, i32* %6
%39 = icmp slt i32 %38, 16
br i1 %39, label %40, label %47
40: ; preds = %37
%41 = load i32, i32* %6
%42 = sext i32 %41 to i64
%43 = load i32, i32* %5
%44 = sext i32 %43 to i64
%45 = sub i64 324, %44
%46 = icmp ult i64 %42, %45
br label %47
47: ; preds = %40, %37
%48 = phi i1 [ false, %37 ], [ %46, %40 ]
br i1 %48, label %49, label %66
49: ; preds = %47
%50 = getelementptr inbounds [53 x i8], [53 x i8]* %10, i64 0, i64 0
%51 = getelementptr inbounds i8, i8* %50, i64 4
%52 = load i32, i32* %6
%53 = mul nsw i32 %52, 3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %51, i64 %54
%56 = load i32, i32* %5
%57 = load i32, i32* %6
%58 = add nsw i32 %56, %57
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = call i32 @sprintf(i8* %55, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %49
%64 = load i32, i32* %6
%65 = add nsw i32 %64, 1
store i32 %65, i32* %6
br label %37
66: ; preds = %47
%67 = load i32, i32* %6
%68 = mul nsw i32 %67, 3
%69 = add nsw i32 4, %68
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [53 x i8], [53 x i8]* %10, i64 0, i64 %70
store i8 0, i8* %71
%72 = getelementptr inbounds [53 x i8], [53 x i8]* %10, i64 0, i64 0
%73 = call i32 @puts(i8* %72)
br label %74
74: ; preds = %66
%75 = load i32, i32* %5
%76 = add nsw i32 %75, 16
store i32 %76, i32* %5
br label %29
77: ; preds = %29
store i32 0, i32* %8
store i32 1, i32* %5
store i32 0, i32* %6
br label %78
78: ; preds = %248, %77
%79 = load i32, i32* %5
%80 = sext i32 %79 to i64
%81 = icmp ult i64 %80, 324
br i1 %81, label %82, label %87
82: ; preds = %78
%83 = load i32, i32* %6
%84 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 0
%85 = load i32, i32* %84
%86 = icmp slt i32 %83, %85
br label %87
87: ; preds = %82, %78
%88 = phi i1 [ false, %78 ], [ %86, %82 ]
br i1 %88, label %89, label %259
89: ; preds = %87
%90 = load i32, i32* %5
%91 = add nsw i32 %90, 2
%92 = load i32, i32* %5
%93 = add nsw i32 %92, 1
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %94
%96 = load i32, i32* %95
%97 = add nsw i32 %91, %96
%98 = sext i32 %97 to i64
%99 = icmp ugt i64 %98, 324
br i1 %99, label %100, label %104
100: ; preds = %89
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%102 = load i32, i32* %8
%103 = add nsw i32 %102, 1
store i32 %103, i32* %8
br label %248
104: ; preds = %89
%105 = load i32, i32* %5
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %106
%108 = load i32, i32* %107
switch i32 %108, label %247 [
i32 1, label %109
i32 21, label %166
]
109: ; preds = %104
%110 = load i32, i32* %5
%111 = add nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %112
%114 = load i32, i32* %113
%115 = icmp ne i32 %114, 5
br i1 %115, label %116, label %120
116: ; preds = %109
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
%118 = load i32, i32* %8
%119 = add nsw i32 %118, 1
store i32 %119, i32* %8
br label %248
120: ; preds = %109
%121 = load i32, i32* %5
%122 = add nsw i32 %121, 2
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %123
%125 = load i32, i32* %124
%126 = icmp ne i32 %125, 1
br i1 %126, label %127, label %129
127: ; preds = %120
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %129
129: ; preds = %127, %120
%130 = load i32, i32* %5
%131 = add nsw i32 %130, 3
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %132
%134 = load i32, i32* %133
%135 = shl i32 %134, 8
%136 = load i32, i32* %5
%137 = add nsw i32 %136, 4
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %138
%140 = load i32, i32* %139
%141 = or i32 %135, %140
store i32 %141, i32* %7
%142 = load i32, i32* %7
switch i32 %142, label %145 [
i32 17472, label %143
]
143: ; preds = %129
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
br label %147
145: ; preds = %129
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
br label %147
147: ; preds = %145, %143
%148 = load i32, i32* %5
%149 = add nsw i32 %148, 5
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %150
%152 = load i32, i32* %151
switch i32 %152, label %157 [
i32 7, label %153
i32 23, label %155
]
153: ; preds = %147
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0))
br label %159
155: ; preds = %147
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0))
br label %159
157: ; preds = %147
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
br label %159
159: ; preds = %157, %155, %153
%160 = load i32, i32* %5
%161 = add nsw i32 %160, 6
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %162
%164 = load i32, i32* %163
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0), i32 %164)
br label %247
166: ; preds = %104
%167 = load i32, i32* %5
%168 = add nsw i32 %167, 1
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %169
%171 = load i32, i32* %170
%172 = icmp ne i32 %171, 9
br i1 %172, label %173, label %177
173: ; preds = %166
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0))
%175 = load i32, i32* %8
%176 = add nsw i32 %175, 1
store i32 %176, i32* %8
br label %248
177: ; preds = %166
%178 = load i32, i32* %5
%179 = add nsw i32 %178, 2
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %180
%182 = load i32, i32* %181
%183 = icmp ne i32 %182, 1
br i1 %183, label %184, label %186
184: ; preds = %177
%185 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %186
186: ; preds = %184, %177
%187 = load i32, i32* %5
%188 = add nsw i32 %187, 3
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %189
%191 = load i32, i32* %190
%192 = shl i32 %191, 24
%193 = load i32, i32* %5
%194 = add nsw i32 %193, 4
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %195
%197 = load i32, i32* %196
%198 = shl i32 %197, 16
%199 = or i32 %192, %198
%200 = load i32, i32* %5
%201 = add nsw i32 %200, 5
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %202
%204 = load i32, i32* %203
%205 = shl i32 %204, 8
%206 = or i32 %199, %205
%207 = load i32, i32* %5
%208 = add nsw i32 %207, 6
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %209
%211 = load i32, i32* %210
%212 = or i32 %206, %211
store i32 %212, i32* %7
%213 = load i32, i32* %7
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0), i32 %213)
%215 = load i32, i32* %5
%216 = add nsw i32 %215, 7
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %217
%219 = load i32, i32* %218
%220 = shl i32 %219, 24
%221 = load i32, i32* %5
%222 = add nsw i32 %221, 8
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %223
%225 = load i32, i32* %224
%226 = shl i32 %225, 16
%227 = or i32 %220, %226
%228 = load i32, i32* %5
%229 = add nsw i32 %228, 9
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %230
%232 = load i32, i32* %231
%233 = shl i32 %232, 8
%234 = or i32 %227, %233
%235 = load i32, i32* %5
%236 = add nsw i32 %235, 10
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %237
%239 = load i32, i32* %238
%240 = or i32 %234, %239
store i32 %240, i32* %7
%241 = load i32, i32* %7
switch i32 %241, label %244 [
i32 0, label %242
]
242: ; preds = %186
%243 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0))
br label %246
244: ; preds = %186
%245 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0))
br label %246
246: ; preds = %244, %242
br label %247
247: ; preds = %104, %246, %159
br label %248
248: ; preds = %247, %173, %116, %100
%249 = load i32, i32* %5
%250 = add nsw i32 %249, 1
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 %251
%253 = load i32, i32* %252
%254 = add nsw i32 2, %253
%255 = load i32, i32* %5
%256 = add nsw i32 %255, %254
store i32 %256, i32* %5
%257 = load i32, i32* %6
%258 = add nsw i32 %257, 1
store i32 %258, i32* %6
br label %78
259: ; preds = %87
%260 = load i32, i32* %5
%261 = sext i32 %260 to i64
%262 = icmp ne i64 %261, 324
br i1 %262, label %268, label %263
263: ; preds = %259
%264 = load i32, i32* %6
%265 = getelementptr inbounds [81 x i32], [81 x i32]* %9, i64 0, i64 0
%266 = load i32, i32* %265
%267 = icmp ne i32 %264, %266
br i1 %267, label %268, label %272
268: ; preds = %263, %259
%269 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.18, i64 0, i64 0))
%270 = load i32, i32* %8
%271 = add nsw i32 %270, 1
store i32 %271, i32* %8
br label %272
272: ; preds = %268, %263
%273 = load i32, i32* %8
store i32 %273, i32* %2
br label %274
274: ; preds = %272, %26, %18
%275 = load i32, i32* %2
ret i32 %275
}

LLVM IR (-O2):
%struct.usb_handle = type { i32 }
@.str.3 = [7 x i8] c"%02X: \00"
@.str.4 = [6 x i8] c"%02X \00"
@.str.13 = [19 x i8] c"Rom version: %hhu\0A\00"
@.str.15 = [17 x i8] c"Rom CRC: 0x%08X\0A\00"
@str = [16 x i8] c"reading ASIC ID\00"
@str.19 = [35 x i8] c"Unexpected ASIC ID structure size.\00"
@str.20 = [15 x i8] c"Unknown device\00"
@str.21 = [12 x i8] c"A GP device\00"
@str.23 = [34 x i8] c"Unexpected Checksum subblock size\00"
@str.24 = [15 x i8] c"Unknown Device\00"
@str.25 = [30 x i8] c"CH disabled (read from eFuse)\00"
@str.26 = [29 x i8] c"CH enabled (read from eFuse)\00"
@str.27 = [19 x i8] c"Unknown CH setting\00"
@str.28 = [17 x i8] c"OMAP 4460 Device\00"
@str.29 = [23 x i8] c"Unexpected fixed value\00"
@str.30 = [28 x i8] c"Unexpected ID subblock size\00"
@str.31 = [19 x i8] c"Truncated subblock\00"
@str.32 = [32 x i8] c"Could not read msg_getid answer\00"
@str.33 = [33 x i8] c"Could not send msg_getid request\00"
define i32 @read_asic_id(%struct.usb_handle* %0) {
%2 = alloca i32
%3 = alloca [81 x i32]
%4 = alloca [53 x i8]
%5 = bitcast i32* %2 to i8*
store i32 -268238845, i32* %2
%6 = bitcast [81 x i32]* %3 to i8*
%7 = getelementptr inbounds [53 x i8], [53 x i8]* %4, i64 0, i64 0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%9 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 0
%10 = call i32 @memset(i32* %9, i32 238, i32 324)
%11 = call i32 @usb_write(%struct.usb_handle* %0, i32* %2, i32 4)
%12 = icmp eq i32 %11, 4
br i1 %12, label %15, label %13
13: ; preds = %1
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.33, i64 0, i64 0))
br label %188
15: ; preds = %1
%16 = call i32 @usb_read(%struct.usb_handle* %0, i32* %9, i32 324)
%17 = icmp eq i32 %16, 324
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = getelementptr inbounds [53 x i8], [53 x i8]* %4, i64 0, i64 4
br label %25
20: ; preds = %15
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.32, i64 0, i64 0))
br label %188
22: ; preds = %42
%23 = load i32, i32* %9
%24 = icmp sgt i32 %23, 0
br i1 %24, label %49, label %184
25: ; preds = %18, %42
%26 = phi i64 [ 0, %18 ], [ %47, %42 ]
%27 = trunc i64 %26 to i32
%28 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %27)
%29 = sub nuw nsw i64 324, %26
br label %30
30: ; preds = %25, %30
%31 = phi i64 [ 0, %25 ], [ %38, %30 ]
%32 = mul nuw nsw i64 %31, 3
%33 = getelementptr inbounds i8, i8* %19, i64 %32
%34 = add nuw nsw i64 %31, %26
%35 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = call i32 @sprintf(i8* %33, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %36)
%38 = add nuw nsw i64 %31, 1
%39 = icmp ult i64 %31, 15
%40 = icmp ugt i64 %29, %38
%41 = select i1 %39, i1 %40, i1 false
br i1 %41, label %30, label %42
42: ; preds = %30
%43 = mul nuw nsw i64 %38, 3
%44 = add nuw nsw i64 %43, 4
%45 = getelementptr inbounds [53 x i8], [53 x i8]* %4, i64 0, i64 %44
store i8 0, i8* %45
%46 = call i32 @puts(i8* %7)
%47 = add nuw nsw i64 %26, 16
%48 = icmp ult i64 %26, 308
br i1 %48, label %25, label %22
49: ; preds = %22, %170
%50 = phi i64 [ %175, %170 ], [ 1, %22 ]
%51 = phi i32 [ %171, %170 ], [ 0, %22 ]
%52 = phi i32 [ %174, %170 ], [ 0, %22 ]
%53 = phi i32 [ %173, %170 ], [ 1, %22 ]
%54 = add nuw nsw i32 %53, 2
%55 = add nuw nsw i32 %53, 1
%56 = zext i32 %55 to i64
%57 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = add nsw i32 %58, %54
%60 = icmp ugt i32 %59, 324
br i1 %60, label %61, label %64
61: ; preds = %49
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.31, i64 0, i64 0))
%63 = add nsw i32 %51, 1
br label %170
64: ; preds = %49
%65 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %50
%66 = load i32, i32* %65
switch i32 %66, label %170 [
i32 1, label %67
i32 21, label %107
]
67: ; preds = %64
%68 = icmp eq i32 %58, 5
br i1 %68, label %72, label %69
69: ; preds = %67
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.30, i64 0, i64 0))
%71 = add nsw i32 %51, 1
br label %170
72: ; preds = %67
%73 = zext i32 %54 to i64
%74 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %73
%75 = load i32, i32* %74
%76 = icmp eq i32 %75, 1
br i1 %76, label %79, label %77
77: ; preds = %72
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.29, i64 0, i64 0))
br label %79
79: ; preds = %77, %72
%80 = add nuw nsw i32 %53, 3
%81 = zext i32 %80 to i64
%82 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %81
%83 = load i32, i32* %82
%84 = shl i32 %83, 8
%85 = add nuw nsw i32 %53, 4
%86 = zext i32 %85 to i64
%87 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %86
%88 = load i32, i32* %87
%89 = or i32 %84, %88
%90 = icmp eq i32 %89, 17472
%91 = select i1 %90, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.28, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.24, i64 0, i64 0)
%92 = call i32 @puts(i8* dereferenceable(1) %91)
%93 = add nuw nsw i32 %53, 5
%94 = zext i32 %93 to i64
%95 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %94
%96 = load i32, i32* %95
%97 = icmp eq i32 %96, 23
%98 = select i1 %97, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.25, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.27, i64 0, i64 0)
%99 = icmp eq i32 %96, 7
%100 = select i1 %99, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str.26, i64 0, i64 0), i8* %98
%101 = call i32 @puts(i8* dereferenceable(1) %100)
%102 = add nuw nsw i32 %53, 6
%103 = zext i32 %102 to i64
%104 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %103
%105 = load i32, i32* %104
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0), i32 %105)
br label %170
107: ; preds = %64
%108 = icmp eq i32 %58, 9
br i1 %108, label %112, label %109
109: ; preds = %107
%110 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.23, i64 0, i64 0))
%111 = add nsw i32 %51, 1
br label %170
112: ; preds = %107
%113 = zext i32 %54 to i64
%114 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %113
%115 = load i32, i32* %114
%116 = icmp eq i32 %115, 1
br i1 %116, label %119, label %117
117: ; preds = %112
%118 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.29, i64 0, i64 0))
br label %119
119: ; preds = %117, %112
%120 = add nuw nsw i32 %53, 3
%121 = zext i32 %120 to i64
%122 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %121
%123 = load i32, i32* %122
%124 = shl i32 %123, 24
%125 = add nuw nsw i32 %53, 4
%126 = zext i32 %125 to i64
%127 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %126
%128 = load i32, i32* %127
%129 = shl i32 %128, 16
%130 = or i32 %129, %124
%131 = add nuw nsw i32 %53, 5
%132 = zext i32 %131 to i64
%133 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %132
%134 = load i32, i32* %133
%135 = shl i32 %134, 8
%136 = or i32 %130, %135
%137 = add nuw nsw i32 %53, 6
%138 = zext i32 %137 to i64
%139 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %138
%140 = load i32, i32* %139
%141 = or i32 %136, %140
%142 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0), i32 %141)
%143 = add nuw nsw i32 %53, 7
%144 = zext i32 %143 to i64
%145 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %144
%146 = load i32, i32* %145
%147 = shl i32 %146, 24
%148 = add nuw nsw i32 %53, 8
%149 = zext i32 %148 to i64
%150 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %149
%151 = load i32, i32* %150
%152 = shl i32 %151, 16
%153 = or i32 %152, %147
%154 = add nuw nsw i32 %53, 9
%155 = zext i32 %154 to i64
%156 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %155
%157 = load i32, i32* %156
%158 = shl i32 %157, 8
%159 = or i32 %153, %158
%160 = add nuw nsw i32 %53, 10
%161 = zext i32 %160 to i64
%162 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 %161
%163 = load i32, i32* %162
%164 = or i32 %159, %163
%165 = icmp eq i32 %164, 0
br i1 %165, label %166, label %168
166: ; preds = %119
%167 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.21, i64 0, i64 0))
br label %170
168: ; preds = %119
%169 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.20, i64 0, i64 0))
br label %170
170: ; preds = %79, %64, %168, %166, %109, %69, %61
%171 = phi i32 [ %63, %61 ], [ %51, %64 ], [ %111, %109 ], [ %51, %166 ], [ %51, %168 ], [ %71, %69 ], [ %51, %79 ]
%172 = load i32, i32* %57
%173 = add i32 %54, %172
%174 = add nuw nsw i32 %52, 1
%175 = sext i32 %173 to i64
%176 = icmp ult i32 %173, 324
%177 = load i32, i32* %9
%178 = icmp slt i32 %174, %177
%179 = select i1 %176, i1 %178, i1 false
br i1 %179, label %49, label %180
180: ; preds = %170
%181 = icmp eq i32 %173, 324
%182 = icmp eq i32 %174, %177
%183 = select i1 %181, i1 %182, i1 false
br i1 %183, label %188, label %184
184: ; preds = %22, %180
%185 = phi i32 [ %171, %180 ], [ 0, %22 ]
%186 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.19, i64 0, i64 0))
%187 = add nsw i32 %185, 1
br label %188
188: ; preds = %184, %180, %20, %13
%189 = phi i32 [ -1, %13 ], [ -1, %20 ], [ %187, %184 ], [ %171, %180 ]
ret i32 %189
}