#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 */
unsigned long crc32(unsigned char, int, unsigned long);
int /*<<< orphan*/ dump_jreg(char *, unsigned char *, int);
int /*<<< orphan*/ free(unsigned char *);
unsigned char *malloc(unsigned long);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
double or1ksim_jtag_shift_dr(unsigned char *, int);
int /*<<< orphan*/ printf(char *, ...);
void *reverse_bits(unsigned long, int);
unsigned long strtoul(char *, int /*<<< orphan*/ *, int);
int process_go_command_read(int next_jreg, int argc, char *argv[]) {
  printf("Processing GO_COMMAND_READ.\n");
  if (next_jreg >= argc) {
    printf("GO_COMMAND_READ usage: GO_COMMAND_READ <length>\n");
    return 0;
  }
  unsigned long int cmd = 0;
  unsigned long int data_bytes = strtoul(argv[next_jreg], NULL, 16);
  if (data_bytes < 0) {
    printf("ERROR: GO_COMMAND_READ length 0x%lx too small\n", data_bytes);
    return 0;
  } else if (data_bytes > 0x10000) {
    printf("ERROR: GO_COMMAND_READ length 0x%lx too large\n", data_bytes);
    return 0;
  }
  unsigned long int crc_in;
  crc_in = crc32(0, 1, 0xffffffff);
  crc_in = crc32(cmd, 4, crc_in);
  cmd = reverse_bits(cmd, 4);
  crc_in = reverse_bits(crc_in, 32);
  int num_bytes = 10 + data_bytes;
  unsigned char *jreg = malloc(num_bytes);
  if (NULL == jreg) {
    printf("ERROR: malloc forGO_COMMAND_READ register failed.\n");
    return 0;
  }
  memset(jreg, 0, num_bytes);
  jreg[0] = 0x0;
  jreg[0] |= cmd << 1;
  jreg[0] |= crc_in << 5;
  jreg[1] = crc_in >> 3;
  jreg[2] = crc_in >> 11;
  jreg[3] = crc_in >> 19;
  jreg[4] = crc_in >> 27;
  dump_jreg("  shifting in", jreg, num_bytes);
  double t = or1ksim_jtag_shift_dr(jreg, 32 + 4 + data_bytes * 8 + 32 + 4 + 1);
  dump_jreg("  shifted out", jreg, num_bytes);
  unsigned char *data = malloc(data_bytes);
  unsigned char status;
  unsigned long int crc_out;
  if (NULL == data) {
    printf("ERROR: data malloc for GO_COMMAND_READ register failed.\n");
    free(jreg);
    return 0;
  }
  int i;
  for (i = 0; i < data_bytes; i++) {
    data[i] = ((jreg[i + 4] >> 5) | (jreg[i + 5] << 3)) & 0xff;
  }
  status = ((jreg[data_bytes + 4] >> 5) | (jreg[data_bytes + 5] << 3)) & 0xf;
  crc_out = ((unsigned long int)jreg[data_bytes + 5] >> 1) |
            ((unsigned long int)jreg[data_bytes + 6] << 7) |
            ((unsigned long int)jreg[data_bytes + 7] << 15) |
            ((unsigned long int)jreg[data_bytes + 8] << 23) |
            ((unsigned long int)jreg[data_bytes + 9] << 31);
  for (i = 0; i < data_bytes; i++) {
    data[i] = reverse_bits(data[i], 8);
  }
  status = reverse_bits(status, 4);
  crc_out = reverse_bits(crc_out, 32);
  unsigned long int crc_computed = 0xffffffff;
  for (i = 0; i < data_bytes; i++) {
    crc_computed = crc32(data[i], 8, crc_computed);
  }
  crc_computed = crc32(status, 4, crc_computed);
  printf("  data:         ");
  for (i = 0; i < data_bytes; i++) {
    printf("%02x", data[i]);
  }
  printf("\n");
  printf("  status:       0x%01x\n", status);
  if (crc_out != crc_computed) {
    printf("  CRC mismatch\n");
    printf("    CRC out:      0x%08lx\n", crc_out);
    printf("    CRC computed: 0x%08lx\n", crc_computed);
  }
  printf("  time taken:   %.12fs\n", t);
  free(data);
  free(jreg);
  return 1;
}


x86 assembly (clang, -O0):
<process_go_command_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     11d6 <process_go_command_read+0x46>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1685 <process_go_command_read+0x4f5>
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   10b0 <strtoul@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jae    1225 <process_go_command_read+0x95>
mov    -0x28(%rbp),%rsi
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1685 <process_go_command_read+0x4f5>
cmpq   $0x10000,-0x28(%rbp)
jbe    1251 <process_go_command_read+0xc1>
mov    -0x28(%rbp),%rsi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1685 <process_go_command_read+0x4f5>
jmp    1256 <process_go_command_read+0xc6>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1040 <crc32@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rdx
mov    $0x4,%esi
movzbl %al,%edi
call   1040 <crc32@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1060 <reverse_bits@plt>
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rdi
mov    $0x20,%esi
call   1060 <reverse_bits@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
add    $0xa,%rax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rdi
call   1090 <malloc@plt>
mov    %rax,-0x40(%rbp)
xor    %eax,%eax
cmp    -0x40(%rbp),%rax
jne    12e6 <process_go_command_read+0x156>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1685 <process_go_command_read+0x4f5>
mov    -0x40(%rbp),%rdi
mov    -0x34(%rbp),%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    -0x40(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdx
shl    $0x1,%rdx
mov    -0x40(%rbp),%rax
movzbl (%rax),%ecx
or     %rdx,%rcx
mov    %cl,(%rax)
mov    -0x30(%rbp),%rdx
shl    $0x5,%rdx
mov    -0x40(%rbp),%rax
movzbl (%rax),%ecx
or     %rdx,%rcx
mov    %cl,(%rax)
mov    -0x30(%rbp),%rax
shr    $0x3,%rax
mov    %al,%cl
mov    -0x40(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x30(%rbp),%rax
shr    $0xb,%rax
mov    %al,%cl
mov    -0x40(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x30(%rbp),%rax
shr    $0x13,%rax
mov    %al,%cl
mov    -0x40(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x30(%rbp),%rax
shr    $0x1b,%rax
mov    %al,%cl
mov    -0x40(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x40(%rbp),%rsi
mov    -0x34(%rbp),%edx
lea    0xd6a(%rip),%rdi
call   1050 <dump_jreg@plt>
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rax
shl    $0x3,%rax
add    $0x24,%rax
add    $0x20,%rax
add    $0x4,%rax
add    $0x1,%rax
mov    %eax,%esi
call   10a0 <or1ksim_jtag_shift_dr@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x34(%rbp),%edx
lea    0xd3d(%rip),%rdi
call   1050 <dump_jreg@plt>
mov    -0x28(%rbp),%rdi
call   1090 <malloc@plt>
mov    %rax,-0x50(%rbp)
xor    %eax,%eax
cmp    -0x50(%rbp),%rax
jne    13f1 <process_go_command_read+0x261>
lea    0xd26(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1685 <process_go_command_read+0x4f5>
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1450 <process_go_command_read+0x2c0>
mov    -0x40(%rbp),%rax
mov    -0x64(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
sar    $0x5,%eax
mov    -0x40(%rbp),%rcx
mov    -0x64(%rbp),%edx
add    $0x5,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x3,%ecx
or     %ecx,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x50(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    13f8 <process_go_command_read+0x268>
mov    -0x40(%rbp),%rax
mov    -0x28(%rbp),%rcx
movzbl 0x4(%rax,%rcx,1),%eax
sar    $0x5,%eax
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rdx
movzbl 0x5(%rcx,%rdx,1),%ecx
shl    $0x3,%ecx
or     %ecx,%eax
and    $0xf,%eax
mov    %al,-0x51(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x28(%rbp),%rcx
movzbl 0x5(%rax,%rcx,1),%eax
shr    $0x1,%rax
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rdx
movzbl 0x6(%rcx,%rdx,1),%ecx
shl    $0x7,%rcx
or     %rcx,%rax
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rdx
movzbl 0x7(%rcx,%rdx,1),%ecx
shl    $0xf,%rcx
or     %rcx,%rax
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rdx
movzbl 0x8(%rcx,%rdx,1),%ecx
shl    $0x17,%rcx
or     %rcx,%rax
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rdx
movzbl 0x9(%rcx,%rdx,1),%ecx
shl    $0x1f,%rcx
or     %rcx,%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1525 <process_go_command_read+0x395>
mov    -0x50(%rbp),%rax
movslq -0x64(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,%edi
mov    $0x8,%esi
call   1060 <reverse_bits@plt>
mov    %al,%dl
mov    -0x50(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    14e4 <process_go_command_read+0x354>
movzbl -0x51(%rbp),%eax
mov    %eax,%edi
mov    $0x4,%esi
call   1060 <reverse_bits@plt>
mov    %al,-0x51(%rbp)
mov    -0x60(%rbp),%rdi
mov    $0x20,%esi
call   1060 <reverse_bits@plt>
mov    %rax,-0x60(%rbp)
mov    $0xffffffff,%eax
mov    %rax,-0x70(%rbp)
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1596 <process_go_command_read+0x406>
mov    -0x50(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x70(%rbp),%rdx
mov    $0x8,%esi
movzbl %al,%edi
call   1040 <crc32@plt>
mov    %rax,-0x70(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    155a <process_go_command_read+0x3ca>
mov    -0x51(%rbp),%al
mov    -0x70(%rbp),%rdx
mov    $0x4,%esi
movzbl %al,%edi
call   1040 <crc32@plt>
mov    %rax,-0x70(%rbp)
lea    0xb7f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    15f9 <process_go_command_read+0x469>
mov    -0x50(%rbp),%rax
movslq -0x64(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xb61(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    15c3 <process_go_command_read+0x433>
lea    0xa1b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movzbl -0x51(%rbp),%esi
lea    0xb38(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x60(%rbp),%rax
cmp    -0x70(%rbp),%rax
je     1659 <process_go_command_read+0x4c9>
lea    0xb34(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x60(%rbp),%rsi
lea    0xb32(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x70(%rbp),%rsi
lea    0xb3b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0xb43(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_go_command_read>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xf0b(%rip),%rdi
call   1050 <puts@plt>
cmp    %ebx,%ebp
jge    1209 <process_go_command_read+0x59>
movslq %ebp,%rax
mov    (%r14,%rax,8),%rdi
xor    %r13d,%r13d
xor    %esi,%esi
mov    $0x10,%edx
call   10d0 <strtoul@plt>
mov    %rax,%r12
cmp    $0x10001,%rax
jb     122a <process_go_command_read+0x7a>
lea    0xe13(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1218 <process_go_command_read+0x68>
lea    0xf5c(%rip),%rdi
call   1050 <puts@plt>
xor    %r13d,%r13d
mov    %r13d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xffffffff,%r15d
xor    %r13d,%r13d
mov    $0xffffffff,%edx
xor    %edi,%edi
mov    $0x1,%esi
call   1060 <crc32@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %rax,%rdx
call   1060 <crc32@plt>
mov    %rax,%rbp
xor    %edi,%edi
mov    $0x4,%esi
call   1080 <reverse_bits@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    $0x20,%esi
call   1080 <reverse_bits@plt>
mov    %rax,%rbp
lea    0xa(%r12),%edi
mov    %rdi,(%rsp)
call   10b0 <malloc@plt>
test   %rax,%rax
je     133b <process_go_command_read+0x18b>
mov    %rax,%r14
xor    %r13d,%r13d
mov    %rax,%rdi
xor    %esi,%esi
mov    (%rsp),%rdx
call   10a0 <memset@plt>
add    %ebx,%ebx
mov    %ebp,%eax
shl    $0x5,%eax
or     %ebx,%eax
mov    %al,(%r14)
mov    %rbp,%rax
shr    $0x3,%rax
mov    %al,0x1(%r14)
mov    %rbp,%rax
shr    $0xb,%rax
mov    %al,0x2(%r14)
mov    %rbp,%rax
shr    $0x13,%rax
mov    %al,0x3(%r14)
shr    $0x1b,%rbp
mov    %bpl,0x4(%r14)
lea    0xd63(%rip),%rdi
mov    %r14,%rsi
mov    (%rsp),%rbx
mov    %ebx,%edx
call   1070 <dump_jreg@plt>
lea    0x49(,%r12,8),%esi
mov    %r14,%rdi
call   10c0 <or1ksim_jtag_shift_dr@plt>
movq   %xmm0,0x10(%rsp)
lea    0xd46(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1070 <dump_jreg@plt>
mov    %r12,%rdi
call   10b0 <malloc@plt>
test   %rax,%rax
je     134c <process_go_command_read+0x19c>
mov    %rax,%rbx
test   %r12,%r12
je     1451 <process_go_command_read+0x2a1>
mov    0x4(%r14),%cl
cmp    $0x20,%r12
jae    1365 <process_go_command_read+0x1b5>
xor    %eax,%eax
jmp    1430 <process_go_command_read+0x280>
lea    0xdf8(%rip),%rdi
call   1050 <puts@plt>
jmp    1218 <process_go_command_read+0x68>
lea    0xdaf(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
call   1030 <free@plt>
jmp    1218 <process_go_command_read+0x68>
mov    %r12,%rax
and    $0xffffffffffffffe0,%rax
movzbl %cl,%ecx
movd   %ecx,%xmm1
pslldq $0xf,%xmm1
xor    %ecx,%ecx
movdqa 0xc7e(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movdqu 0x5(%r14,%rcx,1),%xmm2
movdqa %xmm2,%xmm3
pslldq $0x1,%xmm3
psrldq $0xf,%xmm1
por    %xmm3,%xmm1
psrlw  $0x5,%xmm1
movdqa %xmm0,%xmm3
pandn  %xmm1,%xmm3
movdqu 0x15(%r14,%rcx,1),%xmm1
movdqa %xmm2,%xmm4
psrldq $0xf,%xmm4
movdqa %xmm1,%xmm5
pslldq $0x1,%xmm5
por    %xmm4,%xmm5
psllw  $0x3,%xmm2
pand   %xmm0,%xmm2
por    %xmm2,%xmm3
psrlw  $0x5,%xmm5
movdqa %xmm0,%xmm2
pandn  %xmm5,%xmm2
movdqa %xmm1,%xmm4
psllw  $0x3,%xmm4
pand   %xmm0,%xmm4
por    %xmm2,%xmm4
movdqu %xmm3,(%rbx,%rcx,1)
movdqu %xmm4,0x10(%rbx,%rcx,1)
add    $0x20,%rcx
cmp    %rcx,%rax
jne    1390 <process_go_command_read+0x1e0>
cmp    %rax,%r12
je     1451 <process_go_command_read+0x2a1>
pextrw $0x7,%xmm1,%ecx
shr    $0x8,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl 0x5(%r14,%rax,1),%edx
lea    0x0(,%rdx,8),%esi
shr    $0x5,%cl
or     %sil,%cl
mov    %cl,(%rbx,%rax,1)
add    $0x1,%rax
mov    %edx,%ecx
cmp    %rax,%r12
jne    1430 <process_go_command_read+0x280>
movzbl 0x4(%r12,%r14,1),%eax
shr    $0x5,%rax
movzbl 0x5(%r12,%r14,1),%ecx
mov    %ecx,%edx
and    $0x1,%edx
shr    %rcx
movzbl 0x6(%r12,%r14,1),%esi
shl    $0x7,%rsi
or     %rcx,%rsi
movzbl 0x7(%r12,%r14,1),%ecx
shl    $0xf,%rcx
or     %rsi,%rcx
movzbl 0x8(%r12,%r14,1),%esi
shl    $0x17,%rsi
or     %rcx,%rsi
movzbl 0x9(%r12,%r14,1),%ebp
shl    $0x1f,%rbp
or     %rsi,%rbp
lea    (%rax,%rdx,8),%rax
mov    %rax,(%rsp)
test   %r12,%r12
je     14cc <process_go_command_read+0x31c>
xor    %r13d,%r13d
nopl   (%rax)
movzbl (%rbx,%r13,1),%edi
mov    $0x8,%esi
call   1080 <reverse_bits@plt>
mov    %al,(%rbx,%r13,1)
add    $0x1,%r13
cmp    %r13,%r12
jne    14b0 <process_go_command_read+0x300>
mov    (%rsp),%rdi
mov    $0x4,%esi
call   1080 <reverse_bits@plt>
mov    %rax,%r13
mov    %rbp,%rdi
mov    $0x20,%esi
call   1080 <reverse_bits@plt>
test   %r12,%r12
mov    %rax,(%rsp)
je     151d <process_go_command_read+0x36d>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rbx,%rbp,1),%edi
mov    $0x8,%esi
mov    %r15,%rdx
call   1060 <crc32@plt>
mov    %rax,%r15
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1500 <process_go_command_read+0x350>
mov    %r13,0x8(%rsp)
movzbl %r13b,%edi
mov    $0x4,%esi
mov    %r15,%rdx
call   1060 <crc32@plt>
mov    %rax,%r13
lea    0xb1e(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
test   %r12,%r12
je     1578 <process_go_command_read+0x3c8>
lea    0xb1c(%rip),%rbp
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx,%r15,1),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
add    $0x1,%r15
cmp    %r15,%r12
jne    1560 <process_go_command_read+0x3b0>
mov    $0xa,%edi
call   1040 <putchar@plt>
movzbl 0x8(%rsp),%esi
lea    0xae3(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    (%rsp),%rbp
cmp    %rbp,%r13
je     15cc <process_go_command_read+0x41c>
lea    0xb4e(%rip),%rdi
call   1050 <puts@plt>
lea    0xad8(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xae2(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xaec(%rip),%rdi
movq   0x10(%rsp),%xmm0
mov    $0x1,%al
call   1090 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    $0x1,%r13d
jmp    1218 <process_go_command_read+0x68>

LLVM IR (-O0):
@.str = [29 x i8] c"Processing GO_COMMAND_READ.\0A\00"
@.str.1 = [49 x i8] c"GO_COMMAND_READ usage: GO_COMMAND_READ <length>\0A\00"
@.str.2 = [47 x i8] c"ERROR: GO_COMMAND_READ length 0x%lx too small\0A\00"
@.str.3 = [47 x i8] c"ERROR: GO_COMMAND_READ length 0x%lx too large\0A\00"
@.str.4 = [51 x i8] c"ERROR: malloc forGO_COMMAND_READ register failed.\0A\00"
@.str.5 = [14 x i8] c" shifting in\00"
@.str.6 = [14 x i8] c" shifted out\00"
@.str.7 = [57 x i8] c"ERROR: data malloc for GO_COMMAND_READ register failed.\0A\00"
@.str.8 = [17 x i8] c" data: \00"
@.str.9 = [5 x i8] c"%02x\00"
@.str.10 = [2 x i8] c"\0A\00"
@.str.11 = [24 x i8] c" status: 0x%01x\0A\00"
@.str.12 = [16 x i8] c" CRC mismatch\0A\00"
@.str.13 = [27 x i8] c" CRC out: 0x%08lx\0A\00"
@.str.14 = [27 x i8] c" CRC computed: 0x%08lx\0A\00"
@.str.15 = [24 x i8] c" time taken: %.12fs\0A\00"
define i32 @process_go_command_read(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
%12 = alloca i8*
%13 = alloca double
%14 = alloca i8*
%15 = alloca i8
%16 = alloca i64
%17 = alloca i32
%18 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = icmp sge i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %3
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
br label %308
25: ; preds = %3
store i64 0, i64* %8
%26 = load i8**, i8*** %7
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
%30 = load i8*, i8** %29
%31 = call i64 @strtoul(i8* %30, i32* null, i32 16)
store i64 %31, i64* %9
%32 = load i64, i64* %9
%33 = icmp ult i64 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %25
%35 = load i64, i64* %9
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i64 %35)
store i32 0, i32* %4
br label %308
37: ; preds = %25
%38 = load i64, i64* %9
%39 = icmp ugt i64 %38, 65536
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = load i64, i64* %9
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i64 %41)
store i32 0, i32* %4
br label %308
43: ; preds = %37
br label %44
44: ; preds = %43
%45 = call i64 @crc32(i8 zeroext 0, i32 1, i64 4294967295)
store i64 %45, i64* %10
%46 = load i64, i64* %8
%47 = trunc i64 %46 to i8
%48 = load i64, i64* %10
%49 = call i64 @crc32(i8 zeroext %47, i32 4, i64 %48)
store i64 %49, i64* %10
%50 = load i64, i64* %8
%51 = call i8* @reverse_bits(i64 %50, i32 4)
%52 = ptrtoint i8* %51 to i64
store i64 %52, i64* %8
%53 = load i64, i64* %10
%54 = call i8* @reverse_bits(i64 %53, i32 32)
%55 = ptrtoint i8* %54 to i64
store i64 %55, i64* %10
%56 = load i64, i64* %9
%57 = add i64 10, %56
%58 = trunc i64 %57 to i32
store i32 %58, i32* %11
%59 = load i32, i32* %11
%60 = sext i32 %59 to i64
%61 = call i8* @malloc(i64 %60)
store i8* %61, i8** %12
%62 = load i8*, i8** %12
%63 = icmp eq i8* null, %62
br i1 %63, label %64, label %66
64: ; preds = %44
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %4
br label %308
66: ; preds = %44
%67 = load i8*, i8** %12
%68 = load i32, i32* %11
%69 = call i32 @memset(i8* %67, i32 0, i32 %68)
%70 = load i8*, i8** %12
%71 = getelementptr inbounds i8, i8* %70, i64 0
store i8 0, i8* %71
%72 = load i64, i64* %8
%73 = shl i64 %72, 1
%74 = load i8*, i8** %12
%75 = getelementptr inbounds i8, i8* %74, i64 0
%76 = load i8, i8* %75
%77 = zext i8 %76 to i64
%78 = or i64 %77, %73
%79 = trunc i64 %78 to i8
store i8 %79, i8* %75
%80 = load i64, i64* %10
%81 = shl i64 %80, 5
%82 = load i8*, i8** %12
%83 = getelementptr inbounds i8, i8* %82, i64 0
%84 = load i8, i8* %83
%85 = zext i8 %84 to i64
%86 = or i64 %85, %81
%87 = trunc i64 %86 to i8
store i8 %87, i8* %83
%88 = load i64, i64* %10
%89 = lshr i64 %88, 3
%90 = trunc i64 %89 to i8
%91 = load i8*, i8** %12
%92 = getelementptr inbounds i8, i8* %91, i64 1
store i8 %90, i8* %92
%93 = load i64, i64* %10
%94 = lshr i64 %93, 11
%95 = trunc i64 %94 to i8
%96 = load i8*, i8** %12
%97 = getelementptr inbounds i8, i8* %96, i64 2
store i8 %95, i8* %97
%98 = load i64, i64* %10
%99 = lshr i64 %98, 19
%100 = trunc i64 %99 to i8
%101 = load i8*, i8** %12
%102 = getelementptr inbounds i8, i8* %101, i64 3
store i8 %100, i8* %102
%103 = load i64, i64* %10
%104 = lshr i64 %103, 27
%105 = trunc i64 %104 to i8
%106 = load i8*, i8** %12
%107 = getelementptr inbounds i8, i8* %106, i64 4
store i8 %105, i8* %107
%108 = load i8*, i8** %12
%109 = load i32, i32* %11
%110 = call i32 @dump_jreg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %108, i32 %109)
%111 = load i8*, i8** %12
%112 = load i64, i64* %9
%113 = mul i64 %112, 8
%114 = add i64 36, %113
%115 = add i64 %114, 32
%116 = add i64 %115, 4
%117 = add i64 %116, 1
%118 = trunc i64 %117 to i32
%119 = call double @or1ksim_jtag_shift_dr(i8* %111, i32 %118)
store double %119, double* %13
%120 = load i8*, i8** %12
%121 = load i32, i32* %11
%122 = call i32 @dump_jreg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %120, i32 %121)
%123 = load i64, i64* %9
%124 = call i8* @malloc(i64 %123)
store i8* %124, i8** %14
%125 = load i8*, i8** %14
%126 = icmp eq i8* null, %125
br i1 %126, label %127, label %131
127: ; preds = %66
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0))
%129 = load i8*, i8** %12
%130 = call i32 @free(i8* %129)
store i32 0, i32* %4
br label %308
131: ; preds = %66
store i32 0, i32* %17
br label %132
132: ; preds = %161, %131
%133 = load i32, i32* %17
%134 = sext i32 %133 to i64
%135 = load i64, i64* %9
%136 = icmp ult i64 %134, %135
br i1 %136, label %137, label %164
137: ; preds = %132
%138 = load i8*, i8** %12
%139 = load i32, i32* %17
%140 = add nsw i32 %139, 4
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i8, i8* %138, i64 %141
%143 = load i8, i8* %142
%144 = zext i8 %143 to i32
%145 = ashr i32 %144, 5
%146 = load i8*, i8** %12
%147 = load i32, i32* %17
%148 = add nsw i32 %147, 5
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8, i8* %146, i64 %149
%151 = load i8, i8* %150
%152 = zext i8 %151 to i32
%153 = shl i32 %152, 3
%154 = or i32 %145, %153
%155 = and i32 %154, 255
%156 = trunc i32 %155 to i8
%157 = load i8*, i8** %14
%158 = load i32, i32* %17
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds i8, i8* %157, i64 %159
store i8 %156, i8* %160
br label %161
161: ; preds = %137
%162 = load i32, i32* %17
%163 = add nsw i32 %162, 1
store i32 %163, i32* %17
br label %132
164: ; preds = %132
%165 = load i8*, i8** %12
%166 = load i64, i64* %9
%167 = add i64 %166, 4
%168 = getelementptr inbounds i8, i8* %165, i64 %167
%169 = load i8, i8* %168
%170 = zext i8 %169 to i32
%171 = ashr i32 %170, 5
%172 = load i8*, i8** %12
%173 = load i64, i64* %9
%174 = add i64 %173, 5
%175 = getelementptr inbounds i8, i8* %172, i64 %174
%176 = load i8, i8* %175
%177 = zext i8 %176 to i32
%178 = shl i32 %177, 3
%179 = or i32 %171, %178
%180 = and i32 %179, 15
%181 = trunc i32 %180 to i8
store i8 %181, i8* %15
%182 = load i8*, i8** %12
%183 = load i64, i64* %9
%184 = add i64 %183, 5
%185 = getelementptr inbounds i8, i8* %182, i64 %184
%186 = load i8, i8* %185
%187 = zext i8 %186 to i64
%188 = lshr i64 %187, 1
%189 = load i8*, i8** %12
%190 = load i64, i64* %9
%191 = add i64 %190, 6
%192 = getelementptr inbounds i8, i8* %189, i64 %191
%193 = load i8, i8* %192
%194 = zext i8 %193 to i64
%195 = shl i64 %194, 7
%196 = or i64 %188, %195
%197 = load i8*, i8** %12
%198 = load i64, i64* %9
%199 = add i64 %198, 7
%200 = getelementptr inbounds i8, i8* %197, i64 %199
%201 = load i8, i8* %200
%202 = zext i8 %201 to i64
%203 = shl i64 %202, 15
%204 = or i64 %196, %203
%205 = load i8*, i8** %12
%206 = load i64, i64* %9
%207 = add i64 %206, 8
%208 = getelementptr inbounds i8, i8* %205, i64 %207
%209 = load i8, i8* %208
%210 = zext i8 %209 to i64
%211 = shl i64 %210, 23
%212 = or i64 %204, %211
%213 = load i8*, i8** %12
%214 = load i64, i64* %9
%215 = add i64 %214, 9
%216 = getelementptr inbounds i8, i8* %213, i64 %215
%217 = load i8, i8* %216
%218 = zext i8 %217 to i64
%219 = shl i64 %218, 31
%220 = or i64 %212, %219
store i64 %220, i64* %16
store i32 0, i32* %17
br label %221
221: ; preds = %239, %164
%222 = load i32, i32* %17
%223 = sext i32 %222 to i64
%224 = load i64, i64* %9
%225 = icmp ult i64 %223, %224
br i1 %225, label %226, label %242
226: ; preds = %221
%227 = load i8*, i8** %14
%228 = load i32, i32* %17
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds i8, i8* %227, i64 %229
%231 = load i8, i8* %230
%232 = zext i8 %231 to i64
%233 = call i8* @reverse_bits(i64 %232, i32 8)
%234 = ptrtoint i8* %233 to i8
%235 = load i8*, i8** %14
%236 = load i32, i32* %17
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds i8, i8* %235, i64 %237
store i8 %234, i8* %238
br label %239
239: ; preds = %226
%240 = load i32, i32* %17
%241 = add nsw i32 %240, 1
store i32 %241, i32* %17
br label %221
242: ; preds = %221
%243 = load i8, i8* %15
%244 = zext i8 %243 to i64
%245 = call i8* @reverse_bits(i64 %244, i32 4)
%246 = ptrtoint i8* %245 to i8
store i8 %246, i8* %15
%247 = load i64, i64* %16
%248 = call i8* @reverse_bits(i64 %247, i32 32)
%249 = ptrtoint i8* %248 to i64
store i64 %249, i64* %16
store i64 4294967295, i64* %18
store i32 0, i32* %17
br label %250
250: ; preds = %263, %242
%251 = load i32, i32* %17
%252 = sext i32 %251 to i64
%253 = load i64, i64* %9
%254 = icmp ult i64 %252, %253
br i1 %254, label %255, label %266
255: ; preds = %250
%256 = load i8*, i8** %14
%257 = load i32, i32* %17
%258 = sext i32 %257 to i64
%259 = getelementptr inbounds i8, i8* %256, i64 %258
%260 = load i8, i8* %259
%261 = load i64, i64* %18
%262 = call i64 @crc32(i8 zeroext %260, i32 8, i64 %261)
store i64 %262, i64* %18
br label %263
263: ; preds = %255
%264 = load i32, i32* %17
%265 = add nsw i32 %264, 1
store i32 %265, i32* %17
br label %250
266: ; preds = %250
%267 = load i8, i8* %15
%268 = load i64, i64* %18
%269 = call i64 @crc32(i8 zeroext %267, i32 4, i64 %268)
store i64 %269, i64* %18
%270 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %17
br label %271
271: ; preds = %284, %266
%272 = load i32, i32* %17
%273 = sext i32 %272 to i64
%274 = load i64, i64* %9
%275 = icmp ult i64 %273, %274
br i1 %275, label %276, label %287
276: ; preds = %271
%277 = load i8*, i8** %14
%278 = load i32, i32* %17
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds i8, i8* %277, i64 %279
%281 = load i8, i8* %280
%282 = zext i8 %281 to i32
%283 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %282)
br label %284
284: ; preds = %276
%285 = load i32, i32* %17
%286 = add nsw i32 %285, 1
store i32 %286, i32* %17
br label %271
287: ; preds = %271
%288 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%289 = load i8, i8* %15
%290 = zext i8 %289 to i32
%291 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i32 %290)
%292 = load i64, i64* %16
%293 = load i64, i64* %18
%294 = icmp ne i64 %292, %293
br i1 %294, label %295, label %301
295: ; preds = %287
%296 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
%297 = load i64, i64* %16
%298 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i64 %297)
%299 = load i64, i64* %18
%300 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i64 %299)
br label %301
301: ; preds = %295, %287
%302 = load double, double* %13
%303 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), double %302)
%304 = load i8*, i8** %14
%305 = call i32 @free(i8* %304)
%306 = load i8*, i8** %12
%307 = call i32 @free(i8* %306)
store i32 1, i32* %4
br label %308
308: ; preds = %301, %127, %64, %40, %34, %23
%309 = load i32, i32* %4
ret i32 %309
}

LLVM IR (-O2):
@.str.3 = [47 x i8] c"ERROR: GO_COMMAND_READ length 0x%lx too large\0A\00"
@.str.5 = [14 x i8] c" shifting in\00"
@.str.6 = [14 x i8] c" shifted out\00"
@.str.8 = [17 x i8] c" data: \00"
@.str.9 = [5 x i8] c"%02x\00"
@.str.11 = [24 x i8] c" status: 0x%01x\0A\00"
@.str.13 = [27 x i8] c" CRC out: 0x%08lx\0A\00"
@.str.14 = [27 x i8] c" CRC computed: 0x%08lx\0A\00"
@.str.15 = [24 x i8] c" time taken: %.12fs\0A\00"
@str = [28 x i8] c"Processing GO_COMMAND_READ.\00"
@str.16 = [15 x i8] c" CRC mismatch\00"
@str.17 = [56 x i8] c"ERROR: data malloc for GO_COMMAND_READ register failed.\00"
@str.18 = [50 x i8] c"ERROR: malloc forGO_COMMAND_READ register failed.\00"
@str.19 = [48 x i8] c"GO_COMMAND_READ usage: GO_COMMAND_READ <length>\00"
define i32 @process_go_command_read(i32 %0, i32 %1, i8** nocapture %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%5 = icmp slt i32 %0, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.19, i64 0, i64 0))
br label %190
8: ; preds = %3
%9 = sext i32 %0 to i64
%10 = getelementptr inbounds i8*, i8** %2, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i64 @strtoul(i8* nocapture %11, i32* null, i32 16)
%13 = icmp ugt i64 %12, 65536
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i64 %12)
br label %190
16: ; preds = %8
%17 = tail call i64 @crc32(i8 zeroext 0, i32 1, i64 4294967295)
%18 = tail call i64 @crc32(i8 zeroext 0, i32 4, i64 %17)
%19 = tail call i8* @reverse_bits(i64 0, i32 4)
%20 = tail call i8* @reverse_bits(i64 %18, i32 32)
%21 = ptrtoint i8* %20 to i64
%22 = trunc i64 %12 to i32
%23 = add nuw nsw i32 %22, 10
%24 = zext i32 %23 to i64
%25 = tail call i8* @malloc(i64 %24)
%26 = icmp eq i8* %25, null
br i1 %26, label %27, label %29
27: ; preds = %16
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.18, i64 0, i64 0))
br label %190
29: ; preds = %16
%30 = ptrtoint i8* %19 to i64
%31 = tail call i32 @memset(i8* %25, i32 0, i32 %23)
%32 = shl i64 %30, 1
%33 = shl i64 %21, 5
%34 = or i64 %33, %32
%35 = trunc i64 %34 to i8
store i8 %35, i8* %25
%36 = lshr i64 %21, 3
%37 = trunc i64 %36 to i8
%38 = getelementptr inbounds i8, i8* %25, i64 1
store i8 %37, i8* %38
%39 = lshr i64 %21, 11
%40 = trunc i64 %39 to i8
%41 = getelementptr inbounds i8, i8* %25, i64 2
store i8 %40, i8* %41
%42 = lshr i64 %21, 19
%43 = trunc i64 %42 to i8
%44 = getelementptr inbounds i8, i8* %25, i64 3
store i8 %43, i8* %44
%45 = lshr i64 %21, 27
%46 = trunc i64 %45 to i8
%47 = getelementptr inbounds i8, i8* %25, i64 4
store i8 %46, i8* %47
%48 = tail call i32 @dump_jreg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %25, i32 %23)
%49 = shl nuw nsw i32 %22, 3
%50 = add nuw nsw i32 %49, 73
%51 = tail call double @or1ksim_jtag_shift_dr(i8* %25, i32 %50)
%52 = tail call i32 @dump_jreg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %25, i32 %23)
%53 = tail call i8* @malloc(i64 %12)
%54 = icmp eq i8* %53, null
br i1 %54, label %89, label %55
55: ; preds = %29
%56 = icmp eq i64 %12, 0
br i1 %56, label %102, label %57
57: ; preds = %55
%58 = load i8, i8* %47
%59 = icmp ult i64 %12, 32
br i1 %59, label %86, label %60
60: ; preds = %57
%61 = and i64 %12, -32
%62 = insertelement <16 x i8> poison, i8 %58, i64 15
br label %63
63: ; preds = %63, %60
%64 = phi i64 [ 0, %60 ], [ %81, %63 ]
%65 = phi <16 x i8> [ %62, %60 ], [ %72, %63 ]
%66 = or i64 %64, 5
%67 = getelementptr inbounds i8, i8* %25, i64 %66
%68 = bitcast i8* %67 to <16 x i8>*
%69 = load <16 x i8>, <16 x i8>* %68
%70 = getelementptr inbounds i8, i8* %67, i64 16
%71 = bitcast i8* %70 to <16 x i8>*
%72 = load <16 x i8>, <16 x i8>* %71
%73 = shufflevector <16 x i8> %65, <16 x i8> %69, <16 x i32> <i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30>
%74 = shufflevector <16 x i8> %69, <16 x i8> %72, <16 x i32> <i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30>
%75 = call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %69, <16 x i8> %73, <16 x i8> <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>)
%76 = call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %72, <16 x i8> %74, <16 x i8> <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>)
%77 = getelementptr inbounds i8, i8* %53, i64 %64
%78 = bitcast i8* %77 to <16 x i8>*
store <16 x i8> %75, <16 x i8>* %78
%79 = getelementptr inbounds i8, i8* %77, i64 16
%80 = bitcast i8* %79 to <16 x i8>*
store <16 x i8> %76, <16 x i8>* %80
%81 = add nuw i64 %64, 32
%82 = icmp eq i64 %81, %61
br i1 %82, label %83, label %63
83: ; preds = %63
%84 = icmp eq i64 %12, %61
%85 = extractelement <16 x i8> %72, i64 15
br i1 %84, label %102, label %86
86: ; preds = %57, %83
%87 = phi i8 [ %85, %83 ], [ %58, %57 ]
%88 = phi i64 [ %61, %83 ], [ 0, %57 ]
br label %92
89: ; preds = %29
%90 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.17, i64 0, i64 0))
%91 = tail call i32 @free(i8* %25)
br label %190
92: ; preds = %86, %92
%93 = phi i8 [ %97, %92 ], [ %87, %86 ]
%94 = phi i64 [ %100, %92 ], [ %88, %86 ]
%95 = add nuw nsw i64 %94, 5
%96 = getelementptr inbounds i8, i8* %25, i64 %95
%97 = load i8, i8* %96
%98 = tail call i8 @llvm.fshl.i8(i8 %97, i8 %93, i8 3)
%99 = getelementptr inbounds i8, i8* %53, i64 %94
store i8 %98, i8* %99
%100 = add nuw nsw i64 %94, 1
%101 = icmp eq i64 %100, %12
br i1 %101, label %102, label %92
102: ; preds = %92, %83, %55
%103 = add i64 %12, 4
%104 = getelementptr inbounds i8, i8* %25, i64 %103
%105 = load i8, i8* %104
%106 = lshr i8 %105, 5
%107 = add i64 %12, 5
%108 = getelementptr inbounds i8, i8* %25, i64 %107
%109 = load i8, i8* %108
%110 = shl i8 %109, 3
%111 = and i8 %110, 8
%112 = or i8 %111, %106
%113 = lshr i8 %109, 1
%114 = zext i8 %113 to i64
%115 = add i64 %12, 6
%116 = getelementptr inbounds i8, i8* %25, i64 %115
%117 = load i8, i8* %116
%118 = zext i8 %117 to i64
%119 = shl nuw nsw i64 %118, 7
%120 = or i64 %119, %114
%121 = add i64 %12, 7
%122 = getelementptr inbounds i8, i8* %25, i64 %121
%123 = load i8, i8* %122
%124 = zext i8 %123 to i64
%125 = shl nuw nsw i64 %124, 15
%126 = or i64 %120, %125
%127 = add i64 %12, 8
%128 = getelementptr inbounds i8, i8* %25, i64 %127
%129 = load i8, i8* %128
%130 = zext i8 %129 to i64
%131 = shl nuw nsw i64 %130, 23
%132 = or i64 %126, %131
%133 = add i64 %12, 9
%134 = getelementptr inbounds i8, i8* %25, i64 %133
%135 = load i8, i8* %134
%136 = zext i8 %135 to i64
%137 = shl nuw nsw i64 %136, 31
%138 = or i64 %132, %137
br i1 %56, label %149, label %139
139: ; preds = %102, %139
%140 = phi i64 [ %147, %139 ], [ 0, %102 ]
%141 = getelementptr inbounds i8, i8* %53, i64 %140
%142 = load i8, i8* %141
%143 = zext i8 %142 to i64
%144 = tail call i8* @reverse_bits(i64 %143, i32 8)
%145 = ptrtoint i8* %144 to i64
%146 = trunc i64 %145 to i8
store i8 %146, i8* %141
%147 = add nuw i64 %140, 1
%148 = icmp eq i64 %147, %12
br i1 %148, label %149, label %139
149: ; preds = %139, %102
%150 = zext i8 %112 to i64
%151 = tail call i8* @reverse_bits(i64 %150, i32 4)
%152 = ptrtoint i8* %151 to i64
%153 = trunc i64 %152 to i8
%154 = tail call i8* @reverse_bits(i64 %138, i32 32)
%155 = ptrtoint i8* %154 to i64
br i1 %56, label %164, label %156
156: ; preds = %149, %156
%157 = phi i64 [ %162, %156 ], [ 0, %149 ]
%158 = phi i64 [ %161, %156 ], [ 4294967295, %149 ]
%159 = getelementptr inbounds i8, i8* %53, i64 %157
%160 = load i8, i8* %159
%161 = tail call i64 @crc32(i8 zeroext %160, i32 8, i64 %158)
%162 = add nuw i64 %157, 1
%163 = icmp eq i64 %162, %12
br i1 %163, label %164, label %156
164: ; preds = %156, %149
%165 = phi i64 [ 4294967295, %149 ], [ %161, %156 ]
%166 = tail call i64 @crc32(i8 zeroext %153, i32 4, i64 %165)
%167 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
br i1 %56, label %176, label %168
168: ; preds = %164, %168
%169 = phi i64 [ %174, %168 ], [ 0, %164 ]
%170 = getelementptr inbounds i8, i8* %53, i64 %169
%171 = load i8, i8* %170
%172 = zext i8 %171 to i32
%173 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %172)
%174 = add nuw i64 %169, 1
%175 = icmp eq i64 %174, %12
br i1 %175, label %176, label %168
176: ; preds = %168, %164
%177 = tail call i32 @putchar(i32 10)
%178 = trunc i64 %152 to i32
%179 = and i32 %178, 255
%180 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i32 %179)
%181 = icmp eq i64 %166, %155
br i1 %181, label %186, label %182
182: ; preds = %176
%183 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.16, i64 0, i64 0))
%184 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i64 %155)
%185 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i64 %166)
br label %186
186: ; preds = %182, %176
%187 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), double %51)
%188 = tail call i32 @free(i8* %53)
%189 = tail call i32 @free(i8* %25)
br label %190
190: ; preds = %14, %89, %186, %27, %6
%191 = phi i32 [ 0, %6 ], [ 0, %14 ], [ 0, %27 ], [ 0, %89 ], [ 1, %186 ]
ret i32 %191
}