// File: /workspace/github_c_makefile_star2_O3/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 0x8533
leaq 0x9bec(%rip), %rax      # 0x120f8
movq (%rax), %rcx
leaq 0x53a4(%rip), %rdi      # 0xd8ba
movl $0x6, %esi
movl $0x1, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32c0
leaq 0xac26(%rip), %rax      # 0x13160
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x855c
movq %rdi, %rbx
leaq 0x3a88(%rip), %rsi      # 0xbfd4
callq 0x5860
testq %rax, %rax
je 0x856b
movq 0x30(%rax), %rbp
jmp 0x856d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
leaq 0x3cfe(%rip), %rsi      # 0xc272
movq %rbx, %rdi
callq 0x5860
testq %rax, %rax
je 0x8587
movq 0x30(%rax), %r13
jmp 0x858a
xorl %r13d, %r13d
leaq 0x3d09(%rip), %rsi      # 0xc29a
movq %rbx, %rdi
callq 0x5860
testq %rax, %rax
je 0x85a4
movq 0x30(%rax), %r12
jmp 0x85a7
xorl %r12d, %r12d
leaq 0x3d14(%rip), %rsi      # 0xc2c2
movq %rbx, %rdi
callq 0x5860
testq %rax, %rax
je 0x85c1
movq 0x30(%rax), %r15
jmp 0x85c4
xorl %r15d, %r15d
leaq 0x3d1e(%rip), %rsi      # 0xc2e9
movq %rbx, %rdi
callq 0x5860
testq %rax, %rax
je 0x85de
movq 0x30(%rax), %r14
jmp 0x85e1
xorl %r14d, %r14d
leaq 0x3d25(%rip), %rsi      # 0xc30d
movq %rbx, %rdi
callq 0x5860
testq %rax, %rax
je 0x85fb
movq 0x30(%rax), %rbx
jmp 0x85fd
xorl %ebx, %ebx
leaq (%r15,%r14), %rcx
addq %r12, %rcx
addq %r13, %rcx
addq %rbx, %rcx
leaq 0x9ac7(%rip), %rax      # 0x120d8
cmpl $0x0, (%rax)
leaq 0x9add(%rip), %rax      # 0x120f8
movq (%rax), %rdi
movq %rcx, %xmm1
movq 0x3315(%rip), %xmm2     # 0xb940
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x3319(%rip), %xmm3     # 0xb950
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 0x868a
mulsd 0x325a(%rip), %xmm0     # 0xb8c8
leaq 0x4e63(%rip), %rsi      # 0xd4d8
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31c0
mulsd 0x3296(%rip), %xmm0     # 0xb928
leaq 0x5228(%rip), %rsi      # 0xd8c1
movq %rbp, %rdx
movq %rax, %rbp
movb $0x1, %al
movapd %xmm4, (%rsp)
callq 0x31c0
movq (%rbp), %rdi
movq %r13, %xmm1
punpckldq 0x3284(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x328c(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x324b(%rip), %xmm0     # 0xb928
leaq 0x5216(%rip), %rsi      # 0xd8fa
movq %r13, %rdx
movb $0x1, %al
callq 0x31c0
movq (%rbp), %rdi
movq %r12, %xmm1
punpckldq 0x3241(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x3249(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x3208(%rip), %xmm0     # 0xb928
leaq 0x520e(%rip), %rsi      # 0xd935
movq %r12, %rdx
movb $0x1, %al
callq 0x31c0
movq (%rbp), %rdi
movq %r15, %xmm1
punpckldq 0x31fe(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x3206(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x31c5(%rip), %xmm0     # 0xb928
leaq 0x5206(%rip), %rsi      # 0xd970
movq %r15, %rdx
movb $0x1, %al
callq 0x31c0
movq (%rbp), %rdi
movq %r14, %xmm1
punpckldq 0x31bb(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x31c3(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x3182(%rip), %xmm0     # 0xb928
leaq 0x51fe(%rip), %rsi      # 0xd9ab
movq %r14, %rdx
movb $0x1, %al
callq 0x31c0
movq (%rbp), %rdi
movq %rbx, %xmm1
punpckldq 0x3178(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x3180(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x313f(%rip), %xmm0     # 0xb928
leaq 0x51f2(%rip), %rsi      # 0xd9e2
movq %rbx, %rdx
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31c0