// File: jkingan[P]ladyheather/heathgps.cpp
// Function: exclude_sat(int)
void exclude_sat(int prn)
{
u32 val;
int i;
u32 old_gps;
u32 old_glonass;
u32 old_qzss;
u32 old_sbas;
u32 old_galileo;

   if(read_only) return;
   if(luxor) return;

   if(rcvr_type == ESIP_RCVR) {  
      old_gps = esip_deleted_gps;
      old_glonass = esip_deleted_glonass;  
      old_qzss = esip_deleted_qzss;  
      old_sbas = esip_deleted_sbas;  
      old_galileo = esip_deleted_galileo;  

      if(prn <= 0) {  // restore all sats
         esip_deleted_gps = 0;
         esip_deleted_glonass = 0;  
         esip_deleted_qzss = 0;  
         esip_deleted_sbas = 0;  
         esip_deleted_galileo = 0;  
      }
      else if((prn >= 1) && (prn <= 32)) {  // delete gps sat
         esip_deleted_gps |= (1U << (prn-1));
      }
      else if((prn >= 65) && (prn <= 92)) {  // delete glonass sat
         esip_deleted_glonass |= (1U << (prn-65));
      }
      else if((prn >= 93) && (prn <= 99)) {  // delete qzss sat
         esip_deleted_qzss |= (1U << (prn-93));
      }
      else if((prn >= 33) && (prn <= 51)) {  // delete sbas sat
         esip_deleted_sbas |= (1U << (prn-33));
      }
      else if(0 && (prn >= 211) && (prn <= 230)) {  // delete galileo sat !!!!!! what are galileo PRN's?
         esip_deleted_galileo |= (1U << (prn-211));
      }

      set_amu_mask(amu_mask);     // this will set the sat disable flags

      esip_deleted_gps = old_gps;
      esip_deleted_glonass = old_glonass;  
      esip_deleted_qzss = old_qzss;  
      esip_deleted_sbas = old_sbas;  
      esip_deleted_galileo = old_galileo;  

      request_rcvr_config(8799);
   }
   else if(rcvr_type == FURUNO_RCVR) {
      if((prn >= 120) && (prn < 120+32)) {  // !!!! handle disabling multiple sats
         i = (prn - 120);
         val = (1 << i);
         val |= excluded_sbas;
         sprintf(out,"GPmge,%05X", val);
         send_furuno_cmd(out);
      }
      else if(prn < 32) {
         if(prn) {
            val = 1 << (prn-1);   // val is bitmap of sats to exclude
            val = (~val);         // now it's bitmap of sats to include
            val &= sats_enabled;
         }
         else {  // enable all SBAS sats
            send_furuno_cmd("GPmge,00000");
            val = 0xFFFFFFFF;
         }

         val ^= 0xFFFFFFFF;
         sprintf(out, "GPset,U%08X", val);
         send_furuno_cmd(out);
      }

      reset_sat_tracking();
      send_furuno_cmd("GPsrq");
      send_furuno_cmd("GPmgq");
   }
   else if(rcvr_type == MOTO_RCVR) {
      if(prn > 32) return;
      send_moto_start("Am");
      send_byte(0);
      if(prn) {
         val = 1 << (prn-1);     // val = bitmask of sats to exclude
         val |= (~sats_enabled);
      }
      else {
         val = 0;
      }
      send_dword(val);
      send_moto_end();

      reset_sat_tracking();
      request_sat_health();
   }
   else if(rcvr_type == NVS_RCVR) {
      if(prn) {  // exclude sat
         send_nvs_start(0x12);
         if(prn >= NVS_GLONASS_PRN) {
            send_byte(0x02);  // GLONASS
            send_byte(prn-NVS_GLONASS_PRN);
         }
         else {
            send_byte(0x01);  // GPS
            send_byte((u08) prn);
         }
         send_byte(0x02);  // disable
         send_nvs_end();
      }
      else {  // enable all excluded sats
         for(i=1; i<=32; i++) {  // GPS sats
            if(sat[i].disabled) {
               send_nvs_start(0x12);
               send_byte(0x01);  // GPS
               send_byte(i);
               send_byte(0x01);  // enable
               send_nvs_end();
            }
         }
         for(i=NVS_GLONASS_PRN+1; i<=NVS_GLONASS_PRN+24; i++) { // GLONASS sats
            if(sat[i].disabled) {
               send_nvs_start(0x12);
               send_byte(0x02);  // GLONASS
               send_byte(i-NVS_GLONASS_PRN);
               send_byte(0x01);  // enable
               send_nvs_end();
            }
         }
      }
   }
   else if(rcvr_type == SCPI_RCVR) {
      if(prn > 32) return;
      if(prn) {
         if(scpi_type == NORTEL_TYPE) sprintf(out, "GPS:SAT:TRAC:IGNORE %d", prn);
         else                         sprintf(out, ":GPS:SAT:TRAC:IGN %d", prn);
         queue_scpi_cmd(out, SCPI_IGNORE_MSG);
      }
      else if(scpi_type == NORTEL_TYPE) {
         queue_scpi_cmd("GPS:SAT:TRAC:INCLUDE 1,2,3,4,5,6,7,8,9,10,11,12,13", SCPI_INCLUDE_MSG);
         queue_scpi_cmd("GPS:SAT:TRAC:INCLUDE 14,15,16,17,18,19,20,21,22,23", SCPI_INCLUDE_MSG);
         queue_scpi_cmd("GPS:SAT:TRAC:INCLUDE 24,25,26,27,28,29,30,31,32", SCPI_INCLUDE_MSG);
         queue_scpi_cmd("SYNC:IMMEDIATE", SCPI_JAMSYNC_MSG);
      }
      else {
         queue_scpi_cmd(":GPS:SAT:TRAC:IGN:NONE", SCPI_IGNORE_MSG);
         queue_scpi_cmd(":GPS:SAT:TRAC:INCL:ALL", SCPI_INCLUDE_MSG);
         queue_scpi_cmd(":SYNC:HOLD:REC:INIT", SCPI_HOLDOVER_MSG);
      }

      if(scpi_type == NORTEL_TYPE) {
         queue_scpi_cmd("GPS:SAT:TRAC:IGNORE?", SCPI_IGNORE_MSG);
         queue_scpi_cmd("GPS:SAT:TRAC:INCLUDE?", SCPI_INCLUDE_MSG);
      }
      else queue_scpi_cmd(":GPS:SAT:TRAC:IGN?", SCPI_IGNORE_MSG);
   }
   else if(rcvr_type == SS_RCVR) {
      old_gps = ss_deleted_gps;
      old_sbas = ss_deleted_sbas;  

      if(prn <= 0) {  // restore all sats
         ss_deleted_gps = 0;
         ss_deleted_sbas = 0;  
      }
      else if((prn >= 1) && (prn <= 32)) {  // delete gps sat
         ss_deleted_gps |= (1U << (prn-1));
         send_ss_start(90, 16);
         send_ss_string("UGPS-000");
         send_byte((ss_deleted_gps >> 0) & 0xFF);
         send_byte((ss_deleted_gps >> 8) & 0xFF);
         send_byte((ss_deleted_gps >> 16) & 0xFF);
         send_byte((ss_deleted_gps >> 24) & 0xFF);
         send_ss_end();
      }
      else if(0 && (prn >= 120) && (prn <= 138)) {  // !!!!! this needs work - delete sbas sat
         ss_deleted_sbas |= (1U << (prn-33));
         send_ss_start(90, 16);
         send_ss_string("UGPS-0G5");
         send_byte((ss_deleted_gps >> 0) & 0xFF);
         send_byte((ss_deleted_gps >> 8) & 0xFF);
         send_byte((ss_deleted_gps >> 16) & 0xFF);
         send_byte((ss_deleted_gps >> 24) & 0xFF);
         send_ss_end();
      }

      ss_deleted_gps = old_gps;
      ss_deleted_sbas = old_sbas;  
      request_rcvr_config(8799);
   }
   else if(rcvr_type == UCCM_RCVR) {
      if(prn > 32) return;
      if(prn) {
         queue_uccm_cmd("GPS:SAT:TRAC:INCL:ALL", SCPI_INCLUDE_MSG);
         sprintf(out, "GPS:SAT:TRAC:IGN %d", prn);
         queue_uccm_cmd(out, SCPI_IGNORE_MSG);
      }
      else {
         queue_uccm_cmd("GPS:SAT:TRAC:INCL:ALL", SCPI_INCLUDE_MSG);
// uuuu  queue_uccm_cmd("SYNC:HOLD:REC:INIT", SCPI_HOLDOVER_MSG);
      }
      queue_uccm_cmd("GPS:SAT:TRAC:IGN?", SCPI_IGNORE_MSG);
   }
   else if(rcvr_type == TSIP_RCVR) {
      if(prn) set_health_config(2, prn);
      else    set_health_config(1, 0);
      request_sat_health();  // request enable/disable and health status of all sats
   }
   else if(rcvr_type == ZODIAC_RCVR) {
      if(prn > 32) return;
      if(prn) {
         val = 1 << (prn-1);   // val is bitmap of sats to exclude
         val = (~val);         // now it's bitmap of sats to include
         val &= sats_enabled;
      }
      else {
         val = 0xFFFFFFFF;
      }

      set_zod_sat_mask(val);
   }
   else if(rcvr_type == ZYFER_RCVR) {
      if(prn > 32) return;
      if(prn) {
         sprintf(out, "$SSLT,%d,1", prn);
         send_zyfer_cmd(out);
      }
      else {
         for(prn=1; prn<=32; prn++) {
            send_zyfer_cmd("$SSLT,%d,0");
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
leaq 0x306ca8(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0x8f55c
jmp 0x8fe15
leaq 0x20ebbb(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x8f56d
jmp 0x8fe15
movl $0x80000000, %ecx       # imm = 0x80000000
leaq 0x1e8537(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x8f745
leaq 0x2dd9df(%rip), %rax    # 0x36cf68
movl (%rax), %eax
movl %eax, -0x10(%rbp)
leaq 0x2dd9d7(%rip), %rax    # 0x36cf6c
movl (%rax), %eax
movl %eax, -0x14(%rbp)
leaq 0x2dd9d3(%rip), %rax    # 0x36cf74
movl (%rax), %eax
movl %eax, -0x18(%rbp)
leaq 0x2dd9cb(%rip), %rax    # 0x36cf78
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
leaq 0x2dd9b7(%rip), %rax    # 0x36cf70
movl (%rax), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x4(%rbp)
jg 0x8f60a
leaq 0x2dd99d(%rip), %rax    # 0x36cf68
movl $0x0, (%rax)
leaq 0x2dd994(%rip), %rax    # 0x36cf6c
movl $0x0, (%rax)
leaq 0x2dd98f(%rip), %rax    # 0x36cf74
movl $0x0, (%rax)
leaq 0x2dd986(%rip), %rax    # 0x36cf78
movl $0x0, (%rax)
leaq 0x2dd971(%rip), %rax    # 0x36cf70
movl $0x0, (%rax)
jmp 0x8f6d3
cmpl $0x1, -0x4(%rbp)
jl 0x8f63c
cmpl $0x20, -0x4(%rbp)
jg 0x8f63c
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
leaq 0x2dd93c(%rip), %rax    # 0x36cf68
orl (%rax), %ecx
leaq 0x2dd933(%rip), %rax    # 0x36cf68
movl %ecx, (%rax)
jmp 0x8f6d1
cmpl $0x41, -0x4(%rbp)
jl 0x8f66b
cmpl $0x5c, -0x4(%rbp)
jg 0x8f66b
movl -0x4(%rbp), %ecx
subl $0x41, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
leaq 0x2dd90e(%rip), %rax    # 0x36cf6c
orl (%rax), %ecx
leaq 0x2dd905(%rip), %rax    # 0x36cf6c
movl %ecx, (%rax)
jmp 0x8f6cf
cmpl $0x5d, -0x4(%rbp)
jl 0x8f69a
cmpl $0x63, -0x4(%rbp)
jg 0x8f69a
movl -0x4(%rbp), %ecx
subl $0x5d, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
leaq 0x2dd8e7(%rip), %rax    # 0x36cf74
orl (%rax), %ecx
leaq 0x2dd8de(%rip), %rax    # 0x36cf74
movl %ecx, (%rax)
jmp 0x8f6cd
cmpl $0x21, -0x4(%rbp)
jl 0x8f6c9
cmpl $0x33, -0x4(%rbp)
jg 0x8f6c9
movl -0x4(%rbp), %ecx
subl $0x21, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
leaq 0x2dd8bc(%rip), %rax    # 0x36cf78
orl (%rax), %ecx
leaq 0x2dd8b3(%rip), %rax    # 0x36cf78
movl %ecx, (%rax)
jmp 0x8f6cb
jmp 0x8f6cb
jmp 0x8f6cd
jmp 0x8f6cf
jmp 0x8f6d1
jmp 0x8f6d3
leaq 0x2dcbbe(%rip), %rax    # 0x36c298
movss (%rax), %xmm1
movl $0xff, %edx
movss 0xe224d(%rip), %xmm3    # 0x171938
movl %edx, %edi
movl %edx, %esi
movaps %xmm3, %xmm0
movaps %xmm3, %xmm2
callq 0x805d0
movl -0x10(%rbp), %ecx
leaq 0x2dd864(%rip), %rax    # 0x36cf68
movl %ecx, (%rax)
movl -0x14(%rbp), %ecx
leaq 0x2dd85c(%rip), %rax    # 0x36cf6c
movl %ecx, (%rax)
movl -0x18(%rbp), %ecx
leaq 0x2dd858(%rip), %rax    # 0x36cf74
movl %ecx, (%rax)
movl -0x1c(%rbp), %ecx
leaq 0x2dd850(%rip), %rax    # 0x36cf78
movl %ecx, (%rax)
movl -0x20(%rbp), %ecx
leaq 0x2dd83c(%rip), %rax    # 0x36cf70
movl %ecx, (%rax)
movl $0x225f, %edi           # imm = 0x225F
callq 0x8c270
jmp 0x8fe15
leaq 0x1e8364(%rip), %rax    # 0x277ab0
cmpq $0x20000000, (%rax)     # imm = 0x20000000
jne 0x8f84d
cmpl $0x78, -0x4(%rbp)
jl 0x8f7b3
cmpl $0x98, -0x4(%rbp)
jge 0x8f7b3
movl -0x4(%rbp), %eax
subl $0x78, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x8(%rbp)
leaq 0x2dcb43(%rip), %rax    # 0x36c2c8
movl (%rax), %eax
orl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edx
leaq 0x30bc69(%rip), %rdi    # 0x39b400
leaq 0xf47e4(%rip), %rsi     # 0x183f82
movb $0x0, %al
callq 0x9060
leaq 0x30bc54(%rip), %rdi    # 0x39b400
callq 0x83270
jmp 0x8f82b
cmpl $0x20, -0x4(%rbp)
jge 0x8f829
cmpl $0x0, -0x4(%rbp)
je 0x8f7e9
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
xorl $-0x1, %eax
movl %eax, -0x8(%rbp)
leaq 0x2dcae5(%rip), %rax    # 0x36c2c4
movl (%rax), %eax
andl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
jmp 0x8f7fc
leaq 0xf479d(%rip), %rdi     # 0x183f8d
callq 0x83270
movl $0xffffffff, -0x8(%rbp) # imm = 0xFFFFFFFF
movl -0x8(%rbp), %eax
xorl $-0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edx
leaq 0x30bbf1(%rip), %rdi    # 0x39b400
leaq 0xf460c(%rip), %rsi     # 0x183e22
movb $0x0, %al
callq 0x9060
leaq 0x30bbdc(%rip), %rdi    # 0x39b400
callq 0x83270
jmp 0x8f82b
callq 0x81c10
leaq 0xf451a(%rip), %rdi     # 0x183d51
callq 0x83270
leaq 0xf43a1(%rip), %rdi     # 0x183be4
callq 0x83270
jmp 0x8fe13
leaq 0x1e825c(%rip), %rax    # 0x277ab0
cmpq $0x20, (%rax)
jne 0x8f8c5
cmpl $0x20, -0x4(%rbp)
jle 0x8f865
jmp 0x8fe15
leaq 0xf45a7(%rip), %rdi     # 0x183e13
callq 0x86190
xorl %edi, %edi
callq 0x7b210
cmpl $0x0, -0x4(%rbp)
je 0x8f8a2
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x8(%rbp)
leaq 0x2dca2f(%rip), %rax    # 0x36c2c4
movl (%rax), %eax
xorl $-0x1, %eax
orl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
jmp 0x8f8a9
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %edi
callq 0x7b520
callq 0x86230
callq 0x81c10
callq 0x8ea20
jmp 0x8fe11
leaq 0x1e81e4(%rip), %rax    # 0x277ab0
cmpq $0x800, (%rax)          # imm = 0x800
jne 0x8fa02
cmpl $0x0, -0x4(%rbp)
je 0x8f932
movl $0x12, %edi
callq 0x824f0
cmpl $0x40, -0x4(%rbp)
jl 0x8f909
movl $0x2, %edi
callq 0x7b210
movl -0x4(%rbp), %eax
subl $0x40, %eax
movzbl %al, %edi
callq 0x7b210
jmp 0x8f91e
movl $0x1, %edi
callq 0x7b210
movl -0x4(%rbp), %eax
movzbl %al, %edi
callq 0x7b210
movl $0x2, %edi
callq 0x7b210
callq 0x82630
jmp 0x8f9fd
movl $0x1, -0xc(%rbp)
cmpl $0x20, -0xc(%rbp)
jg 0x8f995
movslq -0xc(%rbp), %rcx
leaq 0x20e846(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
cmpb $0x0, 0x1(%rax)
je 0x8f988
movl $0x12, %edi
callq 0x824f0
movl $0x1, %edi
callq 0x7b210
movl -0xc(%rbp), %eax
movzbl %al, %edi
callq 0x7b210
movl $0x1, %edi
callq 0x7b210
callq 0x82630
jmp 0x8f98a
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8f939
movl $0x41, -0xc(%rbp)
cmpl $0x58, -0xc(%rbp)
jg 0x8f9fb
movslq -0xc(%rbp), %rcx
leaq 0x20e7e3(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
cmpb $0x0, 0x1(%rax)
je 0x8f9ee
movl $0x12, %edi
callq 0x824f0
movl $0x2, %edi
callq 0x7b210
movl -0xc(%rbp), %eax
subl $0x40, %eax
movzbl %al, %edi
callq 0x7b210
movl $0x1, %edi
callq 0x7b210
callq 0x82630
jmp 0x8f9f0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8f99c
jmp 0x8f9fd
jmp 0x8fe0f
leaq 0x1e80a7(%rip), %rax    # 0x277ab0
cmpq $0x10, (%rax)
jne 0x8fb45
cmpl $0x20, -0x4(%rbp)
jle 0x8fa1e
jmp 0x8fe15
cmpl $0x0, -0x4(%rbp)
je 0x8fa78
leaq 0x1ea795(%rip), %rax    # 0x27a1c0
cmpl $0x4e, (%rax)
jne 0x8fa4a
movl -0x4(%rbp), %edx
leaq 0x30b9c6(%rip), %rdi    # 0x39b400
leaq 0xf4558(%rip), %rsi     # 0x183f99
movb $0x0, %al
callq 0x9060
jmp 0x8fa62
movl -0x4(%rbp), %edx
leaq 0x30b9ac(%rip), %rdi    # 0x39b400
leaq 0xf4555(%rip), %rsi     # 0x183fb0
movb $0x0, %al
callq 0x9060
leaq 0x30b997(%rip), %rdi    # 0x39b400
movl $0x1e, %esi
callq 0x82fd0
jmp 0x8faff
leaq 0x1ea741(%rip), %rax    # 0x27a1c0
cmpl $0x4e, (%rax)
jne 0x8faca
leaq 0xf43d1(%rip), %rdi     # 0x183e5c
movl $0x20, %esi
callq 0x82fd0
leaq 0xf43f3(%rip), %rdi     # 0x183e8f
movl $0x20, %esi
callq 0x82fd0
leaq 0xf4415(%rip), %rdi     # 0x183ec2
movl $0x20, %esi
callq 0x82fd0
leaq 0xf4434(%rip), %rdi     # 0x183ef2
movl $0x21, %esi
callq 0x82fd0
jmp 0x8fafd
leaq 0xf446f(%rip), %rdi     # 0x183f40
movl $0x1e, %esi
callq 0x82fd0
leaq 0xf4475(%rip), %rdi     # 0x183f57
movl $0x20, %esi
callq 0x82fd0
leaq 0xf447b(%rip), %rdi     # 0x183f6e
movl $0x16, %esi
callq 0x82fd0
jmp 0x8faff
leaq 0x1ea6ba(%rip), %rax    # 0x27a1c0
cmpl $0x4e, (%rax)
jne 0x8fb2f
leaq 0xf44b3(%rip), %rdi     # 0x183fc5
movl $0x1e, %esi
callq 0x82fd0
leaq 0xf44b7(%rip), %rdi     # 0x183fda
movl $0x20, %esi
callq 0x82fd0
jmp 0x8fb40
leaq 0xf43cb(%rip), %rdi     # 0x183f01
movl $0x1e, %esi
callq 0x82fd0
jmp 0x8fe0d
movabsq $0x800000000, %rcx      # imm = 0x800000000
leaq 0x1e7f5a(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x8fc82
leaq 0x2dd42a(%rip), %rax    # 0x36cf90
movl (%rax), %eax
movl %eax, -0x10(%rbp)
leaq 0x2dd422(%rip), %rax    # 0x36cf94
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x4(%rbp)
jg 0x8fb9c
leaq 0x2dd40c(%rip), %rax    # 0x36cf90
movl $0x0, (%rax)
leaq 0x2dd403(%rip), %rax    # 0x36cf94
movl $0x0, (%rax)
jmp 0x8fc5b
cmpl $0x1, -0x4(%rbp)
jl 0x8fc57
cmpl $0x20, -0x4(%rbp)
jg 0x8fc57
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
leaq 0x2dd3ca(%rip), %rax    # 0x36cf90
orl (%rax), %ecx
leaq 0x2dd3c1(%rip), %rax    # 0x36cf90
movl %ecx, (%rax)
movl $0x5a, %edi
movl $0x10, %esi
callq 0x8ab80
leaq 0xf3ee3(%rip), %rdi     # 0x183aca
callq 0x8abe0
leaq 0x2dd39d(%rip), %rax    # 0x36cf90
movl (%rax), %eax
shrl $0x0, %eax
andl $0xff, %eax
movzbl %al, %edi
callq 0x7b210
leaq 0x2dd384(%rip), %rax    # 0x36cf90
movl (%rax), %eax
shrl $0x8, %eax
andl $0xff, %eax
movzbl %al, %edi
callq 0x7b210
leaq 0x2dd36b(%rip), %rax    # 0x36cf90
movl (%rax), %eax
shrl $0x10, %eax
andl $0xff, %eax
movzbl %al, %edi
callq 0x7b210
leaq 0x2dd352(%rip), %rax    # 0x36cf90
movl (%rax), %eax
shrl $0x18, %eax
andl $0xff, %eax
movzbl %al, %edi
callq 0x7b210
callq 0x8ac40
jmp 0x8fc59
jmp 0x8fc59
jmp 0x8fc5b
movl -0x10(%rbp), %ecx
leaq 0x2dd32b(%rip), %rax    # 0x36cf90
movl %ecx, (%rax)
movl -0x1c(%rbp), %ecx
leaq 0x2dd323(%rip), %rax    # 0x36cf94
movl %ecx, (%rax)
movl $0x225f, %edi           # imm = 0x225F
callq 0x8c270
jmp 0x8fe0b
leaq 0x1e7e27(%rip), %rax    # 0x277ab0
cmpq $0x8, (%rax)
jne 0x8fd03
cmpl $0x20, -0x4(%rbp)
jle 0x8fc9a
jmp 0x8fe15
cmpl $0x0, -0x4(%rbp)
je 0x8fcdc
leaq 0xf42b1(%rip), %rdi     # 0x183f58
movl $0x20, %esi
callq 0x82fd0
movl -0x4(%rbp), %edx
leaq 0x30b745(%rip), %rdi    # 0x39b400
leaq 0xf42ef(%rip), %rsi     # 0x183fb1
movb $0x0, %al
callq 0x9060
leaq 0x30b730(%rip), %rdi    # 0x39b400
movl $0x1e, %esi
callq 0x82fd0
jmp 0x8fced
leaq 0xf4275(%rip), %rdi     # 0x183f58
movl $0x20, %esi
callq 0x82fd0
leaq 0xf420e(%rip), %rdi     # 0x183f02
movl $0x1e, %esi
callq 0x82fd0
jmp 0x8fe09
leaq 0x1e7da6(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x8fd3b
cmpl $0x0, -0x4(%rbp)
je 0x8fd25
movl -0x4(%rbp), %esi
movl $0x2, %edi
callq 0x8e990
jmp 0x8fd31
movl $0x1, %edi
xorl %esi, %esi
callq 0x8e990
callq 0x8ea20
jmp 0x8fe07
leaq 0x1e7d6e(%rip), %rax    # 0x277ab0
cmpq $0x100, (%rax)          # imm = 0x100
jne 0x8fd97
cmpl $0x20, -0x4(%rbp)
jle 0x8fd56
jmp 0x8fe15
cmpl $0x0, -0x4(%rbp)
je 0x8fd86
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
xorl $-0x1, %eax
movl %eax, -0x8(%rbp)
leaq 0x2dc548(%rip), %rax    # 0x36c2c4
movl (%rax), %eax
andl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
jmp 0x8fd8d
movl $0xffffffff, -0x8(%rbp) # imm = 0xFFFFFFFF
movl -0x8(%rbp), %edi
callq 0x8fe20
jmp 0x8fe05
leaq 0x1e7d12(%rip), %rax    # 0x277ab0
cmpq $0x100000, (%rax)       # imm = 0x100000
jne 0x8fe03
cmpl $0x20, -0x4(%rbp)
jle 0x8fdaf
jmp 0x8fe15
cmpl $0x0, -0x4(%rbp)
je 0x8fddb
movl -0x4(%rbp), %edx
leaq 0x30b641(%rip), %rdi    # 0x39b400
leaq 0xf422a(%rip), %rsi     # 0x183ff0
movb $0x0, %al
callq 0x9060
leaq 0x30b62c(%rip), %rdi    # 0x39b400
callq 0x85d30
jmp 0x8fe01
movl $0x1, -0x4(%rbp)
cmpl $0x20, -0x4(%rbp)
jg 0x8fdff
leaq 0xf420c(%rip), %rdi     # 0x183ffb
callq 0x85d30
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x8fde2
jmp 0x8fe01
jmp 0x8fe03
jmp 0x8fe05
jmp 0x8fe07
jmp 0x8fe09
jmp 0x8fe0b
jmp 0x8fe0d
jmp 0x8fe0f
jmp 0x8fe11
jmp 0x8fe13
jmp 0x8fe15
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)