// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xb1f8
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x22a0(%rip), %rsi      # 0xd260
callq 0x31b0
cmpl $0x0, %eax
jne 0xafdb
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xad90
jmp 0xb1e5
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xaffb
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x69b0
jmp 0xb1e3
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xb020
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movl $0x2, %edx
callq 0x70f0
jmp 0xb1e1
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xb045
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movl $0x4, %edx
callq 0x70f0
jmp 0xb1df
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xb06a
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movl $0x10, %edx
callq 0x8550
jmp 0xb1dd
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xb08f
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movl $0x8, %edx
callq 0x8b80
jmp 0xb1db
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0xb0b4
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movl $0x20, %edx
callq 0x9170
jmp 0xb1d9
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xb0d4
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x9630
jmp 0xb1d7
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0xb0f6
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x9a70
jmp 0xb1d5
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xb118
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x9fa0
jmp 0xb1d3
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0xb13a
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xa7b0
jmp 0xb1d1
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x2180, %eax           # imm = 0x2180
cmpl $0x0, %eax
je 0xb1b0
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0xb168
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xa7f0
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0xb185
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xa830
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0xb1ae
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xa8b0
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xa870
jmp 0xb1cf
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0xb1cd
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xa8f0
jmp 0xb1cf
jmp 0xb1d1
jmp 0xb1d3
jmp 0xb1d5
jmp 0xb1d7
jmp 0xb1d9
jmp 0xb1db
jmp 0xb1dd
jmp 0xb1df
jmp 0xb1e1
jmp 0xb1e3
jmp 0xb1e5
jmp 0xb1e7
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xafa7
addq $0x20, %rsp
popq %rbp
retq
nop