// File: lemire[P]validateutf8-experiments/tests/unit.cpp
// Function: brute_force_tests()
void brute_force_tests() {
  printf("running brute-force tests\n");
  std::random_device rd{};
  RandomUTF8 gen_1_2_3_4(rd, 1, 1, 1, 1);
  size_t total = 50000;
  for(size_t i = 0; i < total; i++) {
    if((i % (total/100)) == 0) {
      printf("\r\r\r\r%2.0f %%", double(i)/double(total)*100.0); fflush(NULL);
    }
    auto UTF8 = gen_1_2_3_4.generate(rand() % 256);
    if(active_fastvalidate::lookup2::validate(UTF8.data(), UTF8.size()) != fastvalidate::error_code::SUCCESS) {
        printf("bug brute_force_tests %.*s\n", (int) UTF8.size(), UTF8.data());
        display(UTF8);
        abort();
    }
    if(active_fastvalidate::lookup3::validate(UTF8.data(), UTF8.size()) != fastvalidate::error_code::SUCCESS) {
        printf("bug brute_force_tests %.*s\n", (int) UTF8.size(), UTF8.data());
        display(UTF8);
        abort();
    }
    if(active_fastvalidate::lookup4::validate(UTF8.data(), UTF8.size()) != fastvalidate::error_code::SUCCESS) {
        printf("bug brute_force_tests %.*s\n", (int) UTF8.size(), UTF8.data());
        display(UTF8);
        abort();
    }
    if(shiftless_validate_dfa_utf8((const signed char *)UTF8.data(), UTF8.size()) != fastvalidate::error_code::SUCCESS) {
        printf("bug brute_force_tests dfa %.*s\n", (int) UTF8.size(), UTF8.data());
        display(UTF8);
        abort();
    }
    if(shiftless_validate_dfa_utf8_double((const signed char *)UTF8.data(), UTF8.size()) != fastvalidate::error_code::SUCCESS) {
        printf("bug brute_force_tests dfa double %.*s\n", (int) UTF8.size(), UTF8.data());
        display(UTF8);
        abort();
    }
    if(shiftless_validate_dfa_utf8_three((const signed char *)UTF8.data(), UTF8.size()) != fastvalidate::error_code::SUCCESS) {
        printf("bug brute_force_tests dfa three %.*s\n", (int) UTF8.size(), UTF8.data());
        display(UTF8);
        abort();
    }
    if(shiftless_validate_dfa_utf8_quad((const signed char *)UTF8.data(), UTF8.size()) != fastvalidate::error_code::SUCCESS) {
        printf("bug brute_force_tests dfa quad %.*s\n", (int) UTF8.size(), UTF8.data());
        display(UTF8);
        abort();
    }
    for(size_t flip = 0; flip  < 10000; ++flip) {
      // we are going to hack the string as long as it is UTF-8
      UTF8[rand()% UTF8.size()] ^= uint8_t(1) << (rand() % 8); // we flip exactly one bit
      auto e = fidl_validate_string(UTF8.data(), UTF8.size());      
      auto e3 = active_fastvalidate::lookup3::validate(UTF8.data(), UTF8.size());
      
      if(e3 != e) {
        printf("bug brute_force_tests lookup3 %.*s\n", (int) UTF8.size(), UTF8.data());
        if(e3 == fastvalidate::error_code::SUCCESS) {
          printf("lookup3 says it is ok!\n");
        } else {
          printf("lookup3 says it is not ok!\n");
        }
        display(UTF8);
        abort();
      }
      auto e4 = active_fastvalidate::lookup4::validate(UTF8.data(), UTF8.size());
      if(e3 != e4) {
        printf("bug brute_force_tests lookup4 %.*s\n", (int) UTF8.size(), UTF8.data());
        if(e4 == fastvalidate::error_code::SUCCESS) {
          printf("lookup4 says it is ok!\n");
        } else {
          printf("lookup4 says it is not ok!\n");
        }
        display(UTF8);
        abort();
      }      
      
      auto es = shiftless_validate_dfa_utf8((const signed char *)UTF8.data(), UTF8.size());
      
      if(es != e) {
        printf("bug brute_force_tests dfa %.*s\n", (int) UTF8.size(), UTF8.data());
        if(es == fastvalidate::error_code::SUCCESS) {
          printf("dfa says it is ok!\n");
        } else {
          printf("dfa says it is not ok!\n");
        }
        display(UTF8);
        abort();
      }
      auto esd = shiftless_validate_dfa_utf8_double((const signed char *)UTF8.data(), UTF8.size());
      
      if(esd != e) {
        printf("bug brute_force_tests dfa %.*s\n", (int) UTF8.size(), UTF8.data());
        if(esd == fastvalidate::error_code::SUCCESS) {
          printf("double dfa says it is ok!\n");
        } else {
          printf("double dfa says it is not ok!\n");
        }
        display(UTF8);
        abort();
      }
      auto esq = shiftless_validate_dfa_utf8_quad((const signed char *)UTF8.data(), UTF8.size());
      
      if(esq != e) {
        printf("bug brute_force_tests dfa %.*s\n", (int) UTF8.size(), UTF8.data());
        if(esq == fastvalidate::error_code::SUCCESS) {
          printf("quad dfa says it is ok!\n");
        } else {
          printf("quad dfa says it is not ok!\n");
        }
        display(UTF8);
        abort();
      }

      auto est = shiftless_validate_dfa_utf8_three((const signed char *)UTF8.data(), UTF8.size());
      
      if(est != e) {
        printf("bug brute_force_tests dfa %.*s\n", (int) UTF8.size(), UTF8.data());
        if(est == fastvalidate::error_code::SUCCESS) {
          printf("three dfa says it is ok!\n");
        } else {
          printf("three dfa says it is not ok!\n");
        }
        display(UTF8);
        abort();
      }

    }
  }
  printf("\r\r\r\r\n");
}

// Assembly:
subq $0x29e8, %rsp           # imm = 0x29E8
leaq 0xfb827(%rip), %rdi     # 0xff085
xorl %eax, %eax
callq 0x2030
leaq 0x1660(%rsp), %rdi
movq %rdi, 0x230(%rsp)
callq 0xf91c0
movq 0x230(%rsp), %rsi
leaq 0x298(%rsp), %rdi
movl $0x1, %r9d
movl %r9d, %edx
movl %r9d, %ecx
movl %r9d, %r8d
callq 0xfabf0
jmp 0x38a0
movq $0xc350, 0x280(%rsp) # imm = 0xC350
movq $0x0, 0x278(%rsp)
movq 0x278(%rsp), %rax
cmpq 0x280(%rsp), %rax
jae 0x44b3
movq 0x278(%rsp), %rax
movq %rax, 0x228(%rsp)
movq 0x280(%rsp), %rax
movl $0x64, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movq 0x228(%rsp), %rax
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0x39b0
movq 0x278(%rsp), %xmm0
movaps 0xfb736(%rip), %xmm3    # 0xff050
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0xfb73a(%rip), %xmm2    # 0xff060
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0x280(%rsp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd 0xfb713(%rip), %xmm1    # 0xff070
mulsd %xmm1, %xmm0
leaq 0xfb738(%rip), %rdi     # 0xff0a0
movb $0x1, %al
callq 0x2030
jmp 0x3971
xorl %eax, %eax
movl %eax, %edi
callq 0x21e0
jmp 0x397c
jmp 0x39b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x44f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x44e5
callq 0x2050
movl %eax, %edx
addl $0xff, %edx
testl %eax, %eax
movl %eax, %ecx
cmovsl %edx, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
subl %ecx, %eax
movslq %eax, %rdx
leaq 0x260(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0xfad40
jmp 0x39e6
leaq 0x260(%rsp), %rdi
movq %rdi, 0x210(%rsp)
callq 0xf9260
movq 0x210(%rsp), %rdi
movq %rax, 0x218(%rsp)
callq 0xf9180
movq 0x218(%rsp), %rdi
movq %rax, %rsi
callq 0x2410
movl %eax, 0x224(%rsp)
jmp 0x3a29
movl 0x224(%rsp), %eax
cmpl $0x0, %eax
je 0x3ab2
leaq 0x260(%rsp), %rdi
movq %rdi, 0x200(%rsp)
callq 0xf9180
movq 0x200(%rsp), %rdi
movl %eax, 0x20c(%rsp)
callq 0xf9260
movl 0x20c(%rsp), %esi
movq %rax, %rdx
leaq 0xfb63e(%rip), %rdi     # 0xff0ad
xorl %eax, %eax
callq 0x2030
jmp 0x3a78
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x3a87
callq 0x20d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x260(%rsp), %rdi
callq 0xf92a0
jmp 0x44e5
leaq 0x260(%rsp), %rdi
movq %rdi, 0x1e8(%rsp)
callq 0xf9260
movq 0x1e8(%rsp), %rdi
movq %rax, 0x1f0(%rsp)
callq 0xf9180
movq 0x1f0(%rsp), %rdi
movq %rax, %rsi
callq 0x2470
movl %eax, 0x1fc(%rsp)
jmp 0x3af5
movl 0x1fc(%rsp), %eax
cmpl $0x0, %eax
je 0x3b58
leaq 0x260(%rsp), %rdi
movq %rdi, 0x1d8(%rsp)
callq 0xf9180
movq 0x1d8(%rsp), %rdi
movl %eax, 0x1e4(%rsp)
callq 0xf9260
movl 0x1e4(%rsp), %esi
movq %rax, %rdx
leaq 0xfb572(%rip), %rdi     # 0xff0ad
xorl %eax, %eax
callq 0x2030
jmp 0x3b44
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x3b53
callq 0x20d0
leaq 0x260(%rsp), %rdi
movq %rdi, 0x1c0(%rsp)
callq 0xf9260
movq 0x1c0(%rsp), %rdi
movq %rax, 0x1c8(%rsp)
callq 0xf9180
movq 0x1c8(%rsp), %rdi
movq %rax, %rsi
callq 0x24d0
movl %eax, 0x1d4(%rsp)
jmp 0x3b9b
movl 0x1d4(%rsp), %eax
cmpl $0x0, %eax
je 0x3bfe
leaq 0x260(%rsp), %rdi
movq %rdi, 0x1b0(%rsp)
callq 0xf9180
movq 0x1b0(%rsp), %rdi
movl %eax, 0x1bc(%rsp)
callq 0xf9260
movl 0x1bc(%rsp), %esi
movq %rax, %rdx
leaq 0xfb4cc(%rip), %rdi     # 0xff0ad
xorl %eax, %eax
callq 0x2030
jmp 0x3bea
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x3bf9
callq 0x20d0
leaq 0x260(%rsp), %rdi
movq %rdi, 0x198(%rsp)
callq 0xf9260
movq 0x198(%rsp), %rdi
movq %rax, 0x1a0(%rsp)
callq 0xf9180
movq 0x1a0(%rsp), %rdi
movq %rax, %rsi
callq 0x4510
movl %eax, 0x1ac(%rsp)
jmp 0x3c41
movl 0x1ac(%rsp), %eax
cmpl $0x0, %eax
je 0x3ca4
leaq 0x260(%rsp), %rdi
movq %rdi, 0x188(%rsp)
callq 0xf9180
movq 0x188(%rsp), %rdi
movl %eax, 0x194(%rsp)
callq 0xf9260
movl 0x194(%rsp), %esi
movq %rax, %rdx
leaq 0xfb442(%rip), %rdi     # 0xff0c9
xorl %eax, %eax
callq 0x2030
jmp 0x3c90
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x3c9f
callq 0x20d0
leaq 0x260(%rsp), %rdi
movq %rdi, 0x170(%rsp)
callq 0xf9260
movq 0x170(%rsp), %rdi
movq %rax, 0x178(%rsp)
callq 0xf9180
movq 0x178(%rsp), %rdi
movq %rax, %rsi
callq 0x4640
movl %eax, 0x184(%rsp)
jmp 0x3ce7
movl 0x184(%rsp), %eax
cmpl $0x0, %eax
je 0x3d4a
leaq 0x260(%rsp), %rdi
movq %rdi, 0x160(%rsp)
callq 0xf9180
movq 0x160(%rsp), %rdi
movl %eax, 0x16c(%rsp)
callq 0xf9260
movl 0x16c(%rsp), %esi
movq %rax, %rdx
leaq 0xfb3bc(%rip), %rdi     # 0xff0e9
xorl %eax, %eax
callq 0x2030
jmp 0x3d36
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x3d45
callq 0x20d0
leaq 0x260(%rsp), %rdi
movq %rdi, 0x148(%rsp)
callq 0xf9260
movq 0x148(%rsp), %rdi
movq %rax, 0x150(%rsp)
callq 0xf9180
movq 0x150(%rsp), %rdi
movq %rax, %rsi
callq 0x49c0
movl %eax, 0x15c(%rsp)
jmp 0x3d8d
movl 0x15c(%rsp), %eax
cmpl $0x0, %eax
je 0x3df0
leaq 0x260(%rsp), %rdi
movq %rdi, 0x138(%rsp)
callq 0xf9180
movq 0x138(%rsp), %rdi
movl %eax, 0x144(%rsp)
callq 0xf9260
movl 0x144(%rsp), %esi
movq %rax, %rdx
leaq 0xfb33d(%rip), %rdi     # 0xff110
xorl %eax, %eax
callq 0x2030
jmp 0x3ddc
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x3deb
callq 0x20d0
leaq 0x260(%rsp), %rdi
movq %rdi, 0x120(%rsp)
callq 0xf9260
movq 0x120(%rsp), %rdi
movq %rax, 0x128(%rsp)
callq 0xf9180
movq 0x128(%rsp), %rdi
movq %rax, %rsi
callq 0x5170
movl %eax, 0x134(%rsp)
jmp 0x3e33
movl 0x134(%rsp), %eax
cmpl $0x0, %eax
je 0x3e96
leaq 0x260(%rsp), %rdi
movq %rdi, 0x110(%rsp)
callq 0xf9180
movq 0x110(%rsp), %rdi
movl %eax, 0x11c(%rsp)
callq 0xf9260
movl 0x11c(%rsp), %esi
movq %rax, %rdx
leaq 0xfb2bd(%rip), %rdi     # 0xff136
xorl %eax, %eax
callq 0x2030
jmp 0x3e82
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x3e91
callq 0x20d0
movq $0x0, 0x258(%rsp)
cmpq $0x2710, 0x258(%rsp) # imm = 0x2710
jae 0x448d
callq 0x2050
movl %eax, %edx
addl $0x7, %edx
testl %eax, %eax
movl %eax, %ecx
cmovsl %edx, %ecx
andl $0xf8, %ecx
subl %ecx, %eax
movb %al, 0xef(%rsp)
callq 0x2050
cltq
movq %rax, 0xe0(%rsp)
leaq 0x260(%rsp), %rdi
movq %rdi, 0xf8(%rsp)
callq 0xf9180
movq 0xf8(%rsp), %rdi
movq %rax, %rcx
movq 0xe0(%rsp), %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %rsi
callq 0xf9280
movb 0xef(%rsp), %sil
movq 0xf8(%rsp), %rdi
movzbl (%rax), %ecx
movb %sil, %dl
btcl %edx, %ecx
movb %cl, (%rax)
callq 0xf9260
movq 0xf8(%rsp), %rdi
movq %rax, 0xf0(%rsp)
callq 0xf9180
movq 0xf0(%rsp), %rdi
movq %rax, %rsi
callq 0x2860
movq 0xf8(%rsp), %rdi
movl %eax, 0x254(%rsp)
callq 0xf9260
movq 0xf8(%rsp), %rdi
movq %rax, 0x100(%rsp)
callq 0xf9180
movq 0x100(%rsp), %rdi
movq %rax, %rsi
callq 0x2470
movl %eax, 0x10c(%rsp)
jmp 0x3f9f
movl 0x10c(%rsp), %eax
movl %eax, 0x250(%rsp)
movl 0x250(%rsp), %eax
cmpl 0x254(%rsp), %eax
je 0x4046
leaq 0x260(%rsp), %rdi
movq %rdi, 0xd0(%rsp)
callq 0xf9180
movq 0xd0(%rsp), %rdi
movl %eax, 0xdc(%rsp)
callq 0xf9260
movl 0xdc(%rsp), %esi
movq %rax, %rdx
leaq 0xfb160(%rip), %rdi     # 0xff15b
xorl %eax, %eax
callq 0x2030
jmp 0x4004
cmpl $0x0, 0x250(%rsp)
jne 0x4020
leaq 0xfb16a(%rip), %rdi     # 0xff17f
xorl %eax, %eax
callq 0x2030
jmp 0x401e
jmp 0x4032
leaq 0xfb170(%rip), %rdi     # 0xff197
xorl %eax, %eax
callq 0x2030
jmp 0x4030
jmp 0x4032
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x4041
callq 0x20d0
leaq 0x260(%rsp), %rdi
movq %rdi, 0xb8(%rsp)
callq 0xf9260
movq 0xb8(%rsp), %rdi
movq %rax, 0xc0(%rsp)
callq 0xf9180
movq 0xc0(%rsp), %rdi
movq %rax, %rsi
callq 0x24d0
movl %eax, 0xcc(%rsp)
jmp 0x4089
movl 0xcc(%rsp), %eax
movl %eax, 0x24c(%rsp)
movl 0x250(%rsp), %eax
cmpl 0x24c(%rsp), %eax
je 0x4130
leaq 0x260(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0xf9180
movq 0xa8(%rsp), %rdi
movl %eax, 0xb4(%rsp)
callq 0xf9260
movl 0xb4(%rsp), %esi
movq %rax, %rdx
leaq 0xfb0ce(%rip), %rdi     # 0xff1b3
xorl %eax, %eax
callq 0x2030
jmp 0x40ee
cmpl $0x0, 0x24c(%rsp)
jne 0x410a
leaq 0xfb0d8(%rip), %rdi     # 0xff1d7
xorl %eax, %eax
callq 0x2030
jmp 0x4108
jmp 0x411c
leaq 0xfb0de(%rip), %rdi     # 0xff1ef
xorl %eax, %eax
callq 0x2030
jmp 0x411a
jmp 0x411c
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x412b
callq 0x20d0
leaq 0x260(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0xf9260
movq 0x90(%rsp), %rdi
movq %rax, 0x98(%rsp)
callq 0xf9180
movq 0x98(%rsp), %rdi
movq %rax, %rsi
callq 0x4510
movl %eax, 0xa4(%rsp)
jmp 0x4173
movl 0xa4(%rsp), %eax
movl %eax, 0x248(%rsp)
movl 0x248(%rsp), %eax
cmpl 0x254(%rsp), %eax
je 0x421a
leaq 0x260(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0xf9180
movq 0x80(%rsp), %rdi
movl %eax, 0x8c(%rsp)
callq 0xf9260
movl 0x8c(%rsp), %esi
movq %rax, %rdx
leaq 0xfaefa(%rip), %rdi     # 0xff0c9
xorl %eax, %eax
callq 0x2030
jmp 0x41d8
cmpl $0x0, 0x248(%rsp)
jne 0x41f4
leaq 0xfb061(%rip), %rdi     # 0xff24a
xorl %eax, %eax
callq 0x2030
jmp 0x41f2
jmp 0x4206
leaq 0xfb068(%rip), %rdi     # 0xff263
xorl %eax, %eax
callq 0x2030
jmp 0x4204
jmp 0x4206
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x4215
callq 0x20d0
leaq 0x260(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0xf9260
movq 0x68(%rsp), %rdi
movq %rax, 0x70(%rsp)
callq 0xf9180
movq 0x70(%rsp), %rdi
movq %rax, %rsi
callq 0x4640
movl %eax, 0x7c(%rsp)
jmp 0x424e
movl 0x7c(%rsp), %eax
movl %eax, 0x244(%rsp)
movl 0x244(%rsp), %eax
cmpl 0x254(%rsp), %eax
je 0x42e2
leaq 0x260(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xf9180
movq 0x58(%rsp), %rdi
movl %eax, 0x64(%rsp)
callq 0xf9260
movl 0x64(%rsp), %esi
movq %rax, %rdx
leaq 0xfae32(%rip), %rdi     # 0xff0c9
xorl %eax, %eax
callq 0x2030
jmp 0x42a0
cmpl $0x0, 0x244(%rsp)
jne 0x42bc
leaq 0xfaf5a(%rip), %rdi     # 0xff20b
xorl %eax, %eax
callq 0x2030
jmp 0x42ba
jmp 0x42ce
leaq 0xfaf63(%rip), %rdi     # 0xff226
xorl %eax, %eax
callq 0x2030
jmp 0x42cc
jmp 0x42ce
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x42dd
callq 0x20d0
leaq 0x260(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xf9260
movq 0x40(%rsp), %rdi
movq %rax, 0x48(%rsp)
callq 0xf9180
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x5170
movl %eax, 0x54(%rsp)
jmp 0x4316
movl 0x54(%rsp), %eax
movl %eax, 0x240(%rsp)
movl 0x240(%rsp), %eax
cmpl 0x254(%rsp), %eax
je 0x43aa
leaq 0x260(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xf9180
movq 0x30(%rsp), %rdi
movl %eax, 0x3c(%rsp)
callq 0xf9260
movl 0x3c(%rsp), %esi
movq %rax, %rdx
leaq 0xfad6a(%rip), %rdi     # 0xff0c9
xorl %eax, %eax
callq 0x2030
jmp 0x4368
cmpl $0x0, 0x240(%rsp)
jne 0x4384
leaq 0xfaecc(%rip), %rdi     # 0xff245
xorl %eax, %eax
callq 0x2030
jmp 0x4382
jmp 0x4396
leaq 0xfaed3(%rip), %rdi     # 0xff25e
xorl %eax, %eax
callq 0x2030
jmp 0x4394
jmp 0x4396
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x43a5
callq 0x20d0
leaq 0x260(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xf9260
movq 0x18(%rsp), %rdi
movq %rax, 0x20(%rsp)
callq 0xf9180
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x49c0
movl %eax, 0x2c(%rsp)
jmp 0x43de
movl 0x2c(%rsp), %eax
movl %eax, 0x23c(%rsp)
movl 0x23c(%rsp), %eax
cmpl 0x254(%rsp), %eax
je 0x4472
leaq 0x260(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xf9180
movq 0x8(%rsp), %rdi
movl %eax, 0x14(%rsp)
callq 0xf9260
movl 0x14(%rsp), %esi
movq %rax, %rdx
leaq 0xfaca2(%rip), %rdi     # 0xff0c9
xorl %eax, %eax
callq 0x2030
jmp 0x4430
cmpl $0x0, 0x23c(%rsp)
jne 0x444c
leaq 0xfae3a(%rip), %rdi     # 0xff27b
xorl %eax, %eax
callq 0x2030
jmp 0x444a
jmp 0x445e
leaq 0xfae42(%rip), %rdi     # 0xff295
xorl %eax, %eax
callq 0x2030
jmp 0x445c
jmp 0x445e
leaq 0x260(%rsp), %rdi
callq 0x3790
jmp 0x446d
callq 0x20d0
jmp 0x4474
movq 0x258(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x258(%rsp)
jmp 0x3ea2
leaq 0x260(%rsp), %rdi
callq 0xf92a0
movq 0x278(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x278(%rsp)
jmp 0x38b8
leaq 0xfadf9(%rip), %rdi     # 0xff2b3
xorl %eax, %eax
callq 0x2030
jmp 0x44c3
leaq 0x298(%rsp), %rdi
callq 0xf9300
leaq 0x1660(%rsp), %rdi
callq 0xf9320
addq $0x29e8, %rsp           # imm = 0x29E8
retq
leaq 0x298(%rsp), %rdi
callq 0xf9300
leaq 0x1660(%rsp), %rdi
callq 0xf9320
movq 0x290(%rsp), %rdi
callq 0x2260
nopl (%rax)