// File: /workspace/github_c_makefile_star2_O2/mvermeulen[P]wspy/topdown.c
// Function: print_float
void print_float(struct counter_group *cgroup,enum output_format oformat){
  struct counter_info *cinfo;
  unsigned long instructions = 0;
  unsigned long float_512 = 0;
  unsigned long float_256 = 0;
  unsigned long float_128 = 0;
  unsigned long float_mmx = 0;
  unsigned long float_scalar = 0;
  unsigned long float_all = 0;

  if (oformat == PRINT_CSV_HEADER){
    fprintf(outfile,"float,");
    return;
  }  

  switch(cpu_info->vendor){
  case VENDOR_INTEL:
    break;
  case VENDOR_AMD:
    if (cinfo = find_ci_label(cgroup,"instructions"))
      instructions = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"fp_ret_fops_AVX512"))
      float_512 = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"fp_ret_fops_AVX256"))
      float_256 = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"fp_ret_fops_AVX128"))
      float_128 = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"fp_ret_fops_MMX"))
      float_mmx = cinfo->value;
    if (cinfo = find_ci_label(cgroup,"fp_ret_fops_scalar"))
      float_scalar = cinfo->value;

    float_all = float_512 + float_256 + float_128 + float_mmx + float_scalar;

    if (csvflag){
      fprintf(outfile,"%4.2f%%,",(double) float_all / instructions * 100.0);
    } else {
      fprintf(outfile,"instructions         %-14lu # %4.3f float per 1000 inst\n",
	      instructions,(double) float_all / instructions*1000.0);
      fprintf(outfile,"float 512            %-14lu # %4.3f AVX-512 per 1000 inst\n",
	      float_512,(double) float_512 / instructions*1000.0);      
      fprintf(outfile,"float 256            %-14lu # %4.3f AVX-256 per 1000 inst\n",
	      float_256,(double) float_256 / instructions*1000.0);      
      fprintf(outfile,"float 128            %-14lu # %4.3f AVX-128 per 1000 inst\n",
	      float_128,(double) float_128 / instructions*1000.0);
      fprintf(outfile,"float MMX            %-14lu # %4.3f MMX per 1000 inst\n",
	      float_mmx,(double) float_mmx / instructions*1000.0);      
      fprintf(outfile,"float scalar         %-14lu # %4.3f scalar per 1000 inst\n",
	      float_scalar,(double) float_scalar / instructions*1000.0);      
    }
    break;    
  default:
    return;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x2, %esi
jne 0x83fc
leaq 0x8d2f(%rip), %rax      # 0x11108
movq (%rax), %rcx
leaq 0x44d7(%rip), %rdi      # 0xc8ba
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32d0
leaq 0x9d6d(%rip), %rax      # 0x12170
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x8425
movq %rdi, %rbx
leaq 0x2bbf(%rip), %rsi      # 0xafd4
callq 0x576f
testq %rax, %rax
je 0x8434
movq 0x30(%rax), %rbp
jmp 0x8436
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
leaq 0x2e35(%rip), %rsi      # 0xb272
movq %rbx, %rdi
callq 0x576f
testq %rax, %rax
je 0x8450
movq 0x30(%rax), %r13
jmp 0x8453
xorl %r13d, %r13d
leaq 0x2e40(%rip), %rsi      # 0xb29a
movq %rbx, %rdi
callq 0x576f
testq %rax, %rax
je 0x846d
movq 0x30(%rax), %r12
jmp 0x8470
xorl %r12d, %r12d
leaq 0x2e4b(%rip), %rsi      # 0xb2c2
movq %rbx, %rdi
callq 0x576f
testq %rax, %rax
je 0x848a
movq 0x30(%rax), %r15
jmp 0x848d
xorl %r15d, %r15d
leaq 0x2e55(%rip), %rsi      # 0xb2e9
movq %rbx, %rdi
callq 0x576f
testq %rax, %rax
je 0x84a7
movq 0x30(%rax), %r14
jmp 0x84aa
xorl %r14d, %r14d
leaq 0x2e5c(%rip), %rsi      # 0xb30d
movq %rbx, %rdi
callq 0x576f
testq %rax, %rax
je 0x84c4
movq 0x30(%rax), %rbx
jmp 0x84c6
xorl %ebx, %ebx
leaq (%r15,%r14), %rcx
addq %r12, %rcx
addq %r13, %rcx
addq %rbx, %rcx
leaq 0x8c0e(%rip), %rax      # 0x110e8
cmpl $0x0, (%rax)
leaq 0x8c24(%rip), %rax      # 0x11108
movq (%rax), %rdi
movq %rcx, %xmm1
movq 0x244c(%rip), %xmm2     # 0xa940
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x2450(%rip), %xmm3     # 0xa950
subpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %rbp, %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm4
unpckhpd %xmm1, %xmm4            # xmm4 = xmm4[1],xmm1[1]
addsd %xmm1, %xmm4
divsd %xmm4, %xmm0
je 0x8553
mulsd 0x2391(%rip), %xmm0     # 0xa8c8
leaq 0x3f9a(%rip), %rsi      # 0xc4d8
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31c0
mulsd 0x23cd(%rip), %xmm0     # 0xa928
leaq 0x435f(%rip), %rsi      # 0xc8c1
movq %rbp, %rdx
movq %rax, %rbp
movb $0x1, %al
movapd %xmm4, (%rsp)
callq 0x31c0
movq (%rbp), %rdi
movq %r13, %xmm1
punpckldq 0x23bb(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x23c3(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x2382(%rip), %xmm0     # 0xa928
leaq 0x434d(%rip), %rsi      # 0xc8fa
movq %r13, %rdx
movb $0x1, %al
callq 0x31c0
movq (%rbp), %rdi
movq %r12, %xmm1
punpckldq 0x2378(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2380(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x233f(%rip), %xmm0     # 0xa928
leaq 0x4345(%rip), %rsi      # 0xc935
movq %r12, %rdx
movb $0x1, %al
callq 0x31c0
movq (%rbp), %rdi
movq %r15, %xmm1
punpckldq 0x2335(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x233d(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x22fc(%rip), %xmm0     # 0xa928
leaq 0x433d(%rip), %rsi      # 0xc970
movq %r15, %rdx
movb $0x1, %al
callq 0x31c0
movq (%rbp), %rdi
movq %r14, %xmm1
punpckldq 0x22f2(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x22fa(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x22b9(%rip), %xmm0     # 0xa928
leaq 0x4335(%rip), %rsi      # 0xc9ab
movq %r14, %rdx
movb $0x1, %al
callq 0x31c0
movq (%rbp), %rdi
movq %rbx, %xmm1
punpckldq 0x22af(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x22b7(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x2276(%rip), %xmm0     # 0xa928
leaq 0x4329(%rip), %rsi      # 0xc9e2
movq %rbx, %rdx
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31c0