LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/sock.c
// Function: netbuf_add_domain_name
void netbuf_add_domain_name(unsigned char *buf, int buflen, int *offset, 
			    char *name)
{
	unsigned char *start = buf + *offset;
	unsigned char *p = start;
	unsigned char *wordstart, *wordend;

	wordstart = (unsigned char *)name;
	
	while (*wordstart)
	{
		int len;
		wordend = wordstart;
		while (*wordend && *wordend != '.')
		{
			wordend++;
		}

		len = (int)(wordend - wordstart);

		if (len > 0x3F)
		{
			len = 0x3F;
		}

		*p++ = len;

		while (wordstart != wordend)
		{
			*p++ = *wordstart++;
		}

		if (*wordstart == '.')
		{
			wordstart++;
		}
	}

	*p++ = '\0';

	*offset += p - start;
}

// Assembly:
movslq (%rdx), %rax
addq %rdi, %rax
pushq $0x3f
popq %rdi
movq %rax, %rsi
movb (%rcx), %r11b
testb %r11b, %r11b
je 0xa98a
xorl %r9d, %r9d
xorl %r10d, %r10d
movq %rcx, %r8
testb %r11b, %r11b
je 0xa95b
movzbl %r11b, %r11d
cmpl $0x2e, %r11d
je 0xa95b
movb 0x1(%r8), %r11b
incq %r8
incl %r10d
incq %r9
jmp 0xa93d
cmpl $0x3f, %r10d
cmovgel %edi, %r10d
movb %r10b, (%rsi)
incq %rsi
testq %r9, %r9
je 0xa97c
movb (%rcx), %r10b
incq %rcx
movb %r10b, (%rsi)
decq %r9
jmp 0xa966
xorl %ecx, %ecx
cmpb $0x2e, (%r8)
sete %cl
addq %r8, %rcx
jmp 0xa92c
movb $0x0, (%rsi)
subl %eax, %esi
movl (%rdx), %eax
addl %esi, %eax
incl %eax
movl %eax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/sock.c
// Function: calc_domain_name_size
int calc_domain_name_size(unsigned char *buf, int buflen, int offset)
{
	unsigned char *p = buf + offset;
	int len = 0;

	while (*p)
	{
		if ((*p & 0xC0) == 0xC0)
		{
			int newoffset = 0;
			newoffset |= (*p++ & 0x3F) << 8;
			newoffset |= *p;

			p = buf + newoffset;
		}
		else
		{
			if (len)
			{
				len += 1;
			}
			len += *p;
			p += *p + 1;
		}
	}

	return len;
}

