// File: /workspace/github_cpp_makefile_star2_O3/st0ne[P]XReflectorPlus/dxrfd.cpp
// Function: open_blocks(char*)
static int open_blocks(char *filename)
{
   FILE *fp = NULL;
   char inbuf[512];
   char *p = NULL;
   blocks_type::iterator pos;
   short int i;

   char *call_ptr;
   char call[9];
   const char *delim = " \t";

   fp = fopen(filename, "r");
   if (!fp)
   {
      traceit("Failed to open file %s\n", filename);
      return 1;
   }

   blocks.clear();

   traceit("Reading from file: [%s]\n", filename);
   while (fgets(inbuf, 511, fp) != NULL)
   {
      inbuf[511] = '\0';
      p = strchr(inbuf, '\r');
      if (p)
         *p = '\0';
      p = strchr(inbuf, '\n');
      if (p)
         *p = '\0';

      call_ptr = strtok(inbuf, delim);
      if (call_ptr)
      {
         if (strlen(call_ptr) <= 8)
         {
            memset(call, ' ', 9); call[8] = '\0';
            memcpy(call, call_ptr, strlen(call_ptr));

            for (i = 0; i < CALL_SIZE; i++)
            {
               if (call[i] == '_')
                  call[i] = ' ';
            }

            blocks.insert(call);
         }
      }
   }
   fclose(fp);

   traceit("BEGIN listing blocked callsigns...%d calls blocked\n", blocks.size());
   for (pos = blocks.begin(); pos != blocks.end(); pos++)
      traceit("--->[%s]\n", pos->c_str());
   traceit("END listing blocked callsigns\n");

   return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
leaq 0xf0de(%rip), %rdi      # 0x12430
leaq 0x8f3d(%rip), %rsi      # 0xc296
callq 0x2270
testq %rax, %rax
je 0x3676
movq %rax, %rbx
leaq 0xdfbf(%rip), %rdi      # 0x11330
callq 0xa62e
leaq 0x9179(%rip), %rdi      # 0xc4f6
leaq 0xf0ac(%rip), %rsi      # 0x12430
xorl %eax, %eax
callq 0x26fc
leaq 0xa0(%rsp), %rdi
movl $0x1ff, %esi            # imm = 0x1FF
movq %rbx, %rdx
callq 0x23a0
testq %rax, %rax
je 0x360f
leaq 0xa0(%rsp), %r14
leaq 0x913b(%rip), %r15      # 0xc4f3
movq %rsp, %r12
movdqa 0x8c7d(%rip), %xmm0     # 0xc040
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
movdqa %xmm0, 0x90(%rsp)
movdqa 0x8c78(%rip), %xmm0     # 0xc050
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
movdqa %xmm0, 0x80(%rsp)
movdqa 0x8c73(%rip), %xmm0     # 0xc060
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
movdqa %xmm0, 0x70(%rsp)
movdqa 0x8c71(%rip), %xmm0     # 0xc070
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
movdqa %xmm0, 0x60(%rsp)
movdqa 0x8c6f(%rip), %xmm0     # 0xc080
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
movdqa %xmm0, 0x50(%rsp)
movdqa 0x8c6d(%rip), %xmm0     # 0xc090
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
movdqa %xmm0, 0x40(%rsp)
movdqa 0x8c6b(%rip), %xmm0     # 0xc0a0
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
movdqa %xmm0, 0x30(%rsp)
leaq 0x10(%rsp), %r13
movb $0x0, 0x29f(%rsp)
movq %r14, %rdi
movl $0xd, %esi
callq 0x20e0
testq %rax, %rax
je 0x3461
movb $0x0, (%rax)
movq %r14, %rdi
movl $0xa, %esi
callq 0x20e0
testq %rax, %rax
je 0x3476
movb $0x0, (%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x2390
testq %rax, %rax
je 0x35f6
movq %rax, %rbp
movq %rax, %rdi
callq 0x2100
cmpq $0x8, %rax
ja 0x35f6
movabsq $0x2020202020202020, %rax # imm = 0x2020202020202020
movq %rax, (%rsp)
movb $0x0, 0x8(%rsp)
movq %rbp, %rdi
callq 0x2100
movq %r12, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x21b0
movq (%rsp), %xmm0
movdqa %xmm0, %xmm1
pcmpeqb 0x8b57(%rip), %xmm1     # 0xc030
movd %xmm1, %eax
testb $0x1, %al
je 0x34e5
movb $0x20, (%rsp)
movdqa %xmm0, %xmm1
pslld $0x8, %xmm1
pcmpeqb 0x90(%rsp), %xmm1
movd %xmm1, %eax
shrl $0x10, %eax
testb $0x1, %al
leaq 0x20(%rsp), %rcx
je 0x350c
movb $0x20, 0x1(%rsp)
pshuflw $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1,4,5,6,7]
pcmpeqb 0x80(%rsp), %xmm1
pextrw $0x2, %xmm1, %eax
testb $0x1, %al
je 0x3528
movb $0x20, 0x2(%rsp)
movdqa %xmm0, %xmm1
psllq $0x18, %xmm1
pcmpeqb 0x70(%rsp), %xmm1
pextrw $0x3, %xmm1, %eax
testb $0x1, %al
je 0x3545
movb $0x20, 0x3(%rsp)
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
pcmpeqb 0x60(%rsp), %xmm1
pextrw $0x4, %xmm1, %eax
testb $0x1, %al
je 0x355e
movb $0x20, 0x4(%rsp)
movdqa %xmm0, %xmm1
pslldq $0x5, %xmm1             # xmm1 = zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7,8,9,10]
pcmpeqb 0x50(%rsp), %xmm1
pextrw $0x5, %xmm1, %eax
testb $0x1, %al
je 0x357b
movb $0x20, 0x5(%rsp)
movdqa %xmm0, %xmm1
pslldq $0x6, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7,8,9]
pcmpeqb 0x40(%rsp), %xmm1
pextrw $0x6, %xmm1, %eax
testb $0x1, %al
je 0x3598
movb $0x20, 0x6(%rsp)
pslldq $0x7, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8]
pcmpeqb 0x30(%rsp), %xmm0
pextrw $0x7, %xmm0, %eax
testb $0x1, %al
je 0x35b1
movb $0x20, 0x7(%rsp)
movq %rcx, 0x10(%rsp)
movq %r12, %rdi
movq %rcx, %rbp
callq 0x2100
leaq (%rsp,%rax), %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0xa598
leaq 0xdd59(%rip), %rdi      # 0x11330
movq %r13, %rsi
callq 0xa65c
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x35f6
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
movq %r14, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
movq %rbx, %rdx
callq 0x23a0
testq %rax, %rax
jne 0x3444
movq %rbx, %rdi
callq 0x2200
movq 0xdd3a(%rip), %rsi      # 0x11358
leaq 0x8f32(%rip), %rdi      # 0xc557
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x26fc
movq 0xdd13(%rip), %r14      # 0x11348
leaq 0xdcfc(%rip), %r12      # 0x11338
cmpq %r12, %r14
je 0x3666
leaq 0x8f43(%rip), %r15      # 0xc58b
movq 0x20(%r14), %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x26fc
movq %r14, %rdi
callq 0x2260
movq %rax, %r14
cmpq %r12, %rax
jne 0x3648
leaq 0x8f28(%rip), %rdi      # 0xc595
xorl %eax, %eax
callq 0x26fc
jmp 0x3690
leaq 0x8c1b(%rip), %rdi      # 0xc298
leaq 0xedac(%rip), %rsi      # 0x12430
xorl %eax, %eax
callq 0x26fc
movl $0x1, %ebx
movl %ebx, %eax
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x36be
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23f0