LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/jid.c
// Function: xmpp_jid_new
char *xmpp_jid_new(xmpp_ctx_t *ctx, const char *node,
				    const char *domain,
				    const char *resource)
{
    char *result;
    int len,nlen,dlen,rlen;

    /* jid must at least have a domain */
    if (domain == NULL) return NULL;

    /* accumulate lengths */
    dlen = strlen(domain);
    nlen = (node) ? strlen(node) + 1 : 0;
    rlen = (resource) ? strlen(resource) + 1 : 0;
    len = nlen + dlen + rlen;

    /* concat components */
    result = xmpp_alloc(ctx, len + 1);
    if (result != NULL) {
	if (node != NULL) {
	    memcpy(result, node, nlen - 1);
	    result[nlen-1] = '@';
	}
        memcpy(result + nlen, domain, dlen);
	if (resource != NULL) {
	    result[nlen+dlen] = '/';
	    memcpy(result+nlen+dlen+1, resource, rlen - 1);
	}
	result[nlen+dlen+rlen] = '\0';
    }

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorl %ebp, %ebp
testq %rdx, %rdx
je 0x6992
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq %rdx, %rdi
callq 0x2180
movq %rax, 0x18(%rsp)
testq %r12, %r12
je 0x68e0
movq %r12, %rdi
callq 0x2180
movq %rax, %rbp
incl %ebp
testq %rbx, %rbx
je 0x68f5
movq %rbx, %rdi
callq 0x2180
movq %rax, %r13
incl %r13d
jmp 0x68f8
xorl %r13d, %r13d
movq 0x18(%rsp), %rax
addl %ebp, %eax
movq %rax, 0x10(%rsp)
addl %r13d, %eax
incl %eax
movslq %eax, %rsi
movq %r15, %rdi
callq 0x5251
testq %rax, %rax
je 0x6992
movq %rax, %r15
movq %rbx, 0x20(%rsp)
movq %rax, %rbx
movslq %ebp, %rbp
testq %r12, %r12
je 0x6940
leaq -0x1(%rbp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2050
movb $0x40, -0x1(%rbx,%rbp)
movq 0x10(%rsp), %rax
addl %r13d, %eax
movl %eax, 0xc(%rsp)
addq %rbp, %r15
movslq 0x18(%rsp), %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2050
movq 0x20(%rsp), %rsi
testq %rsi, %rsi
je 0x6987
movslq 0x10(%rsp), %rax
movb $0x2f, (%rbx,%rax)
leaq (%r15,%r12), %rdi
incq %rdi
decl %r13d
movslq %r13d, %rdx
callq 0x2050
movslq 0xc(%rsp), %rax
movb $0x0, (%rbx,%rax)
jmp 0x6994
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/jid.c
// Function: xmpp_jid_bare
char *xmpp_jid_bare(xmpp_ctx_t *ctx, const char *jid)
{
    char *result;
    const char *c;

    c = strchr(jid, '/');
    if (c == NULL) return xmpp_strdup(ctx, jid);

    result = xmpp_alloc(ctx, c-jid+1);
    if (result != NULL) {
	memcpy(result, jid, c-jid);
	result[c-jid] = '\0';
    }

    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
movl $0x2f, %esi
callq 0x21f0
testq %rax, %rax
je 0x69f2
movq %rax, %r14
subq %rbx, %r14
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0x5251
testq %rax, %rax
je 0x6a02
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2050
movb $0x0, (%r15,%r14)
jmp 0x6a05
movq %r15, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xc0d0
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/jid.c
// Function: xmpp_jid_node
char *xmpp_jid_node(xmpp_ctx_t *ctx, const char *jid)
{
    char *result = NULL;
    const char *c;

    c = strchr(jid, '@');
    if (c != NULL) {
	result = xmpp_alloc(ctx, (c-jid) + 1);
	if (result != NULL) {
	    memcpy(result, jid, (c-jid));
	    result[c-jid] = '\0';
	}
    }

    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
movl $0x40, %esi
callq 0x21f0
testq %rax, %rax
je 0x6a5a
movq %rax, %r14
subq %rbx, %r14
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0x5251
testq %rax, %rax
je 0x6a5a
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2050
movb $0x0, (%r15,%r14)
jmp 0x6a5d
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/jid.c
// Function: xmpp_jid_domain
char *xmpp_jid_domain(xmpp_ctx_t *ctx, const char *jid)
{
    char *result = NULL;
    const char *c,*s;

    c = strchr(jid, '@');
    if (c == NULL) {
	/* no node, assume domain */
	c = jid;
    } else {
	/* advance past the separator */
	c++;
    }
    s = strchr(c, '/');
    if (s == NULL) {
	/* no resource */
	s = c + strlen(c);
    }
    result = xmpp_alloc(ctx, (s-c) + 1);
    if (result != NULL) {
	memcpy(result, c, (s-c));
	result[s-c] = '\0';
    }

    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
movl $0x40, %esi
callq 0x21f0
leaq 0x1(%rax), %rbx
testq %rax, %rax
cmoveq %r15, %rbx
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x21f0
movq %rax, %r15
testq %rax, %rax
jne 0x6aac
movq %rbx, %rdi
callq 0x2180
movq %rax, %r15
addq %rbx, %r15
subq %rbx, %r15
leaq 0x1(%r15), %rsi
movq %r14, %rdi
callq 0x5251
movq %rax, %r14
testq %rax, %rax
je 0x6ad6
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2050
movb $0x0, (%r14,%r15)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/jid.c
// Function: xmpp_jid_resource
char *xmpp_jid_resource(xmpp_ctx_t *ctx, const char *jid)
{
    char *result = NULL;
    const char *c;
    int len;

    c = strchr(jid, '/');
    if (c != NULL)  {
	c++;
	len = strlen(c);
	result = xmpp_alloc(ctx, len + 1);
	if (result != NULL) {
	    memcpy(result, c, len);
	    result[len] = '\0';
	}
    }

    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
movq %rsi, %rdi
movl $0x2f, %esi
callq 0x21f0
testq %rax, %rax
je 0x6b48
movq %rax, %rbx
incq %rbx
movq %rbx, %rdi
callq 0x2180
movq %rax, %r14
shlq $0x20, %r14
movabsq $0x100000000, %rsi      # imm = 0x100000000
addq %r14, %rsi
sarq $0x20, %rsi
movq %r15, %rdi
callq 0x5251
testq %rax, %rax
je 0x6b48
movq %rax, %r15
sarq $0x20, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2050
movb $0x0, (%r15,%r14)
jmp 0x6b4b
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/md5.c
// Function: MD5Update
void MD5Update(struct MD5Context *ctx, unsigned char const *buf, uint32_t len)
{
    uint32_t t;

    /* Update bitcount */

    t = ctx->bits[0];
    if ((ctx->bits[0] = (t + ((uint32_t)len << 3)) & 0xffffffff) < t)
	ctx->bits[1]++;		/* Carry from low to high */
    ctx->bits[1] += len >> 29;

    t = (t >> 3) & 0x3f;	/* Bytes already in shsInfo->data */

    /* Handle any leading odd-sized chunks */

    if (t) {
	unsigned char *p = ctx->in + t;

	t = 64 - t;
	if (len < t) {
	    memcpy(p, buf, len);
	    return;
	}
	memcpy(p, buf, t);
	MD5Transform(ctx->buf, ctx->in, ctx);
	buf += t;
	len -= t;
    }
    /* Process data in 64-byte chunks */

    while (len >= 64) {
	memcpy(ctx->in, buf, 64);
	MD5Transform(ctx->buf, ctx->in, ctx);
	buf += 64;
	len -= 64;
    }

    /* Handle any remaining bytes of data. */

    memcpy(ctx->in, buf, len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rdi), %eax
leal (,%rdx,8), %ecx
movl %edx, %edi
shrl $0x1d, %edi
addl %eax, %ecx
movl %ecx, 0x10(%rbx)
adcl %edi, 0x14(%rbx)
movq %rsi, %r14
shrl $0x3, %eax
andl $0x3f, %eax
je 0x6bc0
leaq (%rbx,%rax), %rdi
addq $0x18, %rdi
movl $0x40, %ecx
subl %eax, %ecx
movl %edx, %ebp
subl %ecx, %ebp
jae 0x6bc4
movl %edx, %edx
jmp 0x6c33
movl %edx, %ebp
jmp 0x6be4
leaq 0x18(%rbx), %r15
movl %ecx, %r12d
movq %r14, %rsi
movq %r12, %rdx
callq 0x2050
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6c43
addq %r12, %r14
cmpl $0x40, %ebp
jb 0x6c2a
leaq 0x18(%rbx), %r15
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups 0x30(%r14), %xmm3
movups %xmm3, 0x30(%r15)
movups %xmm2, 0x20(%r15)
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6c43
addq $0x40, %r14
addl $-0x40, %ebp
cmpl $0x3f, %ebp
ja 0x6bed
addq $0x18, %rbx
movl %ebp, %edx
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/md5.c
// Function: MD5Final
void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
{
    unsigned count;
    unsigned char *p;

    /* Compute number of bytes mod 64 */
    count = (ctx->bits[0] >> 3) & 0x3F;

    /* Set the first char of padding to 0x80.  This is safe since there is
       always at least one byte free */
    p = ctx->in + count;
    *p++ = 0x80;

    /* Bytes of padding needed to make 64 bytes */
    count = 64 - 1 - count;

    /* Pad out to 56 mod 64 */
    if (count < 8) {
	/* Two lots of padding:  Pad the first block to 64 bytes */
	memset(p, 0, count);
	MD5Transform(ctx->buf, ctx->in, ctx);

	/* Now fill the next block with 56 bytes */
	memset(ctx->in, 0, 56);
    } else {
	/* Pad block to 56 bytes */
	memset(p, 0, count - 8);
    }

    /* Append length in bits and transform */
    PUT_32BIT_LSB_FIRST(ctx->in + 56, ctx->bits[0]);
    PUT_32BIT_LSB_FIRST(ctx->in + 60, ctx->bits[1]);

    MD5Transform(ctx->buf, ctx->in, ctx);
    PUT_32BIT_LSB_FIRST(digest, ctx->buf[0]);
    PUT_32BIT_LSB_FIRST(digest + 4, ctx->buf[1]);
    PUT_32BIT_LSB_FIRST(digest + 8, ctx->buf[2]);
    PUT_32BIT_LSB_FIRST(digest + 12, ctx->buf[3]);
    memset(ctx, 0, sizeof(ctx));	/* In case it's sensitive */
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x10(%rsi), %eax
shrl $0x3, %eax
andl $0x3f, %eax
leaq 0x18(%rsi), %r15
leaq (%rsi,%rax), %rdi
addq $0x19, %rdi
movb $-0x80, -0x1(%rdi)
movl %eax, %ecx
xorl $0x3f, %ecx
cmpl $0x7, %ecx
ja 0x7453
movl %ecx, %edx
xorl %esi, %esi
callq 0x2140
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6c43
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r15)
movups %xmm0, 0x10(%r15)
movups %xmm0, (%r15)
movq $0x0, 0x30(%r15)
jmp 0x7461
movl $0x37, %edx
subl %eax, %edx
xorl %esi, %esi
callq 0x2140
movq 0x10(%rbx), %rax
movq %rax, 0x50(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6c43
movb (%rbx), %al
movb %al, (%r14)
movb 0x1(%rbx), %al
movb %al, 0x1(%r14)
movb 0x2(%rbx), %al
movb %al, 0x2(%r14)
movb 0x3(%rbx), %al
movb %al, 0x3(%r14)
movb 0x4(%rbx), %al
movb %al, 0x4(%r14)
movb 0x5(%rbx), %al
movb %al, 0x5(%r14)
movb 0x6(%rbx), %al
movb %al, 0x6(%r14)
movb 0x7(%rbx), %al
movb %al, 0x7(%r14)
movb 0x8(%rbx), %al
movb %al, 0x8(%r14)
movb 0x9(%rbx), %al
movb %al, 0x9(%r14)
movb 0xa(%rbx), %al
movb %al, 0xa(%r14)
movb 0xb(%rbx), %al
movb %al, 0xb(%r14)
movb 0xc(%rbx), %al
movb %al, 0xc(%r14)
movb 0xd(%rbx), %al
movb %al, 0xd(%r14)
movb 0xe(%rbx), %al
movb %al, 0xe(%r14)
movb 0xf(%rbx), %al
movb %al, 0xf(%r14)
movq $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/parser_libxml2.c
// Function: parser_new
parser_t *parser_new(xmpp_ctx_t *ctx,
                     parser_start_callback startcb,
                     parser_end_callback endcb,
                     parser_stanza_callback stanzacb,
                     void *userdata)
{
    parser_t *parser;

    parser = xmpp_alloc(ctx, sizeof(parser_t));
    if (parser != NULL) {
        parser->ctx = ctx;
        parser->xmlctx = NULL;
        memset(&parser->handlers, 0, sizeof(xmlSAXHandler));
        parser->handlers.startElement = _start_element;
        parser->handlers.endElement = _end_element;
        parser->handlers.characters = _characters;
        parser->startcb = startcb;
        parser->endcb = endcb;
        parser->stanzacb = stanzacb;
        parser->userdata = userdata;
        parser->depth = 0;
        parser->stanza = NULL;

        parser_reset(parser);
    }

    return parser;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movl $0x140, %esi            # imm = 0x140
callq 0x5251
movq %rax, %r15
testq %rax, %rax
je 0x7596
movq %rbp, (%r15)
movq %r15, %rdi
addq $0x8, %rdi
movl $0x108, %edx            # imm = 0x108
xorl %esi, %esi
callq 0x2140
leaq 0x6f(%rip), %rax        # 0x75a8
movq %rax, 0x80(%r15)
leaq 0x142(%rip), %rax       # 0x7689
movq %rax, 0x88(%r15)
leaq 0x1a3(%rip), %rax       # 0x76f8
movq %rax, 0x98(%r15)
movq %r13, 0x110(%r15)
movq %r12, 0x118(%r15)
movq %r14, 0x120(%r15)
movq %rbx, 0x128(%r15)
movl $0x0, 0x130(%r15)
movq $0x0, 0x138(%r15)
movq %r15, %rdi
callq 0x775a
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/parser_libxml2.c
// Function: start_element
static void _start_element(void *userdata, 
                           const xmlChar *name, const xmlChar **attrs)
{
    parser_t *parser = (parser_t *)userdata;
    xmpp_stanza_t *child;

    if (parser->depth == 0) {
        /* notify the owner */
        if (parser->startcb)
            parser->startcb((char *)name, (char **)attrs, 
                            parser->userdata);
    } else {
	/* build stanzas at depth 1 */
	if (!parser->stanza && parser->depth != 1) {
	    /* something terrible happened */
	    /* FIXME: we should probably trigger a disconnect */
	    xmpp_error(parser->ctx, "parser", "oops, where did our stanza go?");
	} else if (!parser->stanza) {
	    /* starting a new toplevel stanza */
	    parser->stanza = xmpp_stanza_new(parser->ctx);
	    if (!parser->stanza) {
		/* FIXME: can't allocate, disconnect */
	    }
	    xmpp_stanza_set_name(parser->stanza, (char *)name);
	    _set_attributes(parser->stanza, attrs);
	} else {
	    /* starting a child of conn->stanza */
	    child = xmpp_stanza_new(parser->ctx);
	    if (!child) {
		/* FIXME: can't allocate, disconnect */
	    }
	    xmpp_stanza_set_name(child, (char *)name);
	    _set_attributes(child, attrs);

	    /* add child to parent */
	    xmpp_stanza_add_child(parser->stanza, child);
	    
	    /* the child is owned by the toplevel stanza now */
	    xmpp_stanza_release(child);

	    /* make child the current stanza */
	    parser->stanza = child;
	}
    }

    parser->depth++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl 0x130(%rdi), %eax
testl %eax, %eax
je 0x7621
movq 0x138(%rbx), %r13
testq %r13, %r13
setne %cl
cmpl $0x1, %eax
sete %al
orb %cl, %al
je 0x763e
movq (%rbx), %rdi
callq 0xb40c
movq %rax, %r12
testq %r13, %r13
je 0x7658
movq %r12, %rdi
movq %r15, %rsi
callq 0xb932
movq %r12, %rdi
movq %r14, %rsi
callq 0x77fa
movq 0x138(%rbx), %rdi
movq %r12, %rsi
callq 0xba98
movq %r12, %rdi
callq 0xb5a8
movq %r12, 0x138(%rbx)
jmp 0x7679
movq 0x110(%rbx), %rax
testq %rax, %rax
je 0x7679
movq 0x128(%rbx), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq *%rax
jmp 0x7679
movq (%rbx), %rdi
leaq 0x6758(%rip), %rsi      # 0xdda0
leaq 0x6758(%rip), %rdx      # 0xdda7
xorl %eax, %eax
callq 0x536c
jmp 0x7679
movq %r12, 0x138(%rbx)
movq %r12, %rdi
movq %r15, %rsi
callq 0xb932
movq 0x138(%rbx), %rdi
movq %r14, %rsi
callq 0x77fa
incl 0x130(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/parser_libxml2.c
// Function: end_element
static void _end_element(void *userdata, const xmlChar *name)
{
    parser_t *parser = (parser_t *)userdata;

    parser->depth--;

    if (parser->depth == 0) {
        /* notify owner */
        if (parser->endcb)
            parser->endcb((char *)name, parser->userdata);
    } else {
	if (parser->stanza->parent) {
	    /* we're finishing a child stanza, so set current to the parent */
	    parser->stanza = parser->stanza->parent;
	} else {
            if (parser->stanzacb)
                parser->stanzacb(parser->stanza,
                                 parser->userdata);
            xmpp_stanza_release(parser->stanza);
            parser->stanza = NULL;
	}
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
decl 0x130(%rdi)
je 0x76ae
movq 0x138(%rbx), %rdi
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x76ca
movq %rax, 0x138(%rbx)
jmp 0x76f6
movq 0x118(%rbx), %rcx
testq %rcx, %rcx
je 0x76f6
movq 0x128(%rbx), %rax
movq %rsi, %rdi
movq %rax, %rsi
popq %rbx
jmpq *%rcx
movq 0x120(%rbx), %rax
testq %rax, %rax
je 0x76e6
movq 0x128(%rbx), %rsi
callq *%rax
movq 0x138(%rbx), %rdi
callq 0xb5a8
movq $0x0, 0x138(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/parser_libxml2.c
// Function: characters
static void _characters(void *userdata, const xmlChar *chr, int len)
{
    parser_t *parser = (parser_t *)userdata;
    xmpp_stanza_t *stanza;

    /* skip unimportant whitespace, etc */
    if (parser->depth < 2) return;

    /* create and populate stanza */
    stanza = xmpp_stanza_new(parser->ctx);
    if (!stanza) {
	/* FIXME: allocation error, disconnect */
	return;
    }
    xmpp_stanza_set_text_with_size(stanza, (char *)chr, len);

    xmpp_stanza_add_child(parser->stanza, stanza);
    xmpp_stanza_release(stanza);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x2, 0x130(%rdi)
jl 0x774f
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0xb40c
testq %rax, %rax
je 0x774f
movq %rax, %r15
movslq %ebp, %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0xbb0c
movq 0x138(%rbx), %rdi
movq %r15, %rsi
callq 0xba98
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb5a8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/parser_libxml2.c
// Function: parser_reset
int parser_reset(parser_t *parser)
{
    if (parser->xmlctx)
        xmlFreeParserCtxt(parser->xmlctx);

    if (parser->stanza) 
	xmpp_stanza_release(parser->stanza);

    parser->xmlctx = xmlCreatePushParserCtxt(&parser->handlers, 
                                             parser, NULL, 0, NULL);
    if (!parser->xmlctx) return 0;

    parser->depth = 0;
    parser->stanza = NULL;

    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x776f
callq 0x2360
movq 0x138(%rbx), %rdi
testq %rdi, %rdi
je 0x7780
callq 0xb5a8
leaq 0x10(%rbx), %rdi
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x21b0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x77ba
movl $0x0, 0x130(%rbx)
movq $0x0, 0x138(%rbx)
movl $0x1, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/parser_libxml2.c
// Function: set_attributes
static void _set_attributes(xmpp_stanza_t *stanza, const xmlChar **attrs)
{
    int i;

    if (!attrs) return;

    for (i = 0; attrs[i]; i += 2) {
        xmpp_stanza_set_attribute(stanza, attrs[i], attrs[i+1]);
    }
}

// Assembly:
testq %rsi, %rsi
je 0x7834
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rsi), %rsi
testq %rsi, %rsi
je 0x782d
movq %rdi, %r14
addq $0x10, %rbx
movq -0x8(%rbx), %rdx
movq %r14, %rdi
callq 0xba1c
movq (%rbx), %rsi
addq $0x10, %rbx
testq %rsi, %rsi
jne 0x7815
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/sasl.c
// Function: sasl_plain
char *sasl_plain(xmpp_ctx_t *ctx, const char *authid, const char *password) {
    int idlen, passlen;
    char *result = NULL;
    char *msg;
    
    /* our message is Base64(authzid,\0,authid,\0,password)
       if there is no authzid, that field is left empty */

    idlen = strlen(authid);
    passlen = strlen(password);
    msg = xmpp_alloc(ctx, 2 + idlen + passlen);
    if (msg != NULL) {
	msg[0] = '\0';
	memcpy(msg+1, authid, idlen);
	msg[1+idlen] = '\0';
	memcpy(msg+1+idlen+1, password, passlen);
	result = base64_encode(ctx, (unsigned char *)msg, 2 + idlen + passlen);
	xmpp_free(ctx, msg);
    }

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2180
movq %rax, %r14
movq %r15, (%rsp)
movq %r15, %rdi
callq 0x2180
movq %rax, %r13
leal (%r14,%rax), %ebp
addl $0x2, %ebp
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0x5251
testq %rax, %rax
je 0x78d7
movq %rax, %r15
xorl %eax, %eax
movb %al, (%r15)
leaq 0x1(%r15), %rdi
movslq %r14d, %r14
movq %r12, %rsi
movq %r14, %rdx
callq 0x2050
leal 0x1(%r14), %eax
cltq
xorl %ecx, %ecx
movb %cl, (%r15,%rax)
leaq (%r15,%r14), %rdi
addq $0x2, %rdi
movslq %r13d, %rdx
movq (%rsp), %rsi
callq 0x2050
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x78e8
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5263
movq %r14, %rax
jmp 0x78d9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/sasl.c
// Function: base64_decoded_len
int base64_decoded_len(xmpp_ctx_t *ctx, 
		       const char * const buffer, const unsigned len)
{
    int nudge;
    int c;

    /* count the padding characters for the remainder */
    nudge = -1;
    c = _base64_invcharmap[(int)buffer[len-1]];
    if (c < 64) nudge = 0;
    else if (c == 64) {
	c = _base64_invcharmap[(int)buffer[len-2]];
	if (c < 64) nudge = 1;
	else if (c == 64) {
	    c = _base64_invcharmap[(int)buffer[len-3]];
	    if (c < 64) nudge = 2;
	} 
    }
    if (nudge < 0) return 0; /* reject bad coding */

    /* decoded steam is 3 bytes for every four */ 
    return 3 * (len >> 2) - nudge;
}

// Assembly:
leal -0x1(%rdx), %eax
movsbq (%rsi,%rax), %rdi
leaq 0x5a5c(%rip), %rax      # 0xdf00
xorl %ecx, %ecx
cmpb $0x40, (%rdi,%rax)
jge 0x84b5
shrl $0x2, %edx
leal (%rdx,%rdx,2), %eax
addl %ecx, %eax
retq
cmpb $0x3d, %dil
jne 0x84e7
leal -0x2(%rdx), %ecx
movsbq (%rsi,%rcx), %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpb $0x40, (%rdi,%rax)
jl 0x84ac
cmpb $0x3d, %dil
jne 0x84e7
leal -0x3(%rdx), %ecx
movsbq (%rsi,%rcx), %rsi
xorl %ecx, %ecx
cmpb $0x40, (%rsi,%rax)
setge %al
jl 0x84ea
xorl %eax, %eax
retq
shrl $0x2, %edx
movb %al, %cl
leal (%rcx,%rcx,2), %eax
leal (%rdx,%rdx,2), %ecx
addl %ecx, %eax
addl $-0x2, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/sha1.c
// Function: SHA1_Update
void SHA1_Update(SHA1_CTX* context, const uint8_t* data, const size_t len)
{
    size_t i, j;

#ifdef VERBOSE
    SHAPrintContext(context, "before");
#endif

    j = (context->count[0] >> 3) & 63;
    if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
    context->count[1] += (len >> 29);
    if ((j + len) > 63) {
        memcpy(&context->buffer[j], data, (i = 64-j));
        SHA1_Transform(context->state, context->buffer);
        for ( ; i + 63 < len; i += 64) {
            SHA1_Transform(context->state, data + i);
        }
        j = 0;
    }
    else i = 0;
    memcpy(&context->buffer[j], &data[i], len - i);

#ifdef VERBOSE
    SHAPrintContext(context, "after ");
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movl 0x14(%rdi), %ebp
leaq (,%rdx,8), %rax
leal (%rax,%rbp), %ecx
shrl $0x3, %ebp
andl $0x3f, %ebp
movl %ecx, 0x14(%rdi)
shrq $0x1d, %rdx
cmpq %rax, %rcx
adcl %edx, 0x18(%rdi)
movq %rsi, %r15
leaq (%rbx,%rbp), %rax
cmpq $0x40, %rax
jb 0x98a6
leaq 0x1c(%r14), %r13
leaq (%r14,%rbp), %rdi
addq $0x1c, %rdi
movl $0x40, %r12d
subq %rbp, %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x2050
movq %r14, %rdi
movq %r13, %rsi
callq 0x86c8
xorq $0x7f, %rbp
cmpq %rbx, %rbp
jae 0x98ab
xorl %ebp, %ebp
movq %r12, %r13
leaq (%r15,%r12), %rsi
movq %r14, %rdi
callq 0x86c8
addq $0x40, %r12
addq $0x7f, %r13
cmpq %rbx, %r13
jb 0x9888
jmp 0x98ad
xorl %r12d, %r12d
jmp 0x98ad
xorl %ebp, %ebp
leaq (%r14,%rbp), %rdi
addq $0x1c, %rdi
addq %r12, %r15
subq %r12, %rbx
movq %r15, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/sha1.c
// Function: SHA1_Final
void SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE])
{
    uint32_t i;
    uint8_t  finalcount[8];

    for (i = 0; i < 8; i++) {
        finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)]
         >> ((3-(i & 3)) * 8) ) & 255);  /* Endian independent */
    }
    SHA1_Update(context, (uint8_t *)"\200", 1);
    while ((context->count[0] & 504) != 448) {
        SHA1_Update(context, (uint8_t *)"\0", 1);
    }
    SHA1_Update(context, finalcount, 8);  /* Should cause a SHA1_Transform() */
    for (i = 0; i < SHA1_DIGEST_SIZE; i++) {
        digest[i] = (uint8_t)
         ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
    }
    
    /* Wipe variables */
    i = 0;
    memset(context->buffer, 0, 64);
    memset(context->state, 0, 20);
    memset(context->count, 0, 8);
    memset(finalcount, 0, 8);	/* SWR */

#ifdef SHA1HANDSOFF  /* make SHA1Transform overwrite its own static vars */
    SHA1_Transform(context->state, context->buffer);
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
xorl %edx, %edx
xorl %ecx, %ecx
cmpq $0x4, %rdx
setb %cl
movl 0x14(%rbx,%rcx,4), %esi
movl %eax, %ecx
notb %cl
andb $0x18, %cl
shrl %cl, %esi
movb %sil, (%rsp,%rdx)
incq %rdx
addl $0x8, %eax
cmpq $0x8, %rdx
jne 0x98e5
leaq 0x46ff(%rip), %rsi      # 0xe011
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9813
movl $0x1f8, %ebp            # imm = 0x1F8
movl 0x14(%rbx), %eax
andl %ebp, %eax
cmpl $0x1c0, %eax            # imm = 0x1C0
je 0x9953
leaq 0x46dc(%rip), %r15      # 0xe013
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9813
movl 0x14(%rbx), %eax
andl %ebp, %eax
cmpl $0x1c0, %eax            # imm = 0x1C0
jne 0x9937
movq %rsp, %rsi
movl $0x8, %edx
movq %rbx, %rdi
callq 0x9813
xorl %eax, %eax
xorl %edx, %edx
movl %edx, %ecx
andl $-0x4, %ecx
movl (%rbx,%rcx), %esi
movl %eax, %ecx
notb %cl
andb $0x18, %cl
shrl %cl, %esi
movb %sil, (%r14,%rdx)
incq %rdx
addl $0x8, %eax
cmpq $0x14, %rdx
jne 0x9967
xorps %xmm0, %xmm0
movups %xmm0, 0x4c(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/sock.c
// Function: sock_connect
sock_t sock_connect(const char * const host, const unsigned int port)
{
    sock_t sock;
    char service[6];
    struct addrinfo *res, *ainfo, hints;
    int err;
    
    sock = -1;

    snprintf(service, 6, "%u", port);

    memset(&hints, 0, sizeof(struct addrinfo));
    hints.ai_family = AF_INET;
    hints.ai_protocol = IPPROTO_TCP;
    hints.ai_socktype = SOCK_STREAM;

    if ((err = getaddrinfo(host, service, &hints, &res)) != 0)
	return -1;

    ainfo = res;
    while (ainfo) {
	if ((sock = socket(ainfo->ai_family, ainfo->ai_socktype, 
		   ainfo->ai_protocol)) >= 0) {
	    sock_set_nonblocking(sock);

	    err = connect(sock, ainfo->ai_addr, ainfo->ai_addrlen);

	    if ((err == 0) || (err < 0 && _in_progress(sock_error())))
		break;
	}

	ainfo = ainfo->ai_next;
    }

    if (res) freeaddrinfo(res);

    return sock;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movl %esi, %ecx
movq %rdi, %rbx
leaq 0x3740(%rip), %rdx      # 0xe111
leaq 0xa(%rsp), %r14
movl $0x6, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x21e0
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x4(%rdx)
movl $0x6, 0xc(%rdx)
movq %rsp, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x23f0
testl %eax, %eax
setne %al
movq (%r15), %r14
testq %r14, %r14
sete %cl
orb %al, %cl
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jne 0xaa95
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
callq 0x21a0
movl %eax, %ebx
testl %eax, %eax
js 0xaa7e
movl %ebx, %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x20b0
movq 0x18(%r14), %rsi
movl 0x10(%r14), %edx
movl %ebx, %edi
callq 0x2160
testl %eax, %eax
je 0xaa87
jns 0xaa7e
callq 0x2390
cmpl $0x73, (%rax)
je 0xaa87
movq 0x28(%r14), %r14
testq %r14, %r14
jne 0xaa35
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xaa95
callq 0x2250
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
movb (%rcx), %r8b
movq %rax, %rsi
testb %r8b, %r8b
je 0xac33
movq %rax, %rsi
xorl %edi, %edi
testb %r8b, %r8b
je 0xabe5
movzbl %r8b, %r8d
cmpl $0x2e, %r8d
je 0xabe5
movb 0x1(%rcx,%rdi), %r8b
incq %rdi
jmp 0xabcc
cmpl $0x3f, %edi
movl $0x3f, %r8d
cmovll %edi, %r8d
movb %r8b, (%rsi)
incq %rsi
testq %rdi, %rdi
je 0xac19
leaq (%rcx,%rdi), %r8
xorl %r9d, %r9d
movb (%rcx,%r9), %r10b
movb %r10b, (%rsi,%r9)
incq %r9
cmpq %r9, %rdi
jne 0xac04
addq %r9, %rsi
jmp 0xac1c
movq %rcx, %r8
xorl %edi, %edi
cmpb $0x2e, (%r8)
sete %dil
leaq (%r8,%rdi), %rcx
movb (%r8,%rdi), %r8b
testb %r8b, %r8b
jne 0xabca
movb $0x0, (%rsi)
subl %eax, %esi
movl (%rdx), %eax
addl %esi, %eax
incl %eax
movl %eax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O3/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
movb (%rdi,%rcx), %dl
testb %dl, %dl
je 0xac8f
addq %rdi, %rcx
xorl %eax, %eax
movzbl %dl, %edx
movl %edx, %esi
notl %esi
testb $-0x40, %sil
jne 0xac6e
andl $0x3f, %edx
shll $0x8, %edx
movzbl 0x1(%rcx), %esi
orl %edx, %esi
movq %rdi, %rcx
jmp 0xac82
leal 0x1(%rax), %r8d
testl %eax, %eax
cmovel %eax, %r8d
addl %edx, %r8d
incl %edx
movl %edx, %esi
movl %r8d, %eax
movl %esi, %esi
movb (%rcx,%rsi), %dl
addq %rsi, %rcx
testb %dl, %dl
jne 0xac50
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/sock.c
// Function: netbuf_get_domain_name
int netbuf_get_domain_name(unsigned char *buf, int buflen, int *offset, char *namebuf, int namebuflen)
{
	unsigned char *start = buf + *offset;
	unsigned char *p, *p2;
	int *curroffset = offset;
	int len = 0;

	*namebuf = '\0';

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

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

	if (namebuflen < len)
	{
		return len;
	}

	/* actually copy in name */
	p = start;
	p2 = (unsigned char *)namebuf;
	while (*p)
	{
		if ((*p & 0xC0) == 0xC0)
		{
			int newoffset = 0;
			newoffset |= (*p++ & 0x3F) << 8;
			newoffset |= *p++;

			if (curroffset)
			{
				*curroffset += (int)(p - start);
				curroffset = NULL;
			}

			p = buf + newoffset;
		}
		else
		{
			int i, partlen;

			if (*namebuf != '\0')
			{
				*p2++ = '.';
			}

			partlen = *p++;
			
			for (i=0; i < partlen; i++)
			{
                                *p2++ = *p++;
			}
		}
	}

	if (curroffset)
	{
		p++;
		*curroffset += (int)(p - start);
		curroffset = NULL;
	}

	*p2 = '\0';

	return 0;
}

// Assembly:
pushq %rbx
movslq (%rdx), %rax
leaq (%rdi,%rax), %rsi
movb $0x0, (%rcx)
movb (%rdi,%rax), %r9b
testb %r9b, %r9b
je 0xad78
xorl %eax, %eax
movl %r9d, %r11d
movq %rsi, %r10
movzbl %r11b, %r11d
movl %r11d, %ebx
notl %ebx
testb $-0x40, %bl
jne 0xacd5
andl $0x3f, %r11d
shll $0x8, %r11d
movzbl 0x1(%r10), %ebx
orl %r11d, %ebx
movq %rdi, %r10
jmp 0xacde
addl %r11d, %eax
incl %r11d
movl %r11d, %ebx
movl %ebx, %ebx
movb (%r10,%rbx), %r11b
addq %rbx, %r10
testb %r11b, %r11b
jne 0xacb2
cmpl %r8d, %eax
jg 0xada3
testb %r9b, %r9b
je 0xad82
movq %rsi, %rax
movq %rcx, %r8
movzbl %r9b, %r9d
movl %r9d, %r10d
notl %r10d
testb $-0x40, %r10b
jne 0xad40
movzbl 0x1(%rax), %r10d
testq %rdx, %rdx
je 0xad2b
subl %esi, %eax
movl (%rdx), %r11d
addl %r11d, %eax
addl $0x2, %eax
movl %eax, (%rdx)
andl $0x3f, %r9d
shll $0x8, %r9d
orl %r10d, %r9d
movl %r9d, %eax
addq %rdi, %rax
xorl %edx, %edx
jmp 0xad6e
cmpb $0x0, (%rcx)
je 0xad5a
movb $0x2e, (%r8)
incq %r8
movzbl (%rax), %r9d
incq %rax
testl %r9d, %r9d
jne 0xad5d
jmp 0xad6e
incq %rax
movb (%rax), %r10b
movb %r10b, (%r8)
incq %r8
incq %rax
decl %r9d
jne 0xad5d
movb (%rax), %r9b
testb %r9b, %r9b
jne 0xad04
jmp 0xad88
movq %rsi, %rax
testl %r8d, %r8d
jns 0xad90
jmp 0xada1
movq %rcx, %r8
movq %rsi, %rax
movq %r8, %rcx
testq %rdx, %rdx
je 0xad9d
subl %esi, %eax
movl (%rdx), %esi
addl %esi, %eax
incl %eax
movl %eax, (%rdx)
movq %rcx, %r8
movb $0x0, (%r8)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xac92
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), %esi
shll $0x8, %esi
movw %si, 0x408(%r14)
movzbl 0x5(%r15,%rdx), %ecx
orl %esi, %ecx
movw %cx, 0x408(%r14)
leal 0x6(%rdx), %esi
movl %esi, (%rbx)
cmpw $0x21, %ax
jne 0xb23b
leaq 0xc(%rsp), %rdx
movl %esi, (%rdx)
leaq 0x40a(%r14), %rcx
movq %r15, %rdi
callq 0xb08e
movzwl 0x408(%r14), %ecx
movl (%rbx), %esi
movzwl %cx, %eax
addl %esi, %eax
movl %eax, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5251
testq %rax, %rax
je 0xb549
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 0xb4b6
movq 0x8(%r14), %rdi
callq 0xc0d0
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0xb541
cmpq $0x0, 0x40(%r14)
je 0xb560
movq 0x8(%r14), %rdi
leaq -0x6269(%rip), %rdx     # 0x5263
movl $0x8, %esi
callq 0x649c
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0xb541
movq 0x40(%r14), %rdi
callq 0x67dd
testq %rax, %rax
je 0xb535
movq %rax, %r15
movq %r15, %rdi
callq 0x6843
testq %rax, %rax
je 0xb558
movq %rax, %r12
movq 0x8(%r14), %r13
movq 0x40(%r14), %rdi
movq %rax, %rsi
callq 0x6766
movq %r13, %rdi
movq %rax, %rsi
callq 0xc0d0
testq %rax, %rax
je 0xb541
movq 0x40(%rbx), %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x65bd
testl %eax, %eax
je 0xb4f0
jmp 0xb541
leaq 0x2bff(%rip), %rdi      # 0xe13b
callq 0x23a0
movq %rbx, %rdi
callq 0xb5a8
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r15, %rdi
callq 0x6811
movq 0x28(%r14), %r14
testq %r14, %r14
je 0xb54b
movq %rbx, %r15
addq $0x28, %r15
movq (%r15), %r12
movq %r14, %rdi
callq 0xb447
testq %rax, %rax
je 0xb541
movq %rbx, 0x30(%rax)
movq %r15, %rcx
testq %r12, %r12
je 0xb597
movq %r12, 0x18(%rax)
addq $0x20, %r12
movq %r12, %rcx
movq %rax, (%rcx)
movq 0x20(%r14), %r14
movq %rax, %r12
testq %r14, %r14
jne 0xb573
jmp 0xb54b
// File: /workspace/github_c_makefile_star2_O3/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 0xb5be
decl %eax
movl %eax, (%rbx)
xorl %eax, %eax
jmp 0xb609
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0xb5d8
movq 0x20(%rdi), %r14
callq 0xb5a8
movq %r14, %rdi
testq %r14, %r14
jne 0xb5c7
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0xb5e6
callq 0x651f
movq 0x38(%rbx), %rsi
testq %rsi, %rsi
je 0xb5f8
movq 0x8(%rbx), %rdi
callq 0x5263
movq 0x8(%rbx), %rdi
movq %rbx, %rsi
callq 0x5263
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_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 0x5251
testq %rax, %rax
je 0xb6d2
movq %rax, %r15
movl $0x400, %r12d           # imm = 0x400
movl $0x400, %edx            # imm = 0x400
movq %rbp, %rdi
movq %rax, %rsi
callq 0xb717
movl %eax, %r13d
testl %eax, %eax
js 0xb6e5
cmpl $0x400, %r13d           # imm = 0x400
jb 0xb6c2
movq %rbx, (%rsp)
movq 0x8(%rbp), %rdi
leal 0x1(%r13), %r12d
movq %r15, %rsi
movq %r12, %rdx
callq 0x5276
testq %rax, %rax
je 0xb6f7
movq %rax, %rbx
movq %rbp, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xb717
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rbx, %r15
cmpl %r13d, %ecx
movl %ecx, %r13d
movq (%rsp), %rbx
ja 0xb6e8
movb $0x0, -0x1(%r12,%r15)
movq %r15, (%r14)
movl %r13d, %ecx
xorl %eax, %eax
jmp 0xb6e0
movq $0x0, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movq %rcx, (%rbx)
jmp 0xb6e8
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 0x5263
movq $0x0, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movq (%rsp), %rbx
jmp 0xb6e0
// File: /workspace/github_c_makefile_star2_O3/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 0xb979
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x38(%rdi), %rsi
testq %rsi, %rsi
je 0xb959
movq 0x8(%rbx), %rdi
callq 0x5263
movl $0x2, 0x10(%rbx)
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0xc0d0
movq %rax, 0x38(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_get_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 0xb9fc
movl %edx, %ebx
movq %rsi, %r15
callq 0x67dd
movq %rax, %r14
movl %ebx, %r13d
leaq -0x1(%r13), %rbp
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x6843
cmpl %ebx, %r13d
je 0xba03
testq %rax, %rax
je 0xba03
movq %rax, (%r15,%rbx,8)
cmpl %ebx, %ebp
je 0xba00
movq 0x40(%r12), %rdi
movq %rax, %rsi
callq 0x6766
movq %rax, 0x8(%r15,%rbx,8)
addq $0x2, %rbx
cmpl %ebx, %r13d
jne 0xb9c5
jmp 0xba03
xorl %ebx, %ebx
jmp 0xba0b
incq %rbx
movq %r14, %rdi
callq 0x6811
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_O3/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 0xba88
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x40(%rdi)
jne 0xba5a
movq 0x8(%r14), %rdi
leaq -0x67e4(%rip), %rdx     # 0x5263
movl $0x8, %esi
callq 0x649c
movq %rax, 0x40(%r14)
testq %rax, %rax
je 0xba7e
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0xc0d0
testq %rax, %rax
je 0xba7e
movq 0x40(%r14), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x65bd
xorl %eax, %eax
jmp 0xba83
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xbb0b
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, 0x10(%rdi)
movq 0x38(%rdi), %rsi
testq %rsi, %rsi
je 0xbaf2
movq 0x8(%rbx), %rdi
callq 0x5263
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0xc0d0
movq %rax, 0x38(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/stanza.c
// Function: xmpp_stanza_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 0xbb78
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 0xbb3e
movq 0x8(%r14), %rdi
callq 0x5263
movq 0x8(%r14), %rdi
leaq 0x1(%rbx), %rsi
callq 0x5251
movq %rax, 0x38(%r14)
testq %rax, %rax
je 0xbb6e
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2050
movq 0x38(%r14), %rax
movb $0x0, (%rax,%rbx)
xorl %eax, %eax
jmp 0xbb73
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq