// File: /workspace/github_c_makefile_star2_O1/mvermeulen[P]wspy/topdown.c
// Function: print_topdown
void print_topdown(struct counter_group *cgroup,enum output_format oformat,int mask){
  unsigned long slots=0;
  unsigned long slots_no_contention = 0;
  unsigned long retiring=0;
  unsigned long frontend=0;
  unsigned long frontend_latency=0;
  unsigned long frontend_bandwidth=0;
  unsigned long backend=0;
  unsigned long retire_not_complete=0;
  unsigned long retire_load_not_complete=0;
  unsigned long backend_cpu=0;
  unsigned long backend_memory=0;
  unsigned long speculation=0;
  unsigned long speculation_branches=0;
  unsigned long speculation_pipeline=0;
  unsigned long branches_mispredicted=0;
  unsigned long resyncs_or_nc_redirects=0;
  unsigned long contention=0;
  unsigned long retire_ucode=0;
  unsigned long retire_fastpath=0;
  int too_short = 0;
  struct counter_info *cinfo;

  if (oformat == PRINT_CSV_HEADER){
    fprintf(outfile,"retire,frontend,backend,speculate,");
  }

  switch(cpu_info->vendor){
  case VENDOR_INTEL:
    if (cinfo = find_ci_label(cgroup,"slots")) slots = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"core.topdown-retiring")) retiring = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"core.topdown-fe-bound")) frontend = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"core.topdown-be-bound")) backend = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"core.topdown-bad-spec")) speculation = cinfo->value;

    // backend level 2
    if (cinfo = find_ci_label(cgroup,"core.topdown-mem-bound")){
      backend_memory = cinfo->value;
      backend_cpu = backend - backend_memory;
    }

    // speculation level 2
    if (cinfo = find_ci_label(cgroup,"core.topdown-br-mispredict")){
      speculation_branches = cinfo->value;
      speculation_pipeline = speculation - speculation_branches;
    }

    // frontend level 2
    if (cinfo = find_ci_label(cgroup,"core.topdown-fetch-lat")){
      frontend_latency = cinfo->value;
      frontend_bandwidth = frontend - frontend_latency;
    }

    // retire level 2
    if (cinfo = find_ci_label(cgroup,"core.topdown-heavy-ops")){
      retire_ucode = cinfo->value;
      retire_fastpath = retiring - retire_ucode;
    }
    
    slots_no_contention = slots;
    break;
  case VENDOR_AMD:
    if (cinfo = find_ci_label(cgroup,"cpu-cycles")){
      if (cpu_info->coreinfo[0].vendor == CORE_AMD_ZEN){
	slots = cinfo->value * 6;
      } else if (cpu_info->coreinfo[0].vendor == CORE_AMD_ZEN5){
	slots = cinfo->value * 8;	
      }
    }
    if (cinfo = find_ci_label(cgroup,"ex_ret_ops")) retiring = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"de_no_dispatch_per_slot.no_ops_from_frontend")) frontend = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"de_no_dispatch_per_slot.backend_stalls")) backend = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"de_no_dispatch_per_slot.smt_contention")) contention = cinfo->value;    
    if (cinfo = find_ci_label(cgroup,"de_src_op_disp.all")){
      if (cinfo->time_running == 0) too_short = 1;
      speculation = cinfo->value - retiring;
    }
    // backend level 2
    if (cinfo = find_ci_label(cgroup,"ex_no_retire.load_not_complete"))
      retire_load_not_complete = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"ex_no_retire.not_complete"))
      retire_not_complete = cinfo->value;
    if (retire_load_not_complete && retire_not_complete){
      backend_memory = backend * (double) retire_load_not_complete / retire_not_complete;
      backend_cpu = backend - backend_memory;
    }

    // speculation level 2
    if (cinfo = find_ci_label(cgroup,"ex_ret_brn_misp"))
      branches_mispredicted = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"resyncs_or_nc_redirects"))
      resyncs_or_nc_redirects = cinfo->value;
    if (branches_mispredicted && resyncs_or_nc_redirects){
      speculation_pipeline = speculation * (double) resyncs_or_nc_redirects / (resyncs_or_nc_redirects + branches_mispredicted);
      speculation_branches = speculation - speculation_pipeline;
    }

    // frontend level 2
    if (cinfo = find_ci_label(cgroup,"de_no_dispatch_per_slot.no_ops_from_frontend.cmask_0x6")){
      frontend_latency = cinfo->value*6;
      frontend_bandwidth = frontend - frontend_latency;
    }

    // retire level 2
    if (cinfo = find_ci_label(cgroup,"ex_ret_ucode_ops")){
      retire_ucode = retiring * (double) cinfo->value / retiring;
      retire_fastpath = retiring - retire_ucode;
    }
    
    slots_no_contention = slots - contention;
    break;
  default:
    return;
  }

  if (slots){
    switch(oformat){
    case PRINT_CSV:
      fprintf(outfile,"%4.1f,",(double) retiring/slots_no_contention*100);
      fprintf(outfile,"%4.1f,",(double) frontend/slots_no_contention*100);
      fprintf(outfile,"%4.1f,",(double) backend/slots_no_contention*100);
      fprintf(outfile,"%4.1f,",(double) speculation/slots_no_contention*100);
      
      break;
    case PRINT_NORMAL:
      if (too_short){
	warning("unable to read performance counter, is runtime too short?\n");
      } else {
	fprintf(outfile,"slots                %-14lu #\n",slots);
	fprintf(outfile,"retiring             %-14lu # %4.1f%% (%4.1lf%%)",
		retiring,(double) retiring/slots*100, (double) retiring/slots_no_contention*100);
	if (((double) retiring/slots_no_contention) > 0.54){
	  fprintf(outfile," high");
	} else if (((double) retiring/slots_no_contention) < 0.14){
	  fprintf(outfile," low");
	}
	fprintf(outfile,"\n");
	if (retire_ucode && frontend_bandwidth){
	  fprintf(outfile,"-- ucode             %-14lu #    %4.1f%%\n",
		  retire_ucode,(double) retire_ucode/slots*100);
	  fprintf(outfile,"-- fastpath          %-14lu #    %4.1f%%\n",
		  retire_fastpath,(double) retire_fastpath/slots*100);
	}		
	fprintf(outfile,"frontend             %-14lu # %4.1f%% (%4.1lf%%)",
		frontend,(double) frontend/slots*100, (double) frontend/slots_no_contention*100);
	if (((double) frontend/slots_no_contention) > 0.45){
	  fprintf(outfile," high");
	} else if (((double) frontend/slots_no_contention) < 0.05){
	  fprintf(outfile," low");
	}
	fprintf(outfile,"\n");
	if (frontend_latency && frontend_bandwidth){
	  fprintf(outfile,"-- latency           %-14lu #    %4.1f%%\n",
		  frontend_latency,(double) frontend_latency/slots*100);
	  fprintf(outfile,"-- bandwidth         %-14lu #    %4.1f%%\n",
		  frontend_bandwidth,(double) frontend_bandwidth/slots*100);
	}	
	fprintf(outfile,"backend              %-14lu # %4.1f%% (%4.1lf%%)",
		backend,(double) backend/slots*100, (double) backend/slots_no_contention*100);
	if (((double) backend/slots_no_contention) > 0.70){
	  fprintf(outfile," high");
	} else if (((double) backend/slots_no_contention) < 0.18){
	  fprintf(outfile," low");
	}
	fprintf(outfile,"\n");
	if (backend_memory && backend_cpu){
	  fprintf(outfile,"-- cpu               %-14lu #    %4.1f%%\n",
		  backend_cpu,(double) backend_cpu/slots*100);
	  fprintf(outfile,"-- memory            %-14lu #    %4.1f%%\n",
		  backend_memory,(double) backend_memory/slots*100);
	}
	fprintf(outfile,"speculation          %-14lu # %4.1f%% (%4.1lf%%)",
		speculation,(double) speculation/slots*100, (double) speculation/slots_no_contention*100);
	if (((double) speculation/slots_no_contention) > 0.10){
	  fprintf(outfile," high");
	} else if (((double) speculation/slots_no_contention) < 0.01){
	  fprintf(outfile," low");
	}
	fprintf(outfile,"\n");
	if (speculation_pipeline && speculation_branches){
	  fprintf(outfile,"-- branch mispredict %-14lu #    %4.1lf%%\n",
		  speculation_branches,(double) speculation_branches/slots*100);
	  fprintf(outfile,"-- pipeline restart  %-14lu #    %4.1f%%\n",
		  speculation_pipeline,(double) speculation_pipeline/slots*100);
	}
	fprintf(outfile,"smt-contention       %-14lu # %4.1f%% ( 0.0%%)\n",contention,(double) contention/slots*100);
      }
      break;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %esi, %r14d
movq %rdi, %r15
cmpl $0x2, %esi
jne 0x5cdb
leaq 0xc436(%rip), %rax      # 0x120f8
movq (%rax), %rcx
leaq 0x7157(%rip), %rdi      # 0xce23
movl $0x22, %esi
movl $0x1, %edx
callq 0x32c0
leaq 0xd47e(%rip), %rax      # 0x13160
movq (%rax), %rbx
movl (%rbx), %eax
cmpl $0x1, %eax
je 0x5d0f
cmpl $0x2, %eax
jne 0x6397
leaq 0x5c85(%rip), %rsi      # 0xb981
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5d4e
movq 0x30(%rax), %rbx
jmp 0x5d50
leaq 0x5c55(%rip), %rsi      # 0xb96b
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5d47
movq 0x18(%rbx), %rcx
movl (%rcx), %ecx
cmpl $0x3, %ecx
je 0x5ebb
cmpl $0x2, %ecx
jne 0x5d47
movq 0x30(%rax), %rax
addq %rax, %rax
leaq (%rax,%rax,2), %rbx
jmp 0x5ec3
xorl %ebx, %ebx
jmp 0x5ec3
xorl %ebx, %ebx
leaq 0x5c45(%rip), %rsi      # 0xb99c
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5d6e
movq 0x30(%rax), %rax
movq %rax, (%rsp)
jmp 0x5d76
movq $0x0, (%rsp)
leaq 0x5c77(%rip), %rsi      # 0xb9f4
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5d90
movq 0x30(%rax), %r13
jmp 0x5d93
xorl %r13d, %r13d
leaq 0x5c86(%rip), %rsi      # 0xba20
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5dad
movq 0x30(%rax), %rbp
jmp 0x5daf
xorl %ebp, %ebp
leaq 0x5c12(%rip), %rsi      # 0xb9c8
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5dc9
movq 0x30(%rax), %r12
jmp 0x5dcc
xorl %r12d, %r12d
leaq 0x5d04(%rip), %rsi      # 0xbad7
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5df6
movq 0x30(%rax), %rcx
movq %rbp, %rdx
movq %rcx, 0x30(%rsp)
subq %rcx, %rdx
movq %rdx, 0x50(%rsp)
jmp 0x5e08
movq $0x0, 0x50(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x5c6a(%rip), %rsi      # 0xba79
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5e32
movq 0x30(%rax), %rdx
movq %r12, %rax
movq %rdx, 0x48(%rsp)
subq %rdx, %rax
movq %rax, 0x28(%rsp)
jmp 0x5e44
movq $0x0, 0x48(%rsp)
movq $0x0, 0x28(%rsp)
movq %r12, 0x60(%rsp)
leaq 0x5c5a(%rip), %rsi      # 0xbaaa
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
movq %r13, 0x68(%rsp)
je 0x5e70
movq 0x30(%rax), %rcx
movq %rcx, 0x40(%rsp)
subq %rcx, %r13
jmp 0x5e7c
movq $0x0, 0x40(%rsp)
xorl %r13d, %r13d
movq %rbp, 0x58(%rsp)
leaq 0x5bc4(%rip), %rsi      # 0xba4c
movq %r15, %rdi
callq 0x587d
movb $0x1, %cl
testq %rax, %rax
je 0x5eac
movq 0x30(%rax), %rbp
movq (%rsp), %r15
subq %rbp, %r15
xorl %eax, %eax
movq %rbx, %r12
jmp 0x624c
xorl %eax, %eax
movq %rbx, %r12
xorl %ebp, %ebp
xorl %r15d, %r15d
jmp 0x624c
movq 0x30(%rax), %rbx
shlq $0x3, %rbx
leaq 0x5ef0(%rip), %rsi      # 0xbdba
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5ee1
movq 0x30(%rax), %rax
movq %rax, (%rsp)
jmp 0x5ee9
movq $0x0, (%rsp)
leaq 0x5ee0(%rip), %rsi      # 0xbdd0
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5f03
movq 0x30(%rax), %r12
jmp 0x5f06
xorl %r12d, %r12d
leaq 0x5f06(%rip), %rsi      # 0xbe13
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5f20
movq 0x30(%rax), %rbp
jmp 0x5f22
xorl %ebp, %ebp
leaq 0x5f50(%rip), %rsi      # 0xbe79
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5f41
movq 0x30(%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x5f4a
movq $0x0, 0x38(%rsp)
movq %r12, 0x68(%rsp)
leaq 0x5efb(%rip), %rsi      # 0xbe51
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5f77
cmpq $0x0, 0x48(%rax)
setne 0x10(%rsp)
movq 0x30(%rax), %r13
subq (%rsp), %r13
jmp 0x5f7f
movb $0x1, 0x10(%rsp)
xorl %r13d, %r13d
leaq 0x5f31(%rip), %rsi      # 0xbeb7
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5f99
movq 0x30(%rax), %r12
jmp 0x5f9c
xorl %r12d, %r12d
leaq 0x5f49(%rip), %rsi      # 0xbeec
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x5fb6
movq 0x30(%rax), %rax
jmp 0x5fb8
xorl %eax, %eax
testq %r12, %r12
setne %cl
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x6063
movq %rbp, %xmm0
movq 0x5964(%rip), %xmm1     # 0xb940
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x5968(%rip), %xmm2     # 0xb950
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq %r12, %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm4
unpckhpd %xmm0, %xmm4            # xmm4 = xmm4[1],xmm0[1]
addsd %xmm0, %xmm4
mulsd %xmm3, %xmm4
movq %rax, %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm4
cvttsd2si %xmm4, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x588a(%rip), %xmm4     # 0xb8d0
cvttsd2si %xmm4, %rdx
andq %rcx, %rdx
orq %rax, %rdx
movq %rbp, %rcx
movq %rdx, 0x30(%rsp)
subq %rdx, %rcx
movq %rcx, 0x50(%rsp)
jmp 0x6075
movq $0x0, 0x50(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x5e9f(%rip), %rsi      # 0xbf1b
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x608f
movq 0x30(%rax), %r12
jmp 0x6092
xorl %r12d, %r12d
leaq 0x5e9d(%rip), %rsi      # 0xbf36
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x60ac
movq 0x30(%rax), %rax
jmp 0x60ae
xorl %eax, %eax
testq %r12, %r12
setne %cl
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x615c
movq %r13, %xmm0
movq 0x586e(%rip), %xmm1     # 0xb940
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x5872(%rip), %xmm2     # 0xb950
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq %rax, %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm4
unpckhpd %xmm0, %xmm4            # xmm4 = xmm4[1],xmm0[1]
addsd %xmm0, %xmm4
mulsd %xmm3, %xmm4
addq %rax, %r12
movq %r12, %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm4
cvttsd2si %xmm4, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x5791(%rip), %xmm4     # 0xb8d0
cvttsd2si %xmm4, %rdx
andq %rcx, %rdx
orq %rax, %rdx
movq %r13, %rcx
movq %rdx, 0x28(%rsp)
subq %rdx, %rcx
movq %rcx, 0x48(%rsp)
jmp 0x616e
movq $0x0, 0x48(%rsp)
movq $0x0, 0x28(%rsp)
movq %r13, 0x60(%rsp)
leaq 0x5ddf(%rip), %rsi      # 0xbf59
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x61a1
movq 0x30(%rax), %rax
addq %rax, %rax
leaq (%rax,%rax,2), %rcx
movq 0x68(%rsp), %r13
movq %rcx, 0x40(%rsp)
subq %rcx, %r13
jmp 0x61ad
movq $0x0, 0x40(%rsp)
xorl %r13d, %r13d
movq %rbp, 0x58(%rsp)
leaq 0x5df7(%rip), %rsi      # 0xbfb0
movq %r15, %rdi
callq 0x587d
testq %rax, %rax
je 0x6238
movq (%rsp), %r15
movq %r15, %xmm0
movq 0x5769(%rip), %xmm1     # 0xb940
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x576d(%rip), %xmm2     # 0xb950
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq 0x30(%rax), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd %xmm3, %xmm1
divsd %xmm3, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x56a8(%rip), %xmm1     # 0xb8d0
cvttsd2si %xmm1, %rbp
andq %rcx, %rbp
orq %rax, %rbp
subq %rbp, %r15
jmp 0x623d
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x38(%rsp), %rax
movb 0x10(%rsp), %cl
movq %rbx, %r12
subq %rax, %r12
testq %rbx, %rbx
je 0x6397
testl %r14d, %r14d
je 0x63a9
cmpl $0x1, %r14d
jne 0x6397
leaq 0xbe89(%rip), %r14      # 0x120f8
movq (%r14), %rdi
movsd (%rsp), %xmm1
movsd 0x56c1(%rip), %xmm2     # 0xb940
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x56c6(%rip), %xmm3     # 0xb950
subpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r12, %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
movapd %xmm2, (%rsp)
divsd %xmm2, %xmm0
mulsd 0x5604(%rip), %xmm0     # 0xb8c8
leaq 0x6e64(%rip), %rbx      # 0xd12f
movq %rbx, %rsi
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movsd 0x68(%rsp), %xmm1
unpcklps 0x565b(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x5663(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x55c2(%rip), %xmm0     # 0xb8c8
movq %rbx, %rsi
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movsd 0x58(%rsp), %xmm1
unpcklps 0x5620(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x5628(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x5587(%rip), %xmm0     # 0xb8c8
movq %rbx, %rsi
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movsd 0x60(%rsp), %xmm1
unpcklps 0x55e5(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x55ed(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x554c(%rip), %xmm0     # 0xb8c8
movq %rbx, %rsi
movb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31c0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb %cl, %cl
je 0x649e
movq %rax, 0x38(%rsp)
leaq 0xbd3b(%rip), %r14      # 0x120f8
movq (%r14), %rdi
leaq 0x6aba(%rip), %rsi      # 0xce81
movq %rbx, %rdx
xorl %eax, %eax
callq 0x31c0
movq (%r14), %rdi
movq (%rsp), %rdx
movq %rdx, %xmm0
movq 0x555b(%rip), %xmm2     # 0xb940
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x555f(%rip), %xmm3     # 0xb950
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, %xmm5
movq %rbx, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm5, %xmm0
movapd %xmm1, 0x10(%rsp)
divsd %xmm1, %xmm0
movsd 0x5494(%rip), %xmm4     # 0xb8c8
mulsd %xmm4, %xmm0
movq %r12, %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
movapd %xmm2, 0x70(%rsp)
divsd %xmm2, %xmm5
movapd %xmm5, 0x80(%rsp)
movapd %xmm5, %xmm1
mulsd %xmm4, %xmm1
leaq 0x6a2d(%rip), %rsi      # 0xcea0
movb $0x2, %al
callq 0x31c0
movapd 0x80(%rsp), %xmm1
ucomisd 0x5465(%rip), %xmm1     # 0xb8f0
jbe 0x64bd
movq (%r14), %rcx
leaq 0x697a(%rip), %rdi      # 0xce11
movl $0x5, %esi
jmp 0x64da
leaq 0x69a1(%rip), %rdi      # 0xce46
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x935d
movsd 0x5433(%rip), %xmm0     # 0xb8f8
ucomisd %xmm1, %xmm0
jbe 0x64e4
movq (%r14), %rcx
leaq 0x6942(%rip), %rdi      # 0xce17
movl $0x4, %esi
movl $0x1, %edx
callq 0x32c0
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3150
testq %rbp, %rbp
je 0x6595
testq %r13, %r13
je 0x6595
movq (%r14), %rdi
movq %rbp, %xmm1
movq 0x542d(%rip), %xmm0     # 0xb940
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x5431(%rip), %xmm0     # 0xb950
subpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x538b(%rip), %xmm1     # 0xb8c8
mulsd %xmm1, %xmm0
leaq 0x6989(%rip), %rsi      # 0xced1
movq %rbp, %rdx
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movq %r15, %xmm1
punpckldq 0x53de(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x53e6(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
mulsd 0x5344(%rip), %xmm0     # 0xb8c8
leaq 0x6970(%rip), %rsi      # 0xcefb
movq %r15, %rdx
movb $0x1, %al
callq 0x31c0
movq 0x68(%rsp), %rdx
movq %rdx, %xmm0
punpckldq 0x5399(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movq (%r14), %rdi
subpd 0x539e(%rip), %xmm0     # 0xb950
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movapd %xmm3, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x52f8(%rip), %xmm2     # 0xb8c8
mulsd %xmm2, %xmm0
divsd 0x70(%rsp), %xmm3
movapd %xmm3, (%rsp)
movapd %xmm3, %xmm1
mulsd %xmm2, %xmm1
leaq 0x6937(%rip), %rsi      # 0xcf25
movb $0x2, %al
callq 0x31c0
movapd (%rsp), %xmm1
ucomisd 0x52fe(%rip), %xmm1     # 0xb900
jbe 0x6629
movq (%r14), %rcx
leaq 0x6803(%rip), %rdi      # 0xce11
movl $0x5, %esi
movl $0x1, %edx
callq 0x32c0
movq 0x58(%rsp), %rbx
movq 0x30(%rsp), %r15
jmp 0x665a
movsd 0x52d7(%rip), %xmm0     # 0xb908
ucomisd %xmm1, %xmm0
movq 0x58(%rsp), %rbx
movq 0x30(%rsp), %r15
jbe 0x665a
movq (%r14), %rcx
leaq 0x67cc(%rip), %rdi      # 0xce17
movl $0x4, %esi
movl $0x1, %edx
callq 0x32c0
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3150
movq 0x40(%rsp), %rdx
testq %rdx, %rdx
je 0x670d
testq %r13, %r13
je 0x670d
movq (%r14), %rdi
movq %rdx, %xmm1
movq 0x52b2(%rip), %xmm0     # 0xb940
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x52b6(%rip), %xmm0     # 0xb950
subpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x5210(%rip), %xmm1     # 0xb8c8
mulsd %xmm1, %xmm0
leaq 0x6893(%rip), %rsi      # 0xcf56
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movq %r13, %xmm1
punpckldq 0x5266(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x526e(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
mulsd 0x51cc(%rip), %xmm0     # 0xb8c8
leaq 0x687d(%rip), %rsi      # 0xcf80
movq %r13, %rdx
movb $0x1, %al
callq 0x31c0
movq %rbx, %xmm0
punpckldq 0x5226(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movq (%r14), %rdi
subpd 0x522b(%rip), %xmm0     # 0xb950
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movapd %xmm3, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x5185(%rip), %xmm2     # 0xb8c8
mulsd %xmm2, %xmm0
divsd 0x70(%rsp), %xmm3
movapd %xmm3, (%rsp)
movapd %xmm3, %xmm1
mulsd %xmm2, %xmm1
leaq 0x6849(%rip), %rsi      # 0xcfaa
movq %rbx, %rdx
movb $0x2, %al
callq 0x31c0
movapd (%rsp), %xmm1
ucomisd 0x5170(%rip), %xmm1     # 0xb8e8
jbe 0x679a
movq (%r14), %rcx
leaq 0x668d(%rip), %rdi      # 0xce11
movl $0x5, %esi
movl $0x1, %edx
callq 0x32c0
movq 0x60(%rsp), %rbx
jmp 0x67c6
movsd 0x516e(%rip), %xmm0     # 0xb910
ucomisd %xmm1, %xmm0
movq 0x60(%rsp), %rbx
jbe 0x67c6
movq (%r14), %rcx
leaq 0x6660(%rip), %rdi      # 0xce17
movl $0x4, %esi
movl $0x1, %edx
callq 0x32c0
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3150
testq %r15, %r15
movq 0x50(%rsp), %rdx
je 0x6879
testq %rdx, %rdx
je 0x6879
movq (%r14), %rdi
movq %rdx, %xmm1
movq 0x5146(%rip), %xmm0     # 0xb940
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x514a(%rip), %xmm0     # 0xb950
subpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x50a4(%rip), %xmm1     # 0xb8c8
mulsd %xmm1, %xmm0
leaq 0x67ac(%rip), %rsi      # 0xcfdb
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movq %r15, %xmm1
punpckldq 0x50fa(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x5102(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
mulsd 0x5060(%rip), %xmm0     # 0xb8c8
leaq 0x6796(%rip), %rsi      # 0xd005
movq %r15, %rdx
movb $0x1, %al
callq 0x31c0
movq %rbx, %xmm0
punpckldq 0x50ba(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movq (%r14), %rdi
subpd 0x50bf(%rip), %xmm0     # 0xb950
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movapd %xmm3, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x5019(%rip), %xmm2     # 0xb8c8
mulsd %xmm2, %xmm0
divsd 0x70(%rsp), %xmm3
movapd %xmm3, (%rsp)
movapd %xmm3, %xmm1
mulsd %xmm2, %xmm1
leaq 0x6762(%rip), %rsi      # 0xd02f
movq %rbx, %rdx
movb $0x2, %al
callq 0x31c0
movapd (%rsp), %xmm1
ucomisd 0x5034(%rip), %xmm1     # 0xb918
jbe 0x6906
movq (%r14), %rcx
leaq 0x6521(%rip), %rdi      # 0xce11
movl $0x5, %esi
movl $0x1, %edx
callq 0x32c0
movq 0x28(%rsp), %rbx
jmp 0x6932
movsd 0x5012(%rip), %xmm0     # 0xb920
ucomisd %xmm1, %xmm0
movq 0x28(%rsp), %rbx
jbe 0x6932
movq (%r14), %rcx
leaq 0x64f4(%rip), %rdi      # 0xce17
movl $0x4, %esi
movl $0x1, %edx
callq 0x32c0
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3150
testq %rbx, %rbx
movq 0x48(%rsp), %rdx
je 0x69e5
testq %rdx, %rdx
je 0x69e5
movq (%r14), %rdi
movq %rdx, %xmm1
movq 0x4fda(%rip), %xmm0     # 0xb940
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x4fde(%rip), %xmm0     # 0xb950
subpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x4f38(%rip), %xmm1     # 0xb8c8
mulsd %xmm1, %xmm0
leaq 0x66c5(%rip), %rsi      # 0xd060
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movq %rbx, %xmm1
punpckldq 0x4f8e(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x4f96(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
mulsd 0x4ef4(%rip), %xmm0     # 0xb8c8
leaq 0x66b0(%rip), %rsi      # 0xd08b
movq %rbx, %rdx
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movq 0x38(%rsp), %rdx
movq %rdx, %xmm1
punpckldq 0x4f46(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x4f4e(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
mulsd 0x4eac(%rip), %xmm0     # 0xb8c8
leaq 0x6692(%rip), %rsi      # 0xd0b5
movb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31c0