// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r15
pushq $0x51
popq %rdi
callq 0x2310
movq %rax, %r14
movq %r15, %rdi
movl %ebx, %esi
callq 0x35e7
movq %r15, %r8
movq %rax, %r12
movslq %ebx, %r15
leaq 0x18(%r14), %rcx
movq %rcx, 0x8(%rsp)
pushq $0x8
popq %r13
pushq $0x2e
popq %r9
pushq $0x20
popq %r10
xorl %ebp, %ebp
movq %rax, (%rsp)
cmpq %r15, %rbp
jge 0x3cb5
movq %r14, %rax
xorl %ecx, %ecx
cmpq $0x8, %rcx
je 0x3be6
leaq (%rcx,%rbp), %rdx
cmpq %r15, %rdx
jge 0x3bc8
movb (%r12,%rcx,2), %dl
movb %dl, (%rax)
movb 0x1(%r12,%rcx,2), %sil
movq %rax, %rdx
jmp 0x3bd5
leaq (%rcx,%rcx,2), %rdx
addq %r14, %rdx
movb $0x20, (%rax)
movb $0x20, %sil
movb %sil, 0x1(%rdx)
movb $0x20, 0x2(%rdx)
incq %rcx
addq $0x3, %rax
jmp 0x3ba9
movb $0x20, 0x18(%r14)
movq 0x8(%rsp), %rax
xorl %ecx, %ecx
pushq $0x8
popq %rdx
cmpq $0x8, %rcx
je 0x3c38
leal (%rcx,%r13), %esi
cmpl %ebx, %esi
jge 0x3c16
movb 0x10(%r12,%rcx,2), %sil
movb %sil, 0x1(%rax)
movb 0x11(%r12,%rcx,2), %dil
movq %rax, %rsi
jmp 0x3c24
leaq (%rdx,%rdx,2), %rsi
addq %r14, %rsi
movb $0x20, 0x1(%rax)
movb $0x20, %dil
movb %dil, 0x2(%rsi)
movb $0x20, 0x3(%rsi)
incq %rdx
incq %rcx
addq $0x3, %rax
jmp 0x3bf5
movw $0x7c20, 0x31(%r14)     # imm = 0x7C20
xorl %eax, %eax
cmpq $0x10, %rax
je 0x3c6a
movzbl (%r8,%rax), %ecx
leal -0x20(%rcx), %edx
cmpb $0x5f, %dl
jb 0x3c57
movl %r9d, %ecx
leal (%rax,%rbp), %edx
cmpl %ebx, %edx
cmovgel %r10d, %ecx
movb %cl, 0x33(%r14,%rax)
incq %rax
jmp 0x3c41
movw $0x7c, 0x43(%r14)
movq 0x8360(%rip), %rax      # 0xbfd8
movq (%rax), %rdi
leaq 0x45fd(%rip), %rsi      # 0x827f
movl %ebp, %edx
movq %r14, %rcx
xorl %eax, %eax
movq %r8, 0x10(%rsp)
callq 0x2340
pushq $0x20
popq %r10
pushq $0x2e
popq %r9
movq 0x10(%rsp), %r8
addq $0x20, %r12
addq $0x10, %rbp
addq $0x10, %r13
addq $0x10, %r8
jmp 0x3b9b
movq 0x831c(%rip), %rax      # 0xbfd8
movq (%rax), %rdi
leaq 0x45c3(%rip), %rsi      # 0x8289
movl %ebx, %edx
xorl %eax, %eax
callq 0x2340
movq %r14, %rdi
callq 0x2290
movq (%rsp), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2290