LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/obstcp-redir.c
// Function: connection_setevents
static void
connection_setevents(struct connection *conn) {
  const short outev = (conn->outqlen < QUEUE_MAX ? EV_READ : 0) |
                      EV_PERSIST |
                      (conn->outqhead ? EV_WRITE : 0);
  const short obsev = (conn->obsqlen < QUEUE_MAX ? EV_READ : 0) |
                      EV_PERSIST |
                      (conn->obsqhead ? EV_WRITE : 0);

  if (conn->outevent.ev_events != outev) {
    if (conn->outevent.ev_events) {
      event_del(&conn->outevent);
    }
    event_set(&conn->outevent, conn->outfd, outev, connection_out_cb, conn);
    event_add(&conn->outevent, NULL);
  }

  if (conn->obsevent.ev_events != obsev) {
    if (conn->obsevent.ev_events) {
      event_del(&conn->obsevent);
    }
    event_set(&conn->obsevent, conn->fd, obsev, connection_obs_cb, conn);
    event_add(&conn->obsevent, NULL);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x8000, %eax           # imm = 0x8000
xorl %ecx, %ecx
cmpl %eax, 0x300(%rdi)
setb %cl
xorl %edx, %edx
cmpq $0x0, 0x2d0(%rdi)
setne %dl
shll $0x2, %edx
leal (%rdx,%rcx,2), %r15d
addl $0x10, %r15d
xorl %ecx, %ecx
cmpl %eax, 0x304(%rdi)
setb %cl
xorl %eax, %eax
cmpq $0x0, 0x2e0(%rdi)
setne %al
shll $0x2, %eax
leal (%rax,%rcx,2), %ebp
addl $0x10, %ebp
movzwl 0x2b8(%rdi), %eax
cmpw %r15w, %ax
je 0x18b1
leaq 0x250(%rbx), %r14
testw %ax, %ax
je 0x188b
movq %r14, %rdi
callq 0x10a0
movl 0x1cc(%rbx), %esi
movzwl %r15w, %edx
leaq 0x105(%rip), %rcx       # 0x19a1
movq %r14, %rdi
movq %rbx, %r8
callq 0x1190
movq %r14, %rdi
xorl %esi, %esi
callq 0x1120
movzwl 0x238(%rbx), %eax
cmpw %bp, %ax
jne 0x18c8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d0(%rbx), %r14
testw %ax, %ax
je 0x18dc
movq %r14, %rdi
callq 0x10a0
movl 0x1c8(%rbx), %esi
movzwl %bp, %edx
leaq 0x27f(%rip), %rcx       # 0x1b6b
movq %r14, %rdi
movq %rbx, %r8
callq 0x1190
movq %r14, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1120
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/obstcp-redir.c
// Function: connection_free
static void
connection_free(struct connection *conn) {
  struct chunk *c, *next;

  if (conn->outevent.ev_events) {
    event_del(&conn->outevent);
  }

  if (conn->obsevent.ev_events) {
    event_del(&conn->obsevent);
  }

  close(conn->fd);
  close(conn->outfd);

  for (c = conn->outqhead; c; c = next) {
    next = c->next;
    free(c);
  }

  for (c = conn->obsqhead; c; c = next) {
    next = c->next;
    free(c);
  }

  obstcp_rbuf_free(&conn->rbuf);

  free(conn);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpw $0x0, 0x2b8(%rdi)
je 0x1928
leaq 0x250(%rbx), %rdi
callq 0x10a0
cmpw $0x0, 0x238(%rbx)
je 0x193e
leaq 0x1d0(%rbx), %rdi
callq 0x10a0
movl 0x1c8(%rbx), %edi
callq 0x10e0
movl 0x1cc(%rbx), %edi
callq 0x10e0
movq 0x2d0(%rbx), %rdi
testq %rdi, %rdi
je 0x196d
movq (%rdi), %r14
callq 0x1030
movq %r14, %rdi
jmp 0x195b
movq 0x2e0(%rbx), %rdi
testq %rdi, %rdi
je 0x1986
movq (%rdi), %r14
callq 0x1030
movq %r14, %rdi
jmp 0x1974
leaq 0x198(%rbx), %rdi
callq 0x396b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/obstcp-redir.c
// Function: connection_obs_cb
static void
connection_obs_cb(int fd, short events, void *arg) {
  struct connection *conn = (struct connection *) arg;

  if (EV_READ & events) {
    int queued;
    if (ioctl(conn->fd, SIOCINQ, &queued)) {
      perror("ioctl");
      connection_free(conn);
      return;
    }
    if (!queued) queued = 16;

    struct chunk *c = malloc(sizeof(struct chunk) + queued);
    if (!c) return;
    memset(c, 0, sizeof(struct chunk));

    const ssize_t n =
      obstcp_rbuf_read_fd(&conn->rbuf, conn->fd, c->data, queued);

    if (n < 0) {
      if (errno == EAGAIN || errno == EWOULDBLOCK) return;
      perror("read");
      free(c);
      connection_free(conn);
      return;
    } else if (n == 0) {
      free(c);
      connection_free(conn);
      return;
    } else {
      c->length = n;
      const char was_empty_q = conn->outqhead ? 0 : 1;

      conn->outqlen += c->length;
      if (conn->pendingqhead) {
        chunks_move(&conn->outqhead, &conn->outqtail,
                    &conn->pendingqhead, &conn->pendingqtail);
      }
      chunk_nq(c, &conn->outqhead, &conn->outqtail);
      if (was_empty_q) if (!connection_out_write(conn)) return;
    }
  }

  if (EV_WRITE & events) {
    if (!connection_obs_write(conn)) return;
  }

  connection_setevents(conn);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
testb $0x2, %bpl
jne 0x1ba1
movzwl %bp, %eax
testb $0x4, %al
je 0x1b94
movq %rbx, %rdi
callq 0x1cfe
testl %eax, %eax
je 0x1cf3
movq %rbx, %rdi
callq 0x1817
jmp 0x1cf3
movl 0x1c8(%rbx), %edi
leaq 0x4(%rsp), %rdx
movl $0x541b, %esi           # imm = 0x541B
xorl %eax, %eax
callq 0x10d0
testl %eax, %eax
jne 0x1cdf
movl 0x4(%rsp), %eax
testl %eax, %eax
jne 0x1bd3
movl $0x10, 0x4(%rsp)
pushq $0x10
popq %rax
movslq %eax, %r15
leaq 0x18(%r15), %rdi
callq 0x1160
testq %rax, %rax
je 0x1cf3
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x198(%rbx), %rdi
movl 0x1c8(%rbx), %esi
movq %rax, %rdx
addq $0x18, %rdx
movq %r15, %rcx
callq 0x3d4a
testq %rax, %rax
js 0x1c7c
je 0x1c92
movl %eax, 0x10(%r14)
movq 0x2d0(%rbx), %rcx
movq 0x2f0(%rbx), %rsi
addl %eax, 0x300(%rbx)
movq %rcx, %rax
testq %rsi, %rsi
je 0x1ca2
leaq 0x2f0(%rbx), %rdx
movq %rcx, %rax
testq %rsi, %rsi
je 0x1c9c
movq %rsi, %rdi
movq (%rsi), %rsi
movq 0x2d8(%rbx), %rax
movq %rax, 0x8(%rdi)
andq $0x0, (%rdi)
movq %rdi, 0x2d8(%rbx)
movq 0x2d0(%rbx), %rax
testq %rax, %rax
jne 0x1c43
movq %rdi, 0x2d0(%rbx)
movq %rdi, %rax
jmp 0x1c43
callq 0x1050
cmpl $0xb, (%rax)
je 0x1cf3
leaq 0x64de(%rip), %rdi      # 0x816b
callq 0x11c0
movq %r14, %rdi
callq 0x1030
jmp 0x1ceb
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movq 0x2d8(%rbx), %rdx
movq %rdx, 0x8(%r14)
andq $0x0, (%r14)
movq %r14, 0x2d8(%rbx)
testq %rax, %rax
jne 0x1cc4
movq %r14, 0x2d0(%rbx)
testq %rcx, %rcx
jne 0x1b7d
movq %rbx, %rdi
callq 0x1d7c
testl %eax, %eax
jne 0x1b7d
jmp 0x1cf3
leaq 0x647f(%rip), %rdi      # 0x8165
callq 0x11c0
movq %rbx, %rdi
callq 0x190b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/obstcp-redir.c
// Function: connection_obs_write
static int
connection_obs_write(struct connection *conn) {
  struct chunk *c, *next;
  for (c = conn->obsqhead; c; c = next) {
    next = c->next;
    if (!connection_write(c, conn->fd)) {
      connection_free(conn);
      return 0;
    }
    if (c->done == c->length) {
      conn->obsqlen -= c->length;
      chunk_free(&conn->obsqhead, &conn->obsqtail);
    } else {
      break;
    }
  }

  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x2e0(%rdi), %r15
movq 0x2e0(%rdi), %r13
leaq 0x2e8(%rdi), %r12
pushq $0x1
popq %rbx
testq %r13, %r13
je 0x1d6b
movq (%r13), %rbp
movl 0x1c8(%r14), %esi
movq %r13, %rdi
callq 0x1dfa
testl %eax, %eax
je 0x1d61
movl 0x14(%r13), %eax
cmpl 0x10(%r13), %eax
jne 0x1d6b
subl %eax, 0x304(%r14)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1e66
movq %rbp, %r13
jmp 0x1d24
movq %r14, %rdi
callq 0x190b
xorl %ebx, %ebx
movl %ebx, %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/obstcp-redir.c
// Function: connection_out_write
static int
connection_out_write(struct connection *conn) {
  struct chunk *c, *next;
  for (c = conn->outqhead; c; c = next) {
    next = c->next;
    if (!connection_write(c, conn->outfd)) {
      connection_free(conn);
      return 0;
    }
    if (c->done == c->length) {
      conn->outqlen -= c->length;
      chunk_free(&conn->outqhead, &conn->outqtail);
    } else {
      break;
    }
  }

  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x2d0(%rdi), %r15
movq 0x2d0(%rdi), %r13
leaq 0x2d8(%rdi), %r12
pushq $0x1
popq %rbx
testq %r13, %r13
je 0x1de9
movq (%r13), %rbp
movl 0x1cc(%r14), %esi
movq %r13, %rdi
callq 0x1dfa
testl %eax, %eax
je 0x1ddf
movl 0x14(%r13), %eax
cmpl 0x10(%r13), %eax
jne 0x1de9
subl %eax, 0x300(%r14)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1e66
movq %rbp, %r13
jmp 0x1da2
movq %r14, %rdi
callq 0x190b
xorl %ebx, %ebx
movl %ebx, %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/obstcp-redir.c
// Function: connection_write
static int
connection_write(struct chunk *c, int fd) {
  if (c->length == c->done) return 1;

  ssize_t n;
  do {
    n = write(fd, c->data + c->done, c->length - c->done);
  } while (n == -1 && errno == EINTR);

  if (n < 0) {
    if (errno == EAGAIN || errno == EWOULDBLOCK) return 1;
    return 0;
  } else if (n == 0) {
    return 0;
  } else {
    c->done += n;
    return 1;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0x10(%rdi), %eax
pushq $0x1
popq %rbx
cmpl 0x14(%rdi), %eax
je 0x1e55
movl %esi, %ebp
movq %rdi, %r14
leaq 0x18(%rdi), %r15
movl 0x10(%r14), %edx
movl 0x14(%r14), %esi
subl %esi, %edx
addq %r15, %rsi
movl %ebp, %edi
callq 0x1090
cmpq $-0x1, %rax
jne 0x1e3b
callq 0x1050
cmpl $0x4, (%rax)
je 0x1e15
jmp 0x1e4d
testq %rax, %rax
js 0x1e48
je 0x1e62
addl %eax, 0x14(%r14)
jmp 0x1e55
callq 0x1050
xorl %ebx, %ebx
cmpl $0xb, (%rax)
sete %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x1e55
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/obstcp-redir.c
// Function: chunk_free
static void
chunk_free(struct chunk **head, struct chunk **tail) {
  if ((*head)->next)
    (*head)->next->last = NULL;

  struct chunk *next = (*head)->next;
  free(*head);

  if (*tail == *head) *tail = NULL;
  *head = next;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x1e89
andq $0x0, 0x8(%rax)
movq (%rbx), %rdi
movq (%rdi), %r15
jmp 0x1e8c
xorl %r15d, %r15d
callq 0x1030
movq (%r14), %rax
cmpq (%rbx), %rax
jne 0x1e9d
andq $0x0, (%r14)
movq %r15, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/os/qq_alloc.c
// Function: qq_alloc
void *
qq_alloc(size_t size)
{
    void  *p;

    p = malloc(size);
    if (p == NULL) {
        qq_log_error(errno, "malloc(%uz) failed", size);
    }

    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x2350
movq %rax, %rbx
testq %rax, %rax
jne 0x247b
callq 0x2030
movl (%rax), %edi
leaq 0x6b93(%rip), %rsi      # 0x9004
movq %r14, %rdx
xorl %eax, %eax
callq 0x65bd
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/os/qq_alloc.c
// Function: qq_calloc
void *
qq_calloc(size_t size)
{
    void  *p;

    p = qq_alloc(size);

    if (p) {
        memset(p, 0, size);
    }

    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x244c
testq %rax, %rax
je 0x24a9
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2160
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/os/qq_alloc.c
// Function: qq_memalign
void *
qq_memalign(size_t alignment, size_t size)
{
    void  *p;

    p = memalign(alignment, size);
    if (p == NULL) {
        qq_log_error(errno, "memalign(%uz, %uz) failed", alignment, size);
    }

    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
callq 0x22c0
movq %rax, %r14
testq %rax, %rax
jne 0x24e8
callq 0x2030
movl (%rax), %edi
leaq 0x6b3c(%rip), %rsi      # 0x9017
movq %r15, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x65bd
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_android_app.c
// Function: qq_android_app_init
qq_int_t
qq_android_app_init(qq_cycle_t *cycle)
{
    if (qq_add_listening_config(SOCK_STREAM,
        QQ_ANDROID_APP_TCP_LISTENING_PORT,
        QQ_ANDROID_APP_TCP_LISTENING_POOL_SIZE,
        qq_android_app_init_connection_handler) == QQ_ERROR)
    {
        qq_log_error(0, "qq_android_app_init()->qq_add_listening_config() failed");
        return QQ_ERROR;
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x31(%rip), %rcx        # 0x2534
pushq $0x1
popq %rdi
movl $0x400, %edx            # imm = 0x400
movl $0x2af8, %esi           # imm = 0x2AF8
callq 0x5f10
cmpq $-0x1, %rax
je 0x251f
xorl %eax, %eax
jmp 0x2532
leaq 0x6b0b(%rip), %rsi      # 0x9031
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_android_app.c
// Function: qq_android_app_init_connection_handler
static void
qq_android_app_init_connection_handler(qq_connection_t *c)
{
    qq_event_t   *rev, *wev;

    qq_log_debug("qq_android_app_init_connection_handler()");

    rev = c->read;
    rev->handler = qq_android_app_read_event_handler;

    wev = c->write;
    wev->handler = qq_android_app_write_event_handler;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6b3b(%rip), %rdi      # 0x907f
xorl %eax, %eax
callq 0x6706
movq 0x8(%rbx), %rax
leaq 0x3b(%rip), %rcx        # 0x2591
movq %rcx, 0x10(%rax)
movq 0x10(%rbx), %rax
leaq 0x75(%rip), %rcx        # 0x25da
movq %rcx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_android_app.c
// Function: qq_android_app_read_event_handler
static void
qq_android_app_read_event_handler(qq_event_t *ev)
{
    qq_log_debug("qq_android_app_read_event_handler()");

    qq_connection_t   *c;
    u_char             buf[3];
    int                len;

    c = ev->data;
    len = c->recv(c, buf, 3);

    c->send(c, buf, 3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6b03(%rip), %rdi      # 0x90a8
xorl %eax, %eax
callq 0x6706
movq (%rbx), %rbx
leaq -0x1b(%rbp), %r14
pushq $0x3
popq %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *0x28(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_app.c
// Function: qq_app_init
qq_int_t
qq_app_init(qq_cycle_t *cycle)
{
    if (qq_mysql_init() == QQ_ERROR) {
        qq_log_error(0, "qq_mysql_init() failed");
        return QQ_ERROR;
    }

    if (qq_ios_app_init(cycle) == QQ_ERROR) {
        qq_log_error(0, "qq_ios_app_init() failed");
        return QQ_ERROR;
    }

    if (qq_android_app_init(cycle) == QQ_ERROR) {
        qq_log_error(0, "qq_android_app_init() failed");
        return QQ_ERROR;
    }

    if (qq_wifi_device_init(cycle) == QQ_ERROR) {
        qq_log_error(0, "qq_wifi_device_init() failed");
        return QQ_ERROR;
    }

    if (qq_video_audio_device_init(cycle) == QQ_ERROR) {
        qq_log_error(0, "qq_video_audio_device_init() failed");
        return QQ_ERROR;
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x7344
cmpq $-0x1, %rax
je 0x2640
movq %rbx, %rdi
callq 0x3b2c
cmpq $-0x1, %rax
je 0x2649
movq %rbx, %rdi
callq 0x24f8
cmpq $-0x1, %rax
je 0x2652
movq %rbx, %rdi
callq 0x84c4
cmpq $-0x1, %rax
je 0x265b
movq %rbx, %rdi
callq 0x8438
cmpq $-0x1, %rax
je 0x2664
xorl %eax, %eax
jmp 0x2677
leaq 0x6aaa(%rip), %rsi      # 0x90f1
jmp 0x266b
leaq 0x6ab8(%rip), %rsi      # 0x9108
jmp 0x266b
leaq 0x6ac8(%rip), %rsi      # 0x9121
jmp 0x266b
leaq 0x6adc(%rip), %rsi      # 0x913e
jmp 0x266b
leaq 0x6af0(%rip), %rsi      # 0x915b
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_app.c
// Function: qq_app_done
void
qq_app_done(qq_cycle_t *cycle)
{
    qq_log_debug("qq_app_done()");

    qq_mysql_close();
    qq_ios_app_done();
    qq_android_app_done();
    qq_wifi_device_done();
    qq_video_audio_device_done();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x6af6(%rip), %rdi      # 0x917f
xorl %eax, %eax
callq 0x6706
callq 0x73db
callq 0x3ba8
callq 0x2570
callq 0x8612
popq %rbp
jmp 0x84b1
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_app.c
// Function: qq_app_close_connection
void
qq_app_close_connection(qq_connection_t *c)
{
    qq_pool_t  *pool;

    qq_log_debug("qq_app_close_connection(fd:%d)", c->fd);

    c->destroyed = 1;

    pool = c->pool;

    qq_close_connection(c);

    qq_destroy_pool(pool);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x18(%rdi), %esi
leaq 0x6acf(%rip), %rdi      # 0x918d
xorl %eax, %eax
callq 0x6706
orb $0x4, 0x98(%rbx)
movq 0x40(%rbx), %r14
movq %rbx, %rdi
callq 0x2856
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2348
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_buf.c
// Function: qq_create_temp_buf
qq_buf_t *
qq_create_temp_buf(qq_pool_t *pool, size_t size)
{
    qq_buf_t *b;

    b = qq_calloc_buf(pool);
    if (b == NULL) {
        return NULL;
    }

    b->start = qq_palloc(pool, size);
    if (b->start == NULL) {
        return NULL;
    }

    b->pos = b->start;
    b->last = b->start;
    b->end = b->last + size;
    b->temporary = 1;

    return b;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
pushq $0x38
popq %rsi
callq 0x7694
testq %rax, %rax
je 0x272c
movq %rax, %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x764e
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x272c
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
addq %rax, %r14
movq %r14, 0x28(%rbx)
orb $0x1, 0x30(%rbx)
jmp 0x272e
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_connection.c
// Function: qq_get_connection
qq_connection_t *
qq_get_connection(qq_socket_t s)
{
    qq_uint_t         instance;
    qq_event_t       *rev, *wev;
    qq_connection_t  *c;

    c = qq_cycle->free_connections;
    if (c == NULL) {
        qq_log_error(0, 
                     "qq_get_connection(connection_n:%u) worker_connections are not enough",
                     qq_cycle->connection_n);

        return NULL;
    }

    qq_cycle->free_connections = c->data;
    qq_cycle->free_connection_n--;

    rev = c->read;
    wev = c->write;

    memset(c, 0, sizeof(qq_connection_t));

    c->read = rev;
    c->write = wev;
    c->fd = s;

    instance = rev->instance;

    memset(rev, 0, sizeof(qq_event_t));
    memset(wev, 0, sizeof(qq_event_t));

    rev->instance = !instance;
    wev->instance = !instance;

    rev->index = QQ_INVALID_INDEX;
    wev->index = QQ_INVALID_INDEX;

    rev->data = c;
    wev->data = c;

    wev->write = 1;

    return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0xbb62(%rip), %rax      # 0xe2b0
movq (%rax), %rax
movq 0x18(%rax), %rbx
testq %rbx, %rbx
je 0x2814
movl %edi, %r14d
movq (%rbx), %rcx
movq %rcx, 0x18(%rax)
decq 0x20(%rax)
movq 0x8(%rbx), %r12
movq 0x10(%rbx), %r15
movl $0xa0, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2160
movq %r12, 0x8(%rbx)
movq %r15, 0x10(%rbx)
movl %r14d, 0x18(%rbx)
movl 0x8(%r12), %eax
notl %eax
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%r12)
movups %xmm0, 0x30(%r12)
movups %xmm0, 0x20(%r12)
movups %xmm0, 0x10(%r12)
movups %xmm0, (%r12)
andq $0x0, 0x50(%r12)
movups %xmm0, (%r15)
movups %xmm0, 0x10(%r15)
movups %xmm0, 0x20(%r15)
movups %xmm0, 0x30(%r15)
movups %xmm0, 0x40(%r15)
andq $0x0, 0x50(%r15)
andl $0x4, %eax
movl 0x8(%r12), %ecx
andl $-0x5, %ecx
orl %eax, %ecx
movl %ecx, 0x8(%r12)
movl 0x8(%r15), %ecx
andl $-0x5, %ecx
orl %eax, %ecx
movl %ecx, 0x8(%r15)
movl $0xd0d0d0d0, %eax       # imm = 0xD0D0D0D0
movq %rax, 0x18(%r12)
movq %rax, 0x18(%r15)
movq %rbx, (%r12)
movq %rbx, (%r15)
orb $0x1, 0x8(%r15)
jmp 0x2828
movq 0x8(%rax), %rdx
leaq 0x698d(%rip), %rsi      # 0x91ac
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_connection.c
// Function: qq_close_connection
void
qq_close_connection(qq_connection_t *c)
{
    qq_socket_t  fd;

    if (c->fd == (qq_socket_t) -1) {
        qq_log_error(0, "qq_close_connection() connection already closed");
        return;
    }

    if (c->read->timer_set) {
        qq_event_del_timer(c->read);
    }

    if (c->write->timer_set) {
        qq_event_del_timer(c->write);
    }

    qq_epoll_del_connection(c);

    if (c->read->posted) {
        qq_delete_posted_event(c->read);
    }

    if (c->write->posted) {
        qq_delete_posted_event(c->write);
    }

    c->read->closed = 1;
    c->write->closed = 1;

    qq_free_connection(c);

    fd = c->fd;
    c->fd = (qq_socket_t) -1;

    if (close(fd) == -1) {
        qq_log_error(errno, "qq_close_connection(fd:%d) failed", fd);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpl $-0x1, 0x18(%rdi)
je 0x2931
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testb $0x8, 0x9(%rdi)
je 0x2879
callq 0x2961
movq 0x10(%rbx), %rdi
testb $0x8, 0x9(%rdi)
je 0x2888
callq 0x2961
movq %rbx, %rdi
callq 0x2db0
movq 0x8(%rbx), %rax
movl 0x8(%rax), %ecx
testw %cx, %cx
jns 0x28c6
andl $0xffff7fff, %ecx       # imm = 0xFFFF7FFF
movl %ecx, 0x8(%rax)
movq 0x8(%rbx), %rsi
movq 0x48(%rsi), %rax
movq 0x50(%rsi), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
leaq 0x6962(%rip), %rdi      # 0x9221
xorl %eax, %eax
callq 0x6706
movq 0x10(%rbx), %rax
movl 0x8(%rax), %ecx
testw %cx, %cx
jns 0x28fc
andl $0xffff7fff, %ecx       # imm = 0xFFFF7FFF
movl %ecx, 0x8(%rax)
movq 0x10(%rbx), %rsi
movq 0x48(%rsi), %rax
movq 0x50(%rsi), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
leaq 0x692c(%rip), %rdi      # 0x9221
xorl %eax, %eax
callq 0x6706
movq 0x8(%rbx), %rax
movl $0x10000, %ecx          # imm = 0x10000
orl %ecx, 0x8(%rax)
movq 0x10(%rbx), %rax
orl %ecx, 0x8(%rax)
movq %rbx, %rdi
callq 0x2834
movl 0x18(%rbx), %r14d
orl $-0x1, 0x18(%rbx)
movl %r14d, %edi
callq 0x2330
cmpl $-0x1, %eax
je 0x2945
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x68b9(%rip), %rsi      # 0x91f1
xorl %edi, %edi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x65bd
callq 0x2030
movl (%rax), %edi
leaq 0x68ec(%rip), %rsi      # 0x923f
movl %r14d, %edx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x65bd
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_cycle.c
// Function: qq_cycle_init
qq_int_t
qq_cycle_init(void)
{
    qq_pool_t          *pool;
    qq_cycle_t         *cycle;

    pool = qq_create_pool(QQ_CYCLE_POOL_SIZE);
    if (pool == NULL) {
        qq_log_error(0, "qq_create_pool(%d) failed", QQ_CYCLE_POOL_SIZE);
        return QQ_ERROR;
    }

    cycle = qq_pcalloc(pool, sizeof(qq_cycle_t));
    if (cycle == NULL) {
        qq_log_error(0, "qq_pcalloc() failed");
        qq_destroy_pool(pool);
        return QQ_ERROR;
    }
    cycle->pool = pool;
    qq_cycle = cycle;

    if (qq_app_init(cycle) == QQ_ERROR) {
        qq_log_error(0, "qq_app_init() failed");
        return QQ_ERROR;
    }

    if (qq_create_listening(cycle) == QQ_ERROR) {
        qq_log_error(0, "qq_create_listening() failed");
        return QQ_ERROR;
    }

    if (qq_open_listening_sockets(cycle) == QQ_ERROR) {
        qq_log_error(0, "qq_open_listening_sockets() failed");
        return QQ_ERROR;
    }

    if (qq_configure_listening_sockets(cycle) == QQ_ERROR) {
        qq_log_error(0, "qq_configure_listening_sockets() failed");
        return QQ_ERROR;
    }

    if (qq_event_init(cycle) == QQ_ERROR) {
        qq_log_error(0, "qq_event_init() failed");
        return QQ_ERROR;
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl $0x4000, %edi           # imm = 0x4000
callq 0x7620
testq %rax, %rax
je 0x2a08
movq %rax, %r14
pushq $0x58
popq %rsi
movq %rax, %rdi
callq 0x7694
testq %rax, %rax
je 0x2a1f
movq %rax, %rbx
movq %r14, (%rax)
movq %rax, 0xb8f2(%rip)      # 0xe2b0
movq %rax, %rdi
callq 0x25f0
cmpq $-0x1, %rax
je 0x2a39
movq %rbx, %rdi
callq 0x5f95
cmpq $-0x1, %rax
je 0x2a42
movq %rbx, %rdi
callq 0x60ab
cmpq $-0x1, %rax
je 0x2a4b
movq %rbx, %rdi
callq 0x6373
cmpq $-0x1, %rax
je 0x2a54
movq %rbx, %rdi
callq 0x30c0
cmpq $-0x1, %rax
je 0x2a5d
xorl %eax, %eax
jmp 0x2a70
leaq 0x6852(%rip), %rsi      # 0x9261
xorl %edi, %edi
movl $0x4000, %edx           # imm = 0x4000
xorl %eax, %eax
callq 0x65bd
jmp 0x2a6d
leaq 0x6855(%rip), %rsi      # 0x927b
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
movq %r14, %rdi
callq 0x2348
jmp 0x2a6d
leaq 0x684f(%rip), %rsi      # 0x928f
jmp 0x2a64
leaq 0x685b(%rip), %rsi      # 0x92a4
jmp 0x2a64
leaq 0x686f(%rip), %rsi      # 0x92c1
jmp 0x2a64
leaq 0x6889(%rip), %rsi      # 0x92e4
jmp 0x2a64
leaq 0x68a8(%rip), %rsi      # 0x930c
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_cycle.c
// Function: qq_cycle_done
void
qq_cycle_done(void)
{
    qq_log_debug("qq_cycle_done()");

    qq_close_listening_sockets(qq_cycle);

    qq_app_done(qq_cycle);

    qq_event_done(qq_cycle);

    qq_destroy_pool(qq_cycle->pool);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x68a3(%rip), %rdi      # 0x9323
xorl %eax, %eax
callq 0x6706
movq 0xb822(%rip), %rdi      # 0xe2b0
callq 0x6404
movq 0xb816(%rip), %rdi      # 0xe2b0
callq 0x267e
movq 0xb80a(%rip), %rdi      # 0xe2b0
callq 0x331c
movq 0xb7fe(%rip), %rax      # 0xe2b0
movq (%rax), %rdi
popq %rbp
jmp 0x2348
nop
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_epoll.c
// Function: qq_epoll_init
qq_int_t
qq_epoll_init(void)
{
    if (ep == -1) {
        ep = epoll_create(QQ_CONNECTION_NUMBER);

        if (ep == -1) {
            qq_log_error(errno, "epoll_create() failed");
            return QQ_ERROR;
        }
    }

    nevents = QQ_EPOLL_EVENT_NUMBER;
    if (event_list) {
        free(event_list);
    }
    event_list = qq_alloc(sizeof(struct epoll_event) * nevents);
    if (event_list == NULL) {
        qq_log_error(0, "epoll_event malloc(%d) failed", nevents);
        return QQ_ERROR;
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $-0x1, 0xb6e9(%rip)     # 0xe1b0
jne 0x2ade
movl $0x4e20, %edi           # imm = 0x4E20
callq 0x2320
movl %eax, 0xb6d7(%rip)      # 0xe1b0
cmpl $-0x1, %eax
je 0x2b22
movb $0x1, 0xb7d3(%rip)      # 0xe2b8
movq 0xb7d4(%rip), %rdi      # 0xe2c0
callq 0x2348
movl $0x1d4c0, %edi          # imm = 0x1D4C0
callq 0x244c
movq %rax, 0xb7be(%rip)      # 0xe2c0
testq %rax, %rax
je 0x2b0b
xorl %eax, %eax
jmp 0x2b3a
leaq 0x6837(%rip), %rsi      # 0x9349
movl $0x2710, %edx           # imm = 0x2710
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
jmp 0x2b37
callq 0x2030
movl (%rax), %edi
leaq 0x6803(%rip), %rsi      # 0x9333
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_epoll.c
// Function: qq_epoll_done
void
qq_epoll_done(void)
{
    qq_log_debug("qq_epoll_done()");

    if (close(ep) == -1) {
        qq_log_error(errno, "epoll close() failed");
    }
    ep = -1;

    free(event_list);
    event_list = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x6820(%rip), %rdi      # 0x9367
xorl %eax, %eax
callq 0x6706
movl 0xb65c(%rip), %edi      # 0xe1b0
callq 0x2330
cmpl $-0x1, %eax
jne 0x2b73
callq 0x2030
movl (%rax), %edi
leaq 0x680b(%rip), %rsi      # 0x9377
xorl %eax, %eax
callq 0x65bd
orl $-0x1, 0xb636(%rip)     # 0xe1b0
movq 0xb73f(%rip), %rdi      # 0xe2c0
callq 0x2348
andq $0x0, 0xb732(%rip)      # 0xe2c0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_epoll.c
// Function: qq_epoll_add_event
qq_int_t
qq_epoll_add_event(qq_event_t *ev, qq_int_t event)
{
    int                  op;
    uint32_t             events, prev;
    qq_event_t          *e;
    qq_connection_t     *c;
    struct epoll_event   ee;

    c = ev->data;

    if (event == QQ_READ_EVENT) {
        e = c->write;
        prev = EPOLLOUT;
        events = EPOLLIN|EPOLLRDHUP;
    } else {
        e = c->read;
        prev = EPOLLIN|EPOLLRDHUP;
        events = EPOLLOUT;
    }

    if (e->active) {
        op = EPOLL_CTL_MOD;
        events |= prev;
    } else {
        op = EPOLL_CTL_ADD;
    }

    ee.events = events | EPOLLET;
    ee.data.ptr = (void *) ((uintptr_t) c | ev->instance);

    qq_log_debug("epoll add event: fd:%d op:%d ev:%08XD", c->fd, op, ee.events);

    if (epoll_ctl(ep, op, c->fd, &ee) == -1) {
        qq_log_error(errno, "epoll_ctl(%d, %d) failed", op, c->fd);
        return QQ_ERROR;
    }

    ev->active = 1;

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %r12
xorl %eax, %eax
cmpq $0x1, %rsi
sete %al
movl $0x80002001, %ecx       # imm = 0x80002001
movl $0x80000004, %edx       # imm = 0x80000004
cmovel %ecx, %edx
movq 0x8(%r12,%rax,8), %rax
movl 0x8(%rax), %eax
andl $0x8, %eax
movl %eax, %r14d
shrl $0x2, %r14d
incl %r14d
testl %eax, %eax
movl $0x80002005, %ecx       # imm = 0x80002005
cmovel %edx, %ecx
leaq -0x2c(%rbp), %r15
movl %ecx, (%r15)
movl 0x8(%rdi), %eax
shrl $0x2, %eax
andl $0x1, %eax
orq %r12, %rax
movq %rax, 0x4(%r15)
movl 0x18(%r12), %esi
leaq 0x678f(%rip), %rdi      # 0x938c
movl %r14d, %edx
xorl %eax, %eax
callq 0x6706
movl 0xb5a3(%rip), %edi      # 0xe1b0
movl 0x18(%r12), %edx
movl %r14d, %esi
movq %r15, %rcx
callq 0x2280
cmpl $-0x1, %eax
je 0x2c2a
orb $0x8, 0x8(%rbx)
xorl %eax, %eax
jmp 0x2c4a
callq 0x2030
movl (%rax), %edi
movl 0x18(%r12), %ecx
leaq 0x6775(%rip), %rsi      # 0x93b2
movl %r14d, %edx
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_epoll.c
// Function: qq_epoll_del_event
qq_int_t
qq_epoll_del_event(qq_event_t *ev, qq_int_t event)
{
    int                  op;
    uint32_t             prev;
    qq_event_t          *e;
    qq_connection_t     *c;
    struct epoll_event   ee;

    c = ev->data;

    if (event == QQ_READ_EVENT) {
        e = c->write;
        prev = EPOLLOUT;
    } else {
        e = c->read;
        prev = EPOLLIN|EPOLLRDHUP;
    }

    if (e->active) {
        op = EPOLL_CTL_MOD;
        ee.events = prev | EPOLLET;
        ee.data.ptr = (void *) ((uintptr_t) c | ev->instance);
    } else {
        op = EPOLL_CTL_DEL;
        ee.events = 0;
        ee.data.ptr = NULL;
    }

    qq_log_debug("epoll del event: fd:%d op:%d ev:%08XD", c->fd, op, ee.events);

    if (epoll_ctl(ep, op, c->fd, &ee) == -1) {
        qq_log_error(errno, "epoll_ctl(%d, %d) failed", op, c->fd);
        return QQ_ERROR;
    }

    ev->active = 0;

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %r12
xorl %eax, %eax
cmpq $0x1, %rsi
sete %al
movq 0x8(%r12,%rax,8), %rax
testb $0x8, 0x8(%rax)
jne 0x2c8a
pushq $0x2
popq %r14
xorl %ecx, %ecx
xorl %eax, %eax
jmp 0x2cab
cmpq $0x1, %rsi
movl $0x80000004, %eax       # imm = 0x80000004
movl $0x80002001, %ecx       # imm = 0x80002001
cmovel %eax, %ecx
movl 0x8(%rbx), %eax
shrl $0x2, %eax
andl $0x1, %eax
orq %r12, %rax
pushq $0x3
popq %r14
leaq -0x2c(%rbp), %r15
movl %ecx, (%r15)
movq %rax, 0x4(%r15)
movl 0x18(%r12), %esi
leaq 0x6709(%rip), %rdi      # 0x93cb
movl %r14d, %edx
xorl %eax, %eax
callq 0x6706
movl 0xb4de(%rip), %edi      # 0xe1b0
movl 0x18(%r12), %edx
movl %r14d, %esi
movq %r15, %rcx
callq 0x2280
cmpl $-0x1, %eax
je 0x2cef
andb $-0x9, 0x8(%rbx)
xorl %eax, %eax
jmp 0x2d0f
callq 0x2030
movl (%rax), %edi
movl 0x18(%r12), %ecx
leaq 0x66b0(%rip), %rsi      # 0x93b2
movl %r14d, %edx
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_epoll.c
// Function: qq_epoll_add_connection
qq_int_t
qq_epoll_add_connection(qq_connection_t *c)
{
    struct epoll_event  ee;

    ee.events = EPOLLIN|EPOLLOUT|EPOLLET|EPOLLRDHUP;
    ee.data.ptr = (void *) ((uintptr_t) c | c->read->instance);

    qq_log_debug("epoll add connection: fd:%d ev:%08XD", c->fd, ee.events);

    if (epoll_ctl(ep, EPOLL_CTL_ADD, c->fd, &ee) == -1) {
        qq_log_error(errno, "epoll_ctl(EPOLL_CTL_ADD, %d) failed", c->fd);
        return QQ_ERROR;
    }

    c->read->active = 1;
    c->write->active = 1;

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x1c(%rbp), %r14
movl $0x80002005, (%r14)     # imm = 0x80002005
movq 0x8(%rdi), %rax
movl 0x8(%rax), %eax
shrl $0x2, %eax
andl $0x1, %eax
orq %rdi, %rax
movq %rax, 0x4(%r14)
movl 0x18(%rdi), %esi
leaq 0x669e(%rip), %rdi      # 0x93f1
movl $0x80002005, %edx       # imm = 0x80002005
xorl %eax, %eax
callq 0x6706
movl 0xb44b(%rip), %edi      # 0xe1b0
movl 0x18(%rbx), %edx
pushq $0x1
popq %rsi
movq %r14, %rcx
callq 0x2280
cmpl $-0x1, %eax
je 0x2d8c
movq 0x8(%rbx), %rax
orl $0x8, 0x8(%rax)
movq 0x10(%rbx), %rax
orl $0x8, 0x8(%rax)
xorl %eax, %eax
jmp 0x2da7
callq 0x2030
movl (%rax), %edi
movl 0x18(%rbx), %edx
leaq 0x6679(%rip), %rsi      # 0x9416
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_epoll.c
// Function: qq_epoll_del_connection
qq_int_t
qq_epoll_del_connection(qq_connection_t *c)
{
    struct epoll_event  ee;

    qq_log_debug("epoll del connection: fd:%d", c->fd);

    ee.events = 0;
    ee.data.ptr = NULL;

    if (epoll_ctl(ep, EPOLL_CTL_DEL, c->fd, &ee) == -1) {
        qq_log_error(errno, "epoll_ctl(EPOLL_CTL_DEL, %d) failed", c->fd);
        return QQ_ERROR;
    }

    c->read->active = 0;
    c->write->active = 0;

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x18(%rdi), %esi
leaq 0x6674(%rip), %rdi      # 0x943a
xorl %eax, %eax
callq 0x6706
leaq -0x14(%rbp), %rcx
andl $0x0, (%rcx)
andq $0x0, 0x4(%rcx)
movl 0xb3d1(%rip), %edi      # 0xe1b0
movl 0x18(%rbx), %edx
pushq $0x2
popq %rsi
callq 0x2280
cmpl $-0x1, %eax
je 0x2e03
movq 0x8(%rbx), %rax
andl $-0x9, 0x8(%rax)
movq 0x10(%rbx), %rax
andl $-0x9, 0x8(%rax)
xorl %eax, %eax
jmp 0x2e1e
callq 0x2030
movl (%rax), %edi
movl 0x18(%rbx), %edx
leaq 0x6642(%rip), %rsi      # 0x9456
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_event.c
// Function: qq_events_process
void
qq_events_process(void)
{
    qq_msec_t  delta;

    delta = qq_current_msec;

    qq_epoll_process_events(qq_event_find_timer(), QQ_UPDATE_TIME);

    delta = qq_current_msec - delta;
    qq_log_debug("timer delta: %d", delta);

    qq_event_process_posted(&qq_posted_accept_events);

    if (delta) {
        qq_event_expire_timers();
    }

    qq_event_process_posted(&qq_posted_events);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0xb3f4(%rip), %rbx      # 0xe6c0
movq (%rbx), %r14
callq 0x3a1a
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x2e25
movq (%rbx), %rbx
leaq 0x633d(%rip), %rdi      # 0x9626
movq %rbx, %rsi
subq %r14, %rsi
xorl %eax, %eax
callq 0x6706
leaq 0xafcb(%rip), %rdi      # 0xe2c8
callq 0x3974
cmpq %r14, %rbx
je 0x330c
callq 0x3a67
leaq 0xafc5(%rip), %rdi      # 0xe2d8
popq %rbx
popq %r14
popq %rbp
jmp 0x3974
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_event.c
// Function: qq_event_done
void
qq_event_done(qq_cycle_t *cycle)
{
    qq_log_debug("qq_event_done()");

    qq_epoll_done();

    free(cycle->connections);

    free(cycle->read_events);

    free(cycle->write_events);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x630a(%rip), %rdi      # 0x9636
xorl %eax, %eax
callq 0x6706
callq 0x2b3c
movq 0x10(%rbx), %rdi
callq 0x2348
movq 0x28(%rbx), %rdi
callq 0x2348
movq 0x30(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2348
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_event.c
// Function: qq_handle_read_event
qq_int_t
qq_handle_read_event(qq_event_t *rev)
{
    if (!rev->active && !rev->ready) {
        if (qq_epoll_add_event(rev, QQ_READ_EVENT)
            == QQ_ERROR)
        {
            return QQ_ERROR;
        }
    }

    return QQ_OK;
}

// Assembly:
testb $0x28, 0x8(%rdi)
jne 0x3372
pushq %rbp
movq %rsp, %rbp
pushq $0x1
popq %rsi
callq 0x2b90
cmpq $-0x1, %rax
popq %rbp
je 0x3375
xorl %eax, %eax
retq
pushq $-0x1
popq %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_event_accept.c
// Function: qq_enable_accept_events
static qq_int_t
qq_enable_accept_events(qq_cycle_t *cycle)
{
    qq_uint_t         i;
    qq_listening_t   *ls;
    qq_connection_t  *c;

    ls = cycle->listening;
    for (i = 0; i < cycle->nlistening; i++) {
        c = ls[i].connection;
        if (c == NULL || c->read->active) {
            continue;
        }

        if (qq_epoll_add_event(c->read, QQ_READ_EVENT) == QQ_ERROR) {
            return QQ_ERROR;
        }
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %r12
addq $0x58, %r12
xorl %r13d, %r13d
pushq $0x1
popq %r15
pushq $-0x1
popq %r14
cmpq 0x38(%rbx), %r13
jae 0x3690
movq (%r12), %rax
testq %rax, %rax
je 0x3687
movq 0x8(%rax), %rdi
testb $0x8, 0x8(%rdi)
jne 0x3687
movq %r15, %rsi
callq 0x2b90
cmpq $-0x1, %rax
je 0x3693
incq %r13
addq $0x60, %r12
jmp 0x3660
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_event_accept.c
// Function: qq_close_accepted_connection
static void
qq_close_accepted_connection(qq_connection_t *c)
{
    qq_socket_t  fd;

    qq_free_connection(c);

    fd = c->fd;
    c->fd = (qq_socket_t) -1;

    if (close(fd) == -1) {
        qq_log_error(errno, "close sockets failed");
    }

    if (c->pool) {
        qq_destroy_pool(c->pool);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2834
movl 0x18(%rbx), %edi
orl $-0x1, 0x18(%rbx)
callq 0x2330
cmpl $-0x1, %eax
jne 0x36d9
callq 0x2030
movl (%rax), %edi
leaq 0x5fd2(%rip), %rsi      # 0x96a4
xorl %eax, %eax
callq 0x65bd
movq 0x40(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2348
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_event_posted.c
// Function: qq_event_process_posted
void
qq_event_process_posted(qq_queue_t *posted)
{
    qq_queue_t  *q;
    qq_event_t  *ev;

    while (!qq_queue_empty(posted)) {
        q = qq_queue_head(posted);
        ev = qq_queue_data(q, qq_event_t, queue);

        qq_log_debug("qq_event_process_posted(ev:%p)", ev);

        qq_delete_posted_event(ev);

        ev->handler(ev);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5de1(%rip), %r14      # 0x976d
leaq 0x588e(%rip), %r15      # 0x9221
cmpq %rbx, (%rbx)
je 0x39d7
movq 0x8(%rbx), %r13
leaq -0x48(%r13), %r12
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x6706
andb $0x7f, -0x3f(%r13)
movq (%r13), %rax
movq 0x8(%r13), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x6706
movq %r12, %rdi
callq *-0x38(%r13)
jmp 0x3993
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_event_timer.c
// Function: qq_event_find_timer
qq_msec_t
qq_event_find_timer(void)
{
    qq_msec_int_t      timer;
    qq_rbtree_node_t  *node, *root, *sentinel;

    if (qq_event_timer_rbtree.root == &qq_event_timer_sentinel) {
        return QQ_TIMER_INFINITE;
    }

    root     = qq_event_timer_rbtree.root;
    sentinel = qq_event_timer_rbtree.sentinel;

    node = qq_rbtree_min(root, sentinel);
    timer = (qq_msec_int_t) (node->key - qq_current_msec);

    return (qq_msec_t) (timer > 0 ? timer : 0);
}

// Assembly:
movq 0xa8ef(%rip), %rax      # 0xe310
leaq 0xa8c0(%rip), %rcx      # 0xe2e8
cmpq %rcx, %rax
je 0x3a5c
pushq %rbp
movq %rsp, %rbp
movq 0xa8e0(%rip), %rcx      # 0xe318
movq %rax, %rdx
movq 0x8(%rax), %rax
cmpq %rcx, %rax
jne 0x3a38
movq (%rdx), %rcx
leaq 0xac72(%rip), %rax      # 0xe6c0
subq (%rax), %rcx
xorl %eax, %eax
testq %rcx, %rcx
cmovgq %rcx, %rax
popq %rbp
retq
movabsq $-0x1, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_event_timer.c
// Function: qq_event_expire_timers
void
qq_event_expire_timers(void)
{
    qq_event_t        *ev;
    qq_rbtree_node_t  *node, *root, *sentinel;

    sentinel = qq_event_timer_rbtree.sentinel;

    for ( ;; ) {
        root = qq_event_timer_rbtree.root;

        if (root == sentinel) {
            return;
        }

        node = qq_rbtree_min(root, sentinel);

        /* node->key > qq_current_msec */

        if ((qq_msec_int_t) (node->key - qq_current_msec) > 0) {
            return;
        }

        ev = (qq_event_t *) ((char *) node - offsetof(qq_event_t, timer));
        qq_rbtree_delete(&qq_event_timer_rbtree, &ev->timer);

        ev->timer_set = 0;
        ev->timedout = 1;
        ev->handler(ev);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0xa89c(%rip), %r12      # 0xe318
leaq 0xac3d(%rip), %r13      # 0xe6c0
movl $0xfffff3ff, %ebx       # imm = 0xFFFFF3FF
movq 0xa881(%rip), %rax      # 0xe310
cmpq %r12, %rax
je 0x3ad7
movq %rax, %r14
movq 0x8(%rax), %rax
cmpq %r12, %rax
jne 0x3a94
movq (%r14), %rax
subq (%r13), %rax
testq %rax, %rax
jg 0x3ad7
leaq -0x20(%r14), %r15
leaq 0xa859(%rip), %rdi      # 0xe310
movq %r14, %rsi
callq 0x7ad8
movl -0x18(%r14), %eax
andl %ebx, %eax
orl $0x400, %eax            # imm = 0x400
movl %eax, -0x18(%r14)
movq %r15, %rdi
callq *-0x10(%r14)
jmp 0x3a88
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_ios_app.c
// Function: qq_ios_app_init
qq_int_t
qq_ios_app_init(qq_cycle_t *cycle)
{
    if (qq_add_listening_config(SOCK_STREAM,
        QQ_IOS_APP_TCP_LISTENING_PORT,
        QQ_IOS_APP_TCP_LISTENING_POOL_SIZE,
        qq_ios_app_init_connection_handler) == QQ_ERROR)
    {
        qq_log_error(0, "qq_ios_app_init()->qq_add_listening_config() failed");
        return QQ_ERROR;
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x31(%rip), %rcx        # 0x3b68
pushq $0x1
popq %rdi
movl $0x400, %edx            # imm = 0x400
movl $0x2710, %esi           # imm = 0x2710
callq 0x5f10
cmpq $-0x1, %rax
je 0x3b53
xorl %eax, %eax
jmp 0x3b66
leaq 0x5c41(%rip), %rsi      # 0x979b
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_ios_app.c
// Function: qq_ios_app_init_connection_handler
static void
qq_ios_app_init_connection_handler(qq_connection_t *c)
{
    qq_event_t   *rev, *wev;

    qq_log_debug("qq_ios_app_init_connection_handler()");

    rev = c->read;
    rev->handler = qq_ios_app_wait_request_handler;

    wev = c->write;
    wev->handler = qq_ios_app_write_event_handler;

    qq_event_add_timer(rev, QQ_IOS_APP_ACCEPT_TIMEOUT);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5c69(%rip), %rdi      # 0x97e1
xorl %eax, %eax
callq 0x6706
movq 0x8(%rbx), %rdi
leaq 0x3f(%rip), %rax        # 0x3bc9
movq %rax, 0x10(%rdi)
movq 0x10(%rbx), %rax
leaq 0x163(%rip), %rcx       # 0x3cfc
movq %rcx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3d0f
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_ios_app.c
// Function: qq_ios_app_wait_request_handler
static void
qq_ios_app_wait_request_handler(qq_event_t *rev)
{
    qq_connection_t   *c;
    ssize_t            n;
    size_t             size;
    qq_buf_t          *b;
    qq_listening_t    *ls;

    c = rev->data;
    ls = c->listening;

    qq_log_debug("qq_ios_app_wait_request_handler()");

    if (rev->timedout) {
        qq_app_close_connection(c);
        return;
    }

    if (c->close) {
        qq_app_close_connection(c);
        return;
    }

    b = c->buffer;
    if (b == NULL) {
        b = qq_pcalloc(c->pool, sizeof(qq_buf_t));
        if (b == NULL) {
            qq_app_close_connection(c);
            return;
        }
        c->buffer = b;

        size = ls->pool_size -
            ((size_t)((uintptr_t)b - (uintptr_t)c->pool) + sizeof(qq_buf_t));
        b->start = qq_pnalloc(c->pool, size);
        if (b->start == NULL) {
            qq_app_close_connection(c);
            return;
        }
        b->pos = b->start;
        b->last = b->start;
        b->end = b->last + size;
        b->temporary = 1;
    }

    n = c->recv(c, b->pos, (size_t)((uintptr_t)b->end - (uintptr_t)b->start));
    if (n == QQ_AGAIN) {
        if (!rev->timer_set) {
            qq_event_add_timer(rev, QQ_IOS_APP_ACCEPT_TIMEOUT);
        }
        return;
    }

    if (n == QQ_ERROR) {
        qq_app_close_connection(c);
        return;
    }

    if (n == 0) {
        qq_log_error(0, "client closed connection");
        qq_app_close_connection(c);
        return;
    }
    b->last += n;

    rev->handler = qq_ios_app_process_request_handler;
    qq_ios_app_process_request_handler(rev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movq (%rdi), %rbx
movq 0x38(%rbx), %r12
leaq 0x5c21(%rip), %rdi      # 0x9806
xorl %eax, %eax
callq 0x6706
testb $0x4, 0x9(%r14)
jne 0x3cc4
testb $0x20, 0x98(%rbx)
jne 0x3cc4
movq 0x20(%rbx), %r15
testq %r15, %r15
je 0x3c5c
movq (%r15), %rsi
movq 0x20(%r15), %rax
movq 0x28(%r15), %r12
subq %rax, %r12
movq %rbx, %rdi
movq %r12, %rdx
callq *0x28(%rbx)
testq %rax, %rax
je 0x3cb4
cmpq $-0x1, %rax
je 0x3cc4
cmpq $-0x2, %rax
jne 0x3cd4
testb $0x8, 0x9(%r14)
jne 0x3cf3
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3d0f
movq 0x40(%rbx), %rdi
pushq $0x38
popq %rsi
callq 0x7694
testq %rax, %rax
je 0x3cc4
movq %rax, %r15
movq %rax, 0x20(%rbx)
movq 0x50(%r12), %rax
movq 0x40(%rbx), %rdi
subq %r15, %rax
leaq (%rax,%rdi), %r12
addq $-0x38, %r12
movq %r12, %rsi
callq 0x7675
movq %rax, 0x20(%r15)
testq %rax, %rax
je 0x3cc4
movq %rax, (%r15)
movq %rax, 0x8(%r15)
addq %rax, %r12
movq %r12, 0x28(%r15)
orb $0x1, 0x30(%r15)
movq %rax, %rsi
jmp 0x3c18
leaq 0x5b6d(%rip), %rsi      # 0x9828
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x26aa
addq %rax, 0x8(%r15)
leaq 0x9b(%rip), %rax        # 0x3d7a
movq %rax, 0x10(%r14)
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3d7a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq