// File: /workspace/github_c_makefile_star2_O0/LPD-EPFL[P]mctop/src/mctop.c
// Function: print_pow_table
void 
print_pow_table(double*** pt, const uint n_sockets, test_format_t test_format, const char* hostname)
{
  if (test_format == MCT_FILE)
    {
      printf("## Power info ############################################################\n");
      char out_file[50];
      sprintf(out_file, "./desc/%s.mct", hostname);
      printf("## MCTOP output in: %s\n", out_file);

      int ofp_open = 1;
      FILE* ofp = fopen(out_file, "a");
      if (ofp == NULL) 
	{
	  ofp_open = 0;
	  fprintf(stderr, "MCTOP Error: Cannot open output file %s! Using stderr instead.\n", out_file);
	  ofp = stderr;
	}

      fprintf(ofp, "#Power_measurements %d\n", MCTOP_POW_TYPE_NUM);
      for (uint s = 0; s <= n_sockets; s++)
	{
	  const char* text = (s < n_sockets) ? "sockt" : "total";
	  uint type = 0;
	  double* d = pt[type++][s];
	  fprintf(ofp, "Power_%s_%d_idle \t"P5DOUBLEP"\n", text, s, G5DOUBLE(d));
	  d = pt[type++][s];
	  fprintf(ofp, "Power_%s_%d_1stcore \t"P5DOUBLEP"\n", text, s, G5DOUBLE(d));
	  d = pt[type++][s];
	  fprintf(ofp, "Power_%s_%d_2ndcore \t"P5DOUBLEP"\n", text, s, G5DOUBLE(d));
	  d = pt[type++][s];
	  fprintf(ofp, "Power_%s_%d_2ndhwc \t"P5DOUBLEP"\n", text, s, G5DOUBLE(d));
	  d = pt[type++][s];
	  fprintf(ofp, "Power_%s_%d_allcor \t"P5DOUBLEP"\n", text, s, G5DOUBLE(d));
	  d = pt[type++][s];
	  fprintf(ofp, "Power_%s_%d_allhwc \t"P5DOUBLEP"\n", text, s, G5DOUBLE(d));
	}
      if (ofp_open)
	{
	  fclose(ofp);
	}
      printf("##########################################################################\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
cmpl $0x3, -0x10(%rbp)
jne 0x66e4
leaq 0xa21d(%rip), %rdi      # 0x105a7
movb $0x0, %al
callq 0x20d0
leaq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0xa086(%rip), %rsi      # 0x10426
movb $0x0, %al
callq 0x2280
leaq -0x50(%rbp), %rsi
leaq 0xa082(%rip), %rdi      # 0x10434
movb $0x0, %al
callq 0x20d0
movl $0x1, -0x54(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xa18c(%rip), %rsi      # 0x10557
callq 0x2210
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x640c
movl $0x0, -0x54(%rbp)
movq 0xec0f(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq -0x50(%rbp), %rdx
leaq 0xa058(%rip), %rsi      # 0x1044f
movb $0x0, %al
callq 0x2140
movq 0xebf3(%rip), %rax      # 0x14ff8
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
leaq 0xa1dc(%rip), %rsi      # 0x105f3
movl $0x6, %edx
movb $0x0, %al
callq 0x2140
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0xc(%rbp), %eax
ja 0x66c7
movl -0x64(%rbp), %edx
movl -0xc(%rbp), %esi
leaq 0xa1ce(%rip), %rax      # 0x10611
leaq 0xa1c1(%rip), %rcx      # 0x1060b
cmpl %esi, %edx
cmovbq %rcx, %rax
movq %rax, -0x70(%rbp)
movl $0x0, -0x74(%rbp)
movq -0x8(%rbp), %rax
movl -0x74(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x74(%rbp)
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl -0x64(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rdx
movl -0x64(%rbp), %ecx
movq -0x80(%rbp), %rax
movsd (%rax), %xmm0
movq -0x80(%rbp), %rax
movsd 0x8(%rax), %xmm1
movq -0x80(%rbp), %rax
movsd 0x10(%rax), %xmm2
movq -0x80(%rbp), %rax
movsd 0x18(%rax), %xmm3
movq -0x80(%rbp), %rax
movsd 0x20(%rax), %xmm4
leaq 0xa15e(%rip), %rsi      # 0x10617
movb $0x5, %al
callq 0x2140
movq -0x8(%rbp), %rax
movl -0x74(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x74(%rbp)
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl -0x64(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rdx
movl -0x64(%rbp), %ecx
movq -0x80(%rbp), %rax
movsd (%rax), %xmm0
movq -0x80(%rbp), %rax
movsd 0x8(%rax), %xmm1
movq -0x80(%rbp), %rax
movsd 0x10(%rax), %xmm2
movq -0x80(%rbp), %rax
movsd 0x18(%rax), %xmm3
movq -0x80(%rbp), %rax
movsd 0x20(%rax), %xmm4
leaq 0xa12b(%rip), %rsi      # 0x10649
movb $0x5, %al
callq 0x2140
movq -0x8(%rbp), %rax
movl -0x74(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x74(%rbp)
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl -0x64(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rdx
movl -0x64(%rbp), %ecx
movq -0x80(%rbp), %rax
movsd (%rax), %xmm0
movq -0x80(%rbp), %rax
movsd 0x8(%rax), %xmm1
movq -0x80(%rbp), %rax
movsd 0x10(%rax), %xmm2
movq -0x80(%rbp), %rax
movsd 0x18(%rax), %xmm3
movq -0x80(%rbp), %rax
movsd 0x20(%rax), %xmm4
leaq 0xa0fb(%rip), %rsi      # 0x1067e
movb $0x5, %al
callq 0x2140
movq -0x8(%rbp), %rax
movl -0x74(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x74(%rbp)
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl -0x64(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rdx
movl -0x64(%rbp), %ecx
movq -0x80(%rbp), %rax
movsd (%rax), %xmm0
movq -0x80(%rbp), %rax
movsd 0x8(%rax), %xmm1
movq -0x80(%rbp), %rax
movsd 0x10(%rax), %xmm2
movq -0x80(%rbp), %rax
movsd 0x18(%rax), %xmm3
movq -0x80(%rbp), %rax
movsd 0x20(%rax), %xmm4
leaq 0xa0cb(%rip), %rsi      # 0x106b3
movb $0x5, %al
callq 0x2140
movq -0x8(%rbp), %rax
movl -0x74(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x74(%rbp)
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl -0x64(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rdx
movl -0x64(%rbp), %ecx
movq -0x80(%rbp), %rax
movsd (%rax), %xmm0
movq -0x80(%rbp), %rax
movsd 0x8(%rax), %xmm1
movq -0x80(%rbp), %rax
movsd 0x10(%rax), %xmm2
movq -0x80(%rbp), %rax
movsd 0x18(%rax), %xmm3
movq -0x80(%rbp), %rax
movsd 0x20(%rax), %xmm4
leaq 0xa09a(%rip), %rsi      # 0x106e7
movb $0x5, %al
callq 0x2140
movq -0x8(%rbp), %rax
movl -0x74(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x74(%rbp)
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl -0x64(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rdx
movl -0x64(%rbp), %ecx
movq -0x80(%rbp), %rax
movsd (%rax), %xmm0
movq -0x80(%rbp), %rax
movsd 0x8(%rax), %xmm1
movq -0x80(%rbp), %rax
movsd 0x10(%rax), %xmm2
movq -0x80(%rbp), %rax
movsd 0x18(%rax), %xmm3
movq -0x80(%rbp), %rax
movsd 0x20(%rax), %xmm4
leaq 0xa069(%rip), %rsi      # 0x1071b
movb $0x5, %al
callq 0x2140
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x642a
cmpl $0x0, -0x54(%rbp)
je 0x66d6
movq -0x60(%rbp), %rdi
callq 0x20b0
leaq 0x9de2(%rip), %rdi      # 0x104bf
movb $0x0, %al
callq 0x20d0
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)