// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: dumpHex
void dumpHex(void *data_, int len) {
  unsigned char *data = data_;
  unsigned char *line = malloc(sizeof(char) * LINE_LENGTH + 1);
  char *hexrep_orig = bin2hex(data, len);
  char *hexrep = hexrep_orig;
  int i, pos;
  
  for (pos = 0 ; pos < len ; pos += 16) {
    for (i = 0 ; i < 8 ; i++) {
      line[i*3]   = pos+i < len ? hexrep[i*2] : ' ';
      line[i*3+1] = pos+i < len ? hexrep[i*2+1] : ' ';
      line[i*3+2] = ' ';
    }
    line[24] = ' ';
    for (i = 8 ; i < 16 ; i++) {
      line[i*3+1] = pos+i < len ? hexrep[i*2] : ' ';
      line[i*3+2] = pos+i < len ? hexrep[i*2+1] : ' ';
      line[i*3+3] = ' ';
    }
    line[49] = ' ';
    line[50] = '|';
    for (i = 0 ; i < 16 ; i++) {
      if (data[pos+i] >= 0x20 && data[pos+i] < 0x7f) {
        line[51+i] = pos+i < len ? data[pos+i] : ' ';
      } else {
        line[51+i] = pos+i < len ? '.' : ' ';
      }
    }
    line[67] = '|';
    
    line[68] = 0;
    fprintf(stderr, "%08x  %s\n", pos, line);
    hexrep += 32;
  }
  fprintf(stderr, "%08x\n", len);
  free(line);
  free(hexrep_orig);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r12
pushq $0x51
popq %rdi
callq 0x2310
movq %rax, %r14
movq %r12, %rdi
movl %ebx, %esi
callq 0x4c18
movq %rax, (%rsp)
testl %ebx, %ebx
jle 0x2874
movl %ebx, %r15d
movq %r15, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq 0x18(%r14), %rax
movq %rax, 0x8(%rsp)
pxor 0x6b47(%rip), %xmm0     # 0x9100
movdqa %xmm0, 0x10(%rsp)
xorl %ebp, %ebp
movq (%rsp), %r13
movq %r14, %rax
xorl %ecx, %ecx
leaq (%rcx,%rbp), %rdx
cmpq %r15, %rdx
jae 0x25e9
movb (%r13,%rcx,2), %sil
leaq (%rcx,%rcx,2), %rdx
addq %r14, %rdx
movb %sil, (%rax)
movb 0x1(%r13,%rcx,2), %sil
jmp 0x25f2
movb $0x20, (%rax)
movb $0x20, %sil
movq %rax, %rdx
movb %sil, 0x1(%rdx)
movb $0x20, 0x2(%rdx)
incq %rcx
addq $0x3, %rax
cmpq $0x8, %rcx
jne 0x25ca
movb $0x20, 0x18(%r14)
movq 0x8(%rsp), %rax
pushq $0x8
popq %rcx
leaq (%rcx,%rbp), %rdx
cmpq %r15, %rdx
jae 0x2634
movb (%r13,%rcx,2), %sil
leaq (%rcx,%rcx,2), %rdx
addq %r14, %rdx
movb %sil, 0x1(%rax)
movb 0x1(%r13,%rcx,2), %sil
jmp 0x263e
movb $0x20, 0x1(%rax)
movb $0x20, %sil
movq %rax, %rdx
movb %sil, 0x2(%rdx)
movb $0x20, 0x3(%rdx)
incq %rcx
addq $0x3, %rax
cmpq $0x10, %rcx
jne 0x2614
movw $0x7c20, 0x31(%r14)     # imm = 0x7C20
movq %rbp, %rax
orq $0x1, %rax
movq %rbp, %xmm3
pshufd $0x44, %xmm3, %xmm0     # xmm0 = xmm3[0,1,0,1]
movdqa %xmm0, %xmm4
por 0x6a19(%rip), %xmm4     # 0x9090
movdqa %xmm0, %xmm5
por 0x6a1d(%rip), %xmm5     # 0x90a0
movq %rax, %xmm1
punpcklqdq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0]
movdqu (%r12,%rbp), %xmm2
movdqa %xmm2, %xmm6
paddb 0x6a42(%rip), %xmm6     # 0x90e0
movdqa %xmm6, %xmm1
pminub 0x6a46(%rip), %xmm1     # 0x90f0
pcmpeqb %xmm6, %xmm1
movdqa 0x6a49(%rip), %xmm9     # 0x9100
pxor %xmm9, %xmm5
movdqa 0x10(%rsp), %xmm8
movdqa %xmm8, %xmm6
pcmpgtd %xmm5, %xmm6
pshufd $0xa0, %xmm6, %xmm6     # xmm6 = xmm6[0,0,2,2]
pcmpeqd %xmm8, %xmm5
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pand %xmm6, %xmm5
pxor %xmm9, %xmm4
movdqa %xmm8, %xmm6
pcmpgtd %xmm4, %xmm6
pshufd $0xa0, %xmm6, %xmm6     # xmm6 = xmm6[0,0,2,2]
pcmpeqd %xmm8, %xmm4
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pand %xmm6, %xmm4
movdqa %xmm0, %xmm6
por 0x6974(%rip), %xmm6     # 0x9080
packssdw %xmm5, %xmm4
pxor %xmm9, %xmm6
movdqa %xmm8, %xmm5
pcmpgtd %xmm6, %xmm5
pshufd $0xa0, %xmm5, %xmm5     # xmm5 = xmm5[0,0,2,2]
pcmpeqd %xmm8, %xmm6
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
pand %xmm5, %xmm6
pxor %xmm9, %xmm3
movdqa %xmm8, %xmm5
pcmpgtd %xmm3, %xmm5
pshufd $0xa0, %xmm5, %xmm5     # xmm5 = xmm5[0,0,2,2]
pcmpeqd %xmm8, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
pand %xmm5, %xmm3
movdqa %xmm0, %xmm5
por 0x6912(%rip), %xmm5     # 0x9070
packssdw %xmm6, %xmm3
movdqa %xmm0, %xmm6
por 0x6952(%rip), %xmm6     # 0x90c0
packssdw %xmm4, %xmm3
pxor %xmm9, %xmm5
movdqa %xmm8, %xmm4
pcmpgtd %xmm5, %xmm4
pshufd $0xa0, %xmm4, %xmm7     # xmm7 = xmm4[0,0,2,2]
pcmpeqd %xmm8, %xmm5
pshufd $0xf5, %xmm5, %xmm4     # xmm4 = xmm5[1,1,3,3]
pand %xmm7, %xmm4
pxor %xmm9, %xmm6
movdqa %xmm8, %xmm5
pcmpgtd %xmm6, %xmm5
pshufd $0xa0, %xmm5, %xmm5     # xmm5 = xmm5[0,0,2,2]
pcmpeqd %xmm8, %xmm6
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
pand %xmm5, %xmm6
movdqa %xmm0, %xmm5
por 0x68f0(%rip), %xmm5     # 0x90b0
por 0x6908(%rip), %xmm0     # 0x90d0
packssdw %xmm6, %xmm4
pxor %xmm9, %xmm5
movdqa %xmm8, %xmm6
pcmpgtd %xmm5, %xmm6
pshufd $0xa0, %xmm6, %xmm6     # xmm6 = xmm6[0,0,2,2]
pcmpeqd %xmm8, %xmm5
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pand %xmm6, %xmm5
pxor %xmm9, %xmm0
movdqa %xmm8, %xmm6
pcmpgtd %xmm0, %xmm6
pshufd $0xa0, %xmm6, %xmm6     # xmm6 = xmm6[0,0,2,2]
pcmpeqd %xmm8, %xmm0
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pand %xmm6, %xmm0
packssdw %xmm0, %xmm5
packssdw %xmm5, %xmm4
packsswb %xmm4, %xmm3
pand %xmm1, %xmm2
pandn 0x68ea(%rip), %xmm1     # 0x9110
por %xmm2, %xmm1
pand %xmm3, %xmm1
pandn 0x68ea(%rip), %xmm3     # 0x9120
por %xmm1, %xmm3
movdqu %xmm3, 0x33(%r14)
movw $0x7c, 0x43(%r14)
movq 0xa78a(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
leaq 0x6af7(%rip), %rsi      # 0x934f
movl %ebp, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2340
addq $0x20, %r13
addq $0x10, %rbp
cmpl %ebx, %ebp
jl 0x25c5
movq 0xa75d(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
leaq 0x6ad4(%rip), %rsi      # 0x9359
movl %ebx, %edx
xorl %eax, %eax
callq 0x2340
movq %r14, %rdi
callq 0x2290
movq (%rsp), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2290