// File: /workspace/github_c_makefile_star2_O1/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 0x855b
leaq 0x9bc4(%rip), %rax      # 0x120f8
movq (%rax), %rcx
leaq 0x537c(%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 0xabfe(%rip), %rax      # 0x13160
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x8584
movq %rdi, %rbx
leaq 0x3a60(%rip), %rsi      # 0xbfd4
callq 0x587d
testq %rax, %rax
je 0x8593
movq 0x30(%rax), %rbp
jmp 0x8595
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
leaq 0x3cd6(%rip), %rsi      # 0xc272
movq %rbx, %rdi
callq 0x587d
testq %rax, %rax
je 0x85af
movq 0x30(%rax), %r13
jmp 0x85b2
xorl %r13d, %r13d
leaq 0x3ce1(%rip), %rsi      # 0xc29a
movq %rbx, %rdi
callq 0x587d
testq %rax, %rax
je 0x85cc
movq 0x30(%rax), %r12
jmp 0x85cf
xorl %r12d, %r12d
leaq 0x3cec(%rip), %rsi      # 0xc2c2
movq %rbx, %rdi
callq 0x587d
testq %rax, %rax
je 0x85e9
movq 0x30(%rax), %r15
jmp 0x85ec
xorl %r15d, %r15d
leaq 0x3cf6(%rip), %rsi      # 0xc2e9
movq %rbx, %rdi
callq 0x587d
testq %rax, %rax
je 0x8606
movq 0x30(%rax), %r14
jmp 0x8609
xorl %r14d, %r14d
leaq 0x3cfd(%rip), %rsi      # 0xc30d
movq %rbx, %rdi
callq 0x587d
testq %rax, %rax
je 0x8623
movq 0x30(%rax), %rbx
jmp 0x8625
xorl %ebx, %ebx
leaq (%r15,%r14), %rcx
addq %r12, %rcx
addq %r13, %rcx
addq %rbx, %rcx
leaq 0x9a9f(%rip), %rax      # 0x120d8
cmpl $0x0, (%rax)
leaq 0x9ab5(%rip), %rax      # 0x120f8
movq (%rax), %rdi
movq %rcx, %xmm1
movq 0x32ed(%rip), %xmm2     # 0xb940
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x32f1(%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 0x86b2
mulsd 0x3232(%rip), %xmm0     # 0xb8c8
leaq 0x4e3b(%rip), %rsi      # 0xd4d8
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31c0
mulsd 0x326e(%rip), %xmm0     # 0xb928
leaq 0x5200(%rip), %rsi      # 0xd8c1
movq %rbp, %rdx
movq %rax, %rbp
movb $0x1, %al
movapd %xmm4, (%rsp)
callq 0x31c0
movq (%rbp), %rdi
movq %r13, %xmm1
punpckldq 0x325c(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x3264(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x3223(%rip), %xmm0     # 0xb928
leaq 0x51ee(%rip), %rsi      # 0xd8fa
movq %r13, %rdx
movb $0x1, %al
callq 0x31c0
movq (%rbp), %rdi
movq %r12, %xmm1
punpckldq 0x3219(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x3221(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x31e0(%rip), %xmm0     # 0xb928
leaq 0x51e6(%rip), %rsi      # 0xd935
movq %r12, %rdx
movb $0x1, %al
callq 0x31c0
movq (%rbp), %rdi
movq %r15, %xmm1
punpckldq 0x31d6(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x31de(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x319d(%rip), %xmm0     # 0xb928
leaq 0x51de(%rip), %rsi      # 0xd970
movq %r15, %rdx
movb $0x1, %al
callq 0x31c0
movq (%rbp), %rdi
movq %r14, %xmm1
punpckldq 0x3193(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x319b(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x315a(%rip), %xmm0     # 0xb928
leaq 0x51d6(%rip), %rsi      # 0xd9ab
movq %r14, %rdx
movb $0x1, %al
callq 0x31c0
movq (%rbp), %rdi
movq %rbx, %xmm1
punpckldq 0x3150(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x3158(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
mulsd 0x3117(%rip), %xmm0     # 0xb928
leaq 0x51ca(%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