LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/sock.c
// Function: netbuf_add_dnsquery_header
void netbuf_add_dnsquery_header(unsigned char *buf, int buflen, int *offset, struct dnsquery_header *header)
{
	unsigned char *p;

	netbuf_add_16bitnum(buf, buflen, offset, header->id);
	
	p = buf + *offset;
	*p++ =    ((header->qr     & 0x01) << 7)
		| ((header->opcode & 0x0F) << 3)
		| ((header->aa     & 0x01) << 2)
		| ((header->tc     & 0x01) << 1)
		| ((header->rd     & 0x01));
	*p++ =    ((header->ra     & 0x01) << 7)
		| ((header->z      & 0x07) << 4)
		| ((header->rcode  & 0x0F));
	*offset += 2;

	netbuf_add_16bitnum(buf, buflen, offset, header->qdcount);
	netbuf_add_16bitnum(buf, buflen, offset, header->ancount);
	netbuf_add_16bitnum(buf, buflen, offset, header->nscount);
	netbuf_add_16bitnum(buf, buflen, offset, header->arcount);
}

// Assembly:
movzwl (%rcx), %eax
movslq (%rdx), %rsi
rolw $0x8, %ax
movw %ax, (%rdi,%rsi)
movslq (%rdx), %rax
leaq 0x2(%rax), %rsi
movl %esi, (%rdx)
movb 0x2(%rcx), %sil
movb 0x3(%rcx), %r8b
shlb $0x7, %sil
shlb $0x3, %r8b
andb $0x78, %r8b
orb %sil, %r8b
movb 0x4(%rcx), %sil
shlb $0x2, %sil
andb $0x4, %sil
orb %r8b, %sil
movb 0x5(%rcx), %r8b
addb %r8b, %r8b
andb $0x2, %r8b
orb %sil, %r8b
movb 0x6(%rcx), %sil
andb $0x1, %sil
orb %r8b, %sil
movb %sil, 0x2(%rdi,%rax)
movb 0x7(%rcx), %sil
movb 0x8(%rcx), %r8b
shlb $0x7, %sil
shlb $0x4, %r8b
andb $0x70, %r8b
orb %sil, %r8b
movb 0x9(%rcx), %sil
andb $0xf, %sil
orb %r8b, %sil
movb %sil, 0x3(%rdi,%rax)
movslq (%rdx), %rax
leaq 0x2(%rax), %rsi
movl %esi, (%rdx)
movzwl 0xa(%rcx), %esi
rolw $0x8, %si
movw %si, 0x2(%rdi,%rax)
movslq (%rdx), %rax
leaq 0x2(%rax), %rsi
movl %esi, (%rdx)
movzwl 0xc(%rcx), %esi
rolw $0x8, %si
movw %si, 0x2(%rdi,%rax)
movslq (%rdx), %rax
leaq 0x2(%rax), %rsi
movl %esi, (%rdx)
movzwl 0xe(%rcx), %esi
rolw $0x8, %si
movw %si, 0x2(%rdi,%rax)
movslq (%rdx), %rax
leaq 0x2(%rax), %rsi
movl %esi, (%rdx)
movzwl 0x10(%rcx), %ecx
rolw $0x8, %cx
movw %cx, 0x2(%rdi,%rax)
addl $0x2, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xae42
movslq (%rbx), %rdx
xorl %ecx, %ecx
movw %cx, 0x400(%r14)
movzbl (%r15,%rdx), %esi
shll $0x8, %esi
movw %si, 0x400(%r14)
movzbl 0x1(%r15,%rdx), %eax
orl %esi, %eax
movw %ax, 0x400(%r14)
leaq 0x2(%rdx), %rsi
movl %esi, (%rbx)
movw %cx, 0x402(%r14)
movzbl 0x2(%r15,%rdx), %esi
shll $0x8, %esi
movw %si, 0x402(%r14)
movzbl 0x3(%r15,%rdx), %edi
orl %esi, %edi
movw %di, 0x402(%r14)
leaq 0x4(%rdx), %rsi
movl %esi, (%rbx)
movl $0x0, 0x404(%r14)
movzbl 0x4(%r15,%rdx), %esi
shll $0x18, %esi
movl %esi, 0x404(%r14)
movzbl 0x5(%r15,%rdx), %edi
shll $0x10, %edi
orl %esi, %edi
movl %edi, 0x404(%r14)
movzbl 0x6(%r15,%rdx), %esi
shll $0x8, %esi
orl %edi, %esi
movl %esi, 0x404(%r14)
movzbl 0x7(%r15,%rdx), %edx
orl %esi, %edx
movl %edx, 0x404(%r14)
movslq (%rbx), %rdx
leaq 0x4(%rdx), %rsi
movl %esi, (%rbx)
movw %cx, 0x408(%r14)
movzbl 0x4(%r15,%rdx), %ecx
shll $0x8, %ecx
movw %cx, 0x408(%r14)
movzbl 0x5(%r15,%rdx), %esi
orl %ecx, %esi
movw %si, 0x408(%r14)
leal 0x6(%rdx), %ecx
movl %ecx, (%rbx)
cmpw $0x21, %ax
jne 0xb3c8
leaq 0xc(%rsp), %rdx
movl %ecx, (%rdx)
leaq 0x40a(%r14), %rcx
movq %r15, %rdi
callq 0xb225
movzwl 0x408(%r14), %eax
addl %eax, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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), %r15
movl $0x48, %esi
movq %r15, %rdi
callq 0x5281
testq %rax, %rax
je 0xb6dd
movq %rax, %rbx
movl $0x1, (%rax)
movq %r15, 0x8(%rax)
movl $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x38(%rax)
movl 0x10(%r14), %eax
movl %eax, 0x10(%rbx)
movq 0x38(%r14), %rsi
testq %rsi, %rsi
je 0xb64a
movq 0x8(%r14), %rdi
callq 0xc264
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0xb6d5
cmpq $0x0, 0x40(%r14)
je 0xb6f4
movq 0x8(%r14), %rdi
leaq -0x63cd(%rip), %rdx     # 0x5293
movl $0x8, %esi
callq 0x64dc
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0xb6d5
movq 0x40(%r14), %rdi
callq 0x681a
testq %rax, %rax
je 0xb6c9
movq %rax, %r15
movq %r15, %rdi
callq 0x6880
testq %rax, %rax
je 0xb6ec
movq %rax, %r12
movq 0x8(%r14), %r13
movq 0x40(%r14), %rdi
movq %rax, %rsi
callq 0x67a3
movq %r13, %rdi
movq %rax, %rsi
callq 0xc264
testq %rax, %rax
je 0xb6d5
movq 0x40(%rbx), %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x65fa
testl %eax, %eax
je 0xb684
jmp 0xb6d5
leaq 0x2a6b(%rip), %rdi      # 0xe13b
callq 0x23a0
movq %rbx, %rdi
callq 0xb73c
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r15, %rdi
callq 0x684e
movq 0x28(%r14), %r14
testq %r14, %r14
je 0xb6df
movq %rbx, %r15
addq $0x28, %r15
movq (%r15), %r12
movq %r14, %rdi
callq 0xb5db
testq %rax, %rax
je 0xb6d5
movq %rbx, 0x30(%rax)
movq %r15, %rcx
testq %r12, %r12
je 0xb72b
movq %r12, 0x18(%rax)
addq $0x20, %r12
movq %r12, %rcx
movq %rax, (%rcx)
movq 0x20(%r14), %r14
movq %rax, %r12
testq %r14, %r14
jne 0xb707
jmp 0xb6df
// File: /workspace/github_c_makefile_star2_O1/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 0xb752
decl %eax
movl %eax, (%rbx)
xorl %eax, %eax
jmp 0xb79d
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0xb76c
movq 0x20(%rdi), %r14
callq 0xb73c
movq %r14, %rdi
testq %r14, %r14
jne 0xb75b
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0xb77a
callq 0x655f
movq 0x38(%rbx), %rsi
testq %rsi, %rsi
je 0xb78c
movq 0x8(%rbx), %rdi
callq 0x5293
movq 0x8(%rbx), %rdi
movq %rbx, %rsi
callq 0x5293
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5281
testq %rax, %rax
je 0xb866
movq %rax, %r15
movl $0x400, %r12d           # imm = 0x400
movl $0x400, %edx            # imm = 0x400
movq %rbp, %rdi
movq %rax, %rsi
callq 0xb8ab
movl %eax, %r13d
testl %eax, %eax
js 0xb879
cmpl $0x400, %r13d           # imm = 0x400
jb 0xb856
movq %rbx, (%rsp)
movq 0x8(%rbp), %rdi
leal 0x1(%r13), %r12d
movq %r15, %rsi
movq %r12, %rdx
callq 0x52a6
testq %rax, %rax
je 0xb88b
movq %rax, %rbx
movq %rbp, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xb8ab
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rbx, %r15
cmpl %r13d, %ecx
movl %ecx, %r13d
movq (%rsp), %rbx
ja 0xb87c
movb $0x0, -0x1(%r12,%r15)
movq %r15, (%r14)
movslq %r13d, %rcx
xorl %eax, %eax
jmp 0xb874
movq $0x0, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movq %rcx, (%rbx)
jmp 0xb87c
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbp), %rdi
movq %r15, %rsi
callq 0x5293
movq $0x0, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movq (%rsp), %rbx
jmp 0xb874
// File: /workspace/github_c_makefile_star2_O1/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:
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl $0x1, 0x10(%rdi)
je 0xbb0d
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x38(%rdi), %rsi
testq %rsi, %rsi
je 0xbaed
movq 0x8(%rbx), %rdi
callq 0x5293
movl $0x2, 0x10(%rbx)
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0xc264
movq %rax, 0x38(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xbb90
movl %edx, %ebx
movq %rsi, %r15
callq 0x681a
movq %rax, %r14
movl %ebx, %r13d
leaq -0x1(%r13), %rbp
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x6880
cmpl %ebx, %r13d
je 0xbb97
testq %rax, %rax
je 0xbb97
movq %rax, (%r15,%rbx,8)
cmpl %ebx, %ebp
je 0xbb94
movq 0x40(%r12), %rdi
movq %rax, %rsi
callq 0x67a3
movq %rax, 0x8(%r15,%rbx,8)
addq $0x2, %rbx
cmpl %ebx, %r13d
jne 0xbb59
jmp 0xbb97
xorl %ebx, %ebx
jmp 0xbb9f
incq %rbx
movq %r14, %rdi
callq 0x684e
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_O1/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:
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl $0x2, 0x10(%rdi)
jne 0xbc1c
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x40(%rdi)
jne 0xbbee
movq 0x8(%r14), %rdi
leaq -0x6948(%rip), %rdx     # 0x5293
movl $0x8, %esi
callq 0x64dc
movq %rax, 0x40(%r14)
testq %rax, %rax
je 0xbc12
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0xc264
testq %rax, %rax
je 0xbc12
movq 0x40(%r14), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x65fa
xorl %eax, %eax
jmp 0xbc17
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl $0x2, 0x10(%rdi)
je 0xbc9f
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, 0x10(%rdi)
movq 0x38(%rdi), %rsi
testq %rsi, %rsi
je 0xbc86
movq 0x8(%rbx), %rdi
callq 0x5293
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0xc264
movq %rax, 0x38(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl $0x2, 0x10(%rdi)
je 0xbd0c
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 0xbcd2
movq 0x8(%r14), %rdi
callq 0x5293
movq 0x8(%r14), %rdi
leaq 0x1(%rbx), %rsi
callq 0x5281
movq %rax, 0x38(%r14)
testq %rax, %rax
je 0xbd02
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2050
movq 0x38(%r14), %rax
movb $0x0, (%rax,%rbx)
xorl %eax, %eax
jmp 0xbd07
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xbd96
movq %rsi, %r14
cmpl $0x2, 0x10(%rbx)
jne 0xbd8d
movq 0x38(%rbx), %rsi
movq %r14, %rdi
callq 0x22e0
testl %eax, %eax
je 0xbd96
movq 0x20(%rbx), %rbx
testq %rbx, %rbx
jne 0xbd77
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xbdf9
movq %rsi, %r14
leaq 0x2366(%rip), %r15      # 0xe11f
cmpl $0x2, 0x10(%rbx)
jne 0xbdf0
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0xbdf0
movq %r15, %rsi
callq 0x67a3
testq %rax, %rax
je 0xbdf0
movq 0x40(%rbx), %rdi
movq %r15, %rsi
callq 0x67a3
movq %r14, %rdi
movq %rax, %rsi
callq 0x22e0
testl %eax, %eax
je 0xbdf9
movq 0x20(%rbx), %rbx
testq %rbx, %rbx
jne 0xbdb9
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xbe3d
movq 0x38(%r14), %rsi
testq %rsi, %rsi
je 0xbeb7
movq 0x8(%r14), %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xc264
movq 0x28(%r14), %r15
xorl %ebx, %ebx
testq %r15, %r15
je 0xbe61
cmpl $0x1, 0x10(%r15)
jne 0xbe5b
movq 0x38(%r15), %rdi
callq 0x2180
addq %rax, %rbx
movq 0x20(%r15), %r15
jmp 0xbe43
testq %rbx, %rbx
je 0xbeb7
movq 0x8(%r14), %rdi
incq %rbx
movq %rbx, %rsi
callq 0x5281
testq %rax, %rax
je 0xbeb7
movq %rax, %rbx
movq 0x28(%r14), %r13
xorl %r12d, %r12d
testq %r13, %r13
je 0xbebb
cmpl $0x1, 0x10(%r13)
jne 0xbeb1
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 0xbe84
xorl %ebx, %ebx
jmp 0xbec0
movb $0x0, (%rbx,%r12)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5281
testq %rax, %rax
je 0xbf76
movq %rax, %rbx
movq %r14, (%rax)
movl $0x28, %esi
movq %r14, %rdi
callq 0x5281
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xbf64
movq %rax, %rdi
xorl %esi, %esi
callq 0x2170
testl %eax, %eax
je 0xbf64
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x5293
movq $0x0, 0x8(%rbx)
cmpq $0x0, 0x8(%rbx)
jne 0xbf78
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5293
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xbfa1
callq 0x2090
xorl %ebp, %ebp
testl %eax, %eax
sete %bpl
jmp 0xbfa6
movl $0x1, %ebp
movq (%rbx), %rdi
movq %rbx, %rsi
callq 0x5293
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5281
testq %rax, %rax
je 0xc0a9
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movq $0x0, 0x20(%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 0xc0ab
movq 0x18(%rbx), %rdi
movl %eax, %esi
callq 0x2450
movl %eax, 0x20(%rbx)
movq %rbx, %rdi
callq 0xc0b3
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc18d
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 0xc104
movl $0x1, %ecx
testl %eax, %eax
jg 0xc1a6
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_O1/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 0xc1f4
movl $0x1, %eax
movl $0x8d, %ecx
btl %edi, %ecx
jae 0xc1f4
retq
xorl %eax, %eax
cmpl $0x8, %edi
sete %al
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc229
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_O1/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 0xc255
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_O1/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 %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2180
movq %rax, %r15
incq %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5281
testq %rax, %rax
je 0xc2a0
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x2050
leaq 0xda2(%rip), %rsi       # 0xd049
leaq 0x1e98(%rip), %rdx      # 0xe146
movq %rbx, %rdi
xorl %eax, %eax
callq 0x539c
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x10, %rsp
movq %rsp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1040
testq %rax, %rax
je 0x125a
movq %rax, %rbx
leaq 0xe3f(%rip), %rdi       # 0x2013
movl $0xb, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x10a0
movq %rbx, %rdi
callq 0x1080
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0xe21(%rip), %r14       # 0x201f
xorl %ebp, %ebp
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1070
leaq 0xe16(%rip), %rdi       # 0x202f
movl $0xc, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x10a0
movq %rbx, %rdi
callq 0x1050
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
movq (%rsp), %rdi
callq 0x1030
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xda3(%rip), %rdi       # 0x2004
callq 0x1090
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x124f
// File: /workspace/github_c_makefile_star2_O1/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 0x3c63(%rip), %rdi      # 0x7101
callq 0x3030
testq %rax, %rax
jne 0x34ca
leaq 0x3c57(%rip), %rdi      # 0x7106
callq 0x3030
testq %rax, %rax
jne 0x34ca
leaq 0x3c52(%rip), %rdi      # 0x7112
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 0x3c30(%rip), %rsi      # 0x7119
movq %r14, %rdi
callq 0x3060
testl %eax, %eax
je 0x350d
leaq 0x3c23(%rip), %rsi      # 0x711f
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 0x3bf7(%rip), %rdi      # 0x7124
callq 0x3030
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3636
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_O1/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 0x38e3
movq %rdi, %r14
movl (%rdi), %edi
cmpl $-0x1, %edi
je 0x38ac
testb $0x10, 0x4(%r14)
jne 0x38ac
leaq 0x4(%rsp), %rsi
callq 0x3240
testl %eax, %eax
jne 0x38ac
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 0x3894
xorl %eax, %eax
movb %al, 0x16(%rsp)
movb %al, 0x1f(%rsp)
jmp 0x389d
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 0x38d7
movq (%r15), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x38d1
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq *%rax
testl %eax, %eax
je 0x38e1
movq 0x10(%r15), %r15
jmp 0x38b3
movb $0x1, 0x8d(%r14)
jmp 0x38e3
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x394a
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 0x3636
testl %eax, %eax
je 0x3942
btl $0x8, %ebp
jb 0x394c
movq %rbx, %rdi
callq 0x3180
testl %eax, %eax
jne 0x394c
movq %rbx, %rdi
callq 0x3050
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x39a9
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 0x398b
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3050
// File: /workspace/github_c_makefile_star2_O1/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 0x3a2c
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x2a0(%rdi), %r14
testq %r14, %r14
je 0x3a0b
movq (%r14), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x3a05
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq *%rax
movq 0x10(%r14), %r14
jmp 0x39eb
cmpb $0x0, 0x74(%rbx)
je 0x3a1e
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_O1/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 0x3aa0
movq %rax, 0x10(%r14)
movq %rbx, 0x28(%r14)
movl $0x1, %eax
jmp 0x3aa2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3ae7
cmpl $0x2, %eax
jne 0x3aff
cmpl $0x5, 0x8(%rbx)
jne 0x3aff
movl $0x0, (%rbx)
movq $0x20, 0x8(%rbx)
movq %rbx, %rdi
callq 0x3b1e
jmp 0x3aff
testl %eax, %eax
jne 0x3aff
cmpq $0x20, 0x8(%rbx)
jne 0x3aff
movl $0x2, (%rbx)
movl $0x5, 0x8(%rbx)
testb $0x2, %bpl
je 0x3b17
cmpl $0x2, (%rbx)
jne 0x3b17
cmpl $0x6, 0x8(%rbx)
jne 0x3b17
movl $0x1, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %ecx
cmpq $0x80, %rax
jl 0x3b64
movl $0x2, %ecx
cmpq $0x800, %rax            # imm = 0x800
jl 0x3b64
movl $0x3, %ecx
cmpq $0x10000, %rax          # imm = 0x10000
jl 0x3b64
movl $0x4, %ecx
cmpq $0x200000, %rax         # imm = 0x200000
jl 0x3b64
xorl %ecx, %ecx
cmpq $0x4000000, %rax        # imm = 0x4000000
setge %cl
addl $0x5, %ecx
movl %ecx, %edx
movb $0x0, 0x14(%rdi,%rdx)
cmpl $0x2, %ecx
jb 0x3b90
movl %eax, %esi
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x13(%rdi,%rdx)
leaq -0x1(%rdx), %rsi
sarq $0x6, %rax
cmpq $0x2, %rdx
movq %rsi, %rdx
jg 0x3b70
decl %ecx
leaq 0x3467(%rip), %rdx      # 0x7000
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
andb $0x7f, %al
jmp 0x3bc2
andb $0x3, %al
orb $-0x8, %al
jmp 0x3bc2
andb $0xf, %al
orb $-0x20, %al
jmp 0x3bc2
andb $0x7, %al
orb $-0x10, %al
jmp 0x3bc2
andb $0x1f, %al
orb $-0x40, %al
jmp 0x3bc2
andb $0x1, %al
orb $-0x4, %al
movb %al, 0x14(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3c37
movl %eax, %ebp
cmpl $0x3, %eax
je 0x3c07
cmpl $0x1, %ebp
jne 0x3c2c
movq 0x8(%rsp), %rcx
movq 0x20(%rbx), %rax
subq %rcx, %rax
jbe 0x3c1e
addq %rcx, 0x18(%rbx)
jmp 0x3c28
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x3c37
jmp 0x3c2c
movq $0x0, 0x18(%rbx)
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3cf5
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x3c74
addq %rax, 0x18(%rbx)
subq %rax, 0x20(%rbx)
movq $0x0, 0x30(%rbx)
movq 0x2a0(%rbx), %r13
testq %r13, %r13
je 0x3cd6
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 0x3cc2
leaq 0x336a(%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 0x3c83
movl $0x3, %r12d
testl %r14d, %r14d
jne 0x3d06
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 0x4fdf
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
cmpq %r14, 0x18(%rbx)
jbe 0x3d06
movq 0x10(%rbx), %rdi
leaq (%rdi,%r14), %rsi
movq %r14, %rdx
callq 0x31a0
subq %r14, 0x18(%rbx)
jmp 0x3d06
// File: /workspace/github_c_makefile_star2_O1/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 0x3c37
cmpl $0x1, %eax
jne 0x3d80
movq 0x8(%rsp), %rdx
movq 0x20(%rbx), %rcx
subq %rdx, %rcx
jbe 0x3d72
addq %rdx, 0x18(%rbx)
jmp 0x3d7c
movq $0x0, 0x18(%rbx)
xorl %ecx, %ecx
movq %rcx, 0x20(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x10, %rsp
cmpl $-0x1, (%rdi)
je 0x3e89
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x3280(%rip), %r12      # 0x7028
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3140
cmpl $0x4, %eax
ja 0x3e73
movl %eax, %ecx
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
xorl %ecx, %ecx
jmp 0x3e77
cmpb $0x0, 0x8c(%r14)
je 0x3dea
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3070
jmp 0x3dcc
movl (%r14), %eax
movl %eax, 0x8(%rsp)
movw $0x1, 0xc(%rsp)
movl 0x88(%r14), %edx
movl $0x1, %esi
movq %r15, %rdi
callq 0x3220
cmpl $-0x1, %eax
jne 0x3e40
callq 0x3090
movq %rax, %rcx
movl $0x4, %eax
cmpl $0x4, (%rcx)
jne 0x3e67
testb $-0x80, 0x4(%r14)
je 0x3dea
jmp 0x3e67
movq %r14, %rdi
callq 0x32c0
cmpl $0x4, %eax
jne 0x3e73
movl $0x4, %eax
jmp 0x3dcc
testb $0x19, 0xe(%rsp)
je 0x3e51
movq %r14, %rdi
callq 0x32c0
jmp 0x3e53
xorl %eax, %eax
cmpl $0x4, %eax
je 0x3e67
testl %eax, %eax
jne 0x3e83
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3070
xorl %ecx, %ecx
testb %cl, %cl
je 0x3dcc
movl %eax, %ebp
movb $0x1, %cl
movl %ebp, %eax
movl %eax, %ebp
testb %cl, %cl
jne 0x3dad
jmp 0x3e99
movb $0x1, %cl
movl %ebp, %eax
jmp 0x3e69
callq 0x3090
movl $0x9, (%rax)
movl $0x4, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq