// File: /workspace/github_c_makefile_star2_O3/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 0xa115(%rip), %rdi      # 0x101c0
leaq 0x2345(%rip), %rsi      # 0x83f7
callq 0x2230
testq %rax, %rax
je 0x6206
movq %rax, %rbx
leaq 0x2330(%rip), %rdi      # 0x83fa
movl $0x1d, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x2270
leaq 0x2335(%rip), %rdi      # 0x8418
movl $0x4f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2270
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 0x6210
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 0x231c(%rip), %rsi      # 0x8468
xorl %eax, %eax
callq 0x21a0
xorl %r13d, %r13d
leaq 0x2317(%rip), %r15      # 0x8474
movzbl (%r14,%r13), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21a0
incq %r13
cmpl $0x10, %r13d
jne 0x615d
movl $0x2, %esi
movl $0x1, %edx
leaq 0x22f1(%rip), %rdi      # 0x847a
movq %rbx, %rcx
callq 0x2270
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 0x2150
incq %r15
cmpl $0x10, %r15d
jne 0x61a7
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2150
movl 0x14(%rsp), %ecx
incl %ecx
leaq (%r12,%r15), %rax
movl 0x10(%rsp), %edx
cmpl %edx, %ecx
jne 0x6132
movq 0x20(%rsp), %r14
addq %r13, %r14
addq %r15, %r12
movl 0xc(%rsp), %ecx
movq 0x18(%rsp), %r13
jmp 0x6213
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x6328
movq %r12, %r14
testl %ecx, %ecx
jle 0x62e4
movl %ecx, %r15d
movq %r12, (%rsp)
subl %ecx, %r13d
leaq 0x223c(%rip), %rsi      # 0x8468
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0x21a0
movl %r15d, %ebp
movl %r15d, %r12d
leaq 0x222e(%rip), %r15      # 0x8474
xorl %r13d, %r13d
movzbl (%r14,%r13), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21a0
incq %r13
cmpl %r13d, %r12d
jne 0x6249
addl $-0x10, %ebp
leaq 0x2210(%rip), %r15      # 0x847d
movq (%rsp), %r13
movl $0x3, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x2270
incl %ebp
jne 0x6271
leaq 0x21e9(%rip), %rdi      # 0x847a
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2270
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 0x2150
incq %r14
cmpl %r14d, %r12d
jne 0x62b1
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2150
leaq 0x212d(%rip), %rdi      # 0x8418
movl $0x4f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2270
leaq 0x217d(%rip), %rdi      # 0x8481
movl $0x1b, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2270
movq %rbx, %rdi
callq 0x21d0
movq %rbx, %rdi
callq 0x20e0
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq