// File: /workspace/github_c_makefile_star2_O2/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 0x5be4
leaq 0xb539(%rip), %rax      # 0x11108
movq (%rax), %rcx
leaq 0x624a(%rip), %rdi      # 0xbe23
pushq $0x22
popq %rsi
pushq $0x1
popq %rdx
callq 0x32d0
leaq 0xc585(%rip), %rax      # 0x12170
movq (%rax), %rbx
movl (%rbx), %eax
cmpl $0x1, %eax
je 0x5c18
cmpl $0x2, %eax
jne 0x6284
leaq 0x4d7c(%rip), %rsi      # 0xa981
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5c51
movq 0x30(%rax), %rbp
jmp 0x5c53
leaq 0x4d4c(%rip), %rsi      # 0xa96b
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5c4a
movq 0x18(%rbx), %rcx
movl (%rcx), %ecx
cmpl $0x3, %ecx
je 0x5dbe
cmpl $0x2, %ecx
jne 0x5c4a
imulq $0x6, 0x30(%rax), %rbp
jmp 0x5dc6
xorl %ebp, %ebp
jmp 0x5dc6
xorl %ebp, %ebp
leaq 0x4d42(%rip), %rsi      # 0xa99c
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5c71
movq 0x30(%rax), %rax
movq %rax, (%rsp)
jmp 0x5c79
movq $0x0, (%rsp)
leaq 0x4d74(%rip), %rsi      # 0xa9f4
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5c93
movq 0x30(%rax), %r13
jmp 0x5c96
xorl %r13d, %r13d
leaq 0x4d83(%rip), %rsi      # 0xaa20
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5cb0
movq 0x30(%rax), %r12
jmp 0x5cb3
xorl %r12d, %r12d
leaq 0x4d0e(%rip), %rsi      # 0xa9c8
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5ccd
movq 0x30(%rax), %rbx
jmp 0x5ccf
xorl %ebx, %ebx
leaq 0x4e01(%rip), %rsi      # 0xaad7
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5cf9
movq 0x30(%rax), %rcx
movq %r12, %rdx
movq %rcx, 0x50(%rsp)
subq %rcx, %rdx
movq %rdx, 0x30(%rsp)
jmp 0x5d0b
movq $0x0, 0x30(%rsp)
movq $0x0, 0x50(%rsp)
leaq 0x4d67(%rip), %rsi      # 0xaa79
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5d35
movq 0x30(%rax), %rdx
movq %rbx, %rax
movq %rdx, 0x28(%rsp)
subq %rdx, %rax
movq %rax, 0x48(%rsp)
jmp 0x5d47
movq $0x0, 0x28(%rsp)
movq $0x0, 0x48(%rsp)
movq %r12, 0x68(%rsp)
leaq 0x4d57(%rip), %rsi      # 0xaaaa
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
movq %r13, 0x60(%rsp)
je 0x5d73
movq 0x30(%rax), %rcx
movq %rcx, 0x40(%rsp)
subq %rcx, %r13
jmp 0x5d7f
movq $0x0, 0x40(%rsp)
xorl %r13d, %r13d
movq %rbx, 0x58(%rsp)
leaq 0x4cc1(%rip), %rsi      # 0xaa4c
movq %r15, %rdi
callq 0x576f
movb $0x1, %cl
testq %rax, %rax
je 0x5daf
movq 0x30(%rax), %rbx
movq (%rsp), %r15
subq %rbx, %r15
xorl %eax, %eax
movq %rbp, %r12
jmp 0x6139
xorl %eax, %eax
movq %rbp, %r12
xorl %ebx, %ebx
xorl %r15d, %r15d
jmp 0x6139
movq 0x30(%rax), %rbp
shlq $0x3, %rbp
leaq 0x4fed(%rip), %rsi      # 0xadba
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5de4
movq 0x30(%rax), %rax
movq %rax, (%rsp)
jmp 0x5dec
movq $0x0, (%rsp)
leaq 0x4fdd(%rip), %rsi      # 0xadd0
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5e06
movq 0x30(%rax), %rax
jmp 0x5e08
xorl %eax, %eax
movq %rax, 0x60(%rsp)
leaq 0x4fff(%rip), %rsi      # 0xae13
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5e27
movq 0x30(%rax), %r13
jmp 0x5e2a
xorl %r13d, %r13d
leaq 0x5048(%rip), %rsi      # 0xae79
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5e49
movq 0x30(%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x5e52
movq $0x0, 0x38(%rsp)
leaq 0x4ff8(%rip), %rsi      # 0xae51
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5e7a
cmpq $0x0, 0x48(%rax)
setne 0x10(%rsp)
movq 0x30(%rax), %r12
subq (%rsp), %r12
jmp 0x5e82
movb $0x1, 0x10(%rsp)
xorl %r12d, %r12d
leaq 0x502e(%rip), %rsi      # 0xaeb7
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5e9c
movq 0x30(%rax), %rbx
jmp 0x5e9e
xorl %ebx, %ebx
leaq 0x5047(%rip), %rsi      # 0xaeec
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5f60
movq 0x30(%rax), %rax
testq %rbx, %rbx
setne %cl
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x5f60
movq %r13, %xmm0
movq 0x4a62(%rip), %xmm1     # 0xa940
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x4a66(%rip), %xmm2     # 0xa950
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq %rbx, %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 0x4988(%rip), %xmm4     # 0xa8d0
cvttsd2si %xmm4, %rdx
andq %rcx, %rdx
orq %rax, %rdx
movq %r13, %rax
subq %rdx, %rax
movq %rax, 0x30(%rsp)
jmp 0x5f6b
movq $0x0, 0x30(%rsp)
xorl %edx, %edx
movq %rdx, 0x50(%rsp)
leaq 0x4fa4(%rip), %rsi      # 0xaf1b
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x5f8a
movq 0x30(%rax), %rbx
jmp 0x5f8c
xorl %ebx, %ebx
leaq 0x4fa3(%rip), %rsi      # 0xaf36
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x6051
movq 0x30(%rax), %rax
testq %rbx, %rbx
setne %cl
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x6051
movq %r12, %xmm0
movq 0x4974(%rip), %xmm1     # 0xa940
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x4978(%rip), %xmm2     # 0xa950
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, %rbx
movq %rbx, %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 0x4897(%rip), %xmm4     # 0xa8d0
cvttsd2si %xmm4, %rbx
andq %rcx, %rbx
orq %rax, %rbx
movq %r12, %rax
subq %rbx, %rax
movq %rax, 0x28(%rsp)
jmp 0x605c
movq $0x0, 0x28(%rsp)
xorl %ebx, %ebx
movq %r13, 0x68(%rsp)
leaq 0x4ef1(%rip), %rsi      # 0xaf59
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
je 0x6089
imulq $0x6, 0x30(%rax), %rcx
movq 0x60(%rsp), %r13
movq %rcx, 0x40(%rsp)
subq %rcx, %r13
jmp 0x6095
movq $0x0, 0x40(%rsp)
xorl %r13d, %r13d
movq %rbx, 0x48(%rsp)
leaq 0x4f0f(%rip), %rsi      # 0xafb0
movq %r15, %rdi
callq 0x576f
testq %rax, %rax
movq %r12, 0x58(%rsp)
je 0x6125
movq (%rsp), %r15
movq %r15, %xmm0
movq 0x487c(%rip), %xmm1     # 0xa940
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x4880(%rip), %xmm2     # 0xa950
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 0x47bb(%rip), %xmm1     # 0xa8d0
cvttsd2si %xmm1, %rbx
andq %rcx, %rbx
orq %rax, %rbx
subq %rbx, %r15
jmp 0x612a
xorl %ebx, %ebx
xorl %r15d, %r15d
movq 0x38(%rsp), %rax
movb 0x10(%rsp), %cl
movq %rbp, %r12
subq %rax, %r12
testq %rbp, %rbp
je 0x6284
testl %r14d, %r14d
je 0x6296
cmpl $0x1, %r14d
jne 0x6284
leaq 0xafac(%rip), %r14      # 0x11108
movq (%r14), %rdi
movsd (%rsp), %xmm1
movsd 0x47d4(%rip), %xmm2     # 0xa940
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x47d9(%rip), %xmm3     # 0xa950
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 0x4717(%rip), %xmm0     # 0xa8c8
leaq 0x5f77(%rip), %rbx      # 0xc12f
movq %rbx, %rsi
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movsd 0x60(%rsp), %xmm1
unpcklps 0x476e(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x4776(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x46d5(%rip), %xmm0     # 0xa8c8
movq %rbx, %rsi
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movsd 0x68(%rsp), %xmm1
unpcklps 0x4733(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x473b(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x469a(%rip), %xmm0     # 0xa8c8
movq %rbx, %rsi
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movsd 0x58(%rsp), %xmm1
unpcklps 0x46f8(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x4700(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x465f(%rip), %xmm0     # 0xa8c8
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 0x6396
movq %rax, 0x38(%rsp)
leaq 0xae5e(%rip), %r14      # 0x11108
movq (%r14), %rdi
leaq 0x5bcd(%rip), %rsi      # 0xbe81
movq %rbp, %rdx
xorl %eax, %eax
callq 0x31c0
movq (%r14), %rdi
movq (%rsp), %rdx
movq %rdx, %xmm0
movq 0x466e(%rip), %xmm2     # 0xa940
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x4672(%rip), %xmm3     # 0xa950
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, %xmm5
movq %rbp, %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 0x45a7(%rip), %xmm4     # 0xa8c8
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 0x5b40(%rip), %rsi      # 0xbea0
movb $0x2, %al
callq 0x31c0
movapd 0x80(%rsp), %xmm1
ucomisd 0x4578(%rip), %xmm1     # 0xa8f0
jbe 0x63b5
movq (%r14), %rcx
leaq 0x5a8d(%rip), %rdi      # 0xbe11
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x32d0
movq 0x58(%rsp), %r12
jmp 0x63dd
leaq 0x5aa9(%rip), %rdi      # 0xbe46
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9121
movsd 0x453b(%rip), %xmm0     # 0xa8f8
ucomisd %xmm1, %xmm0
movq 0x58(%rsp), %r12
jbe 0x63dd
movq (%r14), %rcx
leaq 0x5a45(%rip), %rdi      # 0xbe17
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
callq 0x32d0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x3150
testq %rbx, %rbx
je 0x648c
testq %r13, %r13
je 0x648c
movq (%r14), %rdi
movq %rbx, %xmm1
movq 0x4536(%rip), %xmm0     # 0xa940
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x453a(%rip), %xmm0     # 0xa950
subpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x4494(%rip), %xmm1     # 0xa8c8
mulsd %xmm1, %xmm0
leaq 0x5a92(%rip), %rsi      # 0xbed1
movq %rbx, %rdx
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movq %r15, %xmm1
punpckldq 0x44e7(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x44ef(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
mulsd 0x444d(%rip), %xmm0     # 0xa8c8
leaq 0x5a79(%rip), %rsi      # 0xbefb
movq %r15, %rdx
movb $0x1, %al
callq 0x31c0
movq 0x60(%rsp), %rdx
movq %rdx, %xmm0
punpckldq 0x44a2(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movq (%r14), %rdi
subpd 0x44a7(%rip), %xmm0     # 0xa950
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movapd %xmm3, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x4401(%rip), %xmm2     # 0xa8c8
mulsd %xmm2, %xmm0
divsd 0x70(%rsp), %xmm3
movapd %xmm3, (%rsp)
movapd %xmm3, %xmm1
mulsd %xmm2, %xmm1
leaq 0x5a40(%rip), %rsi      # 0xbf25
movb $0x2, %al
callq 0x31c0
movapd (%rsp), %xmm1
ucomisd 0x4407(%rip), %xmm1     # 0xa900
jbe 0x6517
movq (%r14), %rcx
leaq 0x590c(%rip), %rdi      # 0xbe11
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x32d0
movq 0x50(%rsp), %rbx
jmp 0x653f
movsd 0x43e9(%rip), %xmm0     # 0xa908
ucomisd %xmm1, %xmm0
movq 0x50(%rsp), %rbx
jbe 0x653f
movq (%r14), %rcx
leaq 0x58e3(%rip), %rdi      # 0xbe17
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
callq 0x32d0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x3150
movq 0x40(%rsp), %rdx
testq %rdx, %rdx
je 0x65f0
testq %r13, %r13
je 0x65f0
movq (%r14), %rdi
movq %rdx, %xmm1
movq 0x43cf(%rip), %xmm0     # 0xa940
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x43d3(%rip), %xmm0     # 0xa950
subpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x432d(%rip), %xmm1     # 0xa8c8
mulsd %xmm1, %xmm0
leaq 0x59b0(%rip), %rsi      # 0xbf56
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movq %r13, %xmm1
punpckldq 0x4383(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x438b(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
mulsd 0x42e9(%rip), %xmm0     # 0xa8c8
leaq 0x599a(%rip), %rsi      # 0xbf80
movq %r13, %rdx
movb $0x1, %al
callq 0x31c0
movq 0x68(%rsp), %rdx
movq %rdx, %xmm0
punpckldq 0x433e(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movq (%r14), %rdi
subpd 0x4343(%rip), %xmm0     # 0xa950
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movapd %xmm3, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x429d(%rip), %xmm2     # 0xa8c8
mulsd %xmm2, %xmm0
divsd 0x70(%rsp), %xmm3
movapd %xmm3, (%rsp)
movapd %xmm3, %xmm1
mulsd %xmm2, %xmm1
leaq 0x5961(%rip), %rsi      # 0xbfaa
movb $0x2, %al
callq 0x31c0
movapd (%rsp), %xmm1
ucomisd 0x428b(%rip), %xmm1     # 0xa8e8
jbe 0x666d
movq (%r14), %rcx
leaq 0x57a8(%rip), %rdi      # 0xbe11
pushq $0x5
jmp 0x6687
movsd 0x429b(%rip), %xmm0     # 0xa910
ucomisd %xmm1, %xmm0
jbe 0x6690
movq (%r14), %rcx
leaq 0x5792(%rip), %rdi      # 0xbe17
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
callq 0x32d0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x3150
testq %rbx, %rbx
movq 0x30(%rsp), %rdx
je 0x6741
testq %rdx, %rdx
je 0x6741
movq (%r14), %rdi
movq %rdx, %xmm1
movq 0x427e(%rip), %xmm0     # 0xa940
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x4282(%rip), %xmm0     # 0xa950
subpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x41dc(%rip), %xmm1     # 0xa8c8
mulsd %xmm1, %xmm0
leaq 0x58e4(%rip), %rsi      # 0xbfdb
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movq %rbx, %xmm1
punpckldq 0x4232(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x423a(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
mulsd 0x4198(%rip), %xmm0     # 0xa8c8
leaq 0x58ce(%rip), %rsi      # 0xc005
movq %rbx, %rdx
movb $0x1, %al
callq 0x31c0
movq %r12, %xmm0
punpckldq 0x41f2(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movq (%r14), %rdi
subpd 0x41f7(%rip), %xmm0     # 0xa950
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movapd %xmm3, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x4151(%rip), %xmm2     # 0xa8c8
mulsd %xmm2, %xmm0
divsd 0x70(%rsp), %xmm3
movapd %xmm3, (%rsp)
movapd %xmm3, %xmm1
mulsd %xmm2, %xmm1
leaq 0x589a(%rip), %rsi      # 0xc02f
movq %r12, %rdx
movb $0x2, %al
callq 0x31c0
movapd (%rsp), %xmm1
ucomisd 0x416c(%rip), %xmm1     # 0xa918
jbe 0x67ca
movq (%r14), %rcx
leaq 0x5659(%rip), %rdi      # 0xbe11
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x32d0
movq 0x48(%rsp), %rbx
jmp 0x67f2
movsd 0x414e(%rip), %xmm0     # 0xa920
ucomisd %xmm1, %xmm0
movq 0x48(%rsp), %rbx
jbe 0x67f2
movq (%r14), %rcx
leaq 0x5630(%rip), %rdi      # 0xbe17
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
callq 0x32d0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x3150
testq %rbx, %rbx
movq 0x28(%rsp), %rdx
je 0x68a3
testq %rdx, %rdx
je 0x68a3
movq (%r14), %rdi
movq %rdx, %xmm1
movq 0x411c(%rip), %xmm0     # 0xa940
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x4120(%rip), %xmm0     # 0xa950
subpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
movsd 0x407a(%rip), %xmm1     # 0xa8c8
mulsd %xmm1, %xmm0
leaq 0x5807(%rip), %rsi      # 0xc060
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movq %rbx, %xmm1
punpckldq 0x40d0(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x40d8(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
mulsd 0x4036(%rip), %xmm0     # 0xa8c8
leaq 0x57f2(%rip), %rsi      # 0xc08b
movq %rbx, %rdx
movb $0x1, %al
callq 0x31c0
movq (%r14), %rdi
movq 0x38(%rsp), %rdx
movq %rdx, %xmm1
punpckldq 0x4088(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x4090(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
mulsd 0x3fee(%rip), %xmm0     # 0xa8c8
leaq 0x57d4(%rip), %rsi      # 0xc0b5
movb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31c0