LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_get_child_by_name
xmpp_stanza_t *xmpp_stanza_get_child_by_name(xmpp_stanza_t * const stanza, 
					     const char * const name)
{
    xmpp_stanza_t *child;
    
    for (child = stanza->children; child; child = child->next) {
	if (child->type == XMPP_STANZA_TAG &&
	    (strcmp(name, xmpp_stanza_get_name(child)) == 0))
	    break;
    }

    return child;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x28(%rdi), %rbx
testq %rbx, %rbx
je 0xbc02
movq %rsi, %r14
cmpl $0x2, 0x10(%rbx)
jne 0xbbf9
movq 0x38(%rbx), %rsi
movq %r14, %rdi
callq 0x22e0
testl %eax, %eax
je 0xbc04
movq 0x20(%rbx), %rbx
testq %rbx, %rbx
jne 0xbbe3
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_get_child_by_ns
xmpp_stanza_t *xmpp_stanza_get_child_by_ns(xmpp_stanza_t * const stanza,
					   const char * const ns)
{
    xmpp_stanza_t *child;

    for (child = stanza->children; child; child = child->next) {
	if (xmpp_stanza_get_ns(child) &&
	    strcmp(ns, xmpp_stanza_get_ns(child)) == 0)
	    break;
    }
    
    return child;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x28(%rdi), %rbx
testq %rbx, %rbx
je 0xbc67
movq %rsi, %r14
leaq 0x24f8(%rip), %r15      # 0xe11f
cmpl $0x2, 0x10(%rbx)
jne 0xbc5e
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0xbc5e
movq %r15, %rsi
callq 0x6766
testq %rax, %rax
je 0xbc5e
movq 0x40(%rbx), %rdi
movq %r15, %rsi
callq 0x6766
movq %r14, %rdi
movq %rax, %rsi
callq 0x22e0
testl %eax, %eax
je 0xbc69
movq 0x20(%rbx), %rbx
testq %rbx, %rbx
jne 0xbc27
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_get_text
char *xmpp_stanza_get_text(xmpp_stanza_t * const stanza)
{
    size_t len, clen;
    xmpp_stanza_t *child;
    char *text;

    if (stanza->type == XMPP_STANZA_TEXT) {
	if (stanza->data)
	    return xmpp_strdup(stanza->ctx, stanza->data);
	else
	    return NULL;
    }

    len = 0;
    for (child = stanza->children; child; child = child->next)
	if (child->type == XMPP_STANZA_TEXT)
	    len += strlen(child->data);

    if (len == 0) return NULL;

    text = (char *)xmpp_alloc(stanza->ctx, len + 1);
    if (!text) return NULL;

    len = 0;
    for (child = stanza->children; child; child = child->next)
	if (child->type == XMPP_STANZA_TEXT) {
	    clen = strlen(child->data);
	    memcpy(&text[len], child->data, clen);
	    len += clen;
	}

    text[len] = 0;

    return text;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
cmpl $0x1, 0x10(%rdi)
jne 0xbcad
movq 0x38(%r14), %rsi
testq %rsi, %rsi
je 0xbd2a
movq 0x8(%r14), %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xc0d0
movq 0x28(%r14), %r15
testq %r15, %r15
je 0xbd2a
xorl %ebx, %ebx
cmpl $0x1, 0x10(%r15)
jne 0xbccb
movq 0x38(%r15), %rdi
callq 0x2180
addq %rax, %rbx
movq 0x20(%r15), %r15
testq %r15, %r15
jne 0xbcb8
testq %rbx, %rbx
je 0xbd2a
movq 0x8(%r14), %rdi
incq %rbx
movq %rbx, %rsi
callq 0x5251
testq %rax, %rax
je 0xbd2a
movq %rax, %rbx
movq 0x28(%r14), %r13
xorl %r12d, %r12d
testq %r13, %r13
je 0xbd39
cmpl $0x1, 0x10(%r13)
jne 0xbd24
movq 0x38(%r13), %r14
movq %r14, %rdi
callq 0x2180
movq %rax, %r15
leaq (%rbx,%r12), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2050
addq %r15, %r12
movq 0x20(%r13), %r13
jmp 0xbcf7
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movb $0x0, (%rbx,%r12)
jmp 0xbd2c
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/thread.c
// Function: mutex_create
mutex_t *mutex_create(const xmpp_ctx_t * ctx)
{
    mutex_t *mutex;

    mutex = xmpp_alloc(ctx, sizeof(mutex_t));
    if (mutex) {
	mutex->ctx = ctx;
#ifdef _WIN32
	mutex->mutex = CreateMutex(NULL, FALSE, NULL);
#else
	mutex->mutex = xmpp_alloc(ctx, sizeof(pthread_mutex_t));
	if (mutex->mutex)
	    if (pthread_mutex_init(mutex->mutex, NULL) != 0) {
		xmpp_free(ctx, mutex->mutex);
		mutex->mutex = NULL;
	    }
#endif
	if (!mutex->mutex) {
	    xmpp_free(ctx, mutex);
	    mutex = NULL;
	}
    }

    return mutex;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x10, %esi
callq 0x5251
testq %rax, %rax
je 0xbde3
movq %rax, %rbx
movq %r14, (%rax)
movl $0x28, %esi
movq %r14, %rdi
callq 0x5251
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xbdd8
movq %rax, %rdi
xorl %esi, %esi
callq 0x2170
movq 0x8(%rbx), %rsi
testl %eax, %eax
je 0xbdf0
movq %r14, %rdi
callq 0x5263
movq $0x0, 0x8(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5263
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
testq %rsi, %rsi
jne 0xbde5
jmp 0xbdd8
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/thread.c
// Function: mutex_destroy
int mutex_destroy(mutex_t *mutex)
{
    int ret = 1;
    const xmpp_ctx_t *ctx;

#ifdef _WIN32
    if (mutex->mutex)
	ret = CloseHandle(mutex->mutex);
#else
    if (mutex->mutex)
	ret = pthread_mutex_destroy(mutex->mutex) == 0;
#endif
    ctx = mutex->ctx;
    xmpp_free(ctx, mutex);

    return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0xbe15
callq 0x2090
xorl %ebp, %ebp
testl %eax, %eax
sete %bpl
jmp 0xbe1a
movl $0x1, %ebp
movq (%rbx), %rdi
movq %rbx, %rsi
callq 0x5263
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/tls_openssl.c
// Function: tls_new
tls_t *tls_new(xmpp_ctx_t *ctx, sock_t sock)
{
    tls_t *tls = xmpp_alloc(ctx, sizeof(*tls));

    if (tls) {
        int ret;
	memset(tls, 0, sizeof(*tls));

	tls->ctx = ctx;
	tls->sock = sock;
	tls->ssl_ctx = SSL_CTX_new(SSLv23_client_method());

	SSL_CTX_set_client_cert_cb(tls->ssl_ctx, NULL);
	SSL_CTX_set_mode (tls->ssl_ctx, SSL_MODE_ENABLE_PARTIAL_WRITE);
	SSL_CTX_set_verify (tls->ssl_ctx, SSL_VERIFY_NONE, NULL);

	tls->ssl = SSL_new(tls->ssl_ctx);

	ret = SSL_set_fd(tls->ssl, sock);
	if (ret <= 0) {
	    tls->lasterror = SSL_get_error(tls->ssl, ret);
	    tls_error(tls);
	    tls_free(tls);
	    tls = NULL;
	}
    }

    return tls;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x28, %esi
callq 0x5251
testq %rax, %rax
je 0xbf16
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movq %r14, (%rax)
movl %ebp, 0x8(%rax)
callq 0x2350
movq %rax, %rdi
callq 0x2290
movq %rax, 0x10(%rbx)
movq %rax, %rdi
xorl %esi, %esi
callq 0x2220
movq 0x10(%rbx), %rdi
movl $0x1, %edx
movl $0x21, %esi
xorl %ecx, %ecx
callq 0x2410
movq 0x10(%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2420
movq 0x10(%rbx), %rdi
callq 0x2320
movq %rax, 0x18(%rbx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x22b0
testl %eax, %eax
jg 0xbf18
movq 0x18(%rbx), %rdi
movl %eax, %esi
callq 0x2450
movl %eax, 0x20(%rbx)
movq %rbx, %rdi
callq 0xbf20
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/tls_openssl.c
// Function: tls_start
int tls_start(tls_t *tls)
{
    int ret = -1;

    /* Since we're non-blocking, loop the connect call until it
       succeeds or fails */
    while (ret == -1) {
	ret = SSL_connect(tls->ssl);

	/* wait for something to happen on the sock before looping back */
	if (ret == -1) {
	    fd_set fds;
	    struct timeval tv;

	    tv.tv_sec = 0;
	    tv.tv_usec = 1000;

	    FD_ZERO(&fds); 
	    FD_SET(tls->sock, &fds);
    
	    select(tls->sock + 1, &fds, &fds, NULL, &tv);
	}
    }

    if (ret <= 0) {
	tls->lasterror = SSL_get_error(tls->ssl, ret);
	return 0;
    }

    return 1;

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x23d0
cmpl $-0x1, %eax
jne 0xbffa
leaq 0x10(%rsp), %r14
movq %rsp, %r15
movq $0x0, (%rsp)
movq $0x3e8, 0x8(%rsp)       # imm = 0x3E8
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x80(%rsp)
movl 0x8(%rbx), %edi
leal 0x3f(%rdi), %eax
testl %edi, %edi
cmovnsl %edi, %eax
movl %eax, %edx
andl $-0x40, %edx
movl %edi, %ecx
subl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
sarl $0x6, %eax
cltq
orq %rdx, 0x10(%rsp,%rax,8)
incl %edi
movq %r14, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x2040
movq 0x18(%rbx), %rdi
callq 0x23d0
cmpl $-0x1, %eax
je 0xbf71
movl $0x1, %ecx
testl %eax, %eax
jg 0xc013
movq 0x18(%rbx), %rdi
movl %eax, %esi
callq 0x2450
movl %eax, 0x20(%rbx)
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/tls_openssl.c
// Function: tls_is_recoverable
int tls_is_recoverable(int error)
{
    return (error == SSL_ERROR_NONE || error == SSL_ERROR_WANT_READ
	    || error == SSL_ERROR_WANT_WRITE
	    || error == SSL_ERROR_WANT_CONNECT
	    || error == SSL_ERROR_WANT_ACCEPT);
}

// Assembly:
cmpl $0x8, %edi
jae 0xc061
movl $0x1, %eax
movl $0x8d, %ecx
btl %edi, %ecx
jae 0xc061
retq
xorl %eax, %eax
cmpl $0x8, %edi
sete %al
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/tls_openssl.c
// Function: tls_write
int tls_write(tls_t *tls, const void * const buff, const size_t len)
{
    int ret = SSL_write(tls->ssl, buff, len);

    if (ret <= 0) {
	tls->lasterror = SSL_get_error(tls->ssl, ret);
    }

    return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x2200
movl %eax, %ebp
testl %eax, %eax
jg 0xc0c2
movq 0x18(%rbx), %rdi
movl %ebp, %esi
callq 0x2450
movl %eax, 0x20(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/util.c
// Function: xmpp_strdup
char *xmpp_strdup(const xmpp_ctx_t * const ctx, const char * const s)
{
    size_t len;
    char *copy;

    len = strlen(s);
    copy = xmpp_alloc(ctx, len + 1);
    if (!copy) {
        xmpp_error(ctx, "xmpp", "failed to allocate required memory");
        return NULL;
    }

    memcpy(copy, s, len + 1);

    return copy;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2180
movq %rax, %r12
incq %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5251
movq %rax, %r15
testq %rax, %rax
je 0xc118
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2050
leaq 0xf2a(%rip), %rsi       # 0xd049
leaq 0x2020(%rip), %rdx      # 0xe146
movq %rbx, %rdi
xorl %eax, %eax
callq 0x536c
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_new
TermKey *termkey_new(int fd, int flags)
{
  TermKey *tk = termkey_alloc();
  if(!tk)
    return NULL;

  tk->fd = fd;

  if(!(flags & (TERMKEY_FLAG_RAW|TERMKEY_FLAG_UTF8))) {
    char *e;

    /* Most OSes will set .UTF-8. Some will set .utf8. Try to be fairly
     * generous in parsing these
     */
    if(((e = getenv("LANG")) || (e = getenv("LC_MESSAGES")) || (e = getenv("LC_ALL"))) &&
       (e = strchr(e, '.')) && e++ &&
       (strcaseeq(e, "UTF-8") || strcaseeq(e, "UTF8")))
      flags |= TERMKEY_FLAG_UTF8;
    else
      flags |= TERMKEY_FLAG_RAW;
  }

  termkey_set_flags(tk, flags);

  const char *term = getenv("TERM");

  if(!termkey_init(tk, term))
    goto abort;

  if(!(flags & TERMKEY_FLAG_NOSTART) && !termkey_start(tk))
    goto abort;

  return tk;

abort:
  free(tk);
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movl %edi, %r14d
callq 0x3565
testq %rax, %rax
je 0x355b
movq %rax, %rbx
movl %r14d, (%rax)
testb $0xc, %bpl
jne 0x3510
leaq 0x3c7f(%rip), %rdi      # 0x711d
callq 0x3030
testq %rax, %rax
jne 0x34ca
leaq 0x3c73(%rip), %rdi      # 0x7122
callq 0x3030
testq %rax, %rax
jne 0x34ca
leaq 0x3c6e(%rip), %rdi      # 0x712e
callq 0x3030
testq %rax, %rax
je 0x3508
movq %rax, %rdi
movl $0x2e, %esi
callq 0x3100
testq %rax, %rax
je 0x3508
movq %rax, %r14
incq %r14
leaq 0x3c4c(%rip), %rsi      # 0x7135
movq %r14, %rdi
callq 0x3060
testl %eax, %eax
je 0x350d
leaq 0x3c3f(%rip), %rsi      # 0x713b
movq %r14, %rdi
callq 0x3060
testl %eax, %eax
je 0x350d
orl $0x4, %ebp
jmp 0x3510
orl $0x8, %ebp
movl %ebp, 0x4(%rbx)
movl 0x8(%rbx), %eax
andl $-0x2, %eax
movl %ebp, %ecx
shrl $0x5, %ecx
andl $0x1, %ecx
orl %eax, %ecx
movl %ecx, 0x8(%rbx)
leaq 0x3c13(%rip), %rdi      # 0x7140
callq 0x3030
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3631
testl %eax, %eax
je 0x3553
btl $0x8, %ebp
jb 0x355d
movq %rbx, %rdi
callq 0x3180
testl %eax, %eax
jne 0x355d
movq %rbx, %rdi
callq 0x3050
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_start
int termkey_start(TermKey *tk)
{
  if(tk->is_started)
    return 1;

#ifdef HAVE_TERMIOS
  if(tk->fd != -1 && !(tk->flags & TERMKEY_FLAG_NOTERMIOS)) {
    struct termios termios;
    if(tcgetattr(tk->fd, &termios) == 0) {
      tk->restore_termios = termios;
      tk->restore_termios_valid = 1;

      termios.c_iflag &= ~(IXON|INLCR|ICRNL);
      termios.c_lflag &= ~(ICANON|ECHO
#ifdef IEXTEN
          | IEXTEN
#endif
      );
      termios.c_cc[VMIN] = 1;
      termios.c_cc[VTIME] = 0;

      if(tk->flags & TERMKEY_FLAG_CTRLC)
        /* want no signal keys at all, so just disable ISIG */
        termios.c_lflag &= ~ISIG;
      else {
        /* Disable Ctrl-\==VQUIT and Ctrl-D==VSUSP but leave Ctrl-C as SIGINT */
        termios.c_cc[VQUIT] = _POSIX_VDISABLE;
        termios.c_cc[VSUSP] = _POSIX_VDISABLE;
        /* Some OSes have Ctrl-Y==VDSUSP */
#ifdef VDSUSP
        termios.c_cc[VDSUSP] = _POSIX_VDISABLE;
#endif
      }

#ifdef DEBUG
      fprintf(stderr, "Setting termios(3) flags\n");
#endif
      tcsetattr(tk->fd, TCSANOW, &termios);
    }
  }
#endif

  struct TermKeyDriverNode *p;
  for(p = tk->drivers; p; p = p->next)
    if(p->driver->start_driver)
      if(!(*p->driver->start_driver)(tk, p->info))
        return 0;

#ifdef DEBUG
  fprintf(stderr, "Drivers started; termkey instance %p is ready\n", tk);
#endif

  tk->is_started = 1;
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movl $0x1, %ebx
cmpb $0x0, 0x8d(%rdi)
jne 0x38ca
movq %rdi, %r14
movl (%rdi), %edi
cmpl $-0x1, %edi
je 0x3893
testb $0x10, 0x4(%r14)
jne 0x3893
leaq 0x4(%rsp), %rsi
callq 0x3240
testl %eax, %eax
jne 0x3893
movups 0x4(%rsp), %xmm0
movups 0x14(%rsp), %xmm1
movups 0x24(%rsp), %xmm2
movups 0x30(%rsp), %xmm3
movups %xmm3, 0x64(%r14)
movups %xmm2, 0x58(%r14)
movups %xmm1, 0x48(%r14)
movups %xmm0, 0x38(%r14)
movb $0x1, 0x74(%r14)
andl $0xfffffabf, 0x4(%rsp)  # imm = 0xFFFFFABF
movl 0x10(%rsp), %eax
movl %eax, %ecx
andl $0xffff7ff5, %ecx       # imm = 0xFFFF7FF5
movl %ecx, 0x10(%rsp)
movw $0x100, 0x1a(%rsp)      # imm = 0x100
testb $0x40, 0x4(%r14)
jne 0x387b
xorl %eax, %eax
movb %al, 0x16(%rsp)
movb %al, 0x1f(%rsp)
jmp 0x3884
andl $0xffff7ff4, %eax       # imm = 0xFFFF7FF4
movl %eax, 0x10(%rsp)
movl (%r14), %edi
leaq 0x4(%rsp), %rdx
xorl %esi, %esi
callq 0x3250
movq 0x2a0(%r14), %r15
testq %r15, %r15
je 0x38be
movq (%r15), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x38b8
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq *%rax
testl %eax, %eax
je 0x38c8
movq 0x10(%r15), %r15
jmp 0x389a
movb $0x1, 0x8d(%r14)
jmp 0x38ca
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_new_abstract
TermKey *termkey_new_abstract(const char *term, int flags)
{
  TermKey *tk = termkey_alloc();
  if(!tk)
    return NULL;

  tk->fd = -1;

  termkey_set_flags(tk, flags);

  if(!termkey_init(tk, term)) {
    free(tk);
    return NULL;
  }

  if(!(flags & TERMKEY_FLAG_NOSTART) && !termkey_start(tk))
    goto abort;

  return tk;

abort:
  free(tk);
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x3565
testq %rax, %rax
je 0x3931
movq %rax, %rbx
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl %ebp, 0x4(%rax)
movl 0x8(%rax), %eax
andl $-0x2, %eax
movl %ebp, %ecx
shrl $0x5, %ecx
andl $0x1, %ecx
orl %eax, %ecx
movl %ecx, 0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3631
testl %eax, %eax
je 0x3929
btl $0x8, %ebp
jb 0x3933
movq %rbx, %rdi
callq 0x3180
testl %eax, %eax
jne 0x3933
movq %rbx, %rdi
callq 0x3050
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_free
void termkey_free(TermKey *tk)
{
  free(tk->buffer); tk->buffer = NULL;
  free(tk->keynames); tk->keynames = NULL;

  struct TermKeyDriverNode *p;
  for(p = tk->drivers; p; ) {
    (*p->driver->free_driver)(p->info);
    struct TermKeyDriverNode *next = p->next;
    free(p);
    p = next;
  }

  free(tk);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x3050
xorl %r14d, %r14d
movq %r14, 0x10(%rbx)
movq 0x98(%rbx), %rdi
callq 0x3050
movq %r14, 0x98(%rbx)
movq 0x2a0(%rbx), %r14
testq %r14, %r14
je 0x3990
movq (%r14), %rax
movq 0x8(%r14), %rdi
callq *0x10(%rax)
movq 0x10(%r14), %r15
movq %r14, %rdi
callq 0x3050
movq %r15, %r14
testq %r15, %r15
jne 0x3972
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3050
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_stop
int termkey_stop(TermKey *tk)
{
  if(!tk->is_started)
    return 1;

  struct TermKeyDriverNode *p;
  for(p = tk->drivers; p; p = p->next)
    if(p->driver->stop_driver)
      (*p->driver->stop_driver)(tk, p->info);

#ifdef HAVE_TERMIOS
  if(tk->restore_termios_valid)
    tcsetattr(tk->fd, TCSANOW, &tk->restore_termios);
#endif

  tk->is_started = 0;

  return 1;
}

// Assembly:
cmpb $0x0, 0x8d(%rdi)
je 0x3a13
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x2a0(%rdi), %r14
testq %r14, %r14
je 0x39f2
movq (%r14), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x39ec
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq *%rax
movq 0x10(%r14), %r14
jmp 0x39d2
cmpb $0x0, 0x74(%rbx)
je 0x3a05
movl (%rbx), %edi
leaq 0x38(%rbx), %rdx
xorl %esi, %esi
callq 0x3250
movb $0x0, 0x8d(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_set_buffer_size
int termkey_set_buffer_size(TermKey *tk, size_t size)
{
  unsigned char *buffer = realloc(tk->buffer, size);
  if(!buffer)
    return 0;

  tk->buffer = buffer;
  tk->buffsize = size;

  return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rdi
callq 0x31f0
testq %rax, %rax
je 0x3a87
movq %rax, 0x10(%r14)
movq %rbx, 0x28(%r14)
movl $0x1, %eax
jmp 0x3a89
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_canonicalise
void termkey_canonicalise(TermKey *tk, TermKeyKey *key)
{
  int flags = tk->canonflags;

  if(flags & TERMKEY_CANON_SPACESYMBOL) {
    if(key->type == TERMKEY_TYPE_UNICODE && key->code.codepoint == 0x20) {
      key->type     = TERMKEY_TYPE_KEYSYM;
      key->code.sym = TERMKEY_SYM_SPACE;
    }
  }
  else {
    if(key->type == TERMKEY_TYPE_KEYSYM && key->code.sym == TERMKEY_SYM_SPACE) {
      key->type           = TERMKEY_TYPE_UNICODE;
      key->code.codepoint = 0x20;
      fill_utf8(key);
    }
  }

  if(flags & TERMKEY_CANON_DELBS) {
    if(key->type == TERMKEY_TYPE_KEYSYM && key->code.sym == TERMKEY_SYM_DEL) {
      key->code.sym = TERMKEY_SYM_BACKSPACE;
    }
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x8(%rdi), %ebp
movl (%rsi), %eax
testb $0x1, %bpl
jne 0x3ace
cmpl $0x2, %eax
jne 0x3ae6
cmpl $0x5, 0x8(%rbx)
jne 0x3ae6
movl $0x0, (%rbx)
movq $0x20, 0x8(%rbx)
movq %rbx, %rdi
callq 0x3b05
jmp 0x3ae6
testl %eax, %eax
jne 0x3ae6
cmpq $0x20, 0x8(%rbx)
jne 0x3ae6
movl $0x2, (%rbx)
movl $0x5, 0x8(%rbx)
testb $0x2, %bpl
je 0x3afe
cmpl $0x2, (%rbx)
jne 0x3afe
cmpl $0x6, 0x8(%rbx)
jne 0x3afe
movl $0x1, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: fill_utf8
static void fill_utf8(TermKeyKey *key)
{
  long codepoint = key->code.codepoint;
  int nbytes = utf8_seqlen(codepoint);

  key->utf8[nbytes] = 0;

  // This is easier done backwards
  int b = nbytes;
  while(b > 1) {
    b--;
    key->utf8[b] = 0x80 | (codepoint & 0x3f);
    codepoint >>= 6;
  }

  switch(nbytes) {
    case 1: key->utf8[0] =        (codepoint & 0x7f); break;
    case 2: key->utf8[0] = 0xc0 | (codepoint & 0x1f); break;
    case 3: key->utf8[0] = 0xe0 | (codepoint & 0x0f); break;
    case 4: key->utf8[0] = 0xf0 | (codepoint & 0x07); break;
    case 5: key->utf8[0] = 0xf8 | (codepoint & 0x03); break;
    case 6: key->utf8[0] = 0xfc | (codepoint & 0x01); break;
  }
}

// Assembly:
movq 0x8(%rdi), %rax
cmpq $0x80, %rax
jge 0x3b21
movb $0x0, 0x15(%rdi)
addq $0x14, %rdi
movq %rdi, %rcx
andb $0x7f, %al
movb %al, (%rcx)
retq
movl $0x2, %edx
cmpq $0x800, %rax            # imm = 0x800
jb 0x3b56
movl $0x3, %edx
cmpq $0x10000, %rax          # imm = 0x10000
jb 0x3b56
movl $0x4, %edx
cmpq $0x200000, %rax         # imm = 0x200000
jb 0x3b56
cmpq $0x4000000, %rax        # imm = 0x4000000
movl $0x6, %edx
sbbl $0x0, %edx
leaq 0x14(%rdi), %rcx
movl %edx, %edx
movb $0x0, 0x14(%rdi,%rdx)
movq %rdx, %rsi
movl %eax, %r8d
andb $0x3f, %r8b
orb $-0x80, %r8b
movb %r8b, 0x13(%rdi,%rsi)
leaq -0x1(%rsi), %r8
shrq $0x6, %rax
cmpq $0x2, %rsi
movq %r8, %rsi
ja 0x3b64
decl %edx
leaq 0x3472(%rip), %rsi      # 0x7000
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
andb $0x1f, %al
orb $-0x40, %al
jmp 0x3b1e
andb $0x3, %al
orb $-0x8, %al
jmp 0x3b1e
andb $0xf, %al
orb $-0x20, %al
jmp 0x3b1e
andb $0x7, %al
orb $-0x10, %al
jmp 0x3b1e
andb $0x1, %al
orb $-0x4, %al
jmp 0x3b1e
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_getkey
TermKeyResult termkey_getkey(TermKey *tk, TermKeyKey *key)
{
  size_t nbytes = 0;
  TermKeyResult ret = peekkey(tk, key, 0, &nbytes);

  if(ret == TERMKEY_RES_KEY)
    eat_bytes(tk, nbytes);

  if(ret == TERMKEY_RES_AGAIN)
    /* Call peekkey() again in force mode to obtain whatever it can */
    (void)peekkey(tk, key, 1, &nbytes);
    /* Don't eat it yet though */

  return ret;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
xorl %edx, %edx
callq 0x3c30
movl %eax, %ebp
cmpl $0x3, %eax
je 0x3c02
cmpl $0x1, %ebp
jne 0x3c25
movq 0x8(%rsp), %rax
movq 0x20(%rbx), %rcx
subq %rax, %rcx
jbe 0x3c19
addq 0x18(%rbx), %rax
jmp 0x3c1d
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x3c30
jmp 0x3c25
xorl %eax, %eax
xorl %ecx, %ecx
movq %rax, 0x18(%rbx)
movq %rcx, 0x20(%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: peekkey
static TermKeyResult peekkey(TermKey *tk, TermKeyKey *key, int force, size_t *nbytep)
{
  int again = 0;

  if(!tk->is_started) {
    errno = EINVAL;
    return TERMKEY_RES_ERROR;
  }

#ifdef DEBUG
  fprintf(stderr, "getkey(force=%d): buffer ", force);
  print_buffer(tk);
  fprintf(stderr, "\n");
#endif

  if(tk->hightide) {
    tk->buffstart += tk->hightide;
    tk->buffcount -= tk->hightide;
    tk->hightide = 0;
  }

  TermKeyResult ret;
  struct TermKeyDriverNode *p;
  for(p = tk->drivers; p; p = p->next) {
    ret = (p->driver->peekkey)(tk, p->info, key, force, nbytep);

#ifdef DEBUG
    fprintf(stderr, "Driver %s yields %s\n", p->driver->name, res2str(ret));
#endif

    switch(ret) {
    case TERMKEY_RES_KEY:
#ifdef DEBUG
      print_key(tk, key); fprintf(stderr, "\n");
#endif
      // Slide the data down to stop it running away
      {
        size_t halfsize = tk->buffsize / 2;

        if(tk->buffstart > halfsize) {
          memcpy(tk->buffer, tk->buffer + halfsize, halfsize);
          tk->buffstart -= halfsize;
        }
      }

      /* fallthrough */
    case TERMKEY_RES_EOF:
    case TERMKEY_RES_ERROR:
      return ret;

    case TERMKEY_RES_AGAIN:
      if(!force)
        again = 1;

      /* fallthrough */
    case TERMKEY_RES_NONE:
      break;
    }
  }

  if(again)
    return TERMKEY_RES_AGAIN;

  ret = peekkey_simple(tk, key, force, nbytep);

#ifdef DEBUG
  fprintf(stderr, "getkey_simple(force=%d) yields %s\n", force, res2str(ret));
  if(ret == TERMKEY_RES_KEY) {
    print_key(tk, key); fprintf(stderr, "\n");
  }
#endif

  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
cmpb $0x0, 0x8d(%rdi)
je 0x3cee
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x3c6d
addq %rax, 0x18(%rbx)
subq %rax, 0x20(%rbx)
movq $0x0, 0x30(%rbx)
movq 0x2a0(%rbx), %r13
testq %r13, %r13
je 0x3ccf
xorl %r14d, %r14d
movq (%r13), %rax
movq 0x8(%r13), %rsi
movq %rbx, %rdi
movq %r15, %rdx
movl %ebp, %ecx
movq (%rsp), %r8
callq *0x28(%rax)
movl %eax, %r12d
leal -0x1(%r12), %eax
cmpl $0x3, %eax
ja 0x3cbb
leaq 0x3371(%rip), %rcx      # 0x7018
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
testl %ebp, %ebp
movl $0x1, %eax
cmovel %eax, %r14d
movq 0x10(%r13), %r13
testq %r13, %r13
jne 0x3c7c
movl $0x3, %r12d
testl %r14d, %r14d
jne 0x3cff
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq (%rsp), %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4f53
callq 0x3090
movl $0x16, (%rax)
movl $0x4, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rbx), %r14
shrq %r14
movl $0x1, %r12d
cmpq %r14, 0x18(%rbx)
jbe 0x3cff
movq 0x10(%rbx), %rdi
leaq (%rdi,%r14), %rsi
movq %r14, %rdx
callq 0x31a0
subq %r14, 0x18(%rbx)
jmp 0x3cff
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_getkey_force
TermKeyResult termkey_getkey_force(TermKey *tk, TermKeyKey *key)
{
  size_t nbytes = 0;
  TermKeyResult ret = peekkey(tk, key, 1, &nbytes);

  if(ret == TERMKEY_RES_KEY)
    eat_bytes(tk, nbytes);

  return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
movl $0x1, %edx
callq 0x3c30
cmpl $0x1, %eax
jne 0x3d7d
movq 0x8(%rsp), %rcx
movq 0x20(%rbx), %rdx
subq %rcx, %rdx
jbe 0x3d71
addq 0x18(%rbx), %rcx
jmp 0x3d75
xorl %ecx, %ecx
xorl %edx, %edx
movq %rcx, 0x18(%rbx)
movq %rdx, 0x20(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_waitkey
TermKeyResult termkey_waitkey(TermKey *tk, TermKeyKey *key)
{
  if(tk->fd == -1) {
    errno = EBADF;
    return TERMKEY_RES_ERROR;
  }

  while(1) {
    TermKeyResult ret = termkey_getkey(tk, key);

    switch(ret) {
      case TERMKEY_RES_KEY:
      case TERMKEY_RES_EOF:
      case TERMKEY_RES_ERROR:
        return ret;

      case TERMKEY_RES_NONE:
        ret = termkey_advisereadable(tk);
        if(ret == TERMKEY_RES_ERROR)
          return ret;
        break;

      case TERMKEY_RES_AGAIN:
        {
          if(tk->is_closed)
            // We're closed now. Never going to get more bytes so just go with
            // what we have
            return termkey_getkey_force(tk, key);

          struct pollfd fd;

retry:
          fd.fd = tk->fd;
          fd.events = POLLIN;

          int pollret = poll(&fd, 1, tk->waittime);
          if(pollret == -1) {
            if(errno == EINTR && !(tk->flags & TERMKEY_FLAG_EINTR))
              goto retry;

            return TERMKEY_RES_ERROR;
          }

          if(fd.revents & (POLLIN|POLLHUP|POLLERR))
            ret = termkey_advisereadable(tk);
          else
            ret = TERMKEY_RES_NONE;

          if(ret == TERMKEY_RES_ERROR)
            return ret;
          if(ret == TERMKEY_RES_NONE)
            return termkey_getkey_force(tk, key);
        }
        break;
    }
  }

  /* UNREACHABLE */
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $-0x1, (%rdi)
je 0x3e42
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x3287(%rip), %r12      # 0x7028
movq %rsp, %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3140
cmpl $0x4, %eax
ja 0x3da4
movl %eax, %ecx
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
movq %r14, %rdi
callq 0x32c0
cmpl $0x4, %eax
jne 0x3da4
jmp 0x3e4d
cmpb $0x0, 0x8c(%r14)
jne 0x3e35
movl (%r14), %eax
movl %eax, (%rsp)
movw $0x1, 0x4(%rsp)
movl 0x88(%r14), %edx
movl $0x1, %esi
movq %r15, %rdi
callq 0x3220
cmpl $-0x1, %eax
jne 0x3e19
callq 0x3090
movq %rax, %rcx
movl $0x4, %eax
cmpl $0x4, (%rcx)
jne 0x3e52
testb $-0x80, 0x4(%r14)
je 0x3dd8
jmp 0x3e52
testb $0x19, 0x6(%rsp)
je 0x3e35
movq %r14, %rdi
callq 0x32c0
cmpl $0x4, %eax
je 0x3e52
testl %eax, %eax
jne 0x3da4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3070
jmp 0x3e52
callq 0x3090
movl $0x9, (%rax)
movl $0x4, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_advisereadable
TermKeyResult termkey_advisereadable(TermKey *tk)
{
  ssize_t len;

  if(tk->fd == -1) {
    errno = EBADF;
    return TERMKEY_RES_ERROR;
  }

  if(tk->buffstart) {
    memmove(tk->buffer, tk->buffer + tk->buffstart, tk->buffcount);
    tk->buffstart = 0;
  }

  /* Not expecting it ever to be greater but doesn't hurt to handle that */
  if(tk->buffcount >= tk->buffsize) {
    errno = ENOMEM;
    return TERMKEY_RES_ERROR;
  }

retry:
  len = read(tk->fd, tk->buffer + tk->buffcount, tk->buffsize - tk->buffcount);

  if(len == -1) {
    if(errno == EAGAIN)
      return TERMKEY_RES_NONE;
    else if(errno == EINTR && !(tk->flags & TERMKEY_FLAG_EINTR))
      goto retry;
    else
      return TERMKEY_RES_ERROR;
  }
  else if(len < 1) {
    tk->is_closed = 1;
    return TERMKEY_RES_NONE;
  }
  else {
    tk->buffcount += len;
    return TERMKEY_RES_AGAIN;
  }
}

// Assembly:
pushq %rbx
cmpl $-0x1, (%rdi)
je 0x3eca
movq %rdi, %rbx
movq 0x18(%rdi), %rsi
testq %rsi, %rsi
je 0x3e88
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rdx
addq %rdi, %rsi
callq 0x3230
movq $0x0, 0x18(%rbx)
movq 0x20(%rbx), %rax
cmpq 0x28(%rbx), %rax
jae 0x3ed7
movl (%rbx), %edi
movq 0x20(%rbx), %rax
movq 0x10(%rbx), %rsi
addq %rax, %rsi
movq 0x28(%rbx), %rdx
subq %rax, %rdx
callq 0x3150
cmpq $-0x1, %rax
jne 0x3ef0
callq 0x3090
movl (%rax), %ecx
movl $0x4, %eax
cmpl $0x4, %ecx
jne 0x3ee9
testb $-0x80, 0x4(%rbx)
je 0x3e92
jmp 0x3ee7
callq 0x3090
movl $0x9, (%rax)
jmp 0x3ee2
callq 0x3090
movl $0xc, (%rax)
movl $0x4, %eax
popq %rbx
retq
cmpl $0xb, %ecx
je 0x3f07
jmp 0x3ee7
testq %rax, %rax
jle 0x3f00
addq %rax, 0x20(%rbx)
movl $0x3, %eax
jmp 0x3ee7
movb $0x1, 0x8c(%rbx)
xorl %eax, %eax
jmp 0x3ee7
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_push_bytes
size_t termkey_push_bytes(TermKey *tk, const char *bytes, size_t len)
{
  if(tk->buffstart) {
    memmove(tk->buffer, tk->buffer + tk->buffstart, tk->buffcount);
    tk->buffstart = 0;
  }

  /* Not expecting it ever to be greater but doesn't hurt to handle that */
  if(tk->buffcount >= tk->buffsize) {
    errno = ENOMEM;
    return (size_t)-1;
  }

  if(len > tk->buffsize - tk->buffcount)
    len = tk->buffsize - tk->buffcount;

  // memcpy(), not strncpy() in case of null bytes in input
  memcpy(tk->buffer + tk->buffcount, bytes, len);
  tk->buffcount += len;

  return len;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rdi), %rsi
testq %rsi, %rsi
je 0x3f3a
movq 0x10(%r14), %rdi
movq 0x20(%r14), %rdx
addq %rdi, %rsi
callq 0x3230
movq $0x0, 0x18(%r14)
movq 0x20(%r14), %rdi
movq 0x28(%r14), %rax
subq %rdi, %rax
jbe 0x3f63
cmpq %rbx, %rax
cmovbq %rax, %rbx
addq 0x10(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x31a0
addq %rbx, 0x20(%r14)
jmp 0x3f75
callq 0x3090
movl $0xc, (%rax)
movq $-0x1, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_register_keyname
TermKeySym termkey_register_keyname(TermKey *tk, TermKeySym sym, const char *name)
{
  if(!sym)
    sym = tk->nkeynames;

  if(sym >= tk->nkeynames) {
    const char **new_keynames = realloc(tk->keynames, sizeof(new_keynames[0]) * (sym + 1));
    if(!new_keynames)
      return -1;

    tk->keynames = new_keynames;

    // Fill in the hole
    for(int i = tk->nkeynames; i < sym; i++)
      tk->keynames[i] = NULL;

    tk->nkeynames = sym + 1;
  }

  tk->keynames[sym] = name;

  return sym;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %r15
movl 0x90(%rdi), %eax
testl %esi, %esi
je 0x3f9e
movl %esi, %ebx
cmpl %esi, %eax
jle 0x3fa0
jmp 0x3fef
movl %eax, %ebx
movq 0x98(%r15), %rdi
movslq %ebx, %r12
leaq 0x8(,%r12,8), %rsi
callq 0x31f0
testq %rax, %rax
je 0x3fff
leal 0x1(%rbx), %ecx
movq %rax, 0x98(%r15)
movslq 0x90(%r15), %rax
cmpl %ebx, %eax
jge 0x3fe8
movq 0x98(%r15), %rdx
movq $0x0, (%rdx,%rax,8)
incq %rax
cmpq %rax, %r12
jne 0x3fd1
movl %ecx, 0x90(%r15)
movq 0x98(%r15), %rax
movslq %ebx, %rcx
movq %r14, (%rax,%rcx,8)
jmp 0x4004
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: termkey_lookup_keyname_format
static const char *termkey_lookup_keyname_format(TermKey *tk, const char *str, TermKeySym *sym, TermKeyFormat format)
{
  /* We store an array, so we can't do better than a linear search. Doesn't
   * matter because user won't be calling this too often */

  for(*sym = 0; *sym < tk->nkeynames; (*sym)++) {
    const char *thiskey = tk->keynames[*sym];
    if(!thiskey)
      continue;
    size_t len = strlen(thiskey);
    if(format & TERMKEY_FORMAT_LOWERSPACE) {
      const char *thisstr = str;
      if(strpncmp_camel(&thisstr, &thiskey, len) == 0)
          return thisstr;
    }
    else {
      if(strncmp(str, thiskey, len) == 0)
        return (char *)str + len;
    }
  }

  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl $0x0, (%rdx)
cmpl $0x0, 0x90(%rdi)
jle 0x41a3
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq 0x98(%rdi), %rax
movq %rax, 0x20(%rsp)
xorl %ecx, %ecx
movq %rsi, 0x18(%rsp)
movl %ebp, 0x4(%rsp)
movq %rdx, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq %rcx, 0x28(%rsp)
movq (%rax,%rcx,8), %r13
testq %r13, %r13
je 0x4188
movq %r13, %rdi
callq 0x30f0
testb $0x40, %bpl
jne 0x40c9
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %rax, %r12
callq 0x30c0
testl %eax, %eax
jne 0x4188
jmp 0x41b8
xorl %edx, %edx
xorl %r15d, %r15d
movq %rbx, %r12
movq %r13, 0x38(%rsp)
movq %rax, 0x30(%rsp)
movsbl (%r12), %r14d
testl %r14d, %r14d
je 0x40f1
movb (%r13,%rdx), %bpl
cmpq %rdx, %rax
jne 0x4100
jmp 0x4170
movb (%r13,%rdx), %bpl
testb %bpl, %bpl
je 0x416d
cmpq %rdx, %rax
je 0x416d
movq %rdx, 0x40(%rsp)
callq 0x32e0
movq (%rax), %rax
movsbq %bpl, %rbx
movl (%rax,%rbx,4), %r13d
callq 0x32f0
movq (%rax), %rax
movzwl (%rax,%rbx,2), %eax
movl %eax, %ecx
shrl $0x8, %ecx
testl %r15d, %r15d
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x4142
cmpb $0x20, %r14b
jne 0x4170
movsbl 0x1(%r12), %r14d
incq %r12
movsbl %r13b, %ecx
cmpl %r14d, %ecx
jne 0x4170
andl $0x200, %eax            # imm = 0x200
incq %r12
movq 0x40(%rsp), %rdx
incq %rdx
movl %eax, %r15d
movq 0x38(%rsp), %r13
movq 0x30(%rsp), %rax
jmp 0x40db
xorl %r14d, %r14d
cmpb %bpl, %r14b
movq 0x18(%rsp), %rbx
movl 0x4(%rsp), %ebp
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %r15
je 0x41a6
movq 0x28(%rsp), %rcx
incq %rcx
movl %ecx, (%r14)
movslq 0x90(%r15), %rax
cmpq %rax, %rcx
jl 0x4086
xorl %r12d, %r12d
movq %r12, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq %r12, %rbx
movq %rbx, %r12
jmp 0x41a6
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/termkey.c
// Function: parse_utf8
static TermKeyResult parse_utf8(const unsigned char *bytes, size_t len, long *cp, size_t *nbytep)
{
  unsigned int nbytes;

  unsigned char b0 = bytes[0];

  if(b0 < 0x80) {
    // Single byte ASCII
    *cp = b0;
    *nbytep = 1;
    return TERMKEY_RES_KEY;
  }
  else if(b0 < 0xc0) {
    // Starts with a continuation byte - that's not right
    *cp = UTF8_INVALID;
    *nbytep = 1;
    return TERMKEY_RES_KEY;
  }
  else if(b0 < 0xe0) {
    nbytes = 2;
    *cp = b0 & 0x1f;
  }
  else if(b0 < 0xf0) {
    nbytes = 3;
    *cp = b0 & 0x0f;
  }
  else if(b0 < 0xf8) {
    nbytes = 4;
    *cp = b0 & 0x07;
  }
  else if(b0 < 0xfc) {
    nbytes = 5;
    *cp = b0 & 0x03;
  }
  else if(b0 < 0xfe) {
    nbytes = 6;
    *cp = b0 & 0x01;
  }
  else {
    *cp = UTF8_INVALID;
    *nbytep = 1;
    return TERMKEY_RES_KEY;
  }

  for(unsigned int b = 1; b < nbytes; b++) {
    unsigned char cb;

    if(b >= len)
      return TERMKEY_RES_AGAIN;

    cb = bytes[b];
    if(cb < 0x80 || cb >= 0xc0) {
      *cp = UTF8_INVALID;
      *nbytep = b;
      return TERMKEY_RES_KEY;
    }

    *cp <<= 6;
    *cp |= cb & 0x3f;
  }

  // Check for overlong sequences
  if(nbytes > utf8_seqlen(*cp))
    *cp = UTF8_INVALID;

  // Check for UTF-16 surrogates or invalid *cps
  if((*cp >= 0xD800 && *cp <= 0xDFFF) ||
     *cp == 0xFFFE ||
     *cp == 0xFFFF)
    *cp = UTF8_INVALID;

  *nbytep = nbytes;
  return TERMKEY_RES_KEY;
}

// Assembly:
movzbl (%rdi), %eax
movl $0x1, %r8d
testb %al, %al
jns 0x4cc6
cmpb $-0x40, %al
jae 0x4b8e
movl $0xfffd, %eax           # imm = 0xFFFD
jmp 0x4cc6
cmpb $-0x20, %al
jae 0x4ba0
movl $0x2, %r9d
movl $0x1f, %r8d
jmp 0x4be0
cmpb $-0x10, %al
jae 0x4bb2
movl $0x3, %r9d
movl $0xf, %r8d
jmp 0x4be0
cmpb $-0x8, %al
jae 0x4bc4
movl $0x4, %r9d
movl $0x7, %r8d
jmp 0x4be0
cmpb $-0x4, %al
jae 0x4bd6
movl $0x5, %r9d
movl $0x3, %r8d
jmp 0x4be0
movl $0x6, %r9d
cmpb $-0x3, %al
ja 0x4b84
andl %r8d, %eax
movq %rax, (%rdx)
cmpq $0x1, %rsi
adcq $0x0, %rsi
movl %r9d, %r8d
movl $0x1, %r10d
cmpq %r10, %rsi
je 0x4cb8
movzbl (%rdi,%r10), %r11d
cmpb $-0x41, %r11b
jg 0x4cbe
movq %rax, %r9
shlq $0x6, %r9
andl $0x3f, %r11d
movq %r11, %rax
orq %r9, %rax
movq %rax, (%rdx)
incq %r10
cmpq %r10, %r8
jne 0x4bf7
movl $0x1, %esi
cmpq $0x80, %rax
jl 0x4c71
movl $0x2, %esi
cmpq $0x800, %r9             # imm = 0x800
jb 0x4c71
movl $0x3, %esi
cmpq $0x10000, %r9           # imm = 0x10000
jb 0x4c71
movl $0x4, %esi
cmpq $0x200000, %r9          # imm = 0x200000
jb 0x4c71
cmpq $0x4000000, %r9         # imm = 0x4000000
movl $0x6, %esi
sbbl $0x0, %esi
cmpl %esi, %r8d
movl $0xfffd, %r9d           # imm = 0xFFFD
cmovaq %r9, %rax
movq %rax, %rdi
andq $-0x800, %rdi           # imm = 0xF800
cmpq $0xd800, %rdi           # imm = 0xD800
sete %r10b
movq %rax, %rdi
andq $-0x2, %rdi
cmpq $0xfffe, %rdi           # imm = 0xFFFE
sete %dil
orb %r10b, %dil
cmovneq %r9, %rax
cmpl %esi, %r8d
ja 0x4cc6
testb %dil, %dil
je 0x4cc9
jmp 0x4cc6
movl $0x3, %eax
retq
movl $0xfffd, %eax           # imm = 0xFFFD
movq %r10, %r8
movq %rax, (%rdx)
movq %r8, (%rcx)
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/driver-csi.c
// Function: termkey_interpret_mouse
TermKeyResult termkey_interpret_mouse(TermKey *tk, const TermKeyKey *key, TermKeyMouseEvent *event, int *button, int *line, int *col)
{
  if(key->type != TERMKEY_TYPE_MOUSE)
    return TERMKEY_RES_NONE;

  if(button)
    *button = 0;

  termkey_key_get_linecol(key, line, col);

  if(!event)
    return TERMKEY_RES_KEY;

  int btn = 0;

  int code = key->code.mouse[0];

  int drag = code & 0x20;

  code &= ~0x3c;

  switch(code) {
  case 0:
  case 1:
  case 2:
    *event = drag ? TERMKEY_MOUSE_DRAG : TERMKEY_MOUSE_PRESS;
    btn = code + 1;
    break;

  case 3:
    *event = TERMKEY_MOUSE_RELEASE;
    // no button hint
    break;

  case 64:
  case 65:
  case 66:
  case 67:
    *event = drag ? TERMKEY_MOUSE_DRAG : TERMKEY_MOUSE_PRESS;
    btn = code + 4 - 64;
    break;

  default:
    *event = TERMKEY_MOUSE_UNKNOWN;
  }

  if(button)
    *button = btn;

  if(key->code.mouse[3] & 0x80)
    *event = TERMKEY_MOUSE_RELEASE;

  return TERMKEY_RES_KEY;
}

// Assembly:
xorl %eax, %eax
cmpl $0x3, (%rsi)
jne 0x51bc
testq %rcx, %rcx
je 0x5116
movl $0x0, (%rcx)
testq %r9, %r9
je 0x512e
movzbl 0x9(%rsi), %eax
movzbl 0xb(%rsi), %edi
andl $0xf, %edi
shll $0x8, %edi
orl %eax, %edi
movl %edi, (%r9)
testq %r8, %r8
je 0x5146
movzbl 0xa(%rsi), %eax
movzbl 0xb(%rsi), %edi
andl $0x70, %edi
shll $0x4, %edi
orl %eax, %edi
movl %edi, (%r8)
movl $0x1, %eax
testq %rdx, %rdx
je 0x51bc
movsbl 0x8(%rsi), %r8d
movl %r8d, %edi
andl $-0x3d, %edi
leal -0x40(%rdi), %r9d
cmpl $0x4, %r9d
jb 0x5183
cmpl $0x3, %edi
jae 0x519d
andl $0x20, %r8d
cmpl $0x1, %r8d
movl $0x2, %r8d
sbbl $0x0, %r8d
movl %r8d, (%rdx)
incl %edi
jmp 0x51af
andl $0x20, %r8d
cmpl $0x1, %r8d
movl $0x2, %r8d
sbbl $0x0, %r8d
movl %r8d, (%rdx)
addl $-0x3c, %edi
jmp 0x51af
jne 0x51a7
movl $0x3, (%rdx)
jmp 0x51ad
movl $0x0, (%rdx)
xorl %edi, %edi
testq %rcx, %rcx
je 0x51b6
movl %edi, (%rcx)
cmpb $0x0, 0xb(%rsi)
js 0x51bd
retq
movl $0x3, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/driver-csi.c
// Function: termkey_interpret_position
TermKeyResult termkey_interpret_position(TermKey *tk, const TermKeyKey *key, int *line, int *col)
{
  if(key->type != TERMKEY_TYPE_POSITION)
    return TERMKEY_RES_NONE;

  termkey_key_get_linecol(key, line, col);

  return TERMKEY_RES_KEY;
}

// Assembly:
xorl %eax, %eax
cmpl $0x4, (%rsi)
jne 0x51fe
testq %rcx, %rcx
je 0x51e2
movzbl 0x9(%rsi), %eax
movzbl 0xb(%rsi), %edi
andl $0xf, %edi
shll $0x8, %edi
orl %eax, %edi
movl %edi, (%rcx)
movl $0x1, %eax
testq %rdx, %rdx
je 0x51fe
movzbl 0xa(%rsi), %ecx
movzbl 0xb(%rsi), %esi
andl $0x70, %esi
shll $0x4, %esi
orl %ecx, %esi
movl %esi, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/driver-csi.c
// Function: termkey_interpret_modereport
TermKeyResult termkey_interpret_modereport(TermKey *tk, const TermKeyKey *key, int *initial, int *mode, int *value)
{
  if(key->type != TERMKEY_TYPE_MODEREPORT)
    return TERMKEY_RES_NONE;

  if(initial)
    *initial = key->code.mouse[0];

  if(mode)
    *mode = ((uint8_t)key->code.mouse[1] << 8) | (uint8_t)key->code.mouse[2];

  if(value)
    *value = key->code.mouse[3];

  return TERMKEY_RES_KEY;
}

// Assembly:
xorl %eax, %eax
cmpl $0x5, (%rsi)
jne 0x5234
testq %rdx, %rdx
je 0x5211
movsbl 0x8(%rsi), %eax
movl %eax, (%rdx)
testq %rcx, %rcx
je 0x5223
movzwl 0x9(%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, (%rcx)
movl $0x1, %eax
testq %r8, %r8
je 0x5234
movsbl 0xb(%rsi), %ecx
movl %ecx, (%r8)
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/driver-csi.c
// Function: parse_csi
static TermKeyResult parse_csi(TermKey *tk, size_t introlen, size_t *csi_len, long args[], size_t *nargs, unsigned long *commandp)
{
  size_t csi_end = introlen;

  while(csi_end < tk->buffcount) {
    if(CHARAT(csi_end) >= 0x40 && CHARAT(csi_end) < 0x80)
      break;
    csi_end++;
  }

  if(csi_end >= tk->buffcount)
    return TERMKEY_RES_AGAIN;

  unsigned char cmd = CHARAT(csi_end);
  *commandp = cmd;

  char present = 0;
  int argi = 0;

  size_t p = introlen;

  // See if there is an initial byte
  if(CHARAT(p) >= '<' && CHARAT(p) <= '?') {
    *commandp |= (CHARAT(p) << 8);
    p++;
  }

  // Now attempt to parse out up number;number;... separated values
  while(p < csi_end) {
    unsigned char c = CHARAT(p);

    if(c >= '0' && c <= '9') {
      if(!present) {
        args[argi] = c - '0';
        present = 1;
      }
      else {
        args[argi] = (args[argi] * 10) + c - '0';
      }
    }
    else if(c == ';') {
      if(!present)
        args[argi] = -1;
      present = 0;
      argi++;

      if(argi > 16)
        break;
    }
    else if(c >= 0x20 && c <= 0x2f) {
      *commandp |= c << 16;
      break;
    }

    p++;
  }

  if(present)
    argi++;

  *nargs = argi;
  *csi_len = csi_end + 1;

  return TERMKEY_RES_KEY;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x20(%rdi), %r14
movl $0x3, %eax
cmpq %rsi, %r14
jbe 0x536d
movq 0x10(%rdi), %r11
movq 0x18(%rdi), %r15
addq %r11, %r15
movq %rsi, %r10
movsbq (%r15,%r10), %rbx
cmpq $0x3f, %rbx
jg 0x529b
incq %r10
cmpq %r10, %r14
jne 0x5283
jmp 0x536d
movq %rbx, (%r9)
movq 0x18(%rdi), %rax
addq %r11, %rax
movzbl (%rsi,%rax), %eax
movl %eax, %ebp
andb $-0x4, %bpl
cmpb $0x3c, %bpl
jne 0x52c1
shll $0x8, %eax
orq %rbx, %rax
movq %rax, (%r9)
incq %rsi
xorl %ebx, %ebx
movl $0x0, %eax
cmpq %r10, %rsi
jae 0x5354
xorl %eax, %eax
xorl %ebx, %ebx
movq 0x18(%rdi), %r14
addq %r11, %r14
movzbl (%rsi,%r14), %r14d
leal -0x30(%r14), %ebp
cmpb $0x9, %bpl
ja 0x5304
testb %bl, %bl
je 0x5336
movslq %eax, %rbx
movq (%rcx,%rbx,8), %r15
leaq (%r15,%r15,4), %r15
leaq (%r14,%r15,2), %r14
addq $-0x30, %r14
jmp 0x533d
cmpl $0x3b, %r14d
jne 0x5327
testb %bl, %bl
jne 0x5319
movslq %eax, %rbx
movq $-0x1, (%rcx,%rbx,8)
leal 0x1(%rax), %ebp
cmpl $0xf, %eax
jg 0x535c
xorl %ebx, %ebx
movl %ebp, %eax
jmp 0x5343
movl %r14d, %ebp
andb $-0x10, %bpl
cmpb $0x20, %bpl
jne 0x5343
jmp 0x534d
addl $-0x30, %r14d
movslq %eax, %rbx
movq %r14, (%rcx,%rbx,8)
movb $0x1, %bl
incq %rsi
cmpq %r10, %rsi
jb 0x52d5
jmp 0x5354
shll $0x10, %r14d
orq %r14, (%r9)
cmpb $0x1, %bl
sbbl $-0x1, %eax
movl %eax, %ebp
movslq %ebp, %rax
movq %rax, (%r8)
incq %r10
movq %r10, (%rdx)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libtermkey/driver-csi.c
// Function: peekkey
static TermKeyResult peekkey(TermKey *tk, void *info, TermKeyKey *key, int force, size_t *nbytep)
{
  if(tk->buffcount == 0)
    return tk->is_closed ? TERMKEY_RES_EOF : TERMKEY_RES_NONE;

  TermKeyCsi *csi = info;

  switch(CHARAT(0)) {
    case 0x1b:
      if(tk->buffcount < 2)
        return TERMKEY_RES_NONE;

      switch(CHARAT(1)) {
        case 0x4f: // ESC-prefixed SS3
          return peekkey_ss3(tk, csi, 2, key, force, nbytep);

        case 0x50: // ESC-prefixed DCS
        case 0x5d: // ESC-prefixed OSC
          return peekkey_ctrlstring(tk, csi, 2, key, force, nbytep);

        case 0x5b: // ESC-prefixed CSI
          return peekkey_csi(tk, csi, 2, key, force, nbytep);
      }

      return TERMKEY_RES_NONE;

    case 0x8f: // SS3
      return peekkey_ss3(tk, csi, 1, key, force, nbytep);

    case 0x90: // DCS
    case 0x9d: // OSC
      return peekkey_ctrlstring(tk, csi, 1, key, force, nbytep);

    case 0x9b: // CSI
      return peekkey_csi(tk, csi, 1, key, force, nbytep);
  }

  return TERMKEY_RES_NONE;
}

// Assembly:
pushq %rbx
movq 0x20(%rdi), %r10
testq %r10, %r10
je 0x5926
movq %rdx, %r9
movq 0x10(%rdi), %r11
movq 0x18(%rdi), %rbx
movzbl (%r11,%rbx), %edx
xorl %eax, %eax
cmpl $0x8f, %edx
jle 0x5936
cmpl $0x90, %edx
je 0x5918
cmpl $0x9b, %edx
je 0x5951
cmpl $0x9d, %edx
jne 0x5934
movl $0x1, %edx
movq %r9, %rcx
popq %rbx
jmp 0x5d7b
xorl %eax, %eax
cmpb $0x0, 0x8c(%rdi)
setne %al
addl %eax, %eax
popq %rbx
retq
cmpl $0x1b, %edx
je 0x595f
cmpl $0x8f, %edx
jne 0x5934
movl $0x1, %esi
movq %r9, %rdx
popq %rbx
jmp 0x5c95
movl $0x1, %esi
movq %r9, %rdx
popq %rbx
jmp 0x5e99
cmpq $0x1, %r10
je 0x5934
movzbl 0x1(%r11,%rbx), %edx
cmpl $0x5a, %edx
jg 0x597c
cmpl $0x4f, %edx
je 0x598d
cmpl $0x50, %edx
je 0x5986
jmp 0x5934
cmpl $0x5b, %edx
je 0x5994
cmpl $0x5d, %edx
jne 0x5934
movl $0x2, %edx
jmp 0x591d
movl $0x2, %esi
jmp 0x5948
movl $0x2, %esi
jmp 0x5956