LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_init
af_bool_t af_io_init(af_io_t* io, af_global_t* global) {
  af_io_fd_t pipefd[2];
  if(pthread_mutex_init(&io->mutex, NULL)) {
    return FALSE;
  }
  if(pipe(pipefd)) {
    pthread_mutex_destroy(&io->mutex);
    return FALSE;
  }
  io->global = global;
  io->break_fd_out = pipefd[0];
  io->break_fd_in = pipefd[1];
  if(!af_fd_set_blocking(io->break_fd_in, TRUE)) {
    close(io->break_fd_out);
    close(io->break_fd_in);
    pthread_mutex_destroy(&io->mutex);
    return FALSE;
  }
  io->active_action_count = 0;
  io->first_active_action = NULL;
  io->first_waiting_action = NULL;
  io->last_waiting_action = NULL;
  io->first_done_action = NULL;
  io->to_be_destroyed = FALSE;
  io->handler_task = NULL;
  if(!af_io_prepare_stdin()) {
    close(io->break_fd_out);
    close(io->break_fd_in);
    pthread_mutex_destroy(&io->mutex);
    return FALSE;
  }
  if(pthread_create(&io->pthread, NULL, af_io_main, io)) {
    close(io->break_fd_out);
    close(io->break_fd_in);
    pthread_mutex_destroy(&io->mutex);
    return FALSE;
  }
  return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2300
testl %eax, %eax
jne 0xbef0
movq %rsp, %rdi
callq 0x2190
testl %eax, %eax
jne 0xbee5
movq %r15, 0x30(%r14)
movl (%rsp), %eax
movl %eax, 0x3c(%r14)
movl 0x4(%rsp), %edi
movl %edi, 0x38(%r14)
movq $-0x1, %rsi
callq 0xbf08
testq %rax, %rax
je 0xbed3
movq $0x0, 0x40(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%r14)
movups %xmm0, 0x60(%r14)
movups %xmm0, 0x70(%r14)
callq 0xbf62
testq %rax, %rax
je 0xbed3
leaq 0xf6(%rip), %rdx        # 0xbfb8
movq %r14, %rdi
xorl %esi, %esi
movq %r14, %rcx
callq 0x2250
testl %eax, %eax
je 0xbeff
movl 0x3c(%r14), %edi
callq 0x2180
movl 0x38(%r14), %edi
callq 0x2180
movq %rbx, %rdi
callq 0x2140
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq $-0x1, %r12
jmp 0xbef0
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_fd_set_blocking
af_bool_t af_fd_set_blocking(int fd, af_bool_t blocking) {
  int flags = fcntl(fd, F_GETFL, 0);
  if (flags == -1) {
    return TRUE;
  }
  if (blocking) {
    flags &= ~O_NONBLOCK;
  } else {
    flags |= O_NONBLOCK;
  }
  return fcntl(fd, F_SETFL, flags) != -1 ? TRUE : FALSE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x20c0
cmpl $-0x1, %eax
je 0xbf53
xorl %edx, %edx
testq %r14, %r14
sete %dl
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
shll $0xb, %edx
orl %eax, %edx
movl %ebx, %edi
movl $0x4, %esi
xorl %eax, %eax
callq 0x20c0
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
setne %al
negq %rax
jmp 0xbf5a
movq $-0x1, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_prepare_stdin
af_bool_t af_io_prepare_stdin(void) {
  struct termios tp;
  if(isatty(STDIN_FILENO)) {
    if(tcgetattr(STDIN_FILENO, &tp) == -1) {
      return FALSE;      
    }
    if(tp.c_lflag & ECHO || tp.c_lflag & ICANON) {
      tp.c_lflag &= ~ECHO & ~ICANON;
      if(tcsetattr(STDIN_FILENO, TCSANOW, &tp) == -1) {
	return FALSE;
      }
    }
  }
  return TRUE;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
xorl %edi, %edi
callq 0x20a0
testl %eax, %eax
je 0xbfa8
xorl %ebx, %ebx
leaq 0x4(%rsp), %rsi
xorl %edi, %edi
callq 0x2270
cmpl $-0x1, %eax
je 0xbfaf
movl 0x10(%rsp), %eax
testb $0xa, %al
je 0xbfa8
andl $-0xb, %eax
leaq 0x4(%rsp), %rdx
movl %eax, 0xc(%rdx)
xorl %ebx, %ebx
xorl %edi, %edi
xorl %esi, %esi
callq 0x2280
cmpl $-0x1, %eax
je 0xbfaf
movq $-0x1, %rbx
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_cleanup_stdin
af_bool_t af_io_cleanup_stdin(void) {
  struct termios tp;
  af_fd_set_blocking(STDIN_FILENO, TRUE);
  if(isatty(STDIN_FILENO)) {
    if(tcgetattr(STDIN_FILENO, &tp) == -1) {
      return FALSE;      
    }
    if(!(tp.c_lflag & ECHO) || !(tp.c_lflag & ICANON)) {
      tp.c_lflag |= ECHO | ICANON;
      if(tcsetattr(STDIN_FILENO, TCSANOW, &tp) == -1) {
	return FALSE;
      }
    }
  }
  return TRUE;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movq $-0x1, %rbx
xorl %edi, %edi
movq $-0x1, %rsi
callq 0xbf08
xorl %edi, %edi
callq 0x20a0
testl %eax, %eax
je 0xc544
leaq 0x4(%rsp), %rsi
xorl %edi, %edi
callq 0x2270
cmpl $-0x1, %eax
je 0xc542
movl 0x10(%rsp), %eax
movl %eax, %ecx
notl %ecx
testb $0xa, %cl
je 0xc544
orl $0xa, %eax
leaq 0x4(%rsp), %rdx
movl %eax, 0xc(%rdx)
xorl %edi, %edi
xorl %esi, %esi
callq 0x2280
cmpl $-0x1, %eax
jne 0xc544
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_action_destroy
void af_io_action_destroy(af_io_action_t* action) {
  af_io_t* io = action->io;
  pthread_mutex_lock(&io->mutex);
  if(action->is_done) {
    if(action->prev_action) {
      action->prev_action->next_action = action->next_action;
    } else {
      io->first_done_action = action->next_action;
    }
    if(action->next_action) {
      action->next_action->prev_action = action->prev_action;
    }
    free(action);
  } else {
    action->to_be_destroyed = TRUE;
  }
  pthread_mutex_unlock(&io->mutex);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x10(%rdi), %r15
leaq 0x8(%r15), %rbx
movq %rbx, %rdi
callq 0x2310
cmpq $0x0, 0x78(%r14)
je 0xc5dc
movq (%r14), %rax
addq $0x68, %r15
leaq 0x8(%rax), %rcx
testq %rax, %rax
cmoveq %r15, %rcx
movq 0x8(%r14), %rdx
movq %rdx, (%rcx)
movq 0x8(%r14), %rcx
testq %rcx, %rcx
je 0xc5d2
movq %rax, (%rcx)
movq %r14, %rdi
callq 0x2050
jmp 0xc5e4
movq $-0x1, 0x20(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2210
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_get_pending_write_count
af_cell_t af_io_get_pending_write_count(af_io_t* io) {
  af_cell_t pending_write_count;
  pthread_mutex_lock(&io->mutex);
  pending_write_count = io->pending_write_count;
  pthread_mutex_unlock(&io->mutex);
  return pending_write_count;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x2310
movq 0x48(%rbx), %rbx
movq %r14, %rdi
callq 0x2210
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_action_get_state
void af_io_action_get_state(af_io_action_t* action, af_io_state_t* state) {
  pthread_mutex_lock(&action->io->mutex);
  state->buffer = action->buffer;
  state->count = action->count;
  state->index = action->index;
  state->offset = action->offset;
  state->is_done = action->is_done;
  state->is_closed = action->is_closed;
  state->has_hangup = action->has_hangup;
  state->has_error = action->has_error;
  pthread_mutex_unlock(&action->io->mutex);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rdi
addq $0x8, %rdi
callq 0x2310
movq 0x30(%r14), %rax
movq %rax, (%rbx)
movq 0x38(%r14), %rax
movq %rax, 0x8(%rbx)
movq 0x40(%r14), %rax
movq %rax, 0x10(%rbx)
movq 0x48(%r14), %rax
movq %rax, 0x18(%rbx)
movq 0x78(%r14), %rax
movq %rax, 0x20(%rbx)
movq 0x80(%r14), %rax
movq %rax, 0x28(%rbx)
movq 0x88(%r14), %rax
movq %rax, 0x30(%rbx)
movq 0x90(%r14), %rax
movq %rax, 0x38(%rbx)
movq 0x10(%r14), %rdi
addq $0x8, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2210
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_open
af_io_fd_t af_io_open(af_byte_t* path, af_io_size_t count, af_io_flags_t flags,
		      af_io_mode_t mode, af_io_error_t* error) {
  af_byte_t* path_buffer = malloc(sizeof(af_byte_t) * (count + 1));
  af_io_fd_t fd;
  memcpy(path_buffer, path, count);
  path_buffer[count] = 0;
  if((fd = open(path_buffer, flags, mode)) >= 0) {
    *error = 0;
    free(path_buffer);
    return fd;
  } else {
    *error = errno;
    free(path_buffer);
    return -1;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r13
leaq 0x1(%rsi), %rdi
callq 0x2220
movq %rax, %r14
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x21f0
movb $0x0, (%r14,%r12)
xorl %r12d, %r12d
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x22a0
movl %eax, %ebp
testl %eax, %eax
jns 0xc73f
callq 0x2070
movl (%rax), %r12d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %r12d, (%rbx)
movq %r14, %rdi
callq 0x2050
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_pipe
af_bool_t af_io_pipe(af_io_fd_t* in, af_io_fd_t* out, af_io_error_t* error) {
  af_io_fd_t fds[2];
  if(!pipe(fds)) {
    *out = fds[0];
    *in = fds[1];
    *error = 0;
    return TRUE;
  } else {
    *error = errno;
    return FALSE;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x8(%rsp), %rdi
callq 0x2190
testl %eax, %eax
je 0xc786
callq 0x2070
movl (%rax), %ecx
xorl %eax, %eax
jmp 0xc79d
movl 0x8(%rsp), %eax
movl %eax, (%r15)
movl 0xc(%rsp), %eax
movl %eax, (%r14)
movq $-0x1, %rax
xorl %ecx, %ecx
movl %ecx, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_delete
af_bool_t af_io_delete(af_byte_t* path, af_io_size_t count,
		       af_io_error_t* error) {
  af_byte_t* path_buffer = malloc(sizeof(af_byte_t) * (count + 1));
  memcpy(path_buffer, path, count);
  path_buffer[count] = 0;
  if(!unlink(path_buffer)) {
    *error = 0;
    free(path_buffer);
    return TRUE;
  } else {
    *error = errno;
    free(path_buffer);
    return FALSE;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x1(%rsi), %rdi
callq 0x2220
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x21f0
movb $0x0, (%r14,%r15)
movq %r14, %rdi
callq 0x2080
testl %eax, %eax
je 0xc7f1
callq 0x2070
movl (%rax), %eax
xorl %r15d, %r15d
jmp 0xc7fa
movq $-0x1, %r15
xorl %eax, %eax
movl %eax, (%rbx)
movq %r14, %rdi
callq 0x2050
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_rename
af_bool_t af_io_rename(af_byte_t* path1, af_io_size_t count1,
		       af_byte_t* path2, af_io_size_t count2,
		       af_io_error_t* error) {
  af_byte_t* path_buffer1 = malloc(sizeof(af_byte_t) * (count1 + 1));
  af_byte_t* path_buffer2 = malloc(sizeof(af_byte_t) * (count2 + 1));
  memcpy(path_buffer1, path1, count1);
  path_buffer1[count1] = 0;
  memcpy(path_buffer2, path2, count2);
  path_buffer2[count2] = 0;
  if(!rename(path_buffer1, path_buffer2)) {
    *error = 0;
    free(path_buffer1);
    free(path_buffer2);
    return TRUE;
  } else {
    *error = errno;
    free(path_buffer1);
    free(path_buffer2);
    return TRUE;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, (%rsp)
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %rbx
leaq 0x1(%rsi), %rdi
callq 0x2220
movq %rax, %r14
leaq 0x1(%r12), %rdi
callq 0x2220
movq %rax, %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x21f0
xorl %ebx, %ebx
movb %bl, (%r14,%rbp)
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x21f0
movb %bl, (%r15,%r12)
movq %r14, %rdi
movq %r15, %rsi
callq 0x22b0
testl %eax, %eax
je 0xc8ed
callq 0x2070
movl (%rax), %ebx
movq (%rsp), %rax
movl %ebx, (%rax)
movq %r14, %rdi
callq 0x2050
movq %r15, %rdi
callq 0x2050
movq $-0x1, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_isatty
af_bool_t af_io_isatty(af_io_fd_t fd, af_io_error_t* error) {
  if(isatty(fd)) {
    *error = 0;
    return TRUE;
  } else if(errno == EINVAL || errno == ENOTTY) {
    *error = 0;
    return FALSE;
  } else {
    *error = errno;
    return FALSE;
  }
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x20a0
testl %eax, %eax
je 0xc933
movq $-0x1, %rax
xorl %ecx, %ecx
movl %ecx, (%rbx)
popq %rbx
retq
callq 0x2070
movl (%rax), %edx
xorl %ecx, %ecx
cmpl $0x16, %edx
je 0xc951
movl $0x0, %eax
cmpl $0x19, %edx
je 0xc92f
xorl %eax, %eax
movl %edx, %ecx
jmp 0xc92f
xorl %eax, %eax
jmp 0xc92f
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_get_monotonic_time
void af_io_get_monotonic_time(af_time_t* monotonic_time) {
  struct timespec time;
  clock_gettime(CLOCK_MONOTONIC, &time);
  monotonic_time->sec = time.tv_sec;
  monotonic_time->nsec = time.tv_nsec;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0x20d0
movq (%r14), %rax
movq %rax, (%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_get_real_time
void af_io_get_real_time(af_time_t* monotonic_time) {
  struct timespec time;
  clock_gettime(CLOCK_REALTIME, &time);
  monotonic_time->sec = time.tv_sec;
  monotonic_time->nsec = time.tv_nsec;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
xorl %edi, %edi
movq %r14, %rsi
callq 0x20d0
movq (%r14), %rax
movq %rax, (%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_sleep
af_io_action_t* af_io_sleep(af_io_t* io, af_time_t* sleep_until,
			    af_task_t* task_to_wake) {
  af_io_action_t* action;
  if(!(action = malloc(sizeof(af_io_action_t)))) {
    return NULL;
  }
  action->type = AF_IO_TYPE_SLEEP;
  action->to_be_destroyed = FALSE;
  action->fd = 0;
  action->buffer = NULL;
  action->count = 0;
  action->index = 0;
  action->offset = 0;
  action->whence = AF_IO_SEEK_CUR;
  action->sleep_until.tv_sec = sleep_until->sec;
  action->sleep_until.tv_nsec = sleep_until->nsec;
  action->is_buffer_freeable = FALSE;
  action->task_to_wake = task_to_wake;
  action->is_done = FALSE;
  action->is_closed = FALSE;
  action->has_hangup = FALSE;
  action->has_error = FALSE;
  af_io_add(io, action);
  return action;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movl $0x98, %edi
callq 0x2220
testq %rax, %rax
je 0xca32
movq %rax, %rbx
movq $0x4, 0x18(%rax)
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movl $0x0, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
movq $0x1, 0x50(%rbx)
movq (%r12), %rcx
movq %rcx, 0x58(%rbx)
movq 0x8(%r12), %rcx
movq %rcx, 0x60(%rbx)
movq %rax, 0x68(%rbx)
movq %r15, 0x70(%rbx)
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x88(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xca43
jmp 0xca34
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_add
void af_io_add(af_io_t* io, af_io_action_t* action) {
  af_bool_t wake = FALSE;
  pthread_mutex_lock(&io->mutex);
  action->io = io;
  if(action->type == AF_IO_TYPE_WRITE) {
    io->pending_write_count++;
  }
  if(action->type != AF_IO_TYPE_SLEEP && af_io_is_active(io, action->fd)) {
    action->prev_action = io->last_waiting_action;
    action->next_action = NULL;
    if(action->prev_action) {
      action->prev_action->next_action = action;
    } else {
      io->first_waiting_action = action;
    }
    io->last_waiting_action = action;
  } else {
    action->prev_action = NULL;
    action->next_action = io->first_active_action;
    if(action->next_action) {
      action->next_action->prev_action = action;
    }
    io->first_active_action = action;
    io->active_action_count++;
      wake = TRUE;
  }
  pthread_mutex_unlock(&io->mutex);
  if(wake) {
    af_io_wake(io);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x2310
movq %rbx, 0x10(%r15)
movq 0x18(%r15), %rax
cmpq $0x4, %rax
je 0xca94
cmpq $0x1, %rax
jne 0xca72
incq 0x48(%rbx)
movq 0x50(%rbx), %rax
testq %rax, %rax
je 0xca94
movl 0x28(%r15), %ecx
cmpl %ecx, 0x28(%rax)
jne 0xca8b
cmpq $0x4, 0x18(%rax)
jne 0xcac8
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0xca7f
movq $0x0, (%r15)
movq 0x50(%rbx), %rax
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0xcaab
movq %r15, (%rax)
movq %r15, 0x50(%rbx)
incq 0x40(%rbx)
movq %r14, %rdi
callq 0x2210
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xc55a
movq 0x60(%rbx), %rax
movq %rax, (%r15)
leaq 0x58(%rbx), %rcx
leaq 0x8(%rax), %rdx
testq %rax, %rax
cmoveq %rcx, %rdx
movq $0x0, 0x8(%r15)
movq %r15, (%rdx)
movq %r15, 0x60(%rbx)
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2210
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_tell
af_io_action_t* af_io_tell(af_io_t* io, af_io_fd_t fd,
			   af_task_t* task_to_wake) {
  af_io_action_t* action;
  if(!(action = malloc(sizeof(af_io_action_t)))) {
    return NULL;
  }
  action->type = AF_IO_TYPE_TELL;
  action->to_be_destroyed = FALSE;
  action->fd = fd;
  action->buffer = NULL;
  action->count = 0;
  action->index = 0;
  action->offset = 0;
  action->whence = AF_IO_SEEK_CUR;
  action->sleep_until.tv_sec = 0;
  action->sleep_until.tv_nsec = 0;
  action->is_buffer_freeable = FALSE;
  action->task_to_wake = task_to_wake;
  action->is_done = FALSE;
  action->is_closed = FALSE;
  action->has_hangup = FALSE;
  action->has_error = FALSE;
  af_io_add(io, action);
  return action;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
movl $0x98, %edi
callq 0x2220
testq %rax, %rax
je 0xcb63
movq %rax, %rbx
movq $0x5, 0x18(%rax)
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movl %ebp, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
movq $0x1, 0x50(%rbx)
movups %xmm0, 0x58(%rbx)
movq %rax, 0x68(%rbx)
movq %r15, 0x70(%rbx)
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x88(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xca43
jmp 0xcb65
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_close_async
af_io_action_t* af_io_close_async(af_io_t* io, af_io_fd_t fd) {
  af_io_action_t* action;
  if(!(action = malloc(sizeof(af_io_action_t)))) {
    return NULL;
  }
  action->type = AF_IO_TYPE_CLOSE;
  action->to_be_destroyed = FALSE;
  action->fd = fd;
  action->buffer = NULL;
  action->count = 0;
  action->index = 0;
  action->offset = 0;
  action->whence = AF_IO_SEEK_CUR;
  action->sleep_until.tv_sec = 0;
  action->sleep_until.tv_nsec = 0;
  action->is_buffer_freeable = FALSE;
  action->task_to_wake = NULL;
  action->is_done = FALSE;
  action->is_closed = FALSE;
  action->has_hangup = FALSE;
  action->has_error = FALSE;
  af_io_add(io, action);
  return action;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x98, %edi
callq 0x2220
testq %rax, %rax
je 0xcc4d
movq %rax, %rbx
movq $0x2, 0x18(%rax)
movq $0x0, 0x20(%rax)
movl %ebp, 0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movq $0x1, 0x50(%rax)
movups %xmm0, 0x58(%rax)
movups %xmm0, 0x68(%rax)
movups %xmm0, 0x78(%rax)
movups %xmm0, 0x88(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0xca43
jmp 0xcc4f
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_seek_block
af_io_action_t* af_io_seek_block(af_io_t* io, af_io_fd_t fd, af_io_off_t offset,
				 af_io_whence_t whence,
				 af_task_t* task_to_wake) {
  af_io_action_t* action;
  if(!(action = malloc(sizeof(af_io_action_t)))) {
    return NULL;
  }
  action->type = AF_IO_TYPE_SEEK;
  action->to_be_destroyed = FALSE;
  action->fd = fd;
  action->buffer = NULL;
  action->count = 0;
  action->index = 0;
  action->offset = offset;
  action->whence = whence;
  action->sleep_until.tv_sec = 0;
  action->sleep_until.tv_nsec = 0;
  action->is_buffer_freeable = FALSE;
  action->task_to_wake = task_to_wake;
  action->is_done = FALSE;
  action->is_closed = FALSE;
  action->has_hangup = FALSE;
  action->has_error = FALSE;
  af_io_add(io, action);
  return action;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movl %ecx, %ebp
movq %rdx, %r12
movl %esi, %r13d
movq %rdi, %r14
movl $0x98, %edi
callq 0x2220
testq %rax, %rax
je 0xccce
movq %rax, %rbx
movq $0x3, 0x18(%rax)
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movl %r13d, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movq %rax, 0x40(%rbx)
movq %r12, 0x48(%rbx)
movslq %ebp, %rcx
movq %rcx, 0x50(%rbx)
movups %xmm0, 0x58(%rbx)
movq %rax, 0x68(%rbx)
movq %r15, 0x70(%rbx)
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x88(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xca43
jmp 0xccd0
xorl %ebx, %ebx
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_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_seek_async
af_io_action_t* af_io_seek_async(af_io_t* io, af_io_fd_t fd, af_io_off_t offset,
				 af_io_whence_t whence) {
  af_io_action_t* action;
  if(!(action = malloc(sizeof(af_io_action_t)))) {
    return NULL;
  }
  action->type = AF_IO_TYPE_SEEK;
  action->to_be_destroyed = FALSE;
  action->fd = fd;
  action->buffer = NULL;
  action->count = 0;
  action->index = 0;
  action->offset = offset;
  action->whence = whence;
  action->sleep_until.tv_sec = 0;
  action->sleep_until.tv_nsec = 0;
  action->is_buffer_freeable = FALSE;
  action->task_to_wake = NULL;
  action->is_done = FALSE;
  action->is_closed = FALSE;
  action->has_hangup = FALSE;
  action->has_error = FALSE;
  af_io_add(io, action);
  return action;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %r14
movl $0x98, %edi
callq 0x2220
testq %rax, %rax
je 0xcd4f
movq %rax, %rbx
movq $0x3, 0x18(%rax)
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movl %r12d, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movq %rax, 0x40(%rbx)
movq %r15, 0x48(%rbx)
movslq %ebp, %rax
movq %rax, 0x50(%rbx)
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x68(%rbx)
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x88(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xca43
jmp 0xcd51
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_read_block
af_io_action_t* af_io_read_block(af_io_t* io, af_io_fd_t fd, af_byte_t* buffer,
				 af_io_size_t count, af_task_t* task_to_wake) {
  af_io_action_t* action;
  if(!(action = malloc(sizeof(af_io_action_t)))) {
    return NULL;
  }
  action->type = AF_IO_TYPE_READ;
  action->to_be_destroyed = FALSE;
  action->fd = fd;
  action->buffer = buffer;
  action->count = count;
  action->index = 0;
  action->offset = 0;
  action->whence = AF_IO_SEEK_CUR;
  action->sleep_until.tv_sec = 0;
  action->sleep_until.tv_nsec = 0;
  action->is_buffer_freeable = FALSE;
  action->task_to_wake = task_to_wake;
  action->is_done = count == 0;
  action->is_closed = FALSE;
  action->has_hangup = FALSE;
  action->has_error = FALSE;
  af_fd_set_blocking(fd, FALSE);
  af_io_add(io, action);
  return action;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, %r14
movl $0x98, %edi
callq 0x2220
testq %rax, %rax
je 0xcde4
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movl %ebp, 0x28(%rax)
movq %r13, 0x30(%rax)
movq %r15, 0x38(%rax)
movups %xmm0, 0x40(%rax)
movq $0x1, 0x50(%rax)
movups %xmm0, 0x58(%rax)
xorl %eax, %eax
movq %rax, 0x68(%rbx)
movq %r12, 0x70(%rbx)
xorl %ecx, %ecx
testq %r15, %r15
sete %cl
movq %rcx, 0x78(%rbx)
movups %xmm0, 0x80(%rbx)
movq %rax, 0x90(%rbx)
movl %ebp, %edi
xorl %esi, %esi
callq 0xbf08
movq %r14, %rdi
movq %rbx, %rsi
callq 0xca43
jmp 0xcde6
xorl %ebx, %ebx
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_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_write_block
af_io_action_t* af_io_write_block(af_io_t* io, af_io_fd_t fd, af_byte_t* buffer,
				  af_io_size_t count, af_task_t* task_to_wake) {
  af_io_action_t* action;
  if(!(action = malloc(sizeof(af_io_action_t)))) {
    return NULL;
  }
  action->type = AF_IO_TYPE_WRITE;
  action->to_be_destroyed = FALSE;
  action->fd = fd;
  action->buffer = buffer;
  action->count = count;
  action->index = 0;
  action->offset = 0;
  action->whence = AF_IO_SEEK_CUR;
  action->sleep_until.tv_sec = 0;
  action->sleep_until.tv_nsec = 0;
  action->is_buffer_freeable = FALSE;
  action->task_to_wake = task_to_wake;
  action->is_done = count == 0;
  action->is_closed = FALSE;
  action->has_hangup = FALSE;
  action->has_error = FALSE;
  af_fd_set_blocking(fd, FALSE);
  af_io_add(io, action);
  return action;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, %r14
movl $0x98, %edi
callq 0x2220
testq %rax, %rax
je 0xce84
movq %rax, %rbx
movl $0x1, %eax
movq %rax, 0x18(%rbx)
xorl %ecx, %ecx
movq %rcx, 0x20(%rbx)
movl %ebp, 0x28(%rbx)
movq %r13, 0x30(%rbx)
movq %r15, 0x38(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movq %rax, 0x50(%rbx)
movups %xmm0, 0x58(%rbx)
movq %rcx, 0x68(%rbx)
movq %r12, 0x70(%rbx)
xorl %eax, %eax
testq %r15, %r15
sete %al
movq %rax, 0x78(%rbx)
movups %xmm0, 0x80(%rbx)
movq %rcx, 0x90(%rbx)
movl %ebp, %edi
xorl %esi, %esi
callq 0xbf08
movq %r14, %rdi
movq %rbx, %rsi
callq 0xca43
jmp 0xce86
xorl %ebx, %ebx
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_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_read_async
af_io_action_t* af_io_read_async(af_io_t* io, af_io_fd_t fd, af_byte_t* buffer,
				 af_io_size_t count) {
  af_io_action_t* action;
  if(!(action = malloc(sizeof(af_io_action_t)))) {
    return NULL;
  }
  action->type = AF_IO_TYPE_READ;
  action->to_be_destroyed = FALSE;
  action->fd = fd;
  action->buffer = buffer;
  action->count = count;
  action->index = 0;
  action->offset = 0;
  action->whence = AF_IO_SEEK_CUR;
  action->sleep_until.tv_sec = 0;
  action->sleep_until.tv_nsec = 0;
  action->is_buffer_freeable = FALSE;
  action->task_to_wake = NULL;
  action->is_done = count == 0;
  action->is_closed = FALSE;
  action->has_hangup = FALSE;
  action->has_error = FALSE;
  af_fd_set_blocking(fd, FALSE);
  af_io_add(io, action);
  return action;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r14
movl $0x98, %edi
callq 0x2220
testq %rax, %rax
je 0xcf17
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movl %ebp, 0x28(%rax)
movq %r12, 0x30(%rax)
movq %r15, 0x38(%rax)
movups %xmm0, 0x40(%rax)
movq $0x1, 0x50(%rax)
xorl %eax, %eax
testq %r15, %r15
sete %al
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x68(%rbx)
movq %rax, 0x78(%rbx)
movups %xmm0, 0x80(%rbx)
movq $0x0, 0x90(%rbx)
movl %ebp, %edi
xorl %esi, %esi
callq 0xbf08
movq %r14, %rdi
movq %rbx, %rsi
callq 0xca43
jmp 0xcf19
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_write_async
af_io_action_t* af_io_write_async(af_io_t* io, af_io_fd_t fd, af_byte_t* buffer,
				  af_io_size_t count) {
  af_io_action_t* action;
  af_byte_t* buffer_copy;
  if(!(action = malloc(sizeof(af_io_action_t)))) {
    return NULL;
  }
  if(!(buffer_copy = malloc(sizeof(af_byte_t) * count))) {
    free(action);
    return NULL;
  }
  memcpy(buffer_copy, buffer, sizeof(af_byte_t) * count);
  action->type = AF_IO_TYPE_WRITE;
  action->to_be_destroyed = FALSE;
  action->fd = fd;
  action->buffer = buffer_copy;
  action->count = count;
  action->index = 0;
  action->offset = 0;
  action->whence = AF_IO_SEEK_CUR;
  action->sleep_until.tv_sec = 0;
  action->sleep_until.tv_nsec = 0;
  action->is_buffer_freeable = TRUE;
  action->task_to_wake = NULL;
  action->is_done = count == 0;
  action->is_closed = FALSE;
  action->has_hangup = FALSE;
  action->has_error = FALSE;
  af_fd_set_blocking(fd, FALSE);
  af_io_add(io, action);
  return action;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r14
movl $0x98, %edi
callq 0x2220
testq %rax, %rax
je 0xcfdc
movq %rax, %rbx
movq %r15, %rdi
callq 0x2220
testq %rax, %rax
je 0xcfd4
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x21f0
movl $0x1, %eax
movq %rax, 0x18(%rbx)
xorl %ecx, %ecx
movq %rcx, 0x20(%rbx)
movl %ebp, 0x28(%rbx)
movq %r13, 0x30(%rbx)
movq %r15, 0x38(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movq %rax, 0x50(%rbx)
movups %xmm0, 0x58(%rbx)
movq $-0x1, 0x68(%rbx)
movq %rcx, 0x70(%rbx)
xorl %eax, %eax
testq %r15, %r15
sete %al
movq %rax, 0x78(%rbx)
movups %xmm0, 0x80(%rbx)
movq %rcx, 0x90(%rbx)
movl %ebp, %edi
xorl %esi, %esi
callq 0xbf08
movq %r14, %rdi
movq %rbx, %rsi
callq 0xca43
jmp 0xcfde
movq %rbx, %rdi
callq 0x2050
xorl %ebx, %ebx
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_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_read_nonblock
ssize_t af_io_read_nonblock(int fd, af_byte_t* buffer, af_io_size_t count,
			    af_bool_t* again, af_io_error_t* error) {
  ssize_t size;
  af_fd_set_blocking(fd, FALSE);
  size = read(fd, buffer, sizeof(af_byte_t) * count);
  *again = size == -1 && (errno == EAGAIN || errno == EWOULDBLOCK ||
			  errno == EINTR) ? TRUE : FALSE;
  *error = size != -1 || (size == -1 && (errno == EAGAIN ||
					 errno == EWOULDBLOCK ||
					 errno == EINTR)) ? 0 : errno;
  return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r12
movl %edi, %ebp
xorl %r13d, %r13d
xorl %esi, %esi
callq 0xbf08
movl %ebp, %edi
movq %r12, %rsi
movq %r14, %rdx
callq 0x21c0
movq %rax, %r14
cmpq $-0x1, %rax
je 0xd045
movq $0x0, (%r15)
movl %r13d, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2070
movl (%rax), %eax
cmpl $0xb, %eax
sete %cl
cmpl $0x4, %eax
sete %al
orb %cl, %al
movzbl %al, %eax
negq %rax
movq %rax, (%r15)
callq 0x2070
movl (%rax), %eax
cmpl $0x4, %eax
je 0xd030
cmpl $0xb, %eax
je 0xd030
movl %eax, %r13d
jmp 0xd030
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_write_nonblock
ssize_t af_io_write_nonblock(int fd, af_byte_t* buffer, af_io_size_t count,
			     af_bool_t* again, af_io_error_t* error) {
  ssize_t size;
  af_fd_set_blocking(fd, FALSE);
  size = write(fd, buffer, sizeof(af_byte_t) * count);
  *again = size == -1 && (errno == EAGAIN || errno == EWOULDBLOCK ||
			  errno == EINTR) ? TRUE : FALSE;
  *error = size != -1 || (size == -1 && (errno == EAGAIN ||
					 errno == EWOULDBLOCK ||
					 errno == EINTR)) ? 0 : errno;
  return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r12
movl %edi, %ebp
xorl %r13d, %r13d
xorl %esi, %esi
callq 0xbf08
movl %ebp, %edi
movq %r12, %rsi
movq %r14, %rdx
callq 0x20f0
movq %rax, %r14
cmpq $-0x1, %rax
je 0xd0ce
movq $0x0, (%r15)
movl %r13d, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2070
movl (%rax), %eax
cmpl $0xb, %eax
sete %cl
cmpl $0x4, %eax
sete %al
orb %cl, %al
movzbl %al, %eax
negq %rax
movq %rax, (%r15)
callq 0x2070
movl (%rax), %eax
cmpl $0x4, %eax
je 0xd0b9
cmpl $0xb, %eax
je 0xd0b9
movl %eax, %r13d
jmp 0xd0b9
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/io.c
// Function: timespec_diff
void timespec_diff(struct timespec *start, struct timespec *stop,
                   struct timespec *result) {
  if ((stop->tv_nsec - start->tv_nsec) < 0) {
    result->tv_sec = stop->tv_sec - start->tv_sec - 1;
    result->tv_nsec = stop->tv_nsec - start->tv_nsec + 1000000000;
  } else {
    result->tv_sec = stop->tv_sec - start->tv_sec;
    result->tv_nsec = stop->tv_nsec - start->tv_nsec;
  }
}

// Assembly:
movq (%rsi), %r8
movq 0x8(%rsi), %rax
movq (%rdi), %rsi
movq 0x8(%rdi), %rcx
cmpq %rcx, %rax
jge 0xd14b
notq %rsi
addq %rsi, %r8
movq %r8, (%rdx)
addq $0x3b9aca00, %rax       # imm = 0x3B9ACA00
jmp 0xd151
subq %rsi, %r8
movq %r8, (%rdx)
subq %rcx, %rax
movq %rax, 0x8(%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/kobolt[P]curses-collection/fileselect/fileselect.c
// Function: file_node_new
static file_node_t *file_node_new(file_node_t *parent, char *name, file_node_type_t type)
{
  int len;
  file_node_t *new;

  new = (file_node_t *)malloc(sizeof(file_node_t));
  if (new == NULL)
    return NULL;

  if (name == NULL) {
    new->name = NULL;
  } else {
    len = strlen(name) + 1;
    new->name = (char *)malloc(len);
    strncpy(new->name, name, len);
  }
  new->type = type;
  new->parent = parent;
  new->no_of_subnodes = 0;
  new->subnode = NULL;
  new->marked = 0;
  
  return new;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
movl $0x30, %edi
callq 0x1190
testq %rax, %rax
je 0x1721
movq %rax, %rbx
testq %r15, %r15
je 0x1725
movq %r15, %rdi
callq 0x10d0
incl %eax
movslq %eax, %r12
movq %r12, %rdi
callq 0x1190
movq %rax, 0x8(%rbx)
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1070
jmp 0x172d
xorl %ebx, %ebx
jmp 0x1743
movq $0x0, 0x8(%rbx)
movl %ebp, 0x10(%rbx)
movq %r14, 0x18(%rbx)
xorl %eax, %eax
movl %eax, 0x20(%rbx)
movq $0x0, 0x28(%rbx)
movl %eax, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kobolt[P]curses-collection/fileselect/fileselect.c
// Function: file_node_scan
static int file_node_scan(file_node_t *current, char *path)
{
  DIR *dh;
  struct dirent *entry;
  struct stat st;
  char fullpath[PATH_MAX];
  file_node_t *subnode;

  dh = opendir(path);
  if (dh == NULL) {
    fprintf(stderr, "Error: Unable to open directory: %s\n", path);
    return -1;
  }

  while ((entry = readdir(dh))) {
    if (entry->d_name[0] == '.')
      continue; /* Ignore files with leading dot. */

    snprintf(fullpath, PATH_MAX, "%s/%s", path, entry->d_name);
    if (stat(fullpath, &st) == -1) {
      fprintf(stderr, "Warning: Unable to stat() path: %s\n", fullpath);
      continue;
    }

    if (S_ISDIR(st.st_mode)) {
      subnode = file_node_add(current, entry->d_name, FILE_NODE_TYPE_DIR);
      file_node_scan(subnode, fullpath);

    } else if (S_ISREG(st.st_mode)) {
      file_node_add(current, entry->d_name, FILE_NODE_TYPE_FILE);
    }
  }

  closedir(dh);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1098, %rsp           # imm = 0x1098
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x10c0
testq %rax, %rax
je 0x1866
movq %rax, %r15
movq %rax, %rdi
callq 0x1180
testq %rax, %rax
je 0x184a
movq %rax, %r12
leaq 0x90(%rsp), %r13
movq %rsp, %rbp
cmpb $0x2e, 0x13(%r12)
je 0x1817
addq $0x13, %r12
movl $0x1000, %esi           # imm = 0x1000
movq %r13, %rdi
leaq 0x8d2(%rip), %rdx       # 0x2086
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x1100
movq %r13, %rdi
movq %rbp, %rsi
callq 0x1170
cmpl $-0x1, %eax
je 0x182d
movl 0x18(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
movl %eax, %ecx
negw %cx
jo 0x1807
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x1817
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x1a2b
movq %rax, %rdi
movq %r13, %rsi
callq 0x174f
jmp 0x1817
movq %r14, %rdi
movq %r12, %rsi
movl $0x2, %edx
callq 0x1a2b
movq %r15, %rdi
callq 0x1180
movq %rax, %r12
testq %rax, %rax
jne 0x1799
jmp 0x184a
movq 0x27c4(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x84e(%rip), %rsi       # 0x208c
movq %r13, %rdx
xorl %eax, %eax
callq 0x1160
jmp 0x1817
movq %r15, %rdi
callq 0x1120
xorl %eax, %eax
addq $0x1098, %rsp           # imm = 0x1098
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x278b(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x7ea(%rip), %rsi       # 0x2061
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1160
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1854
// File: /workspace/github_c_makefile_star2_O1/kobolt[P]curses-collection/fileselect/fileselect.c
// Function: file_node_remove
static void file_node_remove(file_node_t *node)
{
  int i;
  free(node->name);
  for (i = 0; i < node->no_of_subnodes; i++) {
    file_node_remove(node->subnode[i]);
  }
  if (node->subnode != NULL) {
    free(node->subnode);
  }
  free(node);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x1040
cmpl $0x0, 0x20(%rbx)
je 0x18b9
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x1888
incq %r14
movl 0x20(%rbx), %eax
cmpq %rax, %r14
jb 0x18a1
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x18c7
callq 0x1040
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/kobolt[P]curses-collection/fileselect/fileselect.c
// Function: file_node_sort
static void file_node_sort(file_node_t *node)
{
  int i;
  qsort(node->subnode, node->no_of_subnodes, sizeof(file_node_t *), file_node_compare);
  for (i = 0; i < node->no_of_subnodes; i++) {
    file_node_sort(node->subnode[i]);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
movl 0x20(%rbx), %esi
leaq 0x19a(%rip), %rcx       # 0x1a85
movl $0x8, %edx
callq 0x1080
cmpl $0x0, 0x20(%rbx)
je 0x1916
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x18d6
incq %r14
movl 0x20(%rbx), %eax
cmpq %rax, %r14
jb 0x18fe
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/kobolt[P]curses-collection/fileselect/fileselect.c
// Function: file_node_print_marked
static void file_node_print_marked(file_node_t *node, char *root_dir, FILE *fh)
{
  int i;
  char path[PATH_MAX];

  if (node->marked) {
    fprintf(fh, "%s/%s\n", root_dir, file_node_path(node, path, PATH_MAX));
  }

  for (i = 0; i < node->no_of_subnodes; i++) {
    file_node_print_marked(node->subnode[i], root_dir, fh);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x0, (%rdi)
je 0x195f
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1ee0
leaq 0x761(%rip), %rsi       # 0x20b0
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x1160
cmpl $0x0, 0x20(%r15)
je 0x1988
xorl %r12d, %r12d
movq 0x28(%r15), %rax
movq (%rax,%r12,8), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x191e
incq %r12
movl 0x20(%r15), %eax
cmpq %rax, %r12
jb 0x1969
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/kobolt[P]curses-collection/fileselect/fileselect.c
// Function: file_node_dump
static void file_node_dump(file_node_t *node)
{
  int i, depth;

  depth = file_node_depth(node);
  while (depth-- > 1)
    printf("  ");

  if (node->type == FILE_NODE_TYPE_ROOT)
    printf("/");
  else {
    printf("%s", node->name);
    if (node->type == FILE_NODE_TYPE_DIR)
      printf("/");
  }

  printf("\n");

  for (i = 0; i < node->no_of_subnodes; i++) {
    file_node_dump(node->subnode[i]);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %ebp, %ebp
movq %rdi, %rax
cmpl $0x0, 0x10(%rax)
je 0x19b4
movq 0x18(%rax), %rax
incl %ebp
testq %rax, %rax
jne 0x19a3
cmpl $0x2, %ebp
jl 0x19d3
incl %ebp
leaq 0x6f5(%rip), %r14       # 0x20b7
movq %r14, %rdi
xorl %eax, %eax
callq 0x10f0
decl %ebp
cmpl $0x2, %ebp
jg 0x19c2
cmpl $0x0, 0x10(%rbx)
je 0x19f1
movq 0x8(%rbx), %rsi
leaq 0x6a5(%rip), %rdi       # 0x2089
xorl %eax, %eax
callq 0x10f0
cmpl $0x1, 0x10(%rbx)
jne 0x19fb
movl $0x2f, %edi
callq 0x1050
movl $0xa, %edi
callq 0x1050
cmpl $0x0, 0x20(%rbx)
je 0x1a26
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x1997
incq %r14
movl 0x20(%rbx), %eax
cmpq %rax, %r14
jb 0x1a0e
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kobolt[P]curses-collection/fileselect/fileselect.c
// Function: file_node_add
static file_node_t *file_node_add(file_node_t *current, char *name, file_node_type_t type)
{
  file_node_t *new;

  new = file_node_new(current, name, type);
  if (new == NULL)
    return NULL;

  if (current->subnode == NULL) {
    current->subnode = malloc(sizeof(file_node_t *));
  } else {
    current->subnode = realloc(current->subnode, sizeof(file_node_t *) * (current->no_of_subnodes + 1));
  }

  current->subnode[current->no_of_subnodes] = new;
  current->no_of_subnodes++;

  return new;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x16d1
testq %rax, %rax
je 0x1a59
movq %rax, %rbx
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x1a5d
movl 0x20(%r14), %esi
incl %esi
shlq $0x3, %rsi
callq 0x11a0
jmp 0x1a67
xorl %ebx, %ebx
jmp 0x1a7a
movl $0x8, %edi
callq 0x1190
movq %rax, 0x28(%r14)
movl 0x20(%r14), %ecx
movq %rbx, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x20(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/kobolt[P]curses-collection/fileselect/fileselect.c
// Function: file_node_list_size
static int file_node_list_size(file_node_t *node)
{
  int i, size;

  if (node->type == FILE_NODE_TYPE_ROOT) {
    size = 0;
  } else {
    size = 1;
  }

  for (i = 0; i < node->no_of_subnodes; i++) {
    size += file_node_list_size(node->subnode[i]);
  }

  return size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpl $0x0, 0x10(%rdi)
setne %bl
movl 0x20(%rdi), %r14d
testq %r14, %r14
je 0x1ad1
movq 0x28(%rdi), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x1a9d
addl %eax, %ebx
incq %r12
cmpq %r12, %r14
jne 0x1abe
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/kobolt[P]curses-collection/fileselect/fileselect.c
// Function: file_node_get_by_node_no
static file_node_t *file_node_get_by_node_no(file_node_t *node, int node_no, int *node_count)
{
  file_node_t *found;
  int i;

  if (node->type != FILE_NODE_TYPE_ROOT) {
    *node_count = *node_count + 1;
  }
  
  if (*node_count == node_no) {
    return node; /* Match found, return self. */
  }

  for (i = 0; i < node->no_of_subnodes; i++) {
    found = file_node_get_by_node_no(node->subnode[i], node_no, node_count);
    if (found != NULL) {
      return found;
    }
  }

  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
cmpl $0x0, 0x10(%rdi)
je 0x1e9b
incl (%r14)
cmpl %ebp, (%r14)
je 0x1ed2
cmpl $0x0, 0x20(%rbx)
je 0x1ecb
xorl %r15d, %r15d
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x1e83
testq %rax, %rax
jne 0x1ecf
incq %r15
movl 0x20(%rbx), %eax
cmpq %rax, %r15
jb 0x1ea9
xorl %ebx, %ebx
jmp 0x1ed2
movq %rax, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kobolt[P]curses-collection/fileselect/fileselect.c
// Function: file_node_path
static char *file_node_path(file_node_t *node, char *path, int path_len)
{
  char temp[PATH_MAX];

  strncpy(path, node->name, path_len);

  node = node->parent;
  while (node != NULL) {
    if (node->type == FILE_NODE_TYPE_ROOT) {
      break;
    }
    strncpy(temp, path, PATH_MAX);
    snprintf(path, path_len, "%s/%s", node->name, temp);
    node = node->parent;
  }

  return path;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rsi
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rdi
callq 0x1070
movq 0x18(%r14), %r12
testq %r12, %r12
je 0x1f54
movq %rsp, %r14
leaq 0x16e(%rip), %r15       # 0x2086
cmpl $0x0, 0x10(%r12)
je 0x1f54
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1070
movq 0x8(%r12), %rcx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %r8
xorl %eax, %eax
callq 0x1100
movq 0x18(%r12), %r12
testq %r12, %r12
jne 0x1f18
movq %rbx, %rax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O1/giometti[P]mastering_UNIX_programming/chapter_05/readdir.c
// Function: main
int main(int argc, char *argv[])
{
	struct stat buf;
	DIR *d;
	struct dirent *dp;
	int dirfd, fd;
        int ret;

        if (argc < 2) {
                fprintf(stderr, "usage: %s <dir>\n", argv[0]);
                return -1;
        }

	/* Open the directory entry */
	dirfd = open(argv[1], O_RDONLY);
	if (dirfd < 0) {
		perror("open");
		return -1;
	}

	/* Create the DIR stream over the dirfd */
	d = fdopendir(dirfd);
	if (d == NULL) {
		fprintf(stderr,
			"Cannot open %s directory\n", argv[1]);
		return -1;
	}

	/* Now iterate over files */
	printf("Files list for directory %s:\n", argv[1]);
	printf("size\tname\n");
	while ((dp = readdir(d)) != NULL) {
		/* Get a file descriptor for next direntry */
		fd = openat(dirfd, dp->d_name, O_RDONLY);
		if (fd < 0) {
			perror(dp->d_name);
			continue;
		}

		/* Get file's statistics */
		ret = fstat(fd, &buf);
		close(fd); /* fd is not needed anymore */
		if (ret < 0) {
			perror(dp->d_name);
			continue;
		}

		/* Print the file entry (size & name) */
		printf("%ld\t%s\n",
			(intmax_t) buf.st_size,
			dp->d_name);
	}

	closedir(d); /* this implicitly closes dirfd */

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r15
cmpl $0x1, %edi
jle 0x1318
movq 0x8(%r15), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x10a0
testl %eax, %eax
js 0x1322
movl %eax, %ebx
addq $0x8, %r15
movl %eax, %edi
callq 0x10c0
testq %rax, %rax
je 0x1330
movq %rax, %r14
movq (%r15), %rsi
leaq 0xdc3(%rip), %rdi       # 0x2034
xorl %eax, %eax
callq 0x1050
leaq 0xddb(%rip), %rdi       # 0x205a
callq 0x1030
movq %r14, %rdi
callq 0x1090
testq %rax, %rax
je 0x12fc
movq %rax, %r13
leaq 0x8(%rsp), %r15
addq $0x13, %r13
movl %ebx, %edi
movq %r13, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x1040
testl %eax, %eax
js 0x12f2
movl %eax, %ebp
movl %eax, %edi
movq %r15, %rsi
callq 0x10d0
movl %eax, %r12d
movl %ebp, %edi
callq 0x1060
testl %r12d, %r12d
js 0x12f2
movq 0x38(%rsp), %rsi
leaq 0xd7c(%rip), %rdi       # 0x2052
movq %r13, %rdx
xorl %eax, %eax
callq 0x1050
movq %r14, %rdi
callq 0x1090
movq %rax, %r13
testq %rax, %rax
jne 0x1299
jmp 0x12fc
movq %r13, %rdi
callq 0x10b0
jmp 0x12e0
movq %r14, %rdi
callq 0x1070
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x110e
jmp 0x1338
leaq 0xcec(%rip), %rdi       # 0x2015
callq 0x10b0
jmp 0x1338
movq %r15, %rdi
callq 0x10f0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1306