// File: /workspace/github_c_makefile_star2_O3/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:
testq %rdi, %rdi
je 0x8b53
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x28ec(%rip), %r15      # 0xb270
leaq 0x28c7(%rip), %r12      # 0xb252
leaq 0x36a5(%rip), %r13      # 0xc037
leaq 0x36dc(%rip), %rbp      # 0xc075
movq (%r14), %rdi
movq %r15, %rsi
callq 0x31a0
testl %eax, %eax
je 0x8aa5
movl 0x10(%r14), %eax
testb $0x1, %al
jne 0x8ab1
testb $0x2, %al
jne 0x8abd
testb $0x4, %al
jne 0x8abd
testb $0x10, %al
jne 0x8ad6
testb $0x8, %al
jne 0x8ae2
testb $0x20, %al
jne 0x8aee
testb $0x40, %al
jne 0x8afa
btl $0xa, %eax
jb 0x8b06
btl $0xb, %eax
jb 0x8b12
btl $0xe, %eax
jb 0x8b1e
testl $0x2180, %eax           # imm = 0x2180
je 0x8b33
testb %al, %al
jns 0x8a38
movq %r14, %rdi
movl %ebx, %esi
leaq 0x4e7b(%rip), %rdx      # 0xd89c
leaq 0x3f8b(%rip), %rcx      # 0xc9b3
leaq 0x3f8d(%rip), %r8       # 0xc9bc
callq 0x825a
movl 0x10(%r14), %eax
btl $0x8, %eax
jae 0x8a61
movq %r14, %rdi
movl %ebx, %esi
leaq 0x4e5c(%rip), %rdx      # 0xd8a6
leaq 0x3f79(%rip), %rcx      # 0xc9ca
leaq 0x3f7b(%rip), %r8       # 0xc9d3
callq 0x825a
movl 0x10(%r14), %eax
btl $0xd, %eax
jae 0x8ac7
movq %r14, %rdi
movl %ebx, %esi
leaq 0x4e42(%rip), %rdx      # 0xd8b5
leaq 0x3f67(%rip), %rcx      # 0xc9e1
leaq 0x3f6b(%rip), %r8       # 0xc9ec
callq 0x825a
movq %r14, %rdi
movl %ebx, %esi
leaq 0x4e1e(%rip), %rdx      # 0xd8b0
leaq 0x3f64(%rip), %rcx      # 0xc9fd
leaq 0x3f68(%rip), %r8       # 0xca08
jmp 0x8b2c
movq %r14, %rdi
movl %ebx, %esi
callq 0x8808
jmp 0x8ac7
movq %r14, %rdi
movl %ebx, %esi
callq 0x5898
jmp 0x8ac7
movq %r14, %rdi
movl %ebx, %esi
callq 0x5c82
movq 0x20(%r14), %r14
testq %r14, %r14
jne 0x8999
jmp 0x8b45
movq %r14, %rdi
movl %ebx, %esi
callq 0x6a06
jmp 0x8ac7
movq %r14, %rdi
movl %ebx, %esi
callq 0x6e7e
jmp 0x8ac7
movq %r14, %rdi
movl %ebx, %esi
callq 0x72ed
jmp 0x8ac7
movq %r14, %rdi
movl %ebx, %esi
callq 0x76a3
jmp 0x8ac7
movq %r14, %rdi
movl %ebx, %esi
callq 0x79ca
jmp 0x8ac7
movq %r14, %rdi
movl %ebx, %esi
callq 0x7dd4
jmp 0x8ac7
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
movq %r13, %rcx
movq %rbp, %r8
callq 0x825a
jmp 0x8ac7
btl $0x10, %eax
jae 0x8ac7
movq %r14, %rdi
movl %ebx, %esi
callq 0x84f2
jmp 0x8ac7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq