// File: /workspace/github_c_makefile_star2_O2/mvermeulen[P]wspy/topdown.c
// Function: print_metrics
void print_metrics(struct counter_group *counter_group_list,enum output_format oformat){
  struct counter_group *cgroup;
  for (cgroup = counter_group_list;cgroup;cgroup = cgroup->next){
    if (!strcmp(cgroup->label,"software")){
      print_software(cgroup,oformat);
    } else if (cgroup->mask & COUNTER_IPC){
      print_ipc(cgroup,oformat);
    } else if (cgroup->mask & COUNTER_TOPDOWN){
      print_topdown(cgroup,oformat,COUNTER_TOPDOWN);
    } else if (cgroup->mask & COUNTER_TOPDOWN2){
      print_topdown(cgroup,oformat,COUNTER_TOPDOWN2);
    } else if (cgroup->mask & COUNTER_TOPDOWN_BE){
      print_topdown_be(cgroup,oformat,COUNTER_TOPDOWN_BE);
    } else if (cgroup->mask & COUNTER_TOPDOWN_FE){
      print_topdown_fe(cgroup,oformat,COUNTER_TOPDOWN_FE);
    } else if (cgroup->mask & COUNTER_TOPDOWN_OP){
      print_topdown_op(cgroup,oformat,COUNTER_TOPDOWN_OP);      
    } else if (cgroup->mask & COUNTER_BRANCH){
      print_branch(cgroup,oformat);
    } else if (cgroup->mask & COUNTER_L2CACHE){
      print_l2cache(cgroup,oformat);      
    } else if (cgroup->mask & COUNTER_L3CACHE){
      print_l3cache(cgroup,oformat);      
    } else if (cgroup->mask & COUNTER_OPCACHE){
      print_opcache(cgroup,oformat);
    } else if (cgroup->mask & (COUNTER_DCACHE|COUNTER_ICACHE|COUNTER_TLB)){
      if (cgroup->mask & COUNTER_DCACHE) print_dcache(cgroup,oformat);
      if (cgroup->mask & COUNTER_ICACHE) print_icache(cgroup,oformat);
      if (cgroup->mask & COUNTER_TLB){
	print_dtlb(cgroup,oformat);	  
	print_itlb(cgroup,oformat);
      }
    } else if (cgroup->mask & COUNTER_FLOAT){
      print_float(cgroup,oformat);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leaq 0x1a45(%rip), %r15      # 0xa270
testq %r14, %r14
je 0x897e
movq (%r14), %rdi
movq %r15, %rsi
callq 0x31a0
testl %eax, %eax
je 0x88ed
movl 0x10(%r14), %eax
testb $0x1, %al
jne 0x88f9
testb $0x2, %al
jne 0x8905
testb $0x4, %al
jne 0x8905
testb $0x10, %al
jne 0x8918
testb $0x8, %al
jne 0x8924
testb $0x20, %al
jne 0x8930
testb $0x40, %al
jne 0x893c
btl $0xa, %eax
jb 0x8948
btl $0xb, %eax
jb 0x8954
btl $0xe, %eax
jb 0x8960
testw $0x2180, %ax            # imm = 0x2180
je 0x896c
testb %al, %al
jns 0x88bd
movq %r14, %rdi
movl %ebx, %esi
callq 0x8357
movl 0x10(%r14), %eax
btl $0x8, %eax
jae 0x88d1
movq %r14, %rdi
movl %ebx, %esi
callq 0x8371
movl 0x10(%r14), %eax
btl $0xd, %eax
jae 0x890f
movq %r14, %rdi
movl %ebx, %esi
callq 0x83a5
movq %r14, %rdi
movl %ebx, %esi
callq 0x838b
jmp 0x890f
movq %r14, %rdi
movl %ebx, %esi
callq 0x86d1
jmp 0x890f
movq %r14, %rdi
movl %ebx, %esi
callq 0x57ca
jmp 0x890f
movq %r14, %rdi
movl %ebx, %esi
callq 0x5bac
movq 0x20(%r14), %r14
jmp 0x882b
movq %r14, %rdi
movl %ebx, %esi
callq 0x68f9
jmp 0x890f
movq %r14, %rdi
movl %ebx, %esi
callq 0x6d6d
jmp 0x890f
movq %r14, %rdi
movl %ebx, %esi
callq 0x71d4
jmp 0x890f
movq %r14, %rdi
movl %ebx, %esi
callq 0x7582
jmp 0x890f
movq %r14, %rdi
movl %ebx, %esi
callq 0x78a5
jmp 0x890f
movq %r14, %rdi
movl %ebx, %esi
callq 0x7cab
jmp 0x890f
movq %r14, %rdi
movl %ebx, %esi
callq 0x833d
jmp 0x890f
btl $0x10, %eax
jae 0x890f
movq %r14, %rdi
movl %ebx, %esi
callq 0x83bf
jmp 0x890f
popq %rbx
popq %r14
popq %r15
retq