LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/handler.c
// Function: timed_handler_add
static void _timed_handler_add(xmpp_conn_t * const conn,
			       xmpp_timed_handler handler,
			       const unsigned long period,
			       void * const userdata, 
			       const int user_handler)
{
    xmpp_handlist_t *item, *tail;

    /* check if handler is already in the list */
    for (item = conn->timed_handlers; item; item = item->next) {
	if (item->handler == (void *)handler)
	    break;
    }
    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->period = period;
    item->last_stamp = time_stamp();

    /* append item to list */
    if (!conn->timed_handlers)
	conn->timed_handlers = item;
    else {
	tail = conn->timed_handlers;
	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, %r15
movq %rdx, %r14
movq %rsi, %r12
leaq 0xf0(%rdi), %r13
movq %r13, %rax
movq (%rax), %rcx
testq %rcx, %rcx
je 0x602f
leaq 0x20(%rcx), %rax
cmpq %r12, 0x8(%rcx)
jne 0x601b
jmp 0x6080
movq 0x8(%rdi), %rdi
pushq $0x40
popq %rsi
callq 0x518f
testq %rax, %rax
je 0x6080
movq %rax, %rbx
movl %ebp, (%rax)
movq %r12, 0x8(%rax)
movq %r15, 0x10(%rax)
andl $0x0, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq %r14, 0x28(%rax)
callq 0xbd43
movq %rax, 0x30(%rbx)
movq (%r13), %rax
testq %rax, %rax
je 0x607c
movq %rax, %r13
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0x606c
addq $0x20, %r13
movq %rbx, (%r13)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/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 0x657f
testq %rax, %rax
je 0x60d7
cmpq %r13, 0x8(%rax)
je 0x6137
movq 0x20(%rax), %rax
jmp 0x60c6
movq 0x8(%r14), %rdi
pushq $0x40
popq %rsi
callq 0x518f
testq %rax, %rax
je 0x6137
movq %rax, %r15
movl %ebp, (%rax)
movq %r13, 0x8(%rax)
movq %r12, 0x10(%rax)
andl $0x0, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq 0x8(%r14), %rdi
movq %rbx, %rsi
callq 0xbcd4
movq %rax, 0x28(%r15)
testq %rax, %rax
je 0x6146
movq 0xf8(%r14), %rdi
movq %rbx, %rsi
callq 0x657f
testq %rax, %rax
je 0x6160
movq %rax, %rcx
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0x6127
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 0x51a1
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 0x641a
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x28
popq %rsi
callq 0x518f
testq %rax, %rax
je 0x6376
movq %rax, %rbx
movslq %ebp, %r12
shlq $0x3, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x518f
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x636b
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x2140
movl %ebp, 0x18(%rbx)
movq %r15, 0x8(%rbx)
movq %r14, 0x10(%rbx)
andl $0x0, 0x1c(%rbx)
movl $0x1, (%rbx)
jmp 0x6378
movq %r15, %rdi
movq %rbx, %rsi
callq 0x51a1
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x63ab
decl %eax
movl %eax, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8(%rbx), %r14
xorl %r12d, %r12d
movslq 0x18(%rbx), %rax
movq 0x20(%rbx), %rsi
cmpq %rax, %r12
jge 0x63fe
movq (%rsi,%r12,8), %r15
testq %r15, %r15
je 0x63f9
movq (%r15), %r13
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x51a1
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x63e9
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq *%rax
movq %r14, %rdi
movq %r15, %rsi
callq 0x51a1
movq %r13, %r15
jmp 0x63c3
incq %r12
jmp 0x63b2
movq %r14, %rdi
callq 0x51a1
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x51a1
// File: /workspace/github_c_makefile_star2_O2/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, %r13
movq %rdi, %rbx
movq 0x8(%rdi), %r15
callq 0x64af
movl %eax, %ebp
movq %rbx, %rdi
movq %r13, %rsi
callq 0x64d9
pushq $0x18
popq %rsi
movq %r15, %rdi
callq 0x518f
pushq $-0x1
popq %r12
testq %rax, %rax
je 0x649d
movq %rax, %r14
movq %r15, %rdi
movq %r13, %rsi
callq 0xbcd4
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x6492
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 %r12d, %r12d
jmp 0x649d
movq %r15, %rdi
movq %r14, %rsi
callq 0x51a1
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/hash.c
// Function: hash_key
static int _hash_key(hash_t *table, const char *key)
{
   int hash = 0;
   int shift = 0;
   const char *c = key;

   while (*c != '\0') {
	/* assume 32 bit ints */
	hash ^= ((int)*c++ << shift);
	shift += 8;
	if (shift > 24) shift = 0;
   }

   return hash % table->length;
}

// Assembly:
xorl %edx, %edx
xorl %eax, %eax
xorl %ecx, %ecx
movsbl (%rsi), %r8d
testl %r8d, %r8d
je 0x64d2
shll %cl, %r8d
incq %rsi
xorl %r8d, %eax
cmpl $0x11, %ecx
leal 0x8(%rcx), %ecx
cmovgel %edx, %ecx
jmp 0x64b5
cltd
idivl 0x18(%rdi)
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r12
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq %rax, (%rsp)
callq 0x64af
movslq %eax, %rbp
shlq $0x3, %rbp
movq 0x20(%rbx), %r15
addq %rbp, %r15
xorl %ecx, %ecx
movq (%r15), %r15
testq %r15, %r15
je 0x656d
movq %rcx, %r14
movq 0x8(%r15), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x22e0
movq %r15, %rcx
testl %eax, %eax
jne 0x6507
movq (%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x51a1
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x6549
movq 0x10(%r15), %rsi
movq %r12, %rdi
callq *%rax
movq (%r15), %rax
testq %r14, %r14
jne 0x6558
addq 0x20(%rbx), %rbp
movq %rbp, %r14
movq %rax, (%r14)
movq %r12, %rdi
movq %r15, %rsi
callq 0x51a1
decl 0x1c(%rbx)
xorl %eax, %eax
jmp 0x6570
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/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
movq %rdi, %r14
callq 0x64af
movslq %eax, %r15
shlq $0x3, %r15
addq 0x20(%r14), %r15
xorl %r14d, %r14d
movq (%r15), %r15
testq %r15, %r15
je 0x65b9
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x22e0
testl %eax, %eax
jne 0x659d
movq 0x10(%r15), %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x20
popq %rsi
callq 0x518f
testq %rax, %rax
je 0x65f0
movl $0x1, (%rax)
incl (%rbx)
movq %rbx, 0x8(%rax)
andq $0x0, 0x10(%rax)
orl $-0x1, 0x18(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x660d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x638a
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x51a1
// File: /workspace/github_c_makefile_star2_O2/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 0x8(%rdi), %rsi
movq 0x10(%rdi), %rax
movl 0x18(%rdi), %ecx
incl %ecx
testq %rax, %rax
je 0x6643
movq (%rax), %r8
testq %r8, %r8
je 0x6643
movl 0x18(%rsi), %edx
jmp 0x6668
movl 0x18(%rsi), %edx
movslq %ecx, %rcx
movslq %edx, %r9
xorl %eax, %eax
cmpq %r9, %rcx
jge 0x6674
movq 0x20(%rsi), %r8
movq (%r8,%rcx,8), %r8
testq %r8, %r8
jne 0x6665
incq %rcx
jmp 0x664e
movl %ecx, 0x18(%rdi)
cmpl %edx, %ecx
jge 0x6675
movq %r8, 0x10(%rdi)
movq 0x8(%r8), %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x676e
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 0x66bc
movq %r12, %rdi
callq 0x2180
movq %rax, %rbp
incl %ebp
testq %rbx, %rbx
je 0x66d1
movq %rbx, %rdi
callq 0x2180
movq %rax, %r13
incl %r13d
jmp 0x66d4
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 0x518f
testq %rax, %rax
je 0x676e
movq %rax, %r15
movq %rbx, 0x20(%rsp)
movq %rax, %rbx
movslq %ebp, %rbp
testq %r12, %r12
je 0x671c
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 0x6763
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 0x6770
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_O2/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
pushq $0x2f
popq %rsi
movq %rbx, %rdi
callq 0x21f0
testq %rax, %rax
je 0x67cc
movq %rax, %r14
subq %rbx, %r14
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0x518f
testq %rax, %rax
je 0x67dc
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2050
movb $0x0, (%r15,%r14)
jmp 0x67df
movq %r15, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xbcd4
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x40
popq %rsi
movq %rbx, %rdi
callq 0x21f0
testq %rax, %rax
je 0x6832
movq %rax, %r14
subq %rbx, %r14
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0x518f
testq %rax, %rax
je 0x6832
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2050
movb $0x0, (%r15,%r14)
jmp 0x6835
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x40
popq %rsi
movq %r15, %rdi
callq 0x21f0
leaq 0x1(%rax), %rbx
testq %rax, %rax
cmoveq %r15, %rbx
pushq $0x2f
popq %rsi
movq %rbx, %rdi
callq 0x21f0
movq %rax, %r15
testq %rax, %rax
jne 0x6880
movq %rbx, %rdi
callq 0x2180
movq %rax, %r15
addq %rbx, %r15
subq %rbx, %r15
leaq 0x1(%r15), %rsi
movq %r14, %rdi
callq 0x518f
movq %rax, %r14
testq %rax, %rax
je 0x68aa
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_O2/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 %rsi, %rax
movq %rdi, %r15
pushq $0x2f
popq %rsi
movq %rax, %rdi
callq 0x21f0
testq %rax, %rax
je 0x691d
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 0x518f
testq %rax, %rax
je 0x691d
movq %rax, %r15
sarq $0x20, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2050
movb $0x0, (%r15,%r14)
jmp 0x6920
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x6996
leaq (%rbx,%rax), %rdi
addq $0x18, %rdi
pushq $0x40
popq %rcx
subl %eax, %ecx
movl %edx, %ebp
subl %ecx, %ebp
jae 0x699a
movl %edx, %edx
movq %r14, %rsi
jmp 0x6a0f
movl %edx, %ebp
jmp 0x69ba
leaq 0x18(%rbx), %r15
movl %ecx, %r12d
movq %r14, %rsi
movq %r12, %rdx
callq 0x2050
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6a1c
addq %r12, %r14
leaq 0x18(%rbx), %r12
movl %ebp, %r15d
cmpl $0x40, %r15d
jb 0x6a06
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups 0x30(%r14), %xmm3
movups %xmm3, 0x30(%r12)
movups %xmm2, 0x20(%r12)
movups %xmm1, 0x10(%r12)
movups %xmm0, (%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6a1c
addq $0x40, %r14
addq $-0x40, %r15
jmp 0x69c1
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O2/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 0x72a2
movl %ecx, %edx
xorl %esi, %esi
callq 0x2140
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6a1c
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r15)
movups %xmm0, 0x10(%r15)
movups %xmm0, (%r15)
andq $0x0, 0x30(%r15)
jmp 0x72ae
pushq $0x37
popq %rdx
subl %eax, %edx
xorl %esi, %esi
callq 0x2140
movq 0x10(%rbx), %rax
movq %rax, 0x50(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6a1c
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)
andq $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x518f
movq %rax, %r15
testq %rax, %rax
je 0x73dc
movq %rbp, (%r15)
movq %r15, %rdi
addq $0x8, %rdi
movl $0x108, %edx            # imm = 0x108
xorl %esi, %esi
callq 0x2140
leaq 0x69(%rip), %rax        # 0x73ee
movq %rax, 0x80(%r15)
leaq 0x13c(%rip), %rax       # 0x74cf
movq %rax, 0x88(%r15)
leaq 0x19a(%rip), %rax       # 0x753b
movq %rax, 0x98(%r15)
movq %r13, 0x110(%r15)
movq %r12, 0x118(%r15)
movq %r14, 0x120(%r15)
movq %rbx, 0x128(%r15)
andl $0x0, 0x130(%r15)
andq $0x0, 0x138(%r15)
movq %r15, %rdi
callq 0x759d
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_O2/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 0x7467
movq 0x138(%rbx), %r13
testq %r13, %r13
setne %cl
cmpl $0x1, %eax
sete %al
orb %cl, %al
je 0x7484
movq (%rbx), %rdi
callq 0xb0b4
movq %rax, %r12
testq %r13, %r13
je 0x749e
movq %r12, %rdi
movq %r15, %rsi
callq 0xb57d
movq %r12, %rdi
movq %r14, %rsi
callq 0x7635
movq 0x138(%rbx), %rdi
movq %r12, %rsi
callq 0xb6e5
movq %r12, %rdi
callq 0xb220
movq %r12, 0x138(%rbx)
jmp 0x74bf
movq 0x110(%rbx), %rax
testq %rax, %rax
je 0x74bf
movq 0x128(%rbx), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq *%rax
jmp 0x74bf
movq (%rbx), %rdi
leaq 0x5912(%rip), %rsi      # 0xcda0
leaq 0x5912(%rip), %rdx      # 0xcda7
xorl %eax, %eax
callq 0x52aa
jmp 0x74bf
movq %r12, 0x138(%rbx)
movq %r12, %rdi
movq %r15, %rsi
callq 0xb57d
movq 0x138(%rbx), %rdi
movq %r14, %rsi
callq 0x7635
incl 0x130(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x74f4
movq 0x138(%rbx), %rdi
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x7510
movq %rax, 0x138(%rbx)
jmp 0x7539
movq 0x118(%rbx), %rcx
testq %rcx, %rcx
je 0x7539
movq 0x128(%rbx), %rax
movq %rsi, %rdi
movq %rax, %rsi
popq %rbx
jmpq *%rcx
movq 0x120(%rbx), %rax
testq %rax, %rax
je 0x752c
movq 0x128(%rbx), %rsi
callq *%rax
movq 0x138(%rbx), %rdi
callq 0xb220
andq $0x0, 0x138(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7592
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0xb0b4
testq %rax, %rax
je 0x7592
movq %rax, %r15
movslq %ebp, %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0xb758
movq 0x138(%rbx), %rdi
movq %r15, %rsi
callq 0xb6e5
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb220
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x75b2
callq 0x2360
movq 0x138(%rbx), %rdi
testq %rdi, %rdi
je 0x75c3
callq 0xb220
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 0x75f5
andl $0x0, 0x130(%rbx)
andq $0x0, 0x138(%rbx)
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7669
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x8, %rbx
movq -0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x7662
movq (%rbx), %rdx
movq %r14, %rdi
callq 0xb666
addq $0x10, %rbx
jmp 0x7648
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x518f
testq %rax, %rax
je 0x770b
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 0x771c
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x51a1
movq %r14, %rax
jmp 0x770d
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_O2/liuhaotian[P]xmppsh/libstrophe/src/sasl.c
// Function: base64_encode
char *base64_encode(xmpp_ctx_t *ctx, 
		    const unsigned char * const buffer, const unsigned len)
{
    int clen;
    char *cbuf, *c;
    uint32_t word, hextet;
    int i;

    clen = base64_encoded_len(ctx, len);
    cbuf = xmpp_alloc(ctx, clen + 1);
    if (cbuf != NULL) {
	c = cbuf;
	/* loop over data, turning every 3 bytes into 4 characters */
	for (i = 0; i < len - 2; i += 3) {
	    word = buffer[i] << 16 | buffer[i+1] << 8 | buffer[i+2];
	    hextet = (word & 0x00FC0000) >> 18;
	    *c++ = _base64_charmap[hextet];
	    hextet = (word & 0x0003F000) >> 12;
	    *c++ = _base64_charmap[hextet];
	    hextet = (word & 0x00000FC0) >> 6;
	    *c++ = _base64_charmap[hextet];
	    hextet = (word & 0x000003F);
	    *c++ = _base64_charmap[hextet];
	}
	/* zero, one or two bytes left */
	switch (len - i) {
	    case 0:
		break;
	    case 1:
		hextet = (buffer[len-1] & 0xFC) >> 2;
		*c++ = _base64_charmap[hextet];
		hextet = (buffer[len-1] & 0x03) << 4;
		*c++ = _base64_charmap[hextet];
		*c++ = _base64_charmap[64]; /* pad */
		*c++ = _base64_charmap[64]; /* pad */
		break;
	    case 2:
		hextet = (buffer[len-2] & 0xFC) >> 2;
		*c++ = _base64_charmap[hextet];
		hextet = ((buffer[len-2] & 0x03) << 4) |
			 ((buffer[len-1] & 0xF0) >> 4);
		*c++ = _base64_charmap[hextet];
		hextet = (buffer[len-1] & 0x0F) << 2;
		*c++ = _base64_charmap[hextet];
		*c++ = _base64_charmap[64]; /* pad */
		break;
	}
	/* add a terminal null */
	*c = '\0';
    }

    return cbuf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
leal 0x2(%rbx), %eax
pushq $0x3
popq %rcx
xorl %edx, %edx
divl %ecx
leal 0x1(,%rax,4), %eax
movslq %eax, %rsi
callq 0x518f
testq %rax, %rax
je 0x7841
leal -0x2(%rbx), %esi
xorl %edi, %edi
leaq 0x575c(%rip), %rdx      # 0xceb0
movq %rax, %rcx
cmpq %rsi, %rdi
jae 0x77c0
movzbl (%r14,%rdi), %r8d
movl %r8d, %r9d
shll $0x10, %r9d
movzbl 0x1(%r14,%rdi), %r10d
shll $0x8, %r10d
movzbl 0x2(%r14,%rdi), %r11d
leal (%r10,%r11), %r15d
orl %r9d, %r10d
shrl $0x2, %r8d
movb (%r8,%rdx), %r8b
movb %r8b, (%rcx)
shrl $0xc, %r10d
andl $0x3f, %r10d
movb (%r10,%rdx), %r8b
movb %r8b, 0x1(%rcx)
shrl $0x6, %r15d
andl $0x3f, %r15d
movb (%r15,%rdx), %r8b
movb %r8b, 0x2(%rcx)
andl $0x3f, %r11d
movb (%r11,%rdx), %r8b
movb %r8b, 0x3(%rcx)
addq $0x4, %rcx
addq $0x3, %rdi
jmp 0x7757
movl %ebx, %r8d
subl %edi, %r8d
cmpl $0x1, %r8d
je 0x7810
cmpl $0x2, %r8d
jne 0x783e
movzbl (%r14,%rsi), %edi
shrl $0x2, %edi
movb (%rdi,%rdx), %dil
movb %dil, (%rcx)
movzbl (%r14,%rsi), %esi
shll $0x4, %esi
andl $0x30, %esi
decl %ebx
movzbl (%r14,%rbx), %edi
shrl $0x4, %edi
orl %esi, %edi
movb (%rdi,%rdx), %sil
movb %sil, 0x1(%rcx)
movzbl (%r14,%rbx), %esi
andl $0xf, %esi
movb (%rdx,%rsi,4), %dl
movb %dl, 0x2(%rcx)
jmp 0x7836
decl %ebx
movzbl (%r14,%rbx), %esi
shrl $0x2, %esi
movb (%rsi,%rdx), %sil
movb %sil, (%rcx)
movzbl (%r14,%rbx), %esi
shll $0x4, %esi
andl $0x30, %esi
movb (%rsi,%rdx), %dl
movb %dl, 0x1(%rcx)
movb $0x3d, 0x2(%rcx)
movb $0x3d, 0x3(%rcx)
addq $0x4, %rcx
movb $0x0, (%rcx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/src/sasl.c
// Function: digest_to_hex
static void _digest_to_hex(const char *digest, char *hex)
{
    int i;
    const char hexdigit[] = "0123456789abcdef";

    for (i = 0; i < 16; i++) {
	*hex++ = hexdigit[ (digest[i] >> 4) & 0x0F ];
	*hex++ = hexdigit[ digest[i] & 0x0F ];
    }
}

// Assembly:
xorl %eax, %eax
leaq 0x5005(%rip), %rcx      # 0xd000
cmpq $0x10, %rax
je 0x8021
movzbl (%rdi,%rax), %edx
shrl $0x4, %edx
movb (%rdx,%rcx), %dl
movb %dl, (%rsi,%rax,2)
movzbl (%rdi,%rax), %edx
andl $0xf, %edx
movb (%rdx,%rcx), %dl
movb %dl, 0x1(%rsi,%rax,2)
incq %rax
jmp 0x7ffb
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x4d14(%rip), %rax      # 0xcf00
xorl %ecx, %ecx
cmpb $0x40, (%rdi,%rax)
jge 0x81fd
shrl $0x2, %edx
leal (%rdx,%rdx,2), %eax
addl %ecx, %eax
retq
cmpb $0x3d, %dil
jne 0x822e
leal -0x2(%rdx), %ecx
movsbq (%rsi,%rcx), %rcx
cmpb $0x40, (%rcx,%rax)
jge 0x8216
pushq $-0x1
popq %rcx
jmp 0x81f4
cmpb $0x3d, %cl
jne 0x822e
leal -0x3(%rdx), %ecx
movsbq (%rsi,%rcx), %rsi
xorl %ecx, %ecx
cmpb $0x40, (%rsi,%rax)
setge %al
jl 0x8231
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_O2/liuhaotian[P]xmppsh/libstrophe/src/sasl.c
// Function: make_string
static char *_make_string(xmpp_ctx_t *ctx, const char *s, const unsigned len)
{
    char *result;

    result = xmpp_alloc(ctx, len + 1);
    if (result != NULL) {
	memcpy(result, s, len);
	result[len] = '\0';
    }
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %r14d
movq %rsi, %rbx
leal 0x1(%r14), %esi
callq 0x518f
movq %rax, %r15
testq %rax, %rax
je 0x842f
movl %r14d, %r14d
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
// File: /workspace/github_c_makefile_star2_O2/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 0x9606
leaq 0x1c(%r14), %r13
leaq (%r14,%rbp), %rdi
addq $0x1c, %rdi
pushq $0x40
popq %r12
subq %rbp, %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x2050
movq %r14, %rdi
movq %r13, %rsi
callq 0x8438
xorl %ebp, %ebp
leaq 0x3f(%r12), %rax
cmpq %rbx, %rax
jae 0x9609
leaq (%r15,%r12), %rsi
movq %r14, %rdi
callq 0x8438
addq $0x40, %r12
jmp 0x95ea
xorl %r12d, %r12d
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_O2/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
xorl %edx, %edx
cmpq $0x8, %rdx
je 0x966f
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, 0x8(%rsp,%rdx)
incq %rdx
addl $0x8, %eax
jmp 0x9646
leaq 0x399b(%rip), %rsi      # 0xd011
pushq $0x1
popq %r15
movq %rbx, %rdi
movq %r15, %rdx
callq 0x9580
movl $0x1f8, %ebp            # imm = 0x1F8
leaq 0x3982(%rip), %r12      # 0xd013
movl 0x14(%rbx), %eax
andl %ebp, %eax
cmpl $0x1c0, %eax            # imm = 0x1C0
je 0x96ad
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x9580
jmp 0x9691
leaq 0x8(%rsp), %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x9580
xorl %eax, %eax
xorl %edx, %edx
cmpq $0x14, %rdx
je 0x96e4
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
jmp 0x96c1
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 $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x29ac(%rip), %rdx      # 0xd111
leaq 0xa(%rsp), %r15
pushq $0x6
popq %rsi
movq %r15, %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, %r14
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x23f0
pushq $-0x1
popq %rbx
testl %eax, %eax
jne 0xa810
jmp 0xa7fa
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
callq 0x21a0
movl %eax, %ebx
testl %eax, %eax
js 0xa7f6
movl %ebx, %edi
callq 0xa81c
movq 0x18(%r14), %rsi
movl 0x10(%r14), %edx
movl %ebx, %edi
callq 0x2160
testl %eax, %eax
je 0xa802
jns 0xa7f6
callq 0x2390
cmpl $0x73, (%rax)
je 0xa802
addq $0x28, %r14
movq (%r14), %r14
testq %r14, %r14
jne 0xa7b9
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xa810
callq 0x2250
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
andw $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