LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x741e(%rip), %rdi      # 0xb67f
xorl %eax, %eax
callq 0x93c0
leaq 0x4(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3250
movl (%r14), %eax
movl %eax, %ecx
andl $0x7f, %ecx
je 0x42a7
shll $0x18, %ecx
addl $0x1000000, %ecx        # imm = 0x1000000
cmpl $0x2000000, %ecx        # imm = 0x2000000
jl 0x42b5
movzbl %ah, %esi
leaq 0x7412(%rip), %rdi      # 0xb6b0
xorl %eax, %eax
callq 0x8f2f
jmp 0x42b5
leaq 0x73df(%rip), %rdi      # 0xb68d
xorl %eax, %eax
callq 0x8f2f
movl $0x4200, %edi           # imm = 0x4200
movl %ebx, %esi
xorl %edx, %edx
movl $0x10004f, %ecx         # imm = 0x10004F
xorl %eax, %eax
callq 0x3230
movl %eax, 0x4(%rsp)
leaq 0xce27(%rip), %rax      # 0x110fc
cmpl $0x0, (%rax)
pushq $0x7
popq %rax
pushq $0x18
popq %rdi
cmovel %eax, %edi
movl %ebx, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3230
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
pushq $0x2
popq %r15
leaq 0xce3f(%rip), %rbx      # 0x11150
xorl %r13d, %r13d
leaq (%r14,%r13), %rdx
movl %r15d, %edi
movl %ebp, %esi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3230
cmpq $-0x1, %rax
je 0x4352
movl %eax, (%r13,%rbx)
testb %al, %al
je 0x4394
movl %eax, %ecx
andl $0xff00, %ecx           # imm = 0xFF00
je 0x4394
movl %eax, %ecx
andl $0xff0000, %ecx         # imm = 0xFF0000
je 0x4394
andl $0xff000000, %eax       # imm = 0xFF000000
jne 0x4365
jmp 0x4394
callq 0x3040
movl (%rax), %r12d
testl %r12d, %r12d
jne 0x4376
orl $-0x1, (%r13,%rbx)
addq $0x4, %r13
leal -0x4(%r13), %eax
cmpl $0xffc, %eax            # imm = 0xFFC
jb 0x4314
jmp 0x4394
movl %r12d, %edi
callq 0x3300
leaq 0x735d(%rip), %rdi      # 0xb6e2
xorl %ebx, %ebx
movl %r12d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x901e
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_O2/mvermeulen[P]wspy/topdown.c
// Function: software_counter_group
struct counter_group *software_counter_group(char *name){
  int i;
  
  struct software_counters {
    char *label;
    unsigned int config;
  } sw_counters[] = {
    { "cpu-clock", PERF_COUNT_SW_CPU_CLOCK },
    { "task-clock", PERF_COUNT_SW_TASK_CLOCK },    
    { "page faults", PERF_COUNT_SW_PAGE_FAULTS },
    { "context switches", PERF_COUNT_SW_CONTEXT_SWITCHES },
    { "cpu migrations", PERF_COUNT_SW_CPU_MIGRATIONS },
    { "major page faults", PERF_COUNT_SW_PAGE_FAULTS_MAJ },
    { "minor page faults", PERF_COUNT_SW_PAGE_FAULTS_MIN },
    { "alignment faults", PERF_COUNT_SW_ALIGNMENT_FAULTS },
    { "emulation faults", PERF_COUNT_SW_EMULATION_FAULTS },
  };
  
  struct counter_group *cgroup = calloc(1,sizeof(struct counter_group));
  cgroup->label = strdup(name);
  cgroup->type_id = PERF_TYPE_SOFTWARE;
  cgroup->ncounters = sizeof(sw_counters)/sizeof(sw_counters[0]);
  cgroup->cinfo = calloc(cgroup->ncounters,sizeof(struct counter_info));
  for (i=0;i<cgroup->ncounters;i++){
    cgroup->cinfo[i].label = strdup(sw_counters[i].label);
    cgroup->cinfo[i].config = sw_counters[i].config;
  }
  return cgroup;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x3190
movq %rax, %rbx
movq %r14, %rdi
callq 0x32f0
movq %rax, (%rbx)
movabsq $0x900000001, %rax      # imm = 0x900000001
movq %rax, 0x8(%rbx)
pushq $0x9
popq %rdi
pushq $0x58
popq %rsi
callq 0x3190
movq %rax, %r14
movq %rax, 0x18(%rbx)
pushq $0x8
popq %r15
leaq 0xb14b(%rip), %r12      # 0xfcf0
cmpq $0x98, %r15
je 0x4bcd
movq -0x8(%r15,%r12), %rdi
callq 0x32f0
movq %rax, (%r14)
movl (%r15,%r12), %eax
movq %rax, 0x18(%r14)
addq $0x10, %r15
addq $0x58, %r14
jmp 0x4ba5
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x3190
movq %rax, %rbx
movq %r14, %rdi
callq 0x32f0
movq %rax, (%rbx)
movl $0x4, 0xc(%rbx)
pushq $0x4
popq %rdi
pushq $0x58
popq %rsi
callq 0x3190
movq %rax, %r14
movq %rax, 0x18(%rbx)
xorl %r15d, %r15d
leaq 0xb15d(%rip), %r12      # 0xfd80
cmpq $0x40, %r15
je 0x4c48
movq (%r15,%r12), %rdi
callq 0x32f0
movq %rax, (%r14)
movl 0x8(%r15,%r12), %eax
movq %rax, 0x18(%r14)
addq $0x10, %r15
addq $0x58, %r14
jmp 0x4c23
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1c
popq %rcx
movl 0xc4c0(%rip), %eax      # 0x11130
leaq 0xc329(%rip), %r12      # 0x10fa0
cmpq $0x13c, %rcx            # imm = 0x13C
je 0x4c93
movl (%rcx,%r12), %edx
andl %ebx, %edx
cmpl $0x1, %edx
sbbl $-0x1, %r13d
addq $0x20, %rcx
jmp 0x4c77
xorl %r14d, %r14d
cmpl $0x1, %eax
movl $0x0, %ebp
adcl $0x5, %ebp
testl %r13d, %r13d
je 0x4d3d
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x3190
movq %rax, %r15
leaq 0x6d6f(%rip), %rdi      # 0xba2e
callq 0x32f0
movq %rax, (%r15)
movl $0x3, 0x8(%r15)
movl %r13d, 0xc(%r15)
movl %r13d, %edi
pushq $0x58
popq %rsi
callq 0x3190
movq %rax, %rcx
movq %rax, 0x18(%r15)
movl %ebx, 0x10(%r15)
leaq 0xd480(%rip), %rax      # 0x12170
movq (%rax), %rsi
pushq $0x1c
popq %rdi
cmpq $0x13c, %rdi            # imm = 0x13C
je 0x4d40
testl %ebx, (%rdi,%r12)
je 0x4d37
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 0x4d34
movl %r14d, %eax
cltd
idivl %ebp
testl %edx, %edx
jne 0x4d34
orb $0x1, 0xc(%rcx,%r8)
incl %r14d
addq $0x20, %rdi
jmp 0x4cf6
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_O2/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, 0xc3c4(%rip)      # 0x11130
movl $0x0, %r8d
adcl $0x5, %r8d
leaq 0xd3f3(%rip), %rax      # 0x12170
movq (%rax), %rax
movl (%rax), %r12d
cmpl $0x1, %r12d
je 0x4da0
cmpl $0x2, %r12d
jne 0x4e72
pushq $0x16
popq %r13
leaq 0xba02(%rip), %r15      # 0x107a0
jmp 0x4dab
pushq $0x2a
popq %r13
leaq 0xbcb5(%rip), %r15      # 0x10a60
movl %r13d, %eax
shll $0x5, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x4dcc
movl 0x14(%r15,%rcx), %edx
andl %ebx, %edx
cmpl $0x1, %edx
sbbl $-0x1, %r14d
addq $0x20, %rcx
jmp 0x4db3
movq %rdi, 0x10(%rsp)
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
movl %r8d, 0xc(%rsp)
callq 0x3190
movq %rax, %rbp
movq 0x10(%rsp), %rdi
callq 0x32f0
movq %rax, (%rbp)
movl $0x4, 0x8(%rbp)
movl %r14d, 0xc(%rbp)
movl %r14d, %edi
pushq $0x58
popq %rsi
callq 0x3190
movl 0xc(%rsp), %r11d
movq %rax, %rcx
movq %rax, 0x18(%rbp)
movl %ebx, 0x10(%rbp)
shll $0x5, %r13d
xorl %edi, %edi
xorl %esi, %esi
cmpq %rdi, %r13
je 0x4e74
testl %ebx, 0x14(%r15,%rdi)
je 0x4e6c
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 0x4e6a
movl %esi, %eax
cltd
idivl %r11d
testl %edx, %edx
je 0x4e64
cmpl $0x4, %r9d
je 0x4e6a
orb $0x1, 0xc(%rcx,%r8)
incl %esi
addq $0x20, %rdi
jmp 0x4e1f
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_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rbx, %rbx
je 0x5333
movq (%rbx), %rsi
leaq 0x685e(%rip), %rdi      # 0xbafe
xorl %eax, %eax
callq 0x93c0
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0xc(%rbx), %rax
cmpq %rax, %r12
jge 0x532a
movq 0x18(%rbx), %rax
movl 0x28(%rax,%r15), %edi
cmpl $-0x1, %edi
je 0x5321
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 0x530d
callq 0x3040
movl (%rax), %r14d
movl %r14d, %edi
callq 0x3300
leaq 0x681c(%rip), %rdi      # 0xbb14
movq %r13, %rsi
movq %rbp, %rdx
movl %r14d, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x901e
jmp 0x5321
leaq 0x682c(%rip), %rdi      # 0xbb40
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x93c0
incq %r12
addq $0x58, %r15
jmp 0x52ad
movq 0x20(%rbx), %rbx
jmp 0x528d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x6776(%rip), %rdi      # 0xbc11
leaq 0x5e7c(%rip), %rsi      # 0xb31e
callq 0x3260
testq %rax, %rax
je 0x54dd
movq %rax, %rbx
movq %rax, %rdi
callq 0x3320
cmpl $0x31, %eax
jne 0x54d4
leaq 0x676c(%rip), %rdi      # 0xbc2f
xorl %eax, %eax
callq 0x9121
movl $0x1, 0xbc5c(%rip)      # 0x11130
movq %rbx, %rdi
popq %rbx
jmp 0x30a0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl 0xc(%rdi), %eax
xorl %ebx, %ebx
testl %eax, %eax
cmovlel %ebx, %eax
imulq $0x58, %rax, %r12
pushq $-0x58
popq %rcx
leaq 0x58(%rcx), %r13
cmpq %r13, %r12
je 0x57b8
movq 0x18(%r15), %rbp
movq 0x58(%rbp,%rcx), %rdi
movq %r14, %rsi
callq 0x31a0
movq %r13, %rcx
testl %eax, %eax
jne 0x5791
addq %r13, %rbp
movq %rbp, %rbx
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_O2/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 0x3257(%rip), %rsi      # 0xb942
callq 0x576f
cmpl $0x2, %ebp
jne 0x8704
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x30(%rax), %xmm0
unpcklps 0x2230(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2238(%rip), %xmm0     # 0xa950
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x1abc(%rip), %xmm1     # 0xa1e8
movapd %xmm1, (%rsp)
pushq $0x30
popq %r13
leaq 0x89cc(%rip), %r14      # 0x11108
xorl %r15d, %r15d
movslq 0xc(%rbx), %rax
cmpq %rax, %r15
jge 0x86f5
movq (%r14), %rdi
movq 0x18(%rbx), %rax
movq -0x30(%rax,%r13), %rdx
movq (%rax,%r13), %rcx
leaq 0x42bd(%rip), %rsi      # 0xca1c
xorl %eax, %eax
callq 0x31c0
movq 0x18(%rbx), %rbp
movq -0x30(%rbp,%r13), %r12
movq %r12, %rdi
leaq 0x31c9(%rip), %rsi      # 0xb942
callq 0x31a0
testl %eax, %eax
je 0x87c8
movq %r12, %rdi
leaq 0x31ac(%rip), %rsi      # 0xb938
callq 0x31a0
testl %eax, %eax
je 0x87c8
movq (%r14), %rdi
movsd (%rbp,%r13), %xmm1
unpcklps 0x219a(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x21a2(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
leaq 0x4274(%rip), %rsi      # 0xca3a
jmp 0x87fc
movq (%r14), %rdi
movsd (%rbp,%r13), %xmm1
unpcklps 0x2167(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x216f(%rip), %xmm1     # 0xa950
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x19f3(%rip), %xmm0     # 0xa1e8
leaq 0x422d(%rip), %rsi      # 0xca29
movb $0x1, %al
callq 0x31c0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x3150
incq %r15
addq $0x58, %r13
jmp 0x873f
// File: /workspace/github_c_makefile_star2_O2/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 0x97bb(%rip), %rsi      # 0x12150
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x3070
cvtsi2sdq 0x97a9(%rip), %xmm0 # 0x12150
movsd %xmm0, 0x10(%rsp)
cvtsi2sdq 0x97a2(%rip), %xmm0 # 0x12158
movsd %xmm0, 0x20(%rsp)
cvtsi2sdq 0x979b(%rip), %xmm0 # 0x12160
movsd %xmm0, 0x8(%rsp)
cvtsi2sdq 0x9794(%rip), %xmm0 # 0x12168
movsd %xmm0, 0x18(%rsp)
leaq 0x86ff(%rip), %r15      # 0x110e0
cmpl $0x0, (%r15)
je 0x89ec
callq 0x96d4
leaq 0x977d(%rip), %r14      # 0x12170
movq (%r14), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
callq 0x5342
leaq 0x86e0(%rip), %rbx      # 0x110e8
cmpl $0x0, (%rbx)
je 0x8a53
movsd 0x17d3(%rip), %xmm1     # 0xa1e8
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 0x86c8(%rip), %rax      # 0x11108
movq (%rax), %rdi
leaq 0x36e5(%rip), %rsi      # 0xc12f
movb $0x1, %al
callq 0x31c0
movl (%rbx), %ebp
cmpl $0x0, (%r15)
je 0x8a68
xorl %edi, %edi
testl %ebp, %ebp
setne %dil
callq 0x9a3e
movl (%rbx), %ebp
movq (%r14), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
testl %ebp, %ebp
setne %sil
callq 0x881a
cmpl $0x0, (%rbx)
je 0x8a93
leaq 0x8680(%rip), %rax      # 0x11108
movq (%rax), %rsi
pushq $0xa
popq %rdi
callq 0x3150
cmpl $0x0, 0x86aa(%rip)      # 0x11144
je 0x8ab4
leaq 0x8649(%rip), %rax      # 0x110ec
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_O2/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 0x3586(%rip), %rdi      # 0xcb6c
leaq 0x1d31(%rip), %rsi      # 0xb31e
callq 0x3260
testq %rax, %rax
je 0x96c4
movq %rax, %rbx
xorl %r15d, %r15d
movq %rsp, %r14
pushq $0x3a
popq %rbp
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0x3170
testq %rax, %rax
je 0x9630
movq %r14, %rdi
movl %ebp, %esi
callq 0x30d0
cmpq $0x1, %rax
sbbl $-0x1, %r15d
jmp 0x9607
movq %rbx, %rdi
callq 0x30e0
movl %r15d, 0x8be1(%rip)     # 0x12220
movl %r15d, %edi
pushq $0x20
popq %rsi
callq 0x3190
movq %rax, 0x8bd7(%rip)      # 0x12228
leaq -0x1(%rsp), %r15
xorl %r12d, %r12d
movq %rsp, %r14
pushq $0x3a
popq %rbp
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0x3170
testq %rax, %rax
je 0x96bc
movq %r14, %rdi
movl %ebp, %esi
callq 0x30d0
testq %rax, %rax
je 0x965f
movb $0x0, (%rax)
callq 0x3360
movq (%rax), %rax
movq %r15, %rdi
movsbq 0x1(%rdi), %rcx
incq %rdi
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x9691
callq 0x32f0
movq 0x8b7c(%rip), %rcx      # 0x12228
movq %r12, %rdx
shlq $0x5, %rdx
movq %rax, (%rcx,%rdx)
incq %r12
jmp 0x965f
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_O2/tsoding[P]x11-double-buffering/././db_pixmap.c
// Function: db_init
void db_init(DB *db, Display *display, Window window)
{
    db->display = display;
    db->window = window;
    db->gc = XCreateGC(display, window, 0, NULL);
    db->back_buffer = XCreatePixmap(display, window, WIDTH, HEIGHT, 24);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, (%rdi)
movq %rdx, 0x8(%rdi)
movq %rsi, %rdi
movq %rdx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x10f0
movq %rax, 0x10(%r15)
pushq $0x18
popq %r8
movq %r14, %rdi
movq %rbx, %rsi
movl $0x320, %edx            # imm = 0x320
movl $0x258, %ecx            # imm = 0x258
callq 0x1170
movq %rax, 0x18(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/tsoding[P]x11-double-buffering/././db_pixmap.c
// Function: db_swap_buffers
void db_swap_buffers(DB *db)
{
    XCopyArea(db->display,
              db->back_buffer,
              db->window,
              db->gc,
              0, 0,
              WIDTH, HEIGHT,
              0, 0);
}

// Assembly:
subq $0x28, %rsp
movq 0x18(%rdi), %rsi
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rcx
andl $0x0, 0x18(%rsp)
andl $0x0, 0x10(%rsp)
movl $0x258, 0x8(%rsp)       # imm = 0x258
movl $0x320, (%rsp)          # imm = 0x320
movq %rax, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x10a0
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x11c7
xorl %r14d, %r14d
movq 0x2e3f(%rip), %rbx      # 0x3fe8
xorl %r15d, %r15d
movq (%rbx), %rax
movq (%rax,%r15), %rdi
testq %rdi, %rdi
je 0x1284
callq 0x1050
addq $0x8, %r15
jmp 0x11ac
movq %rsi, %rbx
movl %edi, %r14d
movq 0x8(%rsi), %rdi
cmpb $0x2d, (%rdi)
jne 0x11e2
cmpb $0x30, 0x1(%rdi)
jne 0x11e2
cmpb $0x0, 0x2(%rdi)
je 0x123c
leaq 0xe1b(%rip), %rsi       # 0x2004
callq 0x1070
testl %eax, %eax
je 0x123c
movslq %r14d, %r12
pushq $0x1
popq %r13
pushq $0x1
popq %r15
xorl %r14d, %r14d
cmpq %r12, %r13
jge 0x1284
movq (%rbx,%r13,8), %rdi
callq 0x1030
movl %r15d, %ecx
testq %rax, %rax
je 0x1234
movq 0x2dbb(%rip), %rcx      # 0x3fd8
movq (%rcx), %rdi
leaq 0xde4(%rip), %rsi       # 0x200b
movq %rax, %rdx
xorl %eax, %eax
callq 0x1080
movl %r14d, %ecx
incq %r13
movl %ecx, %r14d
jmp 0x1200
movslq %r14d, %r15
xorl %r14d, %r14d
pushq $0x2
popq %r12
pushq $0x1
popq %r13
cmpq %r15, %r12
jge 0x1284
movq (%rbx,%r12,8), %rdi
callq 0x1030
movl %r13d, %ecx
testq %rax, %rax
je 0x127c
movq 0x2d71(%rip), %rcx      # 0x3fd8
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x1060
xorl %edi, %edi
callq 0x1040
movl %r14d, %ecx
incq %r12
movl %ecx, %r14d
jmp 0x124a
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_O2/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 0x13e3
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 0x1410
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x163a
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 0x1410
cmpl $0x180, %eax            # imm = 0x180
jbe 0x1684
callq 0x1050
movl $0x7, (%rax)
pushq $-0x1
popq %r14
jmp 0x16a8
movl %eax, %r15d
movl %eax, %edi
callq 0x5552
movl %eax, %r14d
cmpl %ebp, %eax
ja 0x16a8
leaq 0xd0(%rsp), %rsi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x5561
movl %r14d, %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1950
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 0x54e4
xorl %ebp, %ebp
cmpl $0x180, %eax            # imm = 0x180
ja 0x19ae
movl %eax, %r15d
leaq 0xd0(%rsp), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x54eb
testl %eax, %eax
je 0x19ae
leaq 0xd0(%rsp), %rdi
movq %rsp, %rdx
movl %r15d, %esi
callq 0x173d
movl %eax, %ebp
movl %ebp, %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/libobstcp.c
// Function: obstcp_advert_cname_extract
int EXPORTED
obstcp_advert_cname_extract(char *output, unsigned *ooutlen, const char *name) {
  unsigned j = 0;  // current offset into output
  const unsigned outlen = *ooutlen;

  while (*name) {
    if (strncmp(name, kDNSMagic, kDNSMagicLen) == 0) {
      char good = 1;
      unsigned count = 0;
      const char *i;

      for (i = name + kDNSMagicLen; *i; ++i, count++) {
        const char c = *i;
        if (c == '.' || !c)
          break;
        if ((c >= '0' && c <= '9') ||
          (c > 'a' && c <= 'z' && c != 'e' && c != 'i' && c != 'o') ||
          (c > 'A' && c <= 'Z' && c != 'E' && c != 'I' && c != 'O'))
          continue;
        good = 0;
        break;
      }

      if (!count)
        good = 0;

      if (good) {
        if (!buffer_put((uint8_t *) output, outlen, &j,
                        name + kDNSMagicLen, count)) goto spc;
        name += kDNSMagicLen + count;
        if (*name == '.')
          name++;
        continue;
      }
    }

    while (*name && *name != '.')
      name++;
    if (*name == '.') {
      name++;
    } else {
      break;
    }
  }

  if (!j) {
    errno = EEXIST;
    return 0;
  }

  *ooutlen = j;

  return 1;

 spc:
  errno = ENOSPC;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
movl (%rsi), %eax
movl %eax, 0xc(%rsp)
xorl %ebp, %ebp
pushq $0x5
popq %r12
movb (%r13), %r14b
testb %r14b, %r14b
je 0x1aa7
movq %r13, %rdi
leaq 0x5794(%rip), %rsi      # 0x718e
movq %r12, %rdx
callq 0x1060
testl %eax, %eax
jne 0x1a54
leaq 0x5(%r13), %rsi
xorl %r15d, %r15d
movzbl (%rsi,%r15), %eax
testl %eax, %eax
je 0x1a4f
cmpl $0x2e, %eax
je 0x1a4f
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
jb 0x1a4a
leal -0x62(%rax), %ecx
cmpb $0x18, %cl
ja 0x1a30
addl $-0x65, %eax
jmp 0x1a3b
leal -0x42(%rax), %ecx
cmpb $0x18, %cl
ja 0x1a54
addl $-0x45, %eax
cmpl $0xa, %eax
ja 0x1a4a
movl $0x411, %ecx            # imm = 0x411
btl %eax, %ecx
jb 0x1a54
incq %r15
jmp 0x1a0d
testl %r15d, %r15d
jne 0x1a6f
incq %r13
testb %r14b, %r14b
je 0x1aa7
movzbl %r14b, %eax
cmpl $0x2e, %eax
je 0x19e3
movb (%r13), %r14b
jmp 0x1a54
movl %ebp, %edi
leaq (%rdi,%r15), %rbp
cmpl 0xc(%rsp), %ebp
ja 0x1ace
addq 0x10(%rsp), %rdi
movl %r15d, %edx
callq 0x10b0
addl $0x5, %r15d
xorl %eax, %eax
cmpb $0x2e, (%r13,%r15)
leaq (%r13,%r15), %rcx
sete %al
addq %rcx, %rax
movq %rax, %r13
jmp 0x19e3
testl %ebp, %ebp
je 0x1ab2
movl %ebp, (%rbx)
pushq $0x1
popq %rax
jmp 0x1abf
callq 0x1050
movl $0x11, (%rax)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1050
movl $0x1c, (%rax)
jmp 0x1abd
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/libobstcp.c
// Function: obstcp_advert_hostent_extract
int EXPORTED
obstcp_advert_hostent_extract(char *output, unsigned *outlen,
                              const struct hostent *hent) {
  unsigned i;

  for (i = 0; hent->h_aliases[i]; ++i) {
      if (!obstcp_advert_cname_extract(output, outlen, hent->h_aliases[i])) {
        if (errno != EEXIST)
          return 0;
      } else {
        return 1;
      }
  }

  if (hent->h_name) {
    return obstcp_advert_cname_extract(output, outlen, hent->h_name);
  } else {
    errno = EEXIST;
    return 0;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
pushq $0x1
popq %rbp
movq 0x8(%r15), %rax
movl %r12d, %ecx
movq (%rax,%rcx,8), %rdx
testq %rdx, %rdx
je 0x1b20
movq %r14, %rdi
movq %rbx, %rsi
callq 0x19be
testl %eax, %eax
jne 0x1b48
callq 0x1050
incl %r12d
cmpl $0x11, (%rax)
je 0x1af2
jmp 0x1b46
movq (%r15), %rdx
testq %rdx, %rdx
je 0x1b3b
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x19be
callq 0x1050
movl $0x11, (%rax)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/libobstcp.c
// Function: obstcp_advert_cname_encode
void EXPORTED
obstcp_advert_cname_encode(char *output,
                           const char *advert, unsigned advertlen) {
  unsigned i = 0, j = 0;  // i indexes @advert, j indexes @output

  while (advertlen) {
    memcpy(output + j, kDNSMagic, kDNSMagicLen);
    j += kDNSMagicLen;
    unsigned todo = advertlen;
    if (todo > kDNSCharsPerLabel)
      todo = kDNSCharsPerLabel;
    memcpy(output + j, advert + i, todo);
    i += todo;
    j += todo;
    advertlen -= todo;
    output[j++] = '.';
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebp, %ebp
xorl %r13d, %r13d
testl %ebx, %ebx
je 0x1bcc
movl %r13d, %eax
movb $0x78, 0x4(%r15,%rax)
movl $0x78306561, (%r15,%rax) # imm = 0x78306561
cmpl $0x3a, %ebx
pushq $0x3a
popq %rax
movl %eax, %r12d
cmovbl %ebx, %r12d
leal 0x5(%r13), %edi
addq %r15, %rdi
movl %ebp, %esi
addq %r14, %rsi
movq %r12, %rdx
callq 0x10b0
addl %r12d, %ebp
leal (%r12,%r13), %eax
addl $0x5, %eax
subl %r12d, %ebx
addl %r12d, %r13d
addl $0x6, %r13d
movb $0x2e, (%r15,%rax)
jmp 0x1b7b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/libobstcp.c
// Function: obstcp_keys_key_add
int EXPORTED
obstcp_keys_key_add(struct obstcp_keys *keys, const uint8_t *private_key) {
  struct obstcp_keypair *kp, *a;
  static const uint8_t basepoint[32] = {9};

  kp = (struct obstcp_keypair *) malloc(sizeof(struct obstcp_keypair));
  if (!kp) {
    errno = ENOMEM;
    return 0;
  }

  memcpy(kp->private_key, private_key, 32);
  kp->private_key[0] &= 248;
  kp->private_key[31] &= 127;
  kp->private_key[31] |= 64;

  curve25519(kp->public_key, kp->private_key, basepoint);

  kp->keyid = key_keyid(kp->public_key);

  for (a = keys->keys; a; a = a->next) {
    if (a->keyid == kp->keyid) {
      free(kp);
      errno = ENOSPC;
      return 0;
    }
  }


  kp->next = keys->keys;
  keys->keys = kp;

  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
pushq $0x50
popq %rdi
callq 0x10c0
testq %rax, %rax
je 0x1c67
movq %rax, %r14
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm0, (%rax)
andb $-0x8, (%rax)
movups %xmm1, 0x10(%rax)
movb 0x1f(%rax), %al
andb $0x3f, %al
orb $0x40, %al
movb %al, 0x1f(%r14)
movq %r14, %r15
addq $0x20, %r15
leaq 0x5489(%rip), %rdx      # 0x70b0
movq %r15, %rdi
movq %r14, %rsi
callq 0x55c0
movq %r15, %rdi
callq 0x1c89
movl %eax, 0x40(%r14)
movq %rbx, %rcx
movq (%rcx), %rdx
testq %rdx, %rdx
je 0x1c76
leaq 0x48(%rdx), %rcx
cmpl %eax, 0x40(%rdx)
jne 0x1c41
movq %r14, %rdi
callq 0x1030
callq 0x1050
movl $0x1c, (%rax)
jmp 0x1c72
callq 0x1050
movl $0xc, (%rax)
xorl %eax, %eax
jmp 0x1c83
movq (%rbx), %rax
movq %rax, 0x48(%r14)
movq %r14, (%rbx)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/libobstcp.c
// Function: obstcp_keys_free
void EXPORTED
obstcp_keys_free(struct obstcp_keys *keys) {
  struct obstcp_keypair *kp, *next;

  for (kp = keys->keys; kp; kp = next) {
    next = kp->next;
    free(kp);
  }

  keys->keys = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x1cb9
movq 0x48(%rdi), %r14
callq 0x1030
movq %r14, %rdi
jmp 0x1ca6
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/./cursor.h
// Function: cursor_has
static int MAYBEUNUSED
cursor_has(struct obstcp_cursor *c, size_t n) {
  struct cursor_has_state s;
  s.n = n;
  s.found = 0;

  c->fold(c, cursor_has_f, &s);
  return s.found >= n;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
leaq 0x8(%rsp), %r14
movq %rsi, (%r14)
andq $0x0, 0x8(%r14)
leaq 0x11ed(%rip), %rsi      # 0x3311
movq %r14, %rdx
callq *0x8(%rdi)
xorl %eax, %eax
cmpq %rbx, 0x8(%r14)
setae %al
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/./cursor.h
// Function: cursor_read
static const uint8_t * MAYBEUNUSED
cursor_read(uint8_t *buffer, struct obstcp_cursor *c, size_t n) {
  struct iovec iov;

  if (!c->get(c, &iov, n))
    abort();

  if (iov.iov_len == n)
    return (const uint8_t *) iov.iov_base;

  size_t j = 0;
  while (n) {
    memcpy(buffer + j, iov.iov_base, iov.iov_len);
    n -= iov.iov_len;
    j += iov.iov_len;
    if (!c->get(c, &iov, n))
      abort();
  }

  return buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq *(%r15)
testl %eax, %eax
je 0x21b7
cmpq %r14, 0x10(%rsp)
jne 0x217f
movq 0x8(%rsp), %rbx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
testq %r14, %r14
je 0x216d
leaq (%rbx,%rbp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %r13
movq %r13, %rdx
callq 0x10b0
subq %r13, %r14
addq %r13, %rbp
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq *(%r15)
testl %eax, %eax
jne 0x2186
callq 0x1040
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/./iovec_cursor.h
// Function: iovec_cursor_copy_cursor
static void MAYBEUNUSED
iovec_cursor_copy_cursor(struct iovec_cursor *dest, struct obstcp_cursor *src) {
  while (!iovec_cursor_full(dest)) {
    struct iovec iov;
    if (!src->get(src, &iov, ULONG_MAX))
      return;

    iovec_cursor_append(dest, iov.iov_base, iov.iov_len);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x1c(%rdi), %eax
leaq 0x8(%rsp), %r15
pushq $-0x1
popq %r12
cmpl 0x18(%r14), %eax
je 0x2216
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *(%rbx)
testl %eax, %eax
je 0x2216
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdx
movq 0x10(%r14), %rsi
movl 0x1c(%r14), %edi
leal 0x1(%rdi), %eax
shlq $0x4, %rdi
movq %rcx, (%rsi,%rdi)
movl %eax, 0x1c(%r14)
movq %rdx, 0x8(%rsi,%rdi)
jmp 0x21d9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/libobstcp.c
// Function: obs_encrypt
static void
obs_encrypt(struct obstcp_half_connection *hc, uint8_t *out,
        const uint8_t *in, size_t len) {
  size_t l = len, j = 0, i;

  if (hc->used < 64) {
    const size_t m = min_t(size_t, 64u - hc->used, l);
    xor(out, in, hc->keystream + hc->used, m);
    l -= m;
    hc->used += m;
    j += m;
  }
  const unsigned chunks = l >> 6;
  if (chunks) {
    for (i = 0; i < chunks; ++i) {
      salsa208(hc->keystream, hc->block_ctr, hc->key, sigma);
      block_ctr_inc(hc->block_ctr);
      xor(out + j, in + j, hc->keystream, 64);
      l -= 64;
      j += 64;
    }
  }
  if (l) {
    salsa208(hc->keystream, hc->block_ctr, hc->key, sigma);
    block_ctr_inc(hc->block_ctr);
    xor(out + j, in + j, hc->keystream, l);
    hc->used = l;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %r14
movl 0x40(%rdi), %edx
cmpq $0x3f, %rdx
ja 0x226d
pushq $0x40
popq %r13
subq %rdx, %r13
cmpq %r15, %r13
cmovaeq %r15, %r13
addq %r14, %rdx
movq %rbp, %rdi
movq %r12, %rsi
movl %r13d, %ecx
callq 0x33e3
subq %r13, %r15
addl %r13d, 0x40(%r14)
jmp 0x2270
xorl %r13d, %r13d
movq %r15, %rax
shrq $0x6, %rax
testl %eax, %eax
je 0x22e8
movq %rbp, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movl %eax, %r15d
leaq 0x64(%r14), %rbp
leaq 0x44(%r14), %rbx
subq $0x1, %r15
jb 0x22d1
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x4e3a(%rip), %rcx      # 0x70e0
callq 0x3528
movq %rbp, %rdi
callq 0x342b
movq 0x8(%rsp), %rax
leaq (%rax,%r13), %rdi
leaq (%r12,%r13), %rsi
movq %r14, %rdx
pushq $0x40
popq %rcx
callq 0x33e3
addq $0x40, %r13
jmp 0x2290
movabsq $-0x3fffffffc1, %rax    # imm = 0xFFFFFFC00000003F
movq 0x10(%rsp), %r15
andq %rax, %r15
movq 0x8(%rsp), %rbp
testq %r15, %r15
je 0x232a
leaq 0x64(%r14), %rbx
leaq 0x44(%r14), %rdx
leaq 0x4de4(%rip), %rcx      # 0x70e0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3528
movq %rbx, %rdi
callq 0x342b
addq %r13, %rbp
addq %r13, %r12
movq %rbp, %rdi
movq %r12, %rsi
movq %r14, %rdx
movl %r15d, %ecx
callq 0x33e3
movl %r15d, 0x40(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/libobstcp.c
// Function: obstcp_server_encrypt
ssize_t EXPORTED
obstcp_server_encrypt(struct obstcp_server_ctx *ctx, uint8_t *output,
                      const uint8_t *buffer, size_t len) {
  obs_encrypt(&ctx->u.b.out, output, buffer, len);
  if (!ctx->frame_valid && ctx->state == SRV_ST_2ND_FRAME_PENDING) {
    ctx->state = SRV_ST_RUNNING;
  }

  ctx->frame_valid = 1;

  return len;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdi, %r14
addq $0x7c, %rdi
callq 0x2222
cmpb $0x0, 0x195(%r14)
jne 0x2378
cmpl $0x2, 0x190(%r14)
jne 0x2378
movl $0x3, 0x190(%r14)
movb $0x1, 0x195(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/libobstcp.c
// Function: obstcp_server_prefix
int EXPORTED
obstcp_server_prefix(struct obstcp_server_ctx *ctx, struct iovec *prefix) {
  static const uint8_t banner[2] = {0, 0};

  if (!ctx->frame_valid) return -1;

  if (ctx->state == SRV_ST_FIRST_FRAME) {
    prefix->iov_base = (void *) banner;
    prefix->iov_len = 2;
    ctx->state = SRV_ST_2ND_FRAME_PENDING;
    return 1;
  } else {
    prefix->iov_len = 0;
    return 0;
  }
}

// Assembly:
cmpb $0x0, 0x195(%rdi)
je 0x23bd
cmpl $0x1, 0x190(%rdi)
jne 0x23c1
leaq 0x4d2c(%rip), %rax      # 0x70d0
movq %rax, (%rsi)
movq $0x2, 0x8(%rsi)
movl $0x2, 0x190(%rdi)
pushq $0x1
jmp 0x23bf
pushq $-0x1
popq %rax
retq
andq $0x0, 0x8(%rsi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/libobstcp.c
// Function: obstcp_client_banner
void EXPORTED
obstcp_client_banner(struct obstcp_client_ctx *ctx,
                     struct iovec *out) {
  if (ctx->state != CLI_ST_WRITING) abort();
  out->iov_base = (void *) ctx->buffer;
  out->iov_len = ctx->n;
  ctx->n = 0;

  ctx->state = CLI_ST_READING;
}

// Assembly:
cmpl $0x0, 0x270(%rdi)
jne 0x2744
movq %rdi, (%rsi)
movl 0x184(%rdi), %eax
movq %rax, 0x8(%rsi)
andl $0x0, 0x184(%rdi)
movl $0x1, 0x270(%rdi)
retq
pushq %rax
callq 0x1040
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/libobstcp.c
// Function: obstcp_client_accum_init
void EXPORTED
obstcp_client_accum_init(struct obstcp_accum *ac, struct obstcp_client_ctx *ctx) {
  obstcp_accum_init(ac);
  ac->is_server = 0;
  ac->frame_size = obstcp_client_frame_payload_sz(ctx);
  ac->ctx = ctx;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2917
movb $0x0, 0x1bd(%r14)
orw $-0x1, 0x8(%r14)
movq %rbx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/libobstcp.c
// Function: obstcp_accum_init
static void
obstcp_accum_init(struct obstcp_accum *ac) {
  unsigned i;

  memset(ac, 0, sizeof(struct obstcp_accum));

  for (i = 0; i < OBSTCP_ACCUM_BUFFERS - 1; ++i) {
    ac->buffers[i].next = i + 1;
  }
  ac->buffers[OBSTCP_ACCUM_BUFFERS - 1].next = 0xff;

  ac->free_head = 0;
  ac->data_head = ac->data_tail = 0xff;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1c0, %edx            # imm = 0x1C0
xorl %esi, %esi
callq 0x1080
pushq $0x10
popq %rax
movb $0x1, %cl
cmpq $0x178, %rax            # imm = 0x178
je 0x293f
movb %cl, (%rbx,%rax)
addq $0x48, %rax
incb %cl
jmp 0x292c
movb $-0x1, %al
movb %al, 0x178(%rbx)
movw $0xff00, 0x1ba(%rbx)    # imm = 0xFF00
movb %al, 0x1bc(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/libobstcp.c
// Function: obstcp_server_accum_init
void EXPORTED
obstcp_server_accum_init(struct obstcp_accum *ac, struct obstcp_server_ctx *ctx) {
  obstcp_accum_init(ac);
  ac->is_server = 1;
  ac->frame_size = obstcp_server_frame_payload_sz(ctx);
  ac->ctx = ctx;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2917
movb $0x1, 0x1bd(%r14)
orw $-0x1, 0x8(%r14)
movq %rbx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq