LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/handler.c
// Function: id_handler_add
static void _id_handler_add(xmpp_conn_t * const conn,
			 xmpp_handler handler,
			 const char * const id,
			 void * const userdata, int user_handler)
{
    xmpp_handlist_t *item, *tail;

    /* check if handler is already in the list */
    item = (xmpp_handlist_t *)hash_get(conn->id_handlers, id);
    while (item) {
	if (item->handler == (void *)handler)
	    break;
	item = item->next;
    }
    if (item) return;

    /* build new item */
    item = xmpp_alloc(conn->ctx, sizeof(xmpp_handlist_t));
    if (!item) return;

    item->user_handler = user_handler;
    item->handler = (void *)handler;
    item->userdata = userdata;
    item->enabled = 0;
    item->next = NULL;

    item->id = xmpp_strdup(conn->ctx, id);
    if (!item->id) {
	xmpp_free(conn->ctx, item);
	return;
    }

    /* put on list in hash table */
    tail = (xmpp_handlist_t *)hash_get(conn->id_handlers, id);
    if (!tail)
	hash_add(conn->id_handlers, id, item);
    else {
	while (tail->next) 
	    tail = tail->next;
	tail->next = item;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
movq 0xf8(%rdi), %rdi
movq %rdx, %rsi
callq 0x67a3
testq %rax, %rax
je 0x628e
cmpq %r13, 0x8(%rax)
je 0x62f6
movq 0x20(%rax), %rax
jmp 0x627d
movq 0x8(%r14), %rdi
movl $0x40, %esi
callq 0x5281
testq %rax, %rax
je 0x62f6
movq %rax, %r15
movl %ebp, (%rax)
movq %r13, 0x8(%rax)
movq %r12, 0x10(%rax)
movl $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
movq 0x8(%r14), %rdi
movq %rbx, %rsi
callq 0xc264
movq %rax, 0x28(%r15)
testq %rax, %rax
je 0x6305
movq 0xf8(%r14), %rdi
movq %rbx, %rsi
callq 0x67a3
testq %rax, %rax
je 0x631f
movq %rax, %rcx
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0x62e6
movq %r15, 0x20(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5293
movq 0xf8(%r14), %rdi
movq %rbx, %rsi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x65fa
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/hash.c
// Function: hash_new
hash_t *hash_new(xmpp_ctx_t * const ctx, const int size,
		 hash_free_func free)
{
    hash_t *result = NULL;

    result = xmpp_alloc(ctx, sizeof(hash_t));
    if (result != NULL) {
	result->entries = xmpp_alloc(ctx, size * sizeof(hashentry_t *));
	if (result->entries == NULL) {
	    xmpp_free(ctx, result);
	    return NULL;
	}
	memset(result->entries, 0, size * sizeof(hashentry_t *));
	result->length = size;

	result->ctx = ctx;
	result->free = free;
	result->num_keys = 0;
	/* give the caller a reference */
	result->ref = 1;
    }
    
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movl $0x28, %esi
callq 0x5281
movq %rax, %rbx
testq %rax, %rax
je 0x654d
movslq %ebp, %r12
shlq $0x3, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x5281
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x6540
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x2140
movl %ebp, 0x18(%rbx)
movq %r15, 0x8(%rbx)
movq %r14, 0x10(%rbx)
movl $0x0, 0x1c(%rbx)
movl $0x1, (%rbx)
jmp 0x654d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5293
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/hash.c
// Function: hash_release
void hash_release(hash_t * const table)
{
    xmpp_ctx_t *ctx = table->ctx;
    hashentry_t *entry, *next;
    int i;
    
    if (table->ref > 1)
	table->ref--;
    else {
	for (i = 0; i < table->length; i++) {
	    entry = table->entries[i];
	    while (entry != NULL) {
		next = entry->next;
		xmpp_free(ctx, entry->key);
		if (table->free) table->free(ctx, entry->value);
		xmpp_free(ctx, entry);
		entry = next;
	    }
	}
	xmpp_free(ctx, table->entries);
	xmpp_free(ctx, table);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x1, %eax
jbe 0x6580
decl %eax
movl %eax, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8(%rbx), %r14
cmpl $0x0, 0x18(%rbx)
jle 0x65da
xorl %r12d, %r12d
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %r15
testq %r15, %r15
je 0x65ce
movq (%r15), %r13
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x5293
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x65bb
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq *%rax
movq %r14, %rdi
movq %r15, %rsi
callq 0x5293
movq %r13, %r15
testq %r13, %r13
jne 0x659a
incq %r12
movslq 0x18(%rbx), %rax
cmpq %rax, %r12
jl 0x658d
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x5293
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5293
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/hash.c
// Function: hash_add
int hash_add(hash_t *table, const char * const key, void *data)
{
   xmpp_ctx_t *ctx = table->ctx;
   hashentry_t *entry = NULL;
   int index = _hash_key(table, key);

   /* drop existing entry, if any */
   hash_drop(table, key);

   /* allocate and fill a new entry */
   entry = xmpp_alloc(ctx, sizeof(hashentry_t));
   if (!entry) return -1;
   entry->key = xmpp_strdup(ctx, key);
   if (!entry->key) {
       xmpp_free(ctx, entry);
       return -1;
   }
   entry->value = data;
   /* insert ourselves in the linked list */
   /* TODO: this leaks duplicate keys */
   entry->next = table->entries[index];
   table->entries[index] = entry;
   table->num_keys++;

   return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %r12
movq %rdi, %rbx
movq 0x8(%rdi), %r15
movb (%rsi), %dil
testb %dil, %dil
je 0x6644
leaq 0x1(%r12), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
xorl %eax, %eax
movsbl %dil, %edi
shll %cl, %edi
xorl %edi, %eax
cmpl $0x11, %ecx
leal 0x8(%rcx), %ecx
cmovgel %esi, %ecx
movb (%rdx), %dil
incq %rdx
testb %dil, %dil
jne 0x6626
jmp 0x6646
xorl %eax, %eax
cltd
idivl 0x18(%rbx)
movl %edx, %ebp
movq %rbx, %rdi
movq %r12, %rsi
callq 0x66c5
movl $0x18, %esi
movq %r15, %rdi
callq 0x5281
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x66b3
movq %rax, %r14
movq %r15, %rdi
movq %r12, %rsi
callq 0xc264
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x66a8
movq (%rsp), %rax
movq %rax, 0x10(%r14)
movq 0x20(%rbx), %rax
movslq %ebp, %rcx
movq (%rax,%rcx,8), %rdx
movq %rdx, (%r14)
movq %r14, (%rax,%rcx,8)
incl 0x1c(%rbx)
xorl %r13d, %r13d
jmp 0x66b3
movq %r15, %rdi
movq %r14, %rsi
callq 0x5293
movl %r13d, %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/hash.c
// Function: hash_drop
int hash_drop(hash_t *table, const char *key)
{
   xmpp_ctx_t *ctx = table->ctx;
   hashentry_t *entry, *prev;
   int index = _hash_key(table, key);

   /* look up the hash entry */
   entry = table->entries[index];
   prev = NULL;
   while (entry != NULL) {
	/* traverse the linked list looking for the key */
	if (!strcmp(key, entry->key)) {
	  /* match, remove the entry */
	  xmpp_free(ctx, entry->key);
	  if (table->free) table->free(ctx, entry->value);
	  if (prev == NULL) {
	    table->entries[index] = entry->next;
	  } else {
	    prev->next = entry->next;
	  }
	  xmpp_free(ctx, entry);
	  table->num_keys--;
	  return 0;
	}
	prev = entry;
	entry = entry->next;
   }
   /* no match */
   return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movb (%rsi), %dil
testb %dil, %dil
je 0x6706
leaq 0x1(%r14), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
xorl %eax, %eax
movsbl %dil, %edi
shll %cl, %edi
xorl %edi, %eax
cmpl $0x11, %ecx
leal 0x8(%rcx), %ecx
cmovgel %esi, %ecx
movb (%rdx), %dil
incq %rdx
testb %dil, %dil
jne 0x66e8
jmp 0x6708
xorl %eax, %eax
movq 0x8(%rbx), %rcx
movq %rcx, (%rsp)
cltd
idivl 0x18(%rbx)
movslq %edx, %r15
shlq $0x3, %r15
movq 0x20(%rbx), %r12
addq %r15, %r12
xorl %ecx, %ecx
movq (%r12), %r12
testq %r12, %r12
je 0x678f
movq %rcx, %rbp
movq 0x8(%r12), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x22e0
movq %r12, %rcx
testl %eax, %eax
jne 0x6724
movq (%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x5293
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x6769
movq 0x10(%r12), %rsi
movq %r14, %rdi
callq *%rax
movq (%r12), %rax
testq %rbp, %rbp
jne 0x6779
addq 0x20(%rbx), %r15
movq %r15, %rbp
movq %rax, (%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x5293
decl 0x1c(%rbx)
xorl %eax, %eax
jmp 0x6794
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
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/hash.c
// Function: hash_get
void *hash_get(hash_t *table, const char *key)
{
   hashentry_t *entry;
   int index = _hash_key(table, key);
   void *result = NULL;

   /* look up the hash entry */
   entry = table->entries[index];
   while (entry != NULL) {
	/* traverse the linked list looking for the key */
	if (!strcmp(key, entry->key)) {
	  /* match */
	  result = entry->value;
	  return result;
	}
	entry = entry->next;
   }
   /* no match */
   return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movb (%rsi), %r8b
testb %r8b, %r8b
je 0x67dd
leaq 0x1(%rbx), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
xorl %eax, %eax
movsbl %r8b, %r8d
shll %cl, %r8d
xorl %r8d, %eax
cmpl $0x11, %ecx
leal 0x8(%rcx), %ecx
cmovgel %esi, %ecx
movb (%rdx), %r8b
incq %rdx
testb %r8b, %r8b
jne 0x67bd
jmp 0x67df
xorl %eax, %eax
cltd
idivl 0x18(%rdi)
movslq %edx, %r15
shlq $0x3, %r15
addq 0x20(%rdi), %r15
xorl %r14d, %r14d
movq (%r15), %r15
testq %r15, %r15
je 0x680d
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x22e0
testl %eax, %eax
jne 0x67f1
movq 0x10(%r15), %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/hash.c
// Function: hash_iter_new
hash_iterator_t *hash_iter_new(hash_t *table)
{
    xmpp_ctx_t *ctx = table->ctx;
    hash_iterator_t *iter;

    iter = xmpp_alloc(ctx, sizeof(*iter));
    if (iter != NULL) {
	iter->ref = 1;
	iter->table = hash_clone(table);
	iter->entry = NULL;
	iter->index = -1;
    }

    return iter;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movl $0x20, %esi
callq 0x5281
testq %rax, %rax
je 0x684c
movl $0x1, (%rax)
incl (%rbx)
movq %rbx, 0x8(%rax)
movq $0x0, 0x10(%rax)
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/hash.c
// Function: hash_iter_release
void hash_iter_release(hash_iterator_t *iter)
{
    xmpp_ctx_t *ctx = iter->table->ctx;

    iter->ref--;

    if (iter->ref <= 0) {
	hash_release(iter->table);
	xmpp_free(ctx, iter);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq 0x8(%rdi), %r14
decl (%rbx)
je 0x6869
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x655f
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5293
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/hash.c
// Function: hash_iter_next
const char * hash_iter_next(hash_iterator_t *iter)
{
    hash_t *table = iter->table;
    hashentry_t *entry = iter->entry;
    int i = iter->index + 1;

    /* advance until we find the next entry */
    if (entry != NULL) entry = entry->next;
    if (entry == NULL) {
	/* we're off the end of list, search for a new entry */
	while (i < iter->table->length) {
	    entry = table->entries[i];
	    if (entry != NULL) {
		iter->index = i;
		break;
	    }
	    i++;
	}
    }

    if ((entry == NULL) || (i >= table->length)) {
	/* no more keys! */
	return NULL;
    }

    /* remember our current match */
    iter->entry = entry;
    return entry->key;
}

// Assembly:
movq 0x10(%rdi), %rcx
movl 0x18(%rdi), %eax
testq %rcx, %rcx
je 0x6891
movq (%rcx), %rdx
jmp 0x6893
xorl %edx, %edx
movq 0x8(%rdi), %rcx
incl %eax
testq %rdx, %rdx
jne 0x68c9
movl 0x18(%rcx), %esi
cmpl %esi, %eax
jge 0x68c2
movslq %eax, %r8
shlq $0x3, %r8
addq 0x20(%rcx), %r8
movq (%r8), %rdx
testq %rdx, %rdx
jne 0x68c6
incl %eax
addq $0x8, %r8
cmpl %eax, %esi
jne 0x68b0
xorl %edx, %edx
jmp 0x68c9
movl %eax, 0x18(%rdi)
testq %rdx, %rdx
je 0x68dc
cmpl 0x18(%rcx), %eax
jge 0x68dc
movq %rdx, 0x10(%rdi)
movq 0x8(%rdx), %rax
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 %r15d, %r15d
testq %rdx, %rdx
je 0x6937
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbp
movq %rdx, %rdi
callq 0x2180
movq %rax, 0x18(%rsp)
testq %r12, %r12
je 0x6922
movq %r12, %rdi
callq 0x2180
movq %rax, %r15
incl %r15d
testq %rbx, %rbx
je 0x693e
movq %rbx, %rdi
callq 0x2180
movq %rax, %r13
incl %r13d
jmp 0x6941
xorl %ebp, %ebp
jmp 0x69dc
xorl %r13d, %r13d
movq 0x18(%rsp), %rax
addl %r15d, %eax
movq %rax, 0x10(%rsp)
addl %r13d, %eax
incl %eax
movslq %eax, %rsi
movq %rbp, %rdi
callq 0x5281
movq %rax, %rbp
testq %rax, %rax
je 0x69dc
movq %rbx, 0x20(%rsp)
movslq %r15d, %rbx
testq %r12, %r12
je 0x6987
leaq -0x1(%rbx), %rdx
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2050
movb $0x40, -0x1(%rbp,%rbx)
movq 0x10(%rsp), %rax
addl %r13d, %eax
movl %eax, 0xc(%rsp)
movq %rbp, %r15
addq %rbx, %r15
movslq 0x18(%rsp), %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2050
movq 0x20(%rsp), %rsi
testq %rsi, %rsi
je 0x69d2
movslq 0x10(%rsp), %rax
movb $0x2f, (%rbp,%rax)
leaq (%r15,%r12), %rdi
incq %rdi
decl %r13d
movslq %r13d, %rdx
callq 0x2050
movslq 0xc(%rsp), %rax
movb $0x0, (%rbp,%rax)
movq %rbp, %rax
addq $0x28, %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/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 0x6a41
movq %rax, %r14
subq %rbx, %r14
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0x5281
movq %rax, %r15
testq %rax, %rax
je 0x6a38
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2050
movb $0x0, (%r15,%r14)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xc264
// File: /workspace/github_c_makefile_star2_O1/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 0x6a9d
movq %rax, %r14
subq %rbx, %r14
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0x5281
testq %rax, %rax
je 0x6a9d
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2050
movb $0x0, (%r15,%r14)
jmp 0x6aa0
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6aef
movq %rbx, %rdi
callq 0x2180
movq %rax, %r15
addq %rbx, %r15
subq %rbx, %r15
leaq 0x1(%r15), %rsi
movq %r14, %rdi
callq 0x5281
movq %rax, %r14
testq %rax, %rax
je 0x6b19
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_O1/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 0x6b8b
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 0x5281
testq %rax, %rax
je 0x6b8b
movq %rax, %r15
sarq $0x20, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2050
movb $0x0, (%r15,%r14)
jmp 0x6b8e
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movl 0x10(%rdi), %eax
leal (,%r15,8), %ecx
addl %eax, %ecx
movl %ecx, 0x10(%rdi)
jae 0x6be8
incl 0x14(%r14)
movl %r15d, %ecx
shrl $0x1d, %ecx
addl %ecx, 0x14(%r14)
shrl $0x3, %eax
andl $0x3f, %eax
je 0x6c5d
leaq (%r14,%rax), %rdi
addq $0x18, %rdi
movl $0x40, %ebp
subl %eax, %ebp
movl %r15d, %r12d
subl %ebp, %r12d
jae 0x6c21
movl %r15d, %edx
movq %rbx, %rsi
callq 0x2050
movl %r15d, %r12d
jmp 0x6c46
leaq 0x18(%r14), %rax
movq %rax, (%rsp)
movl %ebp, %r13d
movq %rbx, %rsi
movq %r13, %rdx
callq 0x2050
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x6cc6
addq %r13, %rbx
cmpl %ebp, %r15d
movl %r12d, %r15d
jae 0x6c5d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x40, %r15d
jb 0x6ca6
leaq 0x18(%r14), %r12
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x30(%rbx), %xmm3
movups %xmm3, 0x30(%r12)
movups %xmm2, 0x20(%r12)
movups %xmm1, 0x10(%r12)
movups %xmm0, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x6cc6
addq $0x40, %rbx
addl $-0x40, %r15d
cmpl $0x3f, %r15d
ja 0x6c67
addq $0x18, %r14
movl %r15d, %edx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/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 0x754d
movl %ecx, %edx
xorl %esi, %esi
callq 0x2140
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6cc6
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r15)
movups %xmm0, 0x10(%r15)
movups %xmm0, (%r15)
movq $0x0, 0x30(%r15)
jmp 0x755b
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 0x6cc6
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
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 0x5281
movq %rax, %r15
testq %rax, %rax
je 0x7692
movq %rbp, (%r15)
movq %r15, %rdi
addq $0x8, %rdi
movl $0x108, %edx            # imm = 0x108
xorl %esi, %esi
callq 0x2140
leaq 0x6f(%rip), %rax        # 0x76a4
movq %rax, 0x80(%r15)
leaq 0x142(%rip), %rax       # 0x7785
movq %rax, 0x88(%r15)
leaq 0x1a3(%rip), %rax       # 0x77f4
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 0x7856
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_O1/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 0x771d
movq 0x138(%rbx), %r13
testq %r13, %r13
setne %cl
cmpl $0x1, %eax
sete %al
orb %cl, %al
je 0x773a
movq (%rbx), %rdi
callq 0xb5a0
movq %rax, %r12
testq %r13, %r13
je 0x7754
movq %r12, %rdi
movq %r15, %rsi
callq 0xbac6
movq %r12, %rdi
movq %r14, %rsi
callq 0x78f6
movq 0x138(%rbx), %rdi
movq %r12, %rsi
callq 0xbc2c
movq %r12, %rdi
callq 0xb73c
movq %r12, 0x138(%rbx)
jmp 0x7775
movq 0x110(%rbx), %rax
testq %rax, %rax
je 0x7775
movq 0x128(%rbx), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq *%rax
jmp 0x7775
movq (%rbx), %rdi
leaq 0x665c(%rip), %rsi      # 0xdda0
leaq 0x665c(%rip), %rdx      # 0xdda7
xorl %eax, %eax
callq 0x539c
jmp 0x7775
movq %r12, 0x138(%rbx)
movq %r12, %rdi
movq %r15, %rsi
callq 0xbac6
movq 0x138(%rbx), %rdi
movq %r14, %rsi
callq 0x78f6
incl 0x130(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x77aa
movq 0x138(%rbx), %rdi
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x77c6
movq %rax, 0x138(%rbx)
jmp 0x77f2
movq 0x118(%rbx), %rcx
testq %rcx, %rcx
je 0x77f2
movq 0x128(%rbx), %rax
movq %rsi, %rdi
movq %rax, %rsi
popq %rbx
jmpq *%rcx
movq 0x120(%rbx), %rax
testq %rax, %rax
je 0x77db
movq 0x128(%rbx), %rsi
callq *%rax
movq 0x138(%rbx), %rdi
callq 0xb73c
movq $0x0, 0x138(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x784b
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0xb5a0
testq %rax, %rax
je 0x784b
movq %rax, %r15
movslq %ebp, %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0xbca0
movq 0x138(%rbx), %rdi
movq %r15, %rsi
callq 0xbc2c
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb73c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x786b
callq 0x2360
movq 0x138(%rbx), %rdi
testq %rdi, %rdi
je 0x787c
callq 0xb73c
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 0x78b6
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_O1/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 0x7930
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rsi), %rsi
testq %rsi, %rsi
je 0x7929
movq %rdi, %r14
addq $0x10, %rbx
movq -0x8(%rbx), %rdx
movq %r14, %rdi
callq 0xbbb0
movq (%rbx), %rsi
addq $0x10, %rbx
testq %rsi, %rsi
jne 0x7911
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 0x5281
testq %rax, %rax
je 0x79d3
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 0x79e4
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5293
movq %r14, %rax
jmp 0x79d5
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_O1/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), %r9
leaq 0x5962(%rip), %rax      # 0xdf00
xorl %ecx, %ecx
cmpb $0x40, (%r9,%rax)
movl $0x0, %edi
movl $0x0, %r8d
jl 0x85fb
movl $0x1, %r8d
movb $0x1, %dil
cmpb $0x3d, %r9b
jne 0x85fb
leal -0x2(%rdx), %r9d
movsbq (%rsi,%r9), %r9
cmpb $0x40, (%r9,%rax)
jge 0x85db
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %edi, %edi
jmp 0x85fb
cmpb $0x3d, %r9b
jne 0x85fb
leal -0x3(%rdx), %edi
movsbq (%rsi,%rdi), %rsi
xorl %edi, %edi
cmpb $0x40, (%rsi,%rax)
setge %dil
leal (%rdi,%rdi,2), %r8d
addl $-0x2, %r8d
shrl $0x2, %edx
leal (%rdx,%rdx,2), %eax
addl %r8d, %eax
testb %dil, %dil
cmovnel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rsi, %r14
movq %rdi, %r15
movl 0x14(%rdi), %ebp
leaq (,%rdx,8), %rax
leal (%rax,%rbp), %ecx
shrl $0x3, %ebp
andl $0x3f, %ebp
movl %ecx, 0x14(%rdi)
cmpq %rcx, %rax
jbe 0x99ee
incl 0x18(%r15)
movq %rbx, %rax
shrq $0x1d, %rax
addl %eax, 0x18(%r15)
leaq (%rbx,%rbp), %rax
cmpq $0x40, %rax
jb 0x9a57
leaq 0x1c(%r15), %r13
leaq (%r15,%rbp), %rdi
addq $0x1c, %rdi
movl $0x40, %r12d
subq %rbp, %r12
movq %r14, %rsi
movq %r12, %rdx
callq 0x2050
movq %r15, %rdi
movq %r13, %rsi
callq 0x87d8
xorq $0x7f, %rbp
cmpq %rbx, %rbp
jae 0x9a5c
xorl %ebp, %ebp
movq %r12, %r13
leaq (%r14,%r12), %rsi
movq %r15, %rdi
callq 0x87d8
addq $0x40, %r12
addq $0x7f, %r13
cmpq %rbx, %r13
jb 0x9a39
jmp 0x9a5e
xorl %r12d, %r12d
jmp 0x9a5e
xorl %ebp, %ebp
leaq (%r15,%rbp), %rdi
addq $0x1c, %rdi
addq %r12, %r14
subq %r12, %rbx
movq %r14, %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_O1/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 0x9a96
leaq 0x454e(%rip), %rsi      # 0xe011
movl $0x1, %edx
movq %rbx, %rdi
callq 0x99ba
movl $0x1f8, %ebp            # imm = 0x1F8
movl 0x14(%rbx), %eax
andl %ebp, %eax
cmpl $0x1c0, %eax            # imm = 0x1C0
je 0x9b04
leaq 0x452b(%rip), %r15      # 0xe013
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x99ba
movl 0x14(%rbx), %eax
andl %ebp, %eax
cmpl $0x1c0, %eax            # imm = 0x1C0
jne 0x9ae8
movq %rsp, %rsi
movl $0x8, %edx
movq %rbx, %rdi
callq 0x99ba
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 0x9b18
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
nop
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x48, %rsp
movl %esi, %ecx
movq %rdi, %rbx
leaq 0x3572(%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, %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x23f0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0xac58
movq (%rsp), %r14
testq %r14, %r14
je 0xac4a
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
callq 0x21a0
movl %eax, %ebx
testl %eax, %eax
js 0xac44
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 0xac4a
jns 0xac44
callq 0x2390
cmpl $0x73, (%rax)
je 0xac4a
movq 0x28(%r14), %r14
jmp 0xabf6
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xac58
callq 0x2250
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/sock.c
// Function: netbuf_get_32bitnum
void netbuf_get_32bitnum(unsigned char *buf, int buflen, int *offset, unsigned int *num)
{
	unsigned char *start = buf + *offset;
	unsigned char *p = start;
	*num = 0;

	/* assuming big endian */
	*num |= (*p++) << 24;
	*num |= (*p++) << 16;
	*num |= (*p++) << 8;
	*num |= (*p++);

	*offset += 4;
}

// Assembly:
movslq (%rdx), %rax
movl $0x0, (%rcx)
movzbl (%rdi,%rax), %esi
shll $0x18, %esi
movl %esi, (%rcx)
movzbl 0x1(%rdi,%rax), %r8d
shll $0x10, %r8d
orl %esi, %r8d
movl %r8d, (%rcx)
movzbl 0x2(%rdi,%rax), %esi
shll $0x8, %esi
orl %r8d, %esi
movl %esi, (%rcx)
movzbl 0x3(%rdi,%rax), %eax
orl %esi, %eax
movl %eax, (%rcx)
addl $0x4, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/sock.c
// Function: netbuf_get_16bitnum
void netbuf_get_16bitnum(unsigned char *buf, int buflen, int *offset, unsigned short *num)
{
	unsigned char *start = buf + *offset;
	unsigned char *p = start;
	*num = 0;

	/* assuming big endian */
	*num |= (*p++) << 8;
	*num |= (*p++);

	*offset += 2;
}

// Assembly:
movslq (%rdx), %rax
movw $0x0, (%rcx)
movzbl (%rdi,%rax), %esi
shll $0x8, %esi
movw %si, (%rcx)
movzbl 0x1(%rdi,%rax), %edi
orl %esi, %edi
movw %di, (%rcx)
addl $0x2, %eax
movl %eax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/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
cmpb $0x0, (%rcx)
movq %rax, %rsi
je 0xade3
movq %rax, %rsi
xorl %edi, %edi
movzbl (%rcx,%rdi), %r8d
testl %r8d, %r8d
je 0xad9f
cmpl $0x2e, %r8d
je 0xad9f
incq %rdi
jmp 0xad8a
cmpl $0x3f, %edi
movl $0x3f, %r8d
cmovll %edi, %r8d
movb %r8b, (%rsi)
incq %rsi
testq %rdi, %rdi
je 0xadd0
xorl %r8d, %r8d
movb (%rcx,%r8), %r9b
movb %r9b, (%rsi,%r8)
incq %r8
cmpq %r8, %rdi
jne 0xadba
addq %r8, %rsi
addq %r8, %rcx
xorl %edi, %edi
cmpb $0x2e, (%rcx)
sete %dil
cmpb $0x0, (%rcx,%rdi)
leaq (%rcx,%rdi), %rcx
jne 0xad88
movb $0x0, (%rsi)
subl %eax, %esi
movl (%rdx), %eax
addl %esi, %eax
incl %eax
movl %eax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xae3f
addq %rdi, %rcx
xorl %eax, %eax
movzbl %dl, %edx
movl %edx, %esi
notl %esi
testb $-0x40, %sil
jne 0xae1e
andl $0x3f, %edx
shll $0x8, %edx
movzbl 0x1(%rcx), %esi
orl %edx, %esi
movq %rdi, %rcx
jmp 0xae32
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 0xae00
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movslq (%rdx), %rax
leaq (%rdi,%rax), %rsi
movb $0x0, (%rcx)
movb (%rdi,%rax), %r10b
xorl %eax, %eax
testb %r10b, %r10b
je 0xae97
movq %rsi, %r9
movzbl %r10b, %r10d
movl %r10d, %r11d
notl %r11d
testb $-0x40, %r11b
jne 0xae7f
andl $0x3f, %r10d
shll $0x8, %r10d
movzbl 0x1(%r9), %r11d
orl %r10d, %r11d
movq %rdi, %r9
jmp 0xae88
addl %r10d, %eax
incl %r10d
movl %r10d, %r11d
movl %r11d, %r11d
movb (%r9,%r11), %r10b
addq %r11, %r9
testb %r10b, %r10b
jne 0xae5a
cmpl %r8d, %eax
jg 0xaf3b
movb (%rsi), %r9b
testb %r9b, %r9b
je 0xaf1f
movq %rsi, %r8
movq %rcx, %rax
movzbl %r9b, %r9d
movl %r9d, %r10d
notl %r10d
testb $-0x40, %r10b
jne 0xaeed
movzbl 0x1(%r8), %r10d
testq %rdx, %rdx
je 0xaed8
subl %esi, %r8d
movl (%rdx), %r11d
addl %r11d, %r8d
addl $0x2, %r8d
movl %r8d, (%rdx)
andl $0x3f, %r9d
shll $0x8, %r9d
orl %r10d, %r9d
movl %r9d, %r8d
addq %rdi, %r8
xorl %edx, %edx
jmp 0xaf15
cmpb $0x0, (%rcx)
je 0xaef8
movb $0x2e, (%rax)
incq %rax
movzbl (%r8), %r9d
incq %r8
testl %r9d, %r9d
je 0xaf15
movb (%r8), %r10b
movb %r10b, (%rax)
incq %rax
incq %r8
decl %r9d
jne 0xaf04
movb (%r8), %r9b
testb %r9b, %r9b
jne 0xaeae
jmp 0xaf25
movq %rcx, %rax
movq %rsi, %r8
testq %rdx, %rdx
je 0xaf36
subl %esi, %r8d
movl (%rdx), %ecx
addl %r8d, %ecx
incl %ecx
movl %ecx, (%rdx)
movb $0x0, (%rax)
xorl %eax, %eax
retq