// Assembly:
movslq %edx, %rcx
addq %rdi, %rcx
xorl %eax, %eax
movzbl (%rcx), %edx
testl %edx, %edx
je 0xa9dd
movl %edx, %esi
notl %esi
testb $-0x40, %sil
jne 0xa9c2
andl $0x3f, %edx
shll $0x8, %edx
movzbl 0x1(%rcx), %esi
orl %edx, %esi
movq %rdi, %rcx
jmp 0xa9d6
leal 0x1(%rax), %r8d
testl %eax, %eax
cmovel %eax, %r8d
addl %edx, %r8d
incl %edx
movl %edx, %esi
movl %r8d, %eax
movl %esi, %edx
addq %rdx, %rcx
jmp 0xa9a0
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/sock.c
// Function: netbuf_get_dnsquery_resourcerecord
void netbuf_get_dnsquery_resourcerecord(unsigned char *buf, int buflen, int *offset, struct dnsquery_resourcerecord *rr)
{
	netbuf_get_domain_name(buf, buflen, offset, rr->name, 1024);
	netbuf_get_16bitnum(buf, buflen, offset, &(rr->type));
	netbuf_get_16bitnum(buf, buflen, offset, &(rr->_class));
	netbuf_get_32bitnum(buf, buflen, offset, &(rr->ttl));
	netbuf_get_16bitnum(buf, buflen, offset, &(rr->rdlength));
	if (rr->type == 33) /* SRV */
	{
		int newoffset = *offset;
		netbuf_get_dnsquery_srvrdata(buf, buflen, &newoffset, &(rr->rdata));
	}
	*offset += rr->rdlength;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rdi, %r15
movl $0x400, %r8d            # imm = 0x400
callq 0xa9de
movslq (%rbx), %rax
andw $0x0, 0x400(%r14)
movzbl (%r15,%rax), %ecx
shll $0x8, %ecx
movw %cx, 0x400(%r14)
movzbl 0x1(%r15,%rax), %edx
orl %ecx, %edx
movw %dx, 0x400(%r14)
leaq 0x2(%rax), %rcx
movl %ecx, (%rbx)
andw $0x0, 0x402(%r14)
movzbl 0x2(%r15,%rax), %ecx
shll $0x8, %ecx
movw %cx, 0x402(%r14)
movzbl 0x3(%r15,%rax), %edx
orl %ecx, %edx
movw %dx, 0x402(%r14)
addl $0x4, %eax
movl %eax, (%rbx)
leaq 0x404(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rdx
callq 0xa8b7
movslq (%rbx), %rcx
andw $0x0, 0x408(%r14)
movzbl (%r15,%rcx), %edx
shll $0x8, %edx
movw %dx, 0x408(%r14)
movzbl 0x1(%r15,%rcx), %eax
orl %edx, %eax
movw %ax, 0x408(%r14)
addl $0x2, %ecx
movl %ecx, (%rbx)
cmpw $0x21, 0x400(%r14)
jne 0xaef9
leaq 0xc(%rsp), %rdx
movl %ecx, (%rdx)
leaq 0x40a(%r14), %rcx
movq %r15, %rdi
callq 0xad91
movzwl 0x408(%r14), %eax
movl (%rbx), %ecx
movzwl %ax, %eax
addl %ecx, %eax
movl %eax, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_copy
xmpp_stanza_t *xmpp_stanza_copy(const xmpp_stanza_t * const stanza)
{
    xmpp_stanza_t *copy, *child, *copychild, *tail;
    hash_iterator_t *iter;
    const char *key;
    void *val;

    copy = xmpp_stanza_new(stanza->ctx);
    if (!copy) goto copy_error;

    copy->type = stanza->type;

    if (stanza->data) {
	copy->data = xmpp_strdup(stanza->ctx, stanza->data);
	if (!copy->data) goto copy_error;
    }

    if (stanza->attributes) {
	copy->attributes = hash_new(stanza->ctx, 8, xmpp_free);
	if (!copy->attributes) goto copy_error;
	iter = hash_iter_new(stanza->attributes);
	if (!iter) { printf("DEBUG HERE\n"); goto copy_error; }
	while ((key = hash_iter_next(iter))) {
	    val = xmpp_strdup(stanza->ctx,
			      (char *)hash_get(stanza->attributes, key));
	    if (!val) goto copy_error;
	    
	    if (hash_add(copy->attributes, key, val))
		goto copy_error;
	}
	hash_iter_release(iter);
    }

    tail = copy->children;
    for (child = stanza->children; child; child = child->next) {
	copychild = xmpp_stanza_copy(child);
	if (!copychild) goto copy_error;
	copychild->parent = copy;

	if (tail) {
	    copychild->prev = tail;
	    tail->next = copychild;
	} else
	    copy->children = copychild;
	tail = copychild;
    }

    return copy;

copy_error:
    /* release all the hitherto allocated memory */
    if (copy) xmpp_stanza_release(copy);
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rdi
callq 0xb0b4
testq %rax, %rax
je 0xb1c2
movq %rax, %rbx
movl 0x10(%r14), %eax
movl %eax, 0x10(%rbx)
movq 0x38(%r14), %rsi
testq %rsi, %rsi
je 0xb131
movq 0x8(%r14), %rdi
callq 0xbcd4
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0xb1ba
cmpq $0x0, 0x40(%r14)
je 0xb1d9
movq 0x8(%r14), %rdi
leaq -0x5fa6(%rip), %rdx     # 0x51a1
pushq $0x8
popq %rsi
callq 0x630c
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0xb1ba
movq 0x40(%r14), %rdi
callq 0x65c6
testq %rax, %rax
je 0xb1ae
movq %rax, %r15
movq %r15, %rdi
callq 0x6624
testq %rax, %rax
je 0xb1d1
movq %rax, %r12
movq 0x8(%r14), %r13
movq 0x40(%r14), %rdi
movq %rax, %rsi
callq 0x657f
movq %r13, %rdi
movq %rax, %rsi
callq 0xbcd4
testq %rax, %rax
je 0xb1ba
movq 0x40(%rbx), %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x641a
testl %eax, %eax
je 0xb169
jmp 0xb1ba
leaq 0x1f86(%rip), %rdi      # 0xd13b
callq 0x23a0
movq %rbx, %rdi
callq 0xb220
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r15, %rdi
callq 0x65f2
movq %rbx, %r15
addq $0x28, %r15
movq 0x28(%rbx), %r12
addq $0x28, %r14
movq (%r14), %r14
testq %r14, %r14
je 0xb1c4
movq %r14, %rdi
callq 0xb0ea
testq %rax, %rax
je 0xb1ba
movq %rbx, 0x30(%rax)
movq %r15, %rcx
testq %r12, %r12
je 0xb214
movq %r12, 0x18(%rax)
addq $0x20, %r12
movq %r12, %rcx
movq %rax, (%rcx)
addq $0x20, %r14
movq %rax, %r12
jmp 0xb1e8
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_release
int xmpp_stanza_release(xmpp_stanza_t * const stanza)
{
    int released = 0;
    xmpp_stanza_t *child, *tchild;

    /* release stanza */
    if (stanza->ref > 1)
	stanza->ref--;
    else {
	/* release all children */
	child = stanza->children;
	while (child) {
	    tchild = child;
	    child = child->next;
	    xmpp_stanza_release(tchild);
	}

	if (stanza->attributes) hash_release(stanza->attributes);
	if (stanza->data) xmpp_free(stanza->ctx, stanza->data);
	xmpp_free(stanza->ctx, stanza);
	released = 1;
    }

    return released;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x2, %eax
jl 0xb236
decl %eax
movl %eax, (%rbx)
xorl %eax, %eax
jmp 0xb27c
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0xb24d
movq 0x20(%rdi), %r14
callq 0xb220
movq %r14, %rdi
jmp 0xb23a
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0xb25b
callq 0x638a
movq 0x38(%rbx), %rsi
testq %rsi, %rsi
je 0xb26d
movq 0x8(%rbx), %rdi
callq 0x51a1
movq 0x8(%rbx), %rdi
movq %rbx, %rsi
callq 0x51a1
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_to_text
int  xmpp_stanza_to_text(xmpp_stanza_t *stanza,
			 char ** const buf,
			 size_t * const buflen)
{
    char *buffer, *tmp;
    size_t length;
    int ret;

    /* allocate a default sized buffer and attempt to render */
    length = 1024;
    buffer = xmpp_alloc(stanza->ctx, length);
    if (!buffer) {
	*buf = NULL;
	*buflen = 0;
	return XMPP_EMEM;
    }

    ret = _render_stanza_recursive(stanza, buffer, length);
    if (ret < 0) return ret;

    if (ret > length - 1) {
	tmp = xmpp_realloc(stanza->ctx, buffer, ret + 1);
	if (!tmp) {
	    xmpp_free(stanza->ctx, buffer);
	    *buf = NULL;
	    *buflen = 0;
	    return XMPP_EMEM;
	}
	length = ret + 1;
	buffer = tmp;

	ret = _render_stanza_recursive(stanza, buffer, length);
	if (ret > length - 1) return XMPP_EMEM;
    }
    
    buffer[length - 1] = 0;

    *buf = buffer;
    *buflen = ret;

    return XMPP_EOK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rbp
movq 0x8(%rdi), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x518f
testq %rax, %rax
je 0xb338
movq %rax, %r12
movl $0x400, %r13d           # imm = 0x400
movl $0x400, %edx            # imm = 0x400
movq %rbp, %rdi
movq %rax, %rsi
callq 0xb384
movl %eax, %r15d
testl %eax, %eax
js 0xb372
cmpl $0x400, %r15d           # imm = 0x400
jb 0xb344
movq %rbx, (%rsp)
movq 0x8(%rbp), %rdi
leal 0x1(%r15), %r13d
movq %r12, %rsi
movq %r13, %rdx
callq 0x51b4
testq %rax, %rax
je 0xb355
movq %rax, %rbx
movq %rbp, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0xb384
movq %rbx, %r12
cmpl %r15d, %eax
movl %eax, %r15d
movq (%rsp), %rbx
jbe 0xb344
pushq $-0x1
popq %r15
jmp 0xb372
andq $0x0, (%r14)
pushq $-0x1
popq %r15
xorl %eax, %eax
jmp 0xb36f
movb $0x0, -0x1(%r13,%r12)
movq %r12, (%r14)
movl %r15d, %eax
xorl %r15d, %r15d
jmp 0xb36f
movq 0x8(%rbp), %rdi
movq %r12, %rsi
callq 0x51a1
andq $0x0, (%r14)
pushq $-0x1
popq %r15
xorl %eax, %eax
movq (%rsp), %rbx
movq %rax, (%rbx)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_set_name
int xmpp_stanza_set_name(xmpp_stanza_t *stanza, 
			 const char * const name)
{
    if (stanza->type == XMPP_STANZA_TEXT) return XMPP_EINVOP;

    if (stanza->data) xmpp_free(stanza->ctx, stanza->data);

    stanza->type = XMPP_STANZA_TAG;
    stanza->data = xmpp_strdup(stanza->ctx, name);

    return XMPP_EOK;
}

// Assembly:
cmpl $0x1, 0x10(%rdi)
jne 0xb587
pushq $-0x2
popq %rax
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x38(%rdi), %rsi
testq %rsi, %rsi
je 0xb5a3
movq 0x8(%rbx), %rdi
callq 0x51a1
movl $0x2, 0x10(%rbx)
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0xbcd4
movq %rax, 0x38(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_get_attributes
int xmpp_stanza_get_attributes(xmpp_stanza_t * const stanza,
			       const char **attr, int attrlen)
{
    hash_iterator_t *iter;
    const char *key;
    int num = 0;

    if (stanza->attributes == NULL) {
	return 0;
    }

    iter = hash_iter_new(stanza->attributes);
    while ((key = hash_iter_next(iter)) != NULL && attrlen) {
	attr[num++] = key;
	attrlen--;
	if (attrlen == 0) {
	    hash_iter_release(iter);
	    return num;
	}
	attr[num++] = hash_get(stanza->attributes, key);
	attrlen--;
	if (attrlen == 0) {
	    hash_iter_release(iter);
	    return num;
	}
    }

    hash_iter_release(iter);
    return num;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r12
movq 0x40(%rdi), %rdi
testq %rdi, %rdi
je 0xb646
movl %edx, %ebx
movq %rsi, %r15
callq 0x65c6
movq %rax, %r14
movl %ebx, %r13d
leaq -0x1(%r13), %rbp
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x6624
cmpl %ebx, %r13d
je 0xb64d
testq %rax, %rax
je 0xb64d
movq %rax, (%r15,%rbx,8)
cmpl %ebx, %ebp
je 0xb64a
movq 0x40(%r12), %rdi
movq %rax, %rsi
callq 0x657f
movq %rax, 0x8(%r15,%rbx,8)
addq $0x2, %rbx
cmpl %ebx, %r13d
jne 0xb60f
jmp 0xb64d
xorl %ebx, %ebx
jmp 0xb655
incq %rbx
movq %r14, %rdi
callq 0x65f2
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/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_set_attribute
int xmpp_stanza_set_attribute(xmpp_stanza_t * const stanza,
			      const char * const key,
			      const char * const value)
{
    char *val;

    if (stanza->type != XMPP_STANZA_TAG) return XMPP_EINVOP;

    if (!stanza->attributes) {
	stanza->attributes = hash_new(stanza->ctx, 8, xmpp_free);
	if (!stanza->attributes) return XMPP_EMEM;
    }

    val = xmpp_strdup(stanza->ctx, value);
    if (!val) return XMPP_EMEM;

    hash_add(stanza->attributes, key, val);

    return XMPP_EOK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x2, 0x10(%rdi)
jne 0xb6c6
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x40(%rdi)
pushq $-0x1
popq %rbp
jne 0xb6a2
movq 0x8(%r14), %rdi
leaq -0x64f0(%rip), %rdx     # 0x51a1
pushq $0x8
popq %rsi
callq 0x630c
movq %rax, 0x40(%r14)
testq %rax, %rax
je 0xb6c9
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0xbcd4
testq %rax, %rax
je 0xb6c9
movq 0x40(%r14), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x641a
xorl %ebp, %ebp
jmp 0xb6c9
pushq $-0x2
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_set_text
int xmpp_stanza_set_text(xmpp_stanza_t *stanza,
			 const char * const text)
{
    if (stanza->type == XMPP_STANZA_TAG) return XMPP_EINVOP;
    
    stanza->type = XMPP_STANZA_TEXT;

    if (stanza->data) xmpp_free(stanza->ctx, stanza->data);
    stanza->data = xmpp_strdup(stanza->ctx, text);

    return XMPP_EOK;
}

// Assembly:
cmpl $0x2, 0x10(%rdi)
jne 0xb71b
pushq $-0x2
popq %rax
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, 0x10(%rdi)
movq 0x38(%rdi), %rsi
testq %rsi, %rsi
je 0xb73e
movq 0x8(%rbx), %rdi
callq 0x51a1
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0xbcd4
movq %rax, 0x38(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_set_text_with_size
int xmpp_stanza_set_text_with_size(xmpp_stanza_t *stanza,
				   const char * const text,
				   const size_t size)
{
    if (stanza->type == XMPP_STANZA_TAG) return XMPP_EINVOP;

    stanza->type = XMPP_STANZA_TEXT;

    if (stanza->data) xmpp_free(stanza->ctx, stanza->data);
    stanza->data = xmpp_alloc(stanza->ctx, size + 1);
    if (!stanza->data) return XMPP_EMEM;

    memcpy(stanza->data, text, size);
    stanza->data[size] = 0;

    return XMPP_EOK;
}

// Assembly:
cmpl $0x2, 0x10(%rdi)
jne 0xb762
pushq $-0x2
popq %rax
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0x1, 0x10(%rdi)
movq 0x38(%rdi), %rsi
testq %rsi, %rsi
je 0xb789
movq 0x8(%r14), %rdi
callq 0x51a1
movq 0x8(%r14), %rdi
leaq 0x1(%rbx), %rsi
callq 0x518f
movq %rax, 0x38(%r14)
testq %rax, %rax
je 0xb7b9
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2050
movq 0x38(%r14), %rax
movb $0x0, (%rax,%rbx)
xorl %eax, %eax
jmp 0xb7bc
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rsi, %r14
movq %rdi, %rbx
addq $0x28, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xb84e
cmpl $0x2, 0x10(%rbx)
jne 0xb848
movq 0x38(%rbx), %rsi
movq %r14, %rdi
callq 0x22e0
testl %eax, %eax
je 0xb84e
addq $0x20, %rbx
jmp 0xb82a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
addq $0x28, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xb899
movq %rbx, %rdi
callq 0xb7e0
testq %rax, %rax
je 0xb893
movq %rbx, %rdi
callq 0xb7e0
movq %r14, %rdi
movq %rax, %rsi
callq 0x22e0
testl %eax, %eax
je 0xb899
addq $0x20, %rbx
jmp 0xb867
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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, %rbx
cmpl $0x1, 0x10(%rdi)
jne 0xb8df
movq 0x38(%rbx), %rsi
testq %rsi, %rsi
je 0xb962
movq 0x8(%rbx), %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xbcd4
leaq 0x28(%rbx), %r12
xorl %r14d, %r14d
movq %r12, %r15
movq (%r15), %r15
testq %r15, %r15
je 0xb90a
cmpl $0x1, 0x10(%r15)
jne 0xb904
movq 0x38(%r15), %rdi
callq 0x2180
addq %rax, %r14
addq $0x20, %r15
jmp 0xb8e9
testq %r14, %r14
je 0xb962
movq 0x8(%rbx), %rdi
incq %r14
movq %r14, %rsi
callq 0x518f
testq %rax, %rax
je 0xb962
movq %rax, %rbx
xorl %r13d, %r13d
movq (%r12), %r12
testq %r12, %r12
je 0xb966
cmpl $0x1, 0x10(%r12)
jne 0xb95c
movq 0x38(%r12), %r14
movq %r14, %rdi
callq 0x2180
movq %rax, %r15
leaq (%rbx,%r13), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2050
addq %r15, %r13
addq $0x20, %r12
jmp 0xb929
xorl %ebx, %ebx
jmp 0xb96b
movb $0x0, (%rbx,%r13)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x10
popq %rsi
callq 0x518f
testq %rax, %rax
je 0xba14
movq %rax, %rbx
movq %r14, (%rax)
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x518f
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xba09
movq %rax, %rdi
xorl %esi, %esi
callq 0x2170
movq 0x8(%rbx), %rsi
testl %eax, %eax
je 0xba21
movq %r14, %rdi
callq 0x51a1
andq $0x0, 0x8(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x51a1
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
testq %rsi, %rsi
jne 0xba16
jmp 0xba09
// File: /workspace/github_c_makefile_star2_O2/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 0xba46
callq 0x2090
xorl %ebp, %ebp
testl %eax, %eax
sete %bpl
jmp 0xba49
pushq $0x1
popq %rbp
movq (%rbx), %rdi
movq %rbx, %rsi
callq 0x51a1
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x28
popq %rsi
callq 0x518f
testq %rax, %rax
je 0xbb3c
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
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
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 0xbb3e
movq 0x18(%rbx), %rdi
movl %eax, %esi
callq 0x2450
movl %eax, 0x20(%rbx)
movq %rbx, %rdi
callq 0xbb46
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
pushq $-0x1
popq %rbp
pushq $0x40
popq %r12
pushq $0x1
popq %r13
leaq 0x18(%rsp), %r14
leaq 0x8(%rsp), %r15
cmpl $-0x1, %ebp
jne 0xbbfe
movq 0x18(%rbx), %rdi
callq 0x23d0
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0xbb95
andq $0x0, 0x8(%rsp)
movq $0x3e8, 0x10(%rsp)      # imm = 0x3E8
xorl %eax, %eax
cmpq $0x10, %rax
je 0xbbcc
andq $0x0, 0x18(%rsp,%rax,8)
incq %rax
jmp 0xbbbb
movl 0x8(%rbx), %edi
movl %edi, %eax
cltd
idivl %r12d
movslq %eax, %rdx
shll $0x6, %eax
movl %edi, %ecx
subl %eax, %ecx
movq %r13, %rax
shlq %cl, %rax
orq %rax, 0x18(%rsp,%rdx,8)
incl %edi
movq %r14, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x2040
jmp 0xbb95
testl %ebp, %ebp
jle 0xbc07
pushq $0x1
popq %rax
jmp 0xbc17
movq 0x18(%rbx), %rdi
movl %ebp, %esi
callq 0x2450
movl %eax, 0x20(%rbx)
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/tls_openssl.c
// Function: tls_stop
int tls_stop(tls_t *tls)
{
    int ret;

    ret = SSL_shutdown(tls->ssl);

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

    return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x20e0
testl %eax, %eax
jle 0xbc3f
pushq $0x1
popq %rax
jmp 0xbc4f
movq 0x18(%rbx), %rdi
movl %eax, %esi
callq 0x2450
movl %eax, 0x20(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xbc64
movl $0x8d, %eax
btl %edi, %eax
jae 0xbc64
pushq $0x1
popq %rax
retq
xorl %eax, %eax
cmpl $0x8, %edi
sete %al
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/tls_openssl.c
// Function: tls_read
int tls_read(tls_t *tls, void * const buff, const size_t len)
{
    int ret = SSL_read(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 0x2430
movl %eax, %ebp
testl %eax, %eax
jg 0xbc99
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_O2/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 0xbcc5
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_O2/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 0x518f
movq %rax, %r15
testq %rax, %rax
je 0xbd1c
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2050
leaq 0x326(%rip), %rsi       # 0xc049
leaq 0x141c(%rip), %rdx      # 0xd146
movq %rbx, %rdi
xorl %eax, %eax
callq 0x52aa
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/giometti[P]mastering_UNIX_programming/chapter_07/open_memstream.c
// Function: main
int main(void)
{
	FILE *fp;
	char *buf;
	size_t len;

	fp = open_memstream(&buf, &len);
        if (!fp) {
                perror("open_memstream");
                return -1;
        }

	/* Write something in the stream */
	fprintf(fp, "first write");
	fflush(fp);
	printf("buf=%s len=%zu\n", buf, len);

	/* Move to the beginning of the stream */
	rewind(fp);

	/* Write something else in the stream (overwriting
	 * old data)
	 */
	fprintf(fp, "second write");
	fclose(fp);
	printf("buf=%s len=%zu\n", buf, len);

	/* Must free the buffer! */
	free(buf);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1040
testq %rax, %rax
je 0x125f
movq %rax, %rbx
leaq 0xe3b(%rip), %rdi       # 0x2013
pushq $0xb
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %rax, %rcx
callq 0x10a0
movq %rbx, %rdi
callq 0x1080
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0xe1c(%rip), %r15       # 0x201f
xorl %ebp, %ebp
movq %r15, %rdi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1070
leaq 0xe11(%rip), %rdi       # 0x202f
pushq $0xc
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x10a0
movq %rbx, %rdi
callq 0x1050
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
xorl %eax, %eax
callq 0x1060
movq 0x8(%rsp), %rdi
callq 0x1030
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd9e(%rip), %rdi       # 0x2004
callq 0x1090
pushq $-0x1
popq %rbp
jmp 0x1252
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libtermkey/termkey.c
// Function: termkey_check_version
void termkey_check_version(int major, int minor)
{
  if(major != TERMKEY_VERSION_MAJOR) {
    fprintf(stderr, "libtermkey major version mismatch; %d (wants) != %d (library)\n",
        major, TERMKEY_VERSION_MAJOR);
    exit(1);
  }

  if(minor > TERMKEY_VERSION_MINOR) {
    fprintf(stderr, "libtermkey minor version mismatch; %d (wants) > %d (library)\n",
        minor, TERMKEY_VERSION_MINOR);
    exit(1);
  }

  // Happy
}

// Assembly:
pushq %rax
testl %edi, %edi
jne 0x33da
movl %esi, %edx
cmpl $0x18, %esi
jge 0x33f3
popq %rax
retq
movl %edi, %eax
movq 0x7c0d(%rip), %rcx      # 0xaff0
movq (%rcx), %rdi
leaq 0x3cb3(%rip), %rsi      # 0x70a0
movl %eax, %edx
xorl %ecx, %ecx
jmp 0x3407
movq 0x7bf6(%rip), %rax      # 0xaff0
movq (%rax), %rdi
leaq 0x3cdb(%rip), %rsi      # 0x70df
pushq $0x17
popq %rcx
xorl %eax, %eax
callq 0x3190
pushq $0x1
popq %rdi
callq 0x3290
// File: /workspace/github_c_makefile_star2_O2/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 0x3505
testq %rax, %rax
je 0x34fb
movq %rax, %rbx
movl %r14d, (%rax)
testb $0xc, %bpl
jne 0x34b0
leaq 0x3cdd(%rip), %rdi      # 0x711d
callq 0x3030
testq %rax, %rax
jne 0x346c
leaq 0x3cd1(%rip), %rdi      # 0x7122
callq 0x3030
testq %rax, %rax
jne 0x346c
leaq 0x3ccc(%rip), %rdi      # 0x712e
callq 0x3030
testq %rax, %rax
je 0x34a8
pushq $0x2e
popq %rsi
movq %rax, %rdi
callq 0x3110
testq %rax, %rax
je 0x34a8
movq %rax, %r14
incq %r14
leaq 0x3cac(%rip), %rsi      # 0x7135
movq %r14, %rdi
callq 0x3060
testl %eax, %eax
je 0x34ad
leaq 0x3c9f(%rip), %rsi      # 0x713b
movq %r14, %rdi
callq 0x3060
testl %eax, %eax
je 0x34ad
orl $0x4, %ebp
jmp 0x34b0
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 0x3c73(%rip), %rdi      # 0x7140
callq 0x3030
movq %rbx, %rdi
movq %rax, %rsi
callq 0x35cc
testl %eax, %eax
je 0x34f3
btl $0x8, %ebp
jb 0x34fd
movq %rbx, %rdi
callq 0x3180
testl %eax, %eax
jne 0x34fd
movq %rbx, %rdi
callq 0x3050
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rbx
cmpb $0x0, 0x8d(%rdi)
jne 0x3864
movq %rdi, %r14
movl (%rdi), %edi
cmpl $-0x1, %edi
je 0x382a
testb $0x10, 0x4(%r14)
jne 0x382a
leaq 0x4(%rsp), %rsi
callq 0x3240
testl %eax, %eax
jne 0x382a
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 0x3812
xorl %eax, %eax
movb %al, 0x16(%rsp)
movb %al, 0x1f(%rsp)
jmp 0x381b
andl $0xffff7ff4, %eax       # imm = 0xFFFF7FF4
movl %eax, 0x10(%rsp)
movl (%r14), %edi
leaq 0x4(%rsp), %rdx
xorl %esi, %esi
callq 0x3250
leaq 0x2a0(%r14), %r15
movq (%r15), %r15
testq %r15, %r15
je 0x3858
movq (%r15), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x3852
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq *%rax
testl %eax, %eax
je 0x3862
addq $0x10, %r15
jmp 0x3831
movb $0x1, 0x8d(%r14)
jmp 0x3864
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3505
testq %rax, %rax
je 0x38c8
movq %rax, %rbx
orl $-0x1, (%rax)
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 0x35cc
testl %eax, %eax
je 0x38c0
btl $0x8, %ebp
jb 0x38ca
movq %rbx, %rdi
callq 0x3180
testl %eax, %eax
jne 0x38ca
movq %rbx, %rdi
callq 0x3050
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x10(%rbx)
movq 0x98(%rbx), %rdi
callq 0x3050
andq $0x0, 0x98(%rbx)
movq 0x2a0(%rbx), %r14
testq %r14, %r14
je 0x3923
movq (%r14), %rax
movq 0x8(%r14), %rdi
callq *0x10(%rax)
movq 0x10(%r14), %r15
movq %r14, %rdi
callq 0x3050
movq %r15, %r14
jmp 0x3903
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3050
// File: /workspace/github_c_makefile_star2_O2/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 0x39a9
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2a0(%rdi), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x3988
movq (%r14), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x3982
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq *%rax
addq $0x10, %r14
jmp 0x3965
cmpb $0x0, 0x74(%rbx)
je 0x399b
movl (%rbx), %edi
leaq 0x38(%rbx), %rdx
xorl %esi, %esi
callq 0x3250
movb $0x0, 0x8d(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3a19
movq %rax, 0x10(%r14)
movq %rbx, 0x28(%r14)
pushq $0x1
popq %rax
jmp 0x3a1b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3a5d
cmpl $0x2, %eax
jne 0x3a75
cmpl $0x5, 0x8(%rbx)
jne 0x3a75
andl $0x0, (%rbx)
movq $0x20, 0x8(%rbx)
movq %rbx, %rdi
callq 0x3a94
jmp 0x3a75
testl %eax, %eax
jne 0x3a75
cmpq $0x20, 0x8(%rbx)
jne 0x3a75
movl $0x2, (%rbx)
movl $0x5, 0x8(%rbx)
testb $0x2, %bpl
je 0x3a8d
cmpl $0x2, (%rbx)
jne 0x3a8d
cmpl $0x6, 0x8(%rbx)
jne 0x3a8d
movl $0x1, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x4ef8
movl %eax, %eax
movb $0x0, 0x14(%rbx,%rax)
movq %rax, %rcx
cmpq $0x2, %rcx
jl 0x3acd
movl %r14d, %edx
andb $0x3f, %dl
orb $-0x80, %dl
movb %dl, 0x13(%rbx,%rcx)
decq %rcx
sarq $0x6, %r14
jmp 0x3ab1
decl %eax
leaq 0x352a(%rip), %rcx      # 0x7000
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
andb $0x7f, %r14b
jmp 0x3b15
andb $0x3, %r14b
orb $-0x8, %r14b
jmp 0x3b15
andb $0xf, %r14b
orb $-0x20, %r14b
jmp 0x3b15
andb $0x7, %r14b
orb $-0x10, %r14b
jmp 0x3b15
andb $0x1f, %r14b
orb $-0x40, %r14b
jmp 0x3b15
andb $0x1, %r14b
orb $-0x4, %r14b
movb %r14b, 0x14(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x8(%rsp), %rcx
andq $0x0, (%rcx)
xorl %edx, %edx
callq 0x3b7a
movl %eax, %ebx
cmpl $0x3, %eax
je 0x3b5b
cmpl $0x1, %ebx
jne 0x3b6e
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x3c6e
jmp 0x3b6e
pushq $0x1
popq %rdx
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3b7a
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
cmpb $0x0, 0x8d(%rdi)
je 0x3c02
movq %rcx, %r14
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x3bb0
addq %rax, 0x18(%rbx)
subq %rax, 0x20(%rbx)
andq $0x0, 0x30(%rbx)
leaq 0x2a0(%rbx), %rbp
xorl %r13d, %r13d
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x3c11
movq (%rbp), %rax
movq 0x8(%rbp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
movl %r15d, %ecx
movq %r14, %r8
callq *0x28(%rax)
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
ja 0x3bfc
leaq 0x342f(%rip), %rdx      # 0x7018
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testl %r15d, %r15d
pushq $0x1
popq %rax
cmovel %eax, %r13d
addq $0x10, %rbp
jmp 0x3bba
callq 0x30a0
movl $0x16, (%rax)
pushq $0x4
jmp 0x3c3f
testl %r13d, %r13d
je 0x3c4f
pushq $0x3
jmp 0x3c3f
jmp 0x3c40
movq 0x28(%rbx), %r14
shrq %r14
cmpq %r14, 0x18(%rbx)
jbe 0x3c3d
movq 0x10(%rbx), %rdi
leaq (%rdi,%r14), %rsi
movq %r14, %rdx
callq 0x31a0
subq %r14, 0x18(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movq %r14, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4d5a
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %rcx
andq $0x0, (%rcx)
pushq $0x1
popq %rdx
callq 0x3b7a
movl %eax, %ebp
cmpl $0x1, %eax
jne 0x3cb1
movq (%rsp), %rsi
movq %rbx, %rdi
callq 0x3c6e
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $-0x1, (%rdi)
je 0x3d7c
movq %rsi, %r14
movq %rdi, %r15
leaq 0x334d(%rip), %rbp      # 0x7028
pushq $0x4
popq %rbx
movq %rsp, %r12
pushq $0x1
popq %r13
movq %r15, %rdi
movq %r14, %rsi
callq 0x3140
cmpl $0x4, %eax
ja 0x3ce5
movl %eax, %ecx
movslq (%rbp,%rcx,4), %rcx
addq %rbp, %rcx
jmpq *%rcx
movq %r15, %rdi
callq 0x32c0
cmpl $0x4, %eax
jne 0x3ce5
jmp 0x3d8a
cmpb $0x0, 0x8c(%r15)
jne 0x3d6d
movl (%r15), %eax
movl %eax, (%rsp)
movw $0x1, 0x4(%rsp)
movl 0x88(%r15), %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x3220
cmpl $-0x1, %eax
jne 0x3d51
callq 0x30a0
cmpl $0x4, (%rax)
jne 0x3d8a
testb $-0x80, 0x4(%r15)
je 0x3d1a
jmp 0x3d8a
testb $0x19, 0x6(%rsp)
je 0x3d6d
movq %r15, %rdi
callq 0x32c0
cmpl $0x4, %eax
je 0x3d78
testl %eax, %eax
jne 0x3ce5
movq %r15, %rdi
movq %r14, %rsi
callq 0x3070
movl %eax, %ebx
jmp 0x3d8a
callq 0x30a0
movl $0x9, (%rax)
pushq $0x4
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq