LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/cktan[P]tomlc99/toml_json.c
// Function: print_escape_string
static void print_escape_string(const char *s) {
  for (; *s; s++) {
    int ch = *s;
    switch (ch) {
    case '\b':
      printf("\\b");
      break;
    case '\t':
      printf("\\t");
      break;
    case '\n':
      printf("\\n");
      break;
    case '\f':
      printf("\\f");
      break;
    case '\r':
      printf("\\r");
      break;
    case '"':
      printf("\\\"");
      break;
    case '\\':
      printf("\\\\");
      break;
    default:
      printf("%c", ch);
      break;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4a6e(%rip), %r12      # 0x6004
leaq 0x4ad1(%rip), %r13      # 0x606e
leaq 0x4acd(%rip), %rbp      # 0x6071
leaq 0x4ac9(%rip), %r14      # 0x6074
leaq 0x4ac5(%rip), %r15      # 0x6077
jmp 0x15ff
leaq 0x4ab0(%rip), %rdi      # 0x606b
jmp 0x15f5
cmpl $0x22, %eax
je 0x15ee
cmpl $0x5c, %eax
jne 0x15d0
leaq 0x4aaf(%rip), %rdi      # 0x607d
jmp 0x15f5
movsbl %al, %edi
callq 0x1040
jmp 0x15fc
movq %r14, %rdi
jmp 0x15f5
movq %r15, %rdi
jmp 0x15f5
movq %rbp, %rdi
jmp 0x15f5
movq %r13, %rdi
jmp 0x15f5
leaq 0x4a85(%rip), %rdi      # 0x607a
xorl %eax, %eax
callq 0x10d0
incq %rbx
movzbl (%rbx), %eax
cmpq $0xd, %rax
ja 0x15bd
movslq (%r12,%rax,4), %rcx
addq %r12, %rcx
jmpq *%rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cktan[P]tomlc99/toml_json.c
// Function: print_array
static void print_array(toml_array_t *curarr) {
  if (toml_array_kind(curarr) == 't') {
    print_table_array(curarr);
    return;
  }

  printf("[");

  const char *raw;
  toml_array_t *arr;
  toml_table_t *tab;

  const int n = toml_array_nelem(curarr);
  for (int i = 0; i < n; i++) {
    printf("%s", i > 0 ? "," : "");

    if (0 != (arr = toml_array_at(curarr, i))) {
      print_array(arr);
      continue;
    }

    if (0 != (tab = toml_table_at(curarr, i))) {
      print_table(tab);
      continue;
    }

    raw = toml_raw_at(curarr, i);
    if (raw) {
      print_raw(raw);
      continue;
    }

    fflush(stdout);
    fprintf(stderr, "ERROR: unable to decode value in array\n");
    exit(1);
  }

  printf("]");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x343e
movl %eax, %ebp
movl $0x5b, %edi
callq 0x1040
movq %rbx, %rdi
cmpb $0x74, %bpl
jne 0x18c5
xorl %esi, %esi
callq 0x3499
testq %rax, %rax
je 0x1954
movq %rax, %r14
movl $0x1, %ebp
leaq 0x4ead(%rip), %r12      # 0x672f
leaq 0x47dd(%rip), %r13      # 0x6066
leaq 0x4ac5(%rip), %r15      # 0x6355
cmpl $0x1, %ebp
movq %r13, %rsi
cmoveq %r12, %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
callq 0x148b
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3499
movq %rax, %r14
incl %ebp
testq %rax, %rax
jne 0x1890
jmp 0x1954
callq 0x3455
testl %eax, %eax
jle 0x1954
movl %eax, %ebp
leaq 0x4e54(%rip), %r12      # 0x672f
leaq 0x4784(%rip), %r13      # 0x6066
leaq 0x4a6c(%rip), %r14      # 0x6355
xorl %r15d, %r15d
testl %r15d, %r15d
movq %r13, %rsi
cmoveq %r12, %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x10d0
movq %rbx, %rdi
movl %r15d, %esi
callq 0x347d
testq %rax, %rax
je 0x191a
movq %rax, %rdi
callq 0x183b
jmp 0x194c
movq %rbx, %rdi
movl %r15d, %esi
callq 0x3499
testq %rax, %rax
je 0x1934
movq %rax, %rdi
callq 0x148b
jmp 0x194c
movq %rbx, %rdi
movl %r15d, %esi
callq 0x3422
testq %rax, %rax
je 0x196c
movq %rax, %rdi
callq 0x1620
incl %r15d
cmpl %r15d, %ebp
jne 0x18ec
movl $0x5d, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1040
callq 0x12a6
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: parse_intel_event
unsigned long parse_intel_event(char *description){
  char *desc = strdup(description);
  char *name,*val;
  unsigned long value;
  union intel_raw_cpu_format result;
  result.config = 0;
  
  for (name = strtok(desc,",\n");name;name = strtok(NULL,",\n")){
    if (val = strchr(name,'=')){ // expected format "desc=value"
      *val = 0; // null terminator for name
      val++;
      value = strtol(val,NULL,16);
      
      if (!strcmp(name,"event")){
	result.event = value;
      } else if (!strcmp(name,"umask")){
	result.umask = value;
      } else if (!strcmp(name,"cmask")){
	result.cmask = value;	
      } else if (!strcmp(name,"period")){
	// appears in some Intel perf list output, but not sure of purpose, ignore...
      } else {
	fatal("unimplemented %s in parse_intel_event\n",name);
      }
    }
  }
  debug2("parse_event(\"%s\") = %lx\n",description,result.config);
  
  return result.config;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x32e0
leaq 0x8786(%rip), %rsi      # 0xc538
movq %rax, %rdi
callq 0x3270
xorl %ebx, %ebx
testq %rax, %rax
je 0x3eb3
movq %rax, %rbp
movq %r14, (%rsp)
leaq 0x8765(%rip), %r14      # 0xc538
leaq 0x8761(%rip), %r15      # 0xc53b
leaq 0x8760(%rip), %r12      # 0xc541
xorl %r13d, %r13d
movq %rbp, %rdi
movl $0x3d, %esi
callq 0x30d0
testq %rax, %rax
je 0x3e85
movb $0x0, (%rax)
incq %rax
movq %rax, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x31f0
movq %rax, %rbx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x31a0
testl %eax, %eax
je 0x3e69
movq %rbp, %rdi
movq %r12, %rsi
callq 0x31a0
testl %eax, %eax
je 0x3e75
movq %rbp, %rdi
leaq 0x870d(%rip), %rsi      # 0xc547
callq 0x31a0
testl %eax, %eax
je 0x3e9d
movq %rbp, %rdi
leaq 0x8700(%rip), %rsi      # 0xc54d
callq 0x31a0
testl %eax, %eax
je 0x3e85
leaq 0x86f7(%rip), %rdi      # 0xc554
movq %rbp, %rsi
xorl %eax, %eax
callq 0x913b
jmp 0x3e85
movzbl %bl, %eax
andl $0xffffff00, %r13d      # imm = 0xFFFFFF00
jmp 0x3e82
shll $0x8, %ebx
movzwl %bx, %eax
andl $0xffff00ff, %r13d      # imm = 0xFFFF00FF
orl %eax, %r13d
xorl %edi, %edi
movq %r14, %rsi
callq 0x3270
movq %rax, %rbp
testq %rax, %rax
jne 0x3de4
jmp 0x3eac
shll $0x18, %ebx
andl $0xffffff, %r13d        # imm = 0xFFFFFF
orl %ebx, %r13d
jmp 0x3e85
movl %r13d, %ebx
movq (%rsp), %r14
leaq 0x86c1(%rip), %rdi      # 0xc57b
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x96db
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: parse_amd_event
unsigned long parse_amd_event(char *description){
  char *desc = strdup(description);
  char *name,*val;
  unsigned long value;
  union amd_raw_cpu_format result;
  struct stat statbuf;
  result.config = 0;
  
  for (name = strtok(desc,",\n");name;name = strtok(NULL,",\n")){
    if (val = strchr(name,'=')){ // expected format "desc=value"
      *val = 0; // null terminator for name
      val++;
      value = strtol(val,NULL,16);
      
      if (!strcmp(name,"event")){
	result.event = value;
	result.event2 = value>>8;
      } else if (!strcmp(name,"umask")){
	result.umask = value;
      } else if (!strcmp(name,"cmask")){
	result.cmask = value;
      } else if (!strcmp(name,"requires")){
	// the value encodes the name of the type field...
	debug("checking for %s\n",val);
	if (stat(val,&statbuf) ==-1){
	  fatal("%s not found, is the perf module for this device loaded in the kernel?\n");
	}
      } else {
	fatal("unimplemented %s in parse_amd_event\n",name);
      }
    }
  }
  debug2("parse_event(\"%s\") = %lx\n",description,result.config);
  
  return result.config;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, (%rsp)
callq 0x32e0
leaq 0x863e(%rip), %rsi      # 0xc538
movq %rax, %rdi
callq 0x3270
testq %rax, %rax
je 0x403f
movq %rax, %rbx
leaq 0x8623(%rip), %r15      # 0xc538
leaq 0x861f(%rip), %r12      # 0xc53b
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x3d, %esi
callq 0x30d0
testq %rax, %rax
je 0x3ff4
movq %rax, %rbp
movb $0x0, (%rax)
incq %rbp
movq %rbp, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x31f0
movq %rax, %r13
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31a0
testl %eax, %eax
je 0x3fab
movq %rbx, %rdi
leaq 0x85d8(%rip), %rsi      # 0xc541
callq 0x31a0
testl %eax, %eax
je 0x3fcc
movq %rbx, %rdi
leaq 0x85cb(%rip), %rsi      # 0xc547
callq 0x31a0
testl %eax, %eax
je 0x3fe0
movq %rbx, %rdi
leaq 0x8605(%rip), %rsi      # 0xc594
callq 0x31a0
testl %eax, %eax
je 0x400c
leaq 0x8657(%rip), %rdi      # 0xc5f6
movq %rbx, %rsi
xorl %eax, %eax
callq 0x913b
jmp 0x3ff4
movzbl %r13b, %eax
movabsq $-0xf00000100, %rcx     # imm = 0xFFFFFFF0FFFFFF00
andq %rcx, %r14
orq %rax, %r14
andl $0xf00, %r13d           # imm = 0xF00
shlq $0x18, %r13
jmp 0x3ff1
shll $0x8, %r13d
movzwl %r13w, %eax
andq $-0xff01, %r14          # imm = 0xFFFF00FF
orq %rax, %r14
jmp 0x3ff4
shll $0x18, %r13d
movabsq $-0xff000001, %rax      # imm = 0xFFFFFFFF00FFFFFF
andq %rax, %r14
orq %r13, %r14
xorl %edi, %edi
movq %r15, %rsi
callq 0x3270
movq %rax, %rbx
testq %rax, %rax
jne 0x3f1f
jmp 0x4042
leaq 0x858a(%rip), %rdi      # 0xc59d
movq %rbp, %rsi
xorl %eax, %eax
callq 0x95da
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x31e0
cmpl $-0x1, %eax
jne 0x3ff4
leaq 0x8578(%rip), %rdi      # 0xc5ae
xorl %eax, %eax
callq 0x913b
jmp 0x3ff4
xorl %r14d, %r14d
leaq 0x8532(%rip), %rdi      # 0xc57b
movq (%rsp), %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x96db
movq %r14, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: setup_raw_events
int setup_raw_events(void){
  int i;
  struct raw_event *events;
  unsigned int num_events;
  switch(cpu_info->vendor){
  case VENDOR_AMD:
    events = amd_raw_events;
    num_events = sizeof(amd_raw_events)/sizeof(amd_raw_events[0]);
    for (i=0;i<num_events;i++){
      if (events[i].use & counter_mask)
	events[i].raw.config = parse_amd_event(events[i].description);
    }    
    break;
  case VENDOR_INTEL:
    events = intel_raw_events;
    num_events = sizeof(intel_raw_events)/sizeof(intel_raw_events[0]);
    for (i=0;i<num_events;i++){
      if (events[i].use & counter_mask)
	events[i].raw.config = parse_intel_event(events[i].description);
    }        
    break;
  default:
    warning("Unknown CPU, no events parsed\n");
    break;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0xf0e8(%rip), %rax      # 0x13160
movq (%rax), %rax
movl (%rax), %eax
cmpl $0x1, %eax
je 0x40c3
cmpl $0x2, %eax
jne 0x4103
leaq 0xd136(%rip), %rbx      # 0x111c4
movl (%rbx), %eax
movl $0x18, %r14d
leaq 0xd6f3(%rip), %r15      # 0x11790
testl %eax, -0x4(%r14,%r15)
je 0x40b4
movq -0x10(%r14,%r15), %rdi
callq 0x3d98
movq %rax, (%r14,%r15)
movl (%rbx), %eax
addq $0x20, %r14
cmpq $0x2d8, %r14            # imm = 0x2D8
jne 0x409d
jmp 0x40fd
leaq 0xd0fa(%rip), %rbx      # 0x111c4
movl (%rbx), %eax
movl $0x18, %r14d
leaq 0xd977(%rip), %r15      # 0x11a50
testl %eax, -0x4(%r14,%r15)
je 0x40f0
movq -0x10(%r14,%r15), %rdi
callq 0x3ed9
movq %rax, (%r14,%r15)
movl (%rbx), %eax
addq $0x20, %r14
cmpq $0x558, %r14            # imm = 0x558
jne 0x40d9
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8511(%rip), %rdi      # 0xc61b
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x9337
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: launch_child
int launch_child(int argc,char *const argv[],char *const envp[]){
  pid_t child;
  int len;
  char *p,*path;
  char pathbuf[1024];

  if (pipe(child_pipe) == -1) fatal("pipe creation failed\n");
  switch(child = fork()){
  case 0: // child
    if (treeflag){
      debug("ptrace(PTRACE_TRACEME,0)\n");
      ptrace(PTRACE_TRACEME,0,NULL,NULL);
    }
    close(child_pipe[1]); // close writing end
    read(child_pipe[0],pathbuf,sizeof(pathbuf)); // wait until the parent has written
    execve(argv[0],argv,envp);
    // if argv[0] fails, look in path
    path = strdup(getenv("PATH"));
    len = strlen(argv[0]);
    p = strtok(path,":\n");
    if (p){
      do {
	strncpy(pathbuf,p,sizeof(pathbuf)-len-2);
	strcat(pathbuf,"/");
	strcat(pathbuf,argv[0]);
	execve(pathbuf,argv,envp);
	p = strtok(NULL,":\n");
      } while (p);
      // exec failed
      return 1;
    }
    break;
  case -1:
    fatal("fork failed\n");
    return 1;
  default:
    // parent
    close(child_pipe[0]); // close reading end
    child_pid = child;
    is_still_running = 1;
    break;
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdx, %rbx
movq %rsi, %r14
leaq 0xdff8(%rip), %rdi      # 0x1212c
callq 0x3140
cmpl $-0x1, %eax
jne 0x414c
leaq 0x84f5(%rip), %rdi      # 0xc63a
xorl %eax, %eax
callq 0x913b
callq 0x3330
cmpl $-0x1, %eax
je 0x424f
movl %eax, %ebp
testl %eax, %eax
jne 0x4264
leaq 0xdf75(%rip), %rax      # 0x120e0
cmpl $0x0, (%rax)
je 0x418d
leaq 0x84d9(%rip), %rdi      # 0xc650
xorl %eax, %eax
callq 0x95da
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3220
movl 0xdf9d(%rip), %edi      # 0x12130
callq 0x3130
movl 0xdf8e(%rip), %edi      # 0x1212c
movq %rsp, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x3160
movq (%r14), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3180
leaq 0x84aa(%rip), %rdi      # 0xc66a
callq 0x3030
movq %rax, %rdi
callq 0x32e0
movq %rax, %r12
movq (%r14), %rdi
callq 0x30b0
movq %rax, %r15
leaq 0x848d(%rip), %rsi      # 0xc66f
movq %r12, %rdi
callq 0x3270
testq %rax, %rax
je 0x427f
movslq %r15d, %rcx
movl $0x3fe, %r15d           # imm = 0x3FE
subq %rcx, %r15
movq %rsp, %r12
leaq 0x8466(%rip), %r13      # 0xc66f
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x3050
movq %r12, %rdi
callq 0x30b0
movw $0x2f, (%rsp,%rax)
movq (%r14), %rsi
movq %r12, %rdi
callq 0x32a0
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3180
xorl %edi, %edi
movq %r13, %rsi
callq 0x3270
testq %rax, %rax
jne 0x4209
jmp 0x425d
leaq 0x841c(%rip), %rdi      # 0xc672
xorl %eax, %eax
callq 0x913b
movl $0x1, %eax
jmp 0x4281
movl 0xdec2(%rip), %edi      # 0x1212c
callq 0x3130
movl %ebp, 0xdeb3(%rip)      # 0x12128
movl $0x1, 0xdeb5(%rip)      # 0x12134
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: ptrace_setup
void ptrace_setup(pid_t child_pid){
  int status;
  
  debug("ptrace_setup\n");
  waitpid(child_pid,&status,0); // wait for an initial event from the PTRACE_TRACEME

  if (WIFEXITED(status)){
    fatal("child process exited unexpectedly\n");
  } else if (WIFSIGNALED(status)){
    fatal("child process signaled unexpectedly, signal = %d\n",
	  WSTOPSIG(status));
  }
  // set the ptrace event flags
  status = ptrace(PTRACE_SETOPTIONS,child_pid,0,
		  PTRACE_O_EXITKILL | // kill child if I exit
		  PTRACE_O_TRACESYSGOOD | // set 0x80 for syscall traps
		  PTRACE_O_TRACECLONE|PTRACE_O_TRACEFORK|PTRACE_O_TRACEVFORK|
		  PTRACE_O_TRACEEXIT); // exit(2)
  ptrace(trace_syscall?PTRACE_SYSCALL:PTRACE_CONT,child_pid,NULL,NULL); // let the child being
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x83df(%rip), %rdi      # 0xc67f
xorl %eax, %eax
callq 0x95da
leaq 0x4(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3240
movl (%r14), %eax
movl %eax, %ecx
andl $0x7f, %ecx
je 0x42e6
shll $0x18, %ecx
addl $0x1000000, %ecx        # imm = 0x1000000
cmpl $0x2000000, %ecx        # imm = 0x2000000
jl 0x42f4
movzbl %ah, %esi
leaq 0x83d3(%rip), %rdi      # 0xc6b0
xorl %eax, %eax
callq 0x913b
jmp 0x42f4
leaq 0x83a0(%rip), %rdi      # 0xc68d
xorl %eax, %eax
callq 0x913b
movl $0x4200, %edi           # imm = 0x4200
movl %ebx, %esi
xorl %edx, %edx
movl $0x10004f, %ecx         # imm = 0x10004F
xorl %eax, %eax
callq 0x3220
movl %eax, 0x4(%rsp)
leaq 0xddd8(%rip), %rax      # 0x120ec
cmpl $0x0, (%rax)
movl $0x7, %eax
movl $0x18, %edi
cmovel %eax, %edi
movl %ebx, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3220
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: ptrace_read_null_terminated_string
char *ptrace_read_null_terminated_string(pid_t pid,long addr){
  static char buffer[4096];
  char *bufptr = buffer;
  int i;
  int len = 0;
  long int result;
  do {
    result = ptrace(PTRACE_PEEKDATA,pid,addr,0);
    if ((result == -1) && (errno != 0)){
      error("ptrace_read_null_terminated_string, errno = %d - %s\n",errno,strerror(errno));
      return NULL;
    } else {
      ((unsigned int *) &bufptr[len])[0] = result;
    }
    if (bufptr[len] == '\0' ||
	bufptr[len+1] == '\0' ||
	bufptr[len+2] == '\0' ||
	bufptr[len+3] == '\0')
      break;
    len += sizeof(int);
    addr += sizeof(int);
  } while (len < 4096);
  return bufptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
leaq 0xddf3(%rip), %rbx      # 0x12140
xorl %r12d, %r12d
leaq (%r14,%r12), %rdx
movl $0x2, %edi
movl %ebp, %esi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3220
cmpq $-0x1, %rax
je 0x438f
movl %eax, (%r12,%rbx)
testb %al, %al
je 0x43d4
movl %eax, %ecx
andl $0xff00, %ecx           # imm = 0xFF00
je 0x43d4
movl %eax, %ecx
andl $0xff0000, %ecx         # imm = 0xFF0000
je 0x43d4
andl $0xff000000, %eax       # imm = 0xFF000000
jne 0x43a4
jmp 0x43d4
callq 0x3040
movl (%rax), %r15d
testl %r15d, %r15d
jne 0x43b6
movl $0xffffffff, (%r12,%rbx) # imm = 0xFFFFFFFF
addq $0x4, %r12
leal -0x4(%r12), %eax
cmpl $0xffc, %eax            # imm = 0xFFC
jb 0x4350
jmp 0x43d4
movl %r15d, %edi
callq 0x32f0
leaq 0x831d(%rip), %rdi      # 0xc6e2
xorl %ebx, %ebx
movl %r15d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x9230
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: generic_hardware_counter_group
struct counter_group *generic_hardware_counter_group(char *name){
  int i;
  
  struct hardware_counters {
    char *label;
    unsigned int config;
  } hw_counters[] = {
    { "cpu-cycles", PERF_COUNT_HW_CPU_CYCLES },
    { "instructions", PERF_COUNT_HW_INSTRUCTIONS },
    { "branches", PERF_COUNT_HW_BRANCH_INSTRUCTIONS },
    { "branch-misses", PERF_COUNT_HW_BRANCH_MISSES },
  };
  
  struct counter_group *cgroup = calloc(1,sizeof(struct counter_group));
  cgroup->label = strdup(name);
  cgroup->type_id = PERF_TYPE_HARDWARE;
  cgroup->ncounters = sizeof(hw_counters)/sizeof(hw_counters[0]);
  cgroup->cinfo = calloc(cgroup->ncounters,sizeof(struct counter_info));
  for (i=0;i<cgroup->ncounters;i++){
    cgroup->cinfo[i].label = strdup(hw_counters[i].label);
    cgroup->cinfo[i].config = hw_counters[i].config;
  }
  return cgroup;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1, %edi
movl $0x28, %esi
callq 0x3190
movq %rax, %rbx
movq %r14, %rdi
callq 0x32e0
movq %rax, (%rbx)
movl $0x4, 0xc(%rbx)
movl $0x4, %edi
movl $0x58, %esi
callq 0x3190
movq %rax, %r14
movq %rax, 0x18(%rbx)
xorl %r15d, %r15d
leaq 0xc0f0(%rip), %r12      # 0x10d80
movq (%r15,%r12), %rdi
callq 0x32e0
movq %rax, (%r14)
movl 0x8(%r15,%r12), %eax
movq %rax, 0x18(%r14)
addq $0x58, %r14
addq $0x10, %r15
cmpq $0x40, %r15
jne 0x4c90
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: cache_counter_group
struct counter_group *cache_counter_group(char *name,unsigned int mask){
  int i;
  int ncounters = 0;
  int num_counters_available = (nmi_running)?5:6;
  struct counter_group *cgroup = NULL;
  
  for (i=0;i<sizeof(cache_events)/sizeof(cache_events[0]);i++){
    if (mask & cache_events[i].use) ncounters++;
  }
  if (ncounters == 0) return NULL;
  cgroup = calloc(1,sizeof(struct counter_group));
  cgroup->label = strdup("cache");
  cgroup->type_id = PERF_TYPE_HW_CACHE;  
  cgroup->ncounters = ncounters;
  cgroup->cinfo = calloc(cgroup->ncounters,sizeof(struct counter_info));
  cgroup->mask = mask;

  int count = 0;
  unsigned int group_id = -1;
  for (i=0;i<sizeof(cache_events)/sizeof(cache_events[0]);i++){
    if (mask & cache_events[i].use){
      cgroup->cinfo[count].label = cache_events[i].name;
      cgroup->cinfo[count].config = cache_events[i].config;
      if (cpu_info->vendor == VENDOR_AMD){
	if ((count % num_counters_available) == 0)
	  cgroup->cinfo[count].is_group_leader = 1;
      }
      count++;
    }
  }
  return cgroup;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
xorl %r13d, %r13d
movl $0x1c, %ecx
movl 0xd443(%rip), %eax      # 0x12120
leaq 0xd2ac(%rip), %r12      # 0x11f90
movl (%rcx,%r12), %edx
andl %ebx, %edx
cmpl $0x1, %edx
sbbl $-0x1, %r13d
addq $0x20, %rcx
cmpq $0x13c, %rcx            # imm = 0x13C
jne 0x4ce4
xorl %r14d, %r14d
cmpl $0x1, %eax
movl $0x0, %ebp
adcl $0x5, %ebp
testl %r13d, %r13d
je 0x4db0
movl $0x1, %edi
movl $0x28, %esi
callq 0x3190
movq %rax, %r15
leaq 0x7d00(%rip), %rdi      # 0xca2e
callq 0x32e0
movq %rax, (%r15)
movl $0x3, 0x8(%r15)
movl %r13d, 0xc(%r15)
movl %r13d, %edi
movl $0x58, %esi
callq 0x3190
movq %rax, %rcx
movq %rax, 0x18(%r15)
movl %ebx, 0x10(%r15)
leaq 0xe3ff(%rip), %rax      # 0x13160
movq (%rax), %rsi
movl $0x1c, %edi
testl %ebx, (%rdi,%r12)
je 0x4da1
movq -0x14(%rdi,%r12), %rax
movslq %r14d, %rdx
imulq $0x58, %rdx, %r8
movq %rax, (%rcx,%r8)
movq -0xc(%rdi,%r12), %rax
movq %rax, 0x18(%rcx,%r8)
cmpl $0x1, (%rsi)
jne 0x4d9e
movl %r14d, %eax
cltd
idivl %ebp
testl %edx, %edx
jne 0x4d9e
orb $0x1, 0xc(%rcx,%r8)
incl %r14d
addq $0x20, %rdi
cmpq $0x13c, %rdi            # imm = 0x13C
jne 0x4d69
jmp 0x4db3
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: raw_counter_group
struct counter_group *raw_counter_group(char *name,unsigned int mask){
  int i;
  int available_counters = (nmi_running)?5:6;
  
  struct raw_event *events;
  unsigned int num_events;
  switch(cpu_info->vendor){
  case VENDOR_AMD:
    events = amd_raw_events;
    num_events = sizeof(amd_raw_events)/sizeof(amd_raw_events[0]);
    break;
  case VENDOR_INTEL:
    events = intel_raw_events;
    num_events = sizeof(intel_raw_events)/sizeof(intel_raw_events[0]);
    break;
  default:
    return NULL;
  }

  int num_counters = 0;
  for (i=0;i<num_events;i++){
    if (events[i].use & mask) num_counters++;
  }
  
  struct counter_group *cgroup = calloc(1,sizeof(struct counter_group));  
  cgroup->label = strdup(name);
  cgroup->type_id = PERF_TYPE_RAW;
  cgroup->ncounters = num_counters;
  cgroup->cinfo = calloc(cgroup->ncounters,sizeof(struct counter_info));
  cgroup->mask = mask;
  int count = 0;
  for (i=0;i<num_events;i++){
    if (events[i].use & mask){
      cgroup->cinfo[count].label = events[i].name;
      cgroup->cinfo[count].config = events[i].raw.config;
      cgroup->cinfo[count].device_type = events[i].device_type;
      // chunk into multiplex groups if needed
      if (cpu_info->vendor == VENDOR_AMD){
	if (((count % available_counters) == 0) || (events[i].device_type != PERF_TYPE_RAW))
	  cgroup->cinfo[count].is_group_leader = 1;
      }
      count++;
    }
  }
  
  return cgroup;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
xorl %r14d, %r14d
cmpl $0x1, 0xd341(%rip)      # 0x12120
movl $0x0, %ecx
adcl $0x5, %ecx
leaq 0xe372(%rip), %rax      # 0x13160
movq (%rax), %rax
movl (%rax), %r12d
cmpl $0x1, %r12d
je 0x4e13
cmpl $0x2, %r12d
jne 0x4eea
movl $0x16, %r13d
leaq 0xc97f(%rip), %r15      # 0x11790
jmp 0x4e20
movl $0x2a, %r13d
leaq 0xcc30(%rip), %r15      # 0x11a50
movq %rdi, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movl %r13d, %eax
shll $0x5, %eax
xorl %ecx, %ecx
movl 0x14(%r15,%rcx), %edx
andl %ebx, %edx
cmpl $0x1, %edx
sbbl $-0x1, %r14d
addq $0x20, %rcx
cmpq %rcx, %rax
jne 0x4e31
movl $0x1, %edi
movl $0x28, %esi
callq 0x3190
movq %rax, %rbp
movq 0x10(%rsp), %rdi
callq 0x32e0
movq %rax, (%rbp)
movl $0x4, 0x8(%rbp)
movl %r14d, 0xc(%rbp)
movl %r14d, %edi
movl $0x58, %esi
callq 0x3190
movq %rax, %rcx
movq %rax, 0x18(%rbp)
movl %ebx, 0x10(%rbp)
shll $0x5, %r13d
xorl %edi, %edi
xorl %esi, %esi
movl 0xc(%rsp), %r11d
testl %ebx, 0x14(%r15,%rdi)
je 0x4edf
movslq %esi, %rax
imulq $0x58, %rax, %r8
movq (%r15,%rdi), %rax
movq %rax, (%rcx,%r8)
movq 0x18(%r15,%rdi), %rax
movq %rax, 0x18(%rcx,%r8)
movl 0x10(%r15,%rdi), %r9d
movl %r9d, 0x10(%rcx,%r8)
cmpl $0x1, %r12d
jne 0x4edd
movl %esi, %eax
cltd
idivl %r11d
testl %edx, %edx
je 0x4ed7
cmpl $0x4, %r9d
je 0x4edd
orb $0x1, 0xc(%rcx,%r8)
incl %esi
addq $0x20, %rdi
cmpq %rdi, %r13
jne 0x4e97
jmp 0x4eec
xorl %ebp, %ebp
movq %rbp, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: start_counters
void start_counters(struct counter_group *counter_group_list){
  int i,j;
  int status;
  struct counter_group *cgroup;

  for (cgroup = counter_group_list;cgroup;cgroup=cgroup->next){
    debug("Starting %s counters\n",cgroup->label);  
    for (i=0;i<cgroup->ncounters;i++){
      if (cgroup->cinfo[i].fd != -1){
	status = ioctl(cgroup->cinfo[i].fd,PERF_EVENT_IOC_ENABLE,0);
	if (status != 0){
	  error("unable to start %s counter %s, errno=%d,%s\n",
		cgroup->label,cgroup->cinfo[i].label,errno,strerror(errno));
	} else {
	  debug("   started %s counter, name=%s\n",cgroup->label,cgroup->cinfo[i].label);
	}
      }
    }
  }
}

// Assembly:
testq %rdi, %rdi
je 0x53de
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rbx), %rsi
leaq 0x77cd(%rip), %rdi      # 0xcafe
xorl %eax, %eax
callq 0x95da
cmpl $0x0, 0xc(%rbx)
jle 0x53c3
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movl 0x28(%rax,%r15), %edi
cmpl $-0x1, %edi
je 0x53b3
movl $0x2400, %esi           # imm = 0x2400
xorl %edx, %edx
xorl %eax, %eax
callq 0x3110
movq (%rbx), %r13
movq 0x18(%rbx), %rcx
movq (%rcx,%r15), %rbp
testl %eax, %eax
je 0x539f
callq 0x3040
movl (%rax), %r14d
movl %r14d, %edi
callq 0x32f0
leaq 0x778a(%rip), %rdi      # 0xcb14
movq %r13, %rsi
movq %rbp, %rdx
movl %r14d, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x9230
jmp 0x53b3
leaq 0x779a(%rip), %rdi      # 0xcb40
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x95da
incq %r12
movslq 0xc(%rbx), %rax
addq $0x58, %r15
cmpq %rax, %r12
jl 0x5348
movq 0x20(%rbx), %rbx
testq %rbx, %rbx
jne 0x5327
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: check_nmi_watchdog
int check_nmi_watchdog(void){
  int c;
  FILE *fp;
  if ((fp = fopen("/proc/sys/kernel/nmi_watchdog","r")) != NULL){
    c = getc(fp);
    if (c == '1'){
      warning("/proc/sys/kernel/nmi_watchdog is running, missing performance counters\n");
      nmi_running = 1;
    }
    fclose(fp);
  }
}

// Assembly:
pushq %rbx
leaq 0x76c5(%rip), %rdi      # 0xcc11
leaq 0x6dcb(%rip), %rsi      # 0xc31e
callq 0x3250
testq %rax, %rax
je 0x558e
movq %rax, %rbx
movq %rax, %rdi
callq 0x3310
cmpl $0x31, %eax
jne 0x5585
leaq 0x76bb(%rip), %rdi      # 0xcc2f
xorl %eax, %eax
callq 0x9337
movl $0x1, 0xcb9b(%rip)      # 0x12120
movq %rbx, %rdi
popq %rbx
jmp 0x30a0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: find_ci_label
struct counter_info *find_ci_label(struct counter_group *cgroup,char *label){
  int i;
  for (i=0;i<cgroup->ncounters;i++){
    if (!strcmp(cgroup->cinfo[i].label,label)){
      return &cgroup->cinfo[i];
    }
  }
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movslq 0xc(%rdi), %r15
testq %r15, %r15
jle 0x588d
movq %rsi, %r14
movq 0x18(%rdi), %rbx
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x31a0
testl %eax, %eax
je 0x588f
addq $0x58, %rbx
decq %r15
jne 0x5875
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: print_software
void print_software(struct counter_group *cgroup,enum output_format oformat){
  int i;
  struct counter_info *task_info = find_ci_label(cgroup,"task-clock");
  double task_time = (double) task_info->value / 1000000000.0;
  struct counter_info *cinfo;
  if (oformat == PRINT_CSV_HEADER){
    return;
  }
  for (i=0;i<cgroup->ncounters;i++){
    fprintf(outfile,"%-20s %-14lu",cgroup->cinfo[i].label,cgroup->cinfo[i].value);
    if (!strcmp(cgroup->cinfo[i].label,"task-clock") ||
	!strcmp(cgroup->cinfo[i].label,"cpu-clock")){
      fprintf(outfile," # %4.3f seconds",
	     (double) cgroup->cinfo[i].value / 1000000000.0);
    } else {
      fprintf(outfile," # %4.3f/sec",cgroup->cinfo[i].value / task_time);
	     
    }
    fprintf(outfile,"\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x4120(%rip), %rsi      # 0xc942
callq 0x5860
cmpl $0x2, %ebp
je 0x8955
cmpl $0x0, 0xc(%rbx)
jle 0x8955
movsd 0x30(%rax), %xmm0
unpcklps 0x30fa(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x3102(%rip), %xmm0     # 0xb950
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x2986(%rip), %xmm1     # 0xb1e8
movapd %xmm1, (%rsp)
movl $0x30, %r12d
leaq 0x9884(%rip), %r13      # 0x120f8
xorl %r14d, %r14d
movq (%r13), %rdi
movq 0x18(%rbx), %rax
movq -0x30(%rax,%r12), %rdx
movq (%rax,%r12), %rcx
leaq 0x518d(%rip), %rsi      # 0xda1c
xorl %eax, %eax
callq 0x31c0
movq 0x18(%rbx), %r15
movq -0x30(%r15,%r12), %rbp
movq %rbp, %rdi
leaq 0x4099(%rip), %rsi      # 0xc942
callq 0x31a0
testl %eax, %eax
je 0x88f8
movq %rbp, %rdi
leaq 0x407c(%rip), %rsi      # 0xc938
callq 0x31a0
testl %eax, %eax
je 0x88f8
movq (%r13), %rdi
movsd (%r15,%r12), %xmm1
unpcklps 0x306a(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x3072(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
leaq 0x5144(%rip), %rsi      # 0xda3a
jmp 0x892c
movq (%r13), %rdi
movsd (%r15,%r12), %xmm1
unpcklps 0x3037(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x303f(%rip), %xmm1     # 0xb950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x28c3(%rip), %xmm0     # 0xb1e8
leaq 0x50fd(%rip), %rsi      # 0xda29
movb $0x1, %al
callq 0x31c0
movq (%r13), %rsi
movl $0xa, %edi
callq 0x3150
incq %r14
movslq 0xc(%rbx), %rax
addq $0x58, %r12
cmpq %rax, %r14
jl 0x8877
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/topdown.c
// Function: timer_callback
void timer_callback(int signum){
  int i;
  struct rusage rusage;
  double elapsed;

  clock_gettime(CLOCK_REALTIME,&finish_time);
  elapsed = finish_time.tv_sec + finish_time.tv_nsec / 1000000000.0 -
    start_time.tv_sec - start_time.tv_nsec / 1000000000.0;

  if (sflag) read_system();
  read_counters(cpu_info->systemwide_counters,0);

  if (csvflag){
    fprintf(outfile,"%4.1f,",elapsed);
  }

  if (sflag){
    print_system(csvflag?PRINT_CSV:PRINT_NORMAL);
  }
  
  print_metrics(cpu_info->systemwide_counters,csvflag?PRINT_CSV:PRINT_NORMAL);
  if (csvflag) fprintf(outfile,"\n");

  if (is_still_running){
    alarm(interval);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
leaq 0xa5db(%rip), %rsi      # 0x13140
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x3070
cvtsi2sdq 0xa5c9(%rip), %xmm0 # 0x13140
movsd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0xa5bf(%rip), %xmm0 # 0x13148
movsd %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0xa5b5(%rip), %xmm0 # 0x13150
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0xa5ab(%rip), %xmm0 # 0x13158
movsd %xmm0, 0x18(%rsp)
leaq 0x9516(%rip), %r15      # 0x120d0
cmpl $0x0, (%r15)
je 0x8bc5
callq 0x9909
leaq 0xa594(%rip), %r14      # 0x13160
movq (%r14), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
callq 0x53df
leaq 0x94f7(%rip), %rbx      # 0x120d8
cmpl $0x0, (%rbx)
je 0x8c2c
movsd 0x25fa(%rip), %xmm1     # 0xb1e8
movsd 0x20(%rsp), %xmm0
divsd %xmm1, %xmm0
addsd 0x10(%rsp), %xmm0
subsd 0x8(%rsp), %xmm0
movsd 0x18(%rsp), %xmm2
divsd %xmm1, %xmm2
subsd %xmm2, %xmm0
leaq 0x94df(%rip), %rax      # 0x120f8
movq (%rax), %rdi
leaq 0x450c(%rip), %rsi      # 0xd12f
movb $0x1, %al
callq 0x31c0
movl (%rbx), %ebp
cmpl $0x0, (%r15)
je 0x8c41
xorl %edi, %edi
testl %ebp, %ebp
setne %dil
callq 0x9cca
movl (%rbx), %ebp
movq (%r14), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
testl %ebp, %ebp
setne %sil
callq 0x8964
cmpl $0x0, (%rbx)
je 0x8c6e
leaq 0x9497(%rip), %rax      # 0x120f8
movq (%rax), %rsi
movl $0xa, %edi
callq 0x3150
cmpl $0x0, 0x94bf(%rip)      # 0x12134
je 0x8c8f
leaq 0x945e(%rip), %rax      # 0x120dc
movl (%rax), %edi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3120
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/system.c
// Function: setup_net_info
void setup_net_info(void){
  FILE *fp;
  char buffer[1024];
  char *p,*p2;
  int i;
  int count = 0;
  if (fp = fopen("/proc/net/dev","r")){
    // process once to count the number of lines with ':'
    while (fgets(buffer,sizeof(buffer),fp) != NULL){
      p = strchr(buffer,':');
      if (p == NULL) continue;
      count++;
    }

    rewind(fp);
    system_state.num_net = count;
    system_state.netinfo = calloc(count,sizeof(struct netinfo));

    // process again to count create device entries
    count = 0;
    while (fgets(buffer,sizeof(buffer),fp) != NULL){
      p = strchr(buffer,':');
      if (p == NULL) continue;      
      *p = 0;
      p2 = buffer;
      while (isspace(*p2)) p2++;
      system_state.netinfo[count].name = strdup(p2);
      count++;
    }
    fclose(fp);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
leaq 0x4362(%rip), %rdi      # 0xdb6c
leaq 0x2b0d(%rip), %rsi      # 0xc31e
callq 0x3250
testq %rax, %rax
je 0x98f9
movq %rax, %rbx
movq %rsp, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rax, %rdx
callq 0x3170
xorl %ebp, %ebp
testq %rax, %rax
je 0x9865
movq %rsp, %r14
movq %r14, %rdi
movl $0x3a, %esi
callq 0x30d0
cmpq $0x1, %rax
sbbl $-0x1, %ebp
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0x3170
testq %rax, %rax
jne 0x983c
movq %rbx, %rdi
callq 0x30e0
movl %ebp, 0x999d(%rip)      # 0x13210
movl %ebp, %edi
movl $0x20, %esi
callq 0x3190
movq %rax, 0x9992(%rip)      # 0x13218
leaq -0x1(%rsp), %r15
xorl %r12d, %r12d
movq %rsp, %r14
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0x3170
testq %rax, %rax
je 0x98f1
movq %r14, %rdi
movl $0x3a, %esi
callq 0x30d0
testq %rax, %rax
je 0x9891
movb $0x0, (%rax)
callq 0x3350
movq (%rax), %rax
movq %r15, %rdi
movsbq 0x1(%rdi), %rcx
incq %rdi
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x98c6
callq 0x32e0
movq 0x9937(%rip), %rcx      # 0x13218
movq %r12, %rdx
shlq $0x5, %rdx
movq %rax, (%rcx,%rdx)
incq %r12
jmp 0x9891
movq %rbx, %rdi
callq 0x30a0
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ikbenlike[P]nngutils/src/printenv.c
// Function: main
int main(int argc, char **argv){
    char *var;
    int ret = 0;
    if(argc == 1){
        for(int i = 0; environ[i] != NULL; i++){
            puts(environ[i]);
        }
    }
    else if(!strcmp(argv[1], "-0") || !strcmp(argv[1], "--null")){
        for(int i = 2; i < argc; i++){
            var = getenv(argv[i]);
            if(var == NULL){
                ret = 1;
                continue;
            }
            else {
                fprintf(stdout, "%s", var);
                putchar('\0');
            }
        }
    }
    else {
        for(int i = 1; i < argc; i++){
            var = getenv(argv[i]);
            if(var == NULL){
                ret = 1;
                continue;
            }
            else {
                fprintf(stdout, "%s\n", var);
            }
        }
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x1, %edi
jne 0x11d8
movq 0x2e42(%rip), %rbx      # 0x3fe8
movq (%rbx), %rax
movq (%rax), %rdi
xorl %r14d, %r14d
testq %rdi, %rdi
je 0x12a6
movl $0x8, %r15d
callq 0x1050
movq (%rbx), %rax
movq (%rax,%r15), %rdi
addq $0x8, %r15
testq %rdi, %rdi
jne 0x11be
jmp 0x12a6
movq %rsi, %rbx
movl %edi, %r14d
movq 0x8(%rsi), %rdi
cmpb $0x2d, (%rdi)
jne 0x11f3
cmpb $0x30, 0x1(%rdi)
jne 0x11f3
cmpb $0x0, 0x2(%rdi)
je 0x1257
leaq 0xe0a(%rip), %rsi       # 0x2004
callq 0x1070
testl %eax, %eax
je 0x1257
cmpl $0x2, %r14d
jl 0x12a3
movl %r14d, %r12d
movl $0x1, %r13d
leaq 0xdee(%rip), %r15       # 0x200b
xorl %r14d, %r14d
movq (%rbx,%r13,8), %rdi
callq 0x1030
testq %rax, %rax
je 0x1247
movq 0x2da3(%rip), %rcx      # 0x3fd8
movq (%rcx), %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1080
jmp 0x124d
movl $0x1, %r14d
incq %r13
cmpq %r13, %r12
jne 0x1220
jmp 0x12a6
cmpl $0x3, %r14d
jl 0x12a3
movl %r14d, %r15d
xorl %r14d, %r14d
movl $0x2, %r12d
movq 0x2d68(%rip), %r13      # 0x3fd8
movq (%rbx,%r12,8), %rdi
callq 0x1030
testq %rax, %rax
je 0x1293
movq (%r13), %rsi
movq %rax, %rdi
callq 0x1060
xorl %edi, %edi
callq 0x1040
jmp 0x1299
movl $0x1, %r14d
incq %r12
cmpq %r12, %r15
jne 0x1270
jmp 0x12a6
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/agl[P]obstcp/obstcp-tlsadvert.c
// Function: main
int
main(int argc, char **argv) {
  if (argc > 2) return usage(argv[0]);

  unsigned long portnum;
  if (argc == 2) {
    char *endptr;
    portnum = strtoul(argv[1], &endptr, 10);
    if (*endptr) {
      fprintf(stderr, "Not a valid number: %s\n", argv[1]);
      return usage(argv[0]);
    }

    if (portnum < 1 || portnum > 65535) {
      fprintf(stderr, "Not a valid port number (1..65535): %d\n", (int) portnum);
      return usage(argv[0]);
    }
  } else {
    portnum = 443;
  }

  char output[512];
  const int r = obstcp_advert_base32_create(output, sizeof(output), NULL,
                                            OBSTCP_ADVERT_TLSPORT, (int) portnum,
                                            OBSTCP_ADVERT_END);
  if (r >= sizeof(output)) {
    fprintf(stderr, "Advert too large\n");
    return 1;
  } else if (r < 0) {
    perror("Error creating advert");
    return 1;
  }

  output[r] = 0;
  fprintf(stderr, "Port: %d\n", (int) portnum);
  fprintf(stderr, "Advert: %s\n", output);

  char dnsadvert[512];
  if (obstcp_advert_cname_encode_sz(r) > sizeof(dnsadvert)) {
    fprintf(stderr, "Cannot print DNS advert");
  } else {
    obstcp_advert_cname_encode(dnsadvert, output, r);
    dnsadvert[obstcp_advert_cname_encode_sz(r)] = 0;
    fprintf(stderr, "DNS Advert: %s\n", dnsadvert);
  }

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsi, %rbx
cmpl $0x3, %edi
jl 0x131d
movq %rbx, %rdi
callq 0x11ee
jmp 0x13d5
movl $0x1bb, %r14d           # imm = 0x1BB
cmpl $0x2, %edi
jne 0x1376
movq 0x8(%rbx), %rdi
movq %rsp, %r15
movq %r15, %rsi
movl $0xa, %edx
callq 0x10d0
movq %rax, %r14
movq (%r15), %rax
cmpb $0x0, (%rax)
jne 0x13b1
movq $-0x10000, %rax         # imm = 0xFFFF0000
movq %r14, %rcx
addq %rax, %rcx
cmpq %rax, %rcx
ja 0x1376
movq 0x8c98(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x5cb2(%rip), %rsi      # 0x701c
movl %r14d, %edx
xorl %eax, %eax
callq 0x10a0
jmp 0x13ba
xorl %ebx, %ebx
movq %rsp, %rdi
movl $0x200, %esi            # imm = 0x200
xorl %edx, %edx
movl $0x2, %ecx
movl %r14d, %r8d
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x1591
cmpl $0x200, %eax            # imm = 0x200
jb 0x13a2
callq 0x11cc
jmp 0x13d5
movq %rsp, %rsi
movl %eax, %edi
movl %r14d, %edx
callq 0x111e
jmp 0x13da
leaq 0x8(%rbx), %rdi
callq 0x1100
movq (%rbx), %rdx
movq 0x8c34(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x5cba(%rip), %rsi      # 0x7088
xorl %eax, %eax
callq 0x10a0
movl $0x1, %ebx
movl %ebx, %eax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/agl[P]obstcp/libobstcp.c
// Function: obstcp_advert_create
int EXPORTED
obstcp_advert_create(uint8_t *output, unsigned length,
                            const struct obstcp_keys *keys, ...) {
  va_list ap;
  va_start(ap, keys);

  const int r = advert_create(output, length, keys, ap);
  va_end(ap);

  return r;
}

// Assembly:
subq $0xd8, %rsp
leaq 0x20(%rsp), %r10
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x143f
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %r10, 0x10(%rcx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rcx)
callq 0x146c
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/agl[P]obstcp/libobstcp.c
// Function: advert_create
static int
advert_create(uint8_t *output, unsigned length,
              const struct obstcp_keys *keys, va_list ap) {
  uint8_t advert[384];
  unsigned j = 0;

  if (keys && !keys->keys) {
    errno = ENOKEY;
    return -1;
  }

  if (keys) {
    if (!varint_put(advert, sizeof(advert), &j, OBSTCP_KIND_PUBLIC << 1 | 1)) goto spc;
    if (!varint_put(advert, sizeof(advert), &j, 32)) goto spc;
    if (!buffer_put(advert, sizeof(advert), &j, keys->keys->public_key, 32)) goto spc;
  }

  for (;;) {
    const int type = va_arg(ap, int);
    int port, op;
    uint16_t port16;

    switch (type) {
    case OBSTCP_ADVERT_END:
      break;
    case OBSTCP_ADVERT_OBSPORT:
    case OBSTCP_ADVERT_TLSPORT:
      port = va_arg(ap, int);
      if (port < 1 || port > 65535) {
        errno = EINVAL;
        return -1;
      }

      port16 = htons(port);
      op = type == OBSTCP_ADVERT_OBSPORT ? OBSTCP_KIND_OBSPORT :
                                           OBSTCP_KIND_TLSPORT;
      if (!varint_put(advert, sizeof(advert), &j, op << 1 | 1)) goto spc;
      if (!varint_put(advert, sizeof(advert), &j, 2)) goto spc;
      if (!buffer_put(advert, sizeof(advert), &j, &port16, 2)) goto spc;
      break;
    default:
      errno = EINVAL;
      return -1;
    }

    if (type == OBSTCP_ADVERT_END) break;
  }

  if (j <= length)
    memcpy(output, advert, j);

  return j;

 spc:
  errno = E2BIG;
  return -1;
}

// Assembly:
pushq %rbx
subq $0x180, %rsp            # imm = 0x180
testq %rdx, %rdx
je 0x14a4
movq (%rdx), %rax
testq %rax, %rax
je 0x1553
movw $0x2001, (%rsp)         # imm = 0x2001
movups 0x20(%rax), %xmm0
movups 0x30(%rax), %xmm1
movups %xmm0, 0x2(%rsp)
movups %xmm1, 0x12(%rsp)
movl $0x22, %ebx
jmp 0x14a6
xorl %ebx, %ebx
movl (%rcx), %eax
movl $0xffff0000, %edx       # imm = 0xFFFF0000
cmpl $0x28, %eax
ja 0x14c0
movl %eax, %r8d
addq 0x10(%rcx), %r8
addl $0x8, %eax
movl %eax, (%rcx)
jmp 0x14cc
movq 0x8(%rcx), %r8
leaq 0x8(%r8), %r9
movq %r9, 0x8(%rcx)
movl (%r8), %r8d
leal -0x1(%r8), %r9d
cmpl $0x2, %r9d
jae 0x1560
cmpl $0x28, %eax
ja 0x14f0
movl %eax, %r9d
addq 0x10(%rcx), %r9
addl $0x8, %eax
movl %eax, (%rcx)
jmp 0x14fc
movq 0x8(%rcx), %r9
leaq 0x8(%r9), %r10
movq %r10, 0x8(%rcx)
movl (%r9), %r9d
leal (%r9,%rdx), %r10d
cmpl %edx, %r10d
jbe 0x1576
cmpq $0x17f, %rbx            # imm = 0x17F
ja 0x1546
cmpl $0x1, %r8d
setne %r8b
addb %r8b, %r8b
addb $0x7, %r8b
movb %r8b, (%rsp,%rbx)
movb $0x2, 0x1(%rsp,%rbx)
cmpq $0x17c, %rbx            # imm = 0x17C
ja 0x1546
rolw $0x8, %r9w
movw %r9w, 0x2(%rsp,%rbx)
addq $0x4, %rbx
jmp 0x14ad
callq 0x1050
movl $0x7, (%rax)
jmp 0x1581
callq 0x1050
movl $0x7e, (%rax)
jmp 0x1581
testl %r8d, %r8d
jne 0x1576
cmpl %esi, %ebx
ja 0x1586
movq %rsp, %rsi
movq %rbx, %rdx
callq 0x10b0
jmp 0x1586
callq 0x1050
movl $0x16, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/agl[P]obstcp/libobstcp.c
// Function: obstcp_advert_base32_create
int EXPORTED
obstcp_advert_base32_create(char *output, unsigned length,
                            const struct obstcp_keys *keys, ...) {
  uint8_t advert[384];
  va_list ap;
  va_start(ap, keys);

  const int ret = advert_create(advert, sizeof(advert), keys, ap);
  va_end(ap);

  if (ret > sizeof(advert)) {
    goto spc;
  } else if (ret == -1) {
    return -1;
  }

  const unsigned outlen = base32_encode_length(ret);
  if (outlen <= length) {
    base32_encode(output, advert, ret);
  }
  return outlen;

 spc:
  errno = E2BIG;
  return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x15ef
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rsi, 0x10(%rcx)
leaq 0x280(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rcx)
leaq 0xd0(%rsp), %rdi
movl $0x180, %esi            # imm = 0x180
callq 0x146c
cmpl $0x180, %eax            # imm = 0x180
jbe 0x163b
callq 0x1050
movl $0x7, (%rax)
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x165f
movl %eax, %r15d
movl %eax, %edi
callq 0x580a
movl %eax, %r14d
cmpl %ebp, %eax
ja 0x165f
leaq 0xd0(%rsp), %rsi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x581f
movl %r14d, %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/agl[P]obstcp/libobstcp.c
// Function: obstcp_advert_base32_parse
int EXPORTED
obstcp_advert_base32_parse(const char *input, unsigned length, ...) {
  va_list ap;
  va_start(ap, length);
  uint8_t advert[384];
  const unsigned decoded_length = base32_decode_length(length);

  if (decoded_length > sizeof(advert)) return 0;
  if (!base32_decode(advert, input, length)) return 0;

  const int r = advert_parse(advert, decoded_length, ap);
  va_end(ap);

  return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movl %esi, %ebx
movq %rdi, %r14
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x192d
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x280(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
movl %ebx, %edi
callq 0x5794
xorl %ebp, %ebp
cmpl $0x180, %eax            # imm = 0x180
ja 0x198b
movl %eax, %r15d
leaq 0xd0(%rsp), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x579b
testl %eax, %eax
je 0x198b
leaq 0xd0(%rsp), %rdi
movq %rsp, %rdx
movl %r15d, %esi
callq 0x16f4
movl %eax, %ebp
movl %ebp, %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r14
popq %r15
popq %rbp
retq