// File: /workspace/github_c_makefile_star2_O1/bloomsource[P]dns_update/util.c
// Function: write_log_hex
int write_log_hex( char* buf, int buflen )
{
  FILE *fp;
  int i,g,k;
  unsigned char *abuf,*hbuf;


  if ( ( fp = fopen(log_file,"a+")) == NULL) return(-1);

  hbuf = (unsigned char *)buf;
  abuf = (unsigned char *)buf;
  fprintf( fp, "  *** hex message(begin) ***\n" );
  fprintf( fp, "-----------|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|------------------\n" );
  for( i = 0, g = buflen/16; i < g; i++ )
  {
    fprintf( fp, "M(%6.6d)=< ", i*16 );
    for( k = 0; k < 16; k ++) fprintf( fp, "%02x ", *hbuf++ );
        fprintf( fp, "> " );
    for( k = 0; k < 16; k++, abuf++)
        fprintf( fp, "%c", (*abuf>32) ? ((*abuf<128) ? *abuf : '*') : '.');
    fprintf( fp, "\n" );
  }
  if( (i = buflen%16) > 0)
  {
    fprintf( fp, "M(%6.6d)=< ", buflen-buflen%16 );
    for( k = 0; k < i;  k++) fprintf( fp, "%02x ", *hbuf++);
    for( k = i; k < 16; k++) fprintf( fp, "   ");
        fprintf( fp, "> ");
    for( k = 0; k < i; k++, abuf++)
        fprintf( fp, "%c",(*abuf>32) ? ((*abuf<128) ? *abuf : '*') : '.');
    fprintf( fp, "\n");
  }
  fprintf( fp, "-----------|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|------------------\n");
  fprintf( fp, "  *** hex message(end) ***\n");
  fflush( fp );
  fclose( fp );
  return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %r13d
movq %rdi, %r12
leaq 0xa099(%rip), %rdi      # 0x101d0
leaq 0x22b9(%rip), %rsi      # 0x83f7
callq 0x2240
testq %rax, %rax
je 0x6292
movq %rax, %rbx
leaq 0x22a4(%rip), %rdi      # 0x83fa
movl $0x1d, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x2280
leaq 0x22a9(%rip), %rdi      # 0x8418
movl $0x4f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2280
leal 0xf(%r13), %edx
testl %r13d, %r13d
cmovnsl %r13d, %edx
movl %edx, %eax
andl $-0x10, %eax
movl %r13d, %ecx
subl %eax, %ecx
cmpl $0x10, %r13d
jl 0x629c
movq %r13, 0x18(%rsp)
movl %ecx, 0xc(%rsp)
sarl $0x4, %edx
movq %r12, (%rsp)
movq %r12, %rax
xorl %ecx, %ecx
movl %edx, 0x10(%rsp)
movl $0x2a, %ebp
movq %rax, %r12
movq (%rsp), %r14
movl %ecx, 0x14(%rsp)
movl %ecx, %edx
shll $0x4, %edx
movq %rbx, %rdi
leaq 0x2290(%rip), %rsi      # 0x8468
xorl %eax, %eax
callq 0x21b0
xorl %r13d, %r13d
leaq 0x228b(%rip), %r15      # 0x8474
movzbl (%r14,%r13), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21b0
incq %r13
cmpl $0x10, %r13d
jne 0x61e9
movl $0x2, %esi
movl $0x1, %edx
leaq 0x2265(%rip), %rdi      # 0x847a
movq %rbx, %rcx
callq 0x2280
movq %r14, 0x20(%rsp)
leaq (%r14,%r13), %rax
movq %rax, (%rsp)
xorl %r15d, %r15d
movl $0x2e, %r14d
movzbl (%r12,%r15), %eax
testb %al, %al
movl %eax, %ecx
cmovsl %ebp, %ecx
cmpb $0x21, %al
cmovbl %r14d, %ecx
movzbl %cl, %edi
movq %rbx, %rsi
callq 0x2160
incq %r15
cmpl $0x10, %r15d
jne 0x6233
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2160
movl 0x14(%rsp), %ecx
incl %ecx
leaq (%r12,%r15), %rax
movl 0x10(%rsp), %edx
cmpl %edx, %ecx
jne 0x61be
movq 0x20(%rsp), %r14
addq %r13, %r14
addq %r15, %r12
movl 0xc(%rsp), %ecx
movq 0x18(%rsp), %r13
jmp 0x629f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x63b4
movq %r12, %r14
testl %ecx, %ecx
jle 0x6370
movl %ecx, %r15d
movq %r12, (%rsp)
subl %ecx, %r13d
leaq 0x21b0(%rip), %rsi      # 0x8468
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0x21b0
movl %r15d, %ebp
movl %r15d, %r12d
leaq 0x21a2(%rip), %r15      # 0x8474
xorl %r13d, %r13d
movzbl (%r14,%r13), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21b0
incq %r13
cmpl %r13d, %r12d
jne 0x62d5
addl $-0x10, %ebp
leaq 0x2184(%rip), %r15      # 0x847d
movq (%rsp), %r13
movl $0x3, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x2280
incl %ebp
jne 0x62fd
leaq 0x215d(%rip), %rdi      # 0x847a
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2280
xorl %r14d, %r14d
movl $0x2a, %ebp
movl $0x2e, %r15d
movzbl (%r13,%r14), %eax
testb %al, %al
movl %eax, %ecx
cmovsl %ebp, %ecx
cmpb $0x21, %al
cmovbl %r15d, %ecx
movzbl %cl, %edi
movq %rbx, %rsi
callq 0x2160
incq %r14
cmpl %r14d, %r12d
jne 0x633d
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2160
leaq 0x20a1(%rip), %rdi      # 0x8418
movl $0x4f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2280
leaq 0x20f1(%rip), %rdi      # 0x8481
movl $0x1b, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2280
movq %rbx, %rdi
callq 0x21e0
movq %rbx, %rdi
callq 0x20e0
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq