LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/auth.c
// Function: handle_sasl_result
static int _handle_sasl_result(xmpp_conn_t * const conn,
			       xmpp_stanza_t * const stanza,
			       void * const userdata)
{
    char *name;

    name = xmpp_stanza_get_name(stanza);

    /* the server should send a <success> or <failure> stanza */
    if (strcmp(name, "failure") == 0) {
	xmpp_debug(conn->ctx, "xmpp", "SASL %s auth failed", 
		   (char *)userdata);
	
	/* fall back to next auth method */
	_auth(conn);
    } else if (strcmp(name, "success") == 0) {
	/* SASL PLAIN auth successful, we need to restart the stream */
	xmpp_debug(conn->ctx, "xmpp", "SASL %s auth successful", 
		   (char *)userdata);

	/* reset parser */
	conn_prepare_reset(conn, _handle_open_sasl);

	/* send stream tag */
	conn_open_stream(conn);
    } else {
	/* got unexpected reply */
	xmpp_error(conn->ctx, "xmpp", "Got unexpected reply to SASL %s"\
		   "authentication.", (char *)userdata);
	xmpp_disconnect(conn);
    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xb97a
movq %rax, %r15
leaq 0x9950(%rip), %rsi      # 0xd5a1
movq %rax, %rdi
callq 0x22e0
testl %eax, %eax
je 0x3c96
leaq 0x9959(%rip), %rsi      # 0xd5bd
movq %r15, %rdi
callq 0x22e0
movq 0x8(%rbx), %rdi
leaq 0x93d2(%rip), %rsi      # 0xd049
testl %eax, %eax
je 0x3cbc
leaq 0x995b(%rip), %rdx      # 0xd5dd
movq %r14, %rcx
xorl %eax, %eax
callq 0x536c
movq %rbx, %rdi
callq 0x4edd
jmp 0x3ce4
movq 0x8(%rbx), %rdi
leaq 0x93a8(%rip), %rsi      # 0xd049
leaq 0x9901(%rip), %rdx      # 0xd5a9
movq %r14, %rcx
xorl %eax, %eax
callq 0x5516
movq %rbx, %rdi
callq 0x35a7
jmp 0x3ce4
leaq 0x9902(%rip), %rdx      # 0xd5c5
movq %r14, %rcx
xorl %eax, %eax
callq 0x5516
leaq 0x27b(%rip), %rsi       # 0x3f4f
movq %rbx, %rdi
callq 0x49ac
movq %rbx, %rdi
callq 0x51ab
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/auth.c
// Function: handle_digestmd5_challenge
static int _handle_digestmd5_challenge(xmpp_conn_t * const conn,
			      xmpp_stanza_t * const stanza,
			      void * const userdata)
{
    char *text;
    char *response;
    xmpp_stanza_t *auth, *authdata;
    char *name;

    name = xmpp_stanza_get_name(stanza);
    xmpp_debug(conn->ctx, "xmpp",\
	"handle digest-md5 (challenge) called for %s", name);

    if (strcmp(name, "challenge") == 0) {
	text = xmpp_stanza_get_text(stanza);
	response = sasl_digest_md5(conn->ctx, text, conn->jid, conn->pass);
	if (!response) {
	    disconnect_mem_error(conn);
	    return 0;
	}
	xmpp_free(conn->ctx, text);

	auth = xmpp_stanza_new(conn->ctx);
	if (!auth) {
	    disconnect_mem_error(conn);
	    return 0;
	}	
	xmpp_stanza_set_name(auth, "response");
	xmpp_stanza_set_ns(auth, XMPP_NS_SASL);
	
	authdata = xmpp_stanza_new(conn->ctx);
	if (!authdata) {
	    disconnect_mem_error(conn);
	    return 0;
	}

	xmpp_stanza_set_text(authdata, response);
	xmpp_free(conn->ctx, response);

	xmpp_stanza_add_child(auth, authdata);
	xmpp_stanza_release(authdata);

	handler_add(conn, _handle_digestmd5_rspauth, 
		    XMPP_NS_SASL, NULL, NULL, NULL);

	xmpp_send(conn, auth);
	xmpp_stanza_release(auth);

    } else {
	return _handle_sasl_result(conn, stanza, "DIGEST-MD5");
    }

    /* remove ourselves */
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xb97a
movq %rax, %r15
movq 0x8(%rbx), %rdi
leaq 0x9339(%rip), %rsi      # 0xd049
leaq 0x9ad7(%rip), %rdx      # 0xd7ee
movq %rax, %rcx
xorl %eax, %eax
callq 0x5516
leaq 0xa0b9(%rip), %rsi      # 0xdde1
movq %r15, %rdi
callq 0x22e0
testl %eax, %eax
je 0x3d4b
leaq 0x9776(%rip), %rdx      # 0xd4b1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3c34
jmp 0x3e2e
movq %r14, %rdi
callq 0xbc7c
movq %rax, %r14
movq 0x8(%rbx), %rdi
movq 0x78(%rbx), %rdx
movq 0x80(%rbx), %rcx
movq %rax, %rsi
callq 0x7a38
testq %rax, %rax
je 0x3e26
movq %rax, %r15
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x5263
movq 0x8(%rbx), %rdi
callq 0xb40c
testq %rax, %rax
je 0x3e26
movq %rax, %r14
leaq 0x9a79(%rip), %rsi      # 0xd81a
movq %rax, %rdi
callq 0xb932
leaq 0x96d0(%rip), %rsi      # 0xd480
movq %r14, %rdi
callq 0xba89
movq 0x8(%rbx), %rdi
callq 0xb40c
testq %rax, %rax
je 0x3e26
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0xbac4
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x5263
movq %r14, %rdi
movq %r12, %rsi
callq 0xba98
movq %r12, %rdi
callq 0xb5a8
leaq 0x701(%rip), %rsi       # 0x44fb
leaq 0x967f(%rip), %rdx      # 0xd480
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x648b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5145
movq %r14, %rdi
callq 0xb5a8
jmp 0x3e2e
movq %rbx, %rdi
callq 0xc184
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/auth.c
// Function: handle_legacy
static int _handle_legacy(xmpp_conn_t * const conn,
			  xmpp_stanza_t * const stanza,
			  void * const userdata)
{
    char *type, *name;

    /* delete missing handler */
    xmpp_timed_handler_delete(conn, _handle_missing_legacy);

    /* server responded to legacy auth request */
    type = xmpp_stanza_get_type(stanza);
    name = xmpp_stanza_get_name(stanza);
    if (!type || strcmp(name, "iq") != 0) {
	xmpp_error(conn->ctx, "xmpp", "Server sent us an unexpected response "\
		   "to legacy authentication request.");
	xmpp_disconnect(conn);
    } else if (strcmp(type, "error") == 0) {
	/* legacy client auth failed, no more fallbacks */
	xmpp_error(conn->ctx, "xmpp", "Legacy client authentication failed.");
	xmpp_disconnect(conn);
    } else if (strcmp(type, "result") == 0) {
	/* auth succeeded */
	xmpp_debug(conn->ctx, "xmpp", "Legacy auth succeeded.");

	conn->authenticated = 1;
	conn->conn_handler(conn, XMPP_CONN_CONNECT, 0, NULL, conn->userdata);
    } else {
	xmpp_error(conn->ctx, "xmpp", "Server sent us a legacy authentication "\
		   "response with a bad type.");
	xmpp_disconnect(conn);
    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xd8(%rip), %rsi        # 0x3f26
callq 0x5f99
movq %r15, %rdi
callq 0xbbb5
movq %rax, %r14
movq %r15, %rdi
callq 0xb97a
testq %r14, %r14
je 0x3e7c
cmpb $0x69, (%rax)
jne 0x3e7c
cmpb $0x71, 0x1(%rax)
jne 0x3e7c
cmpb $0x0, 0x2(%rax)
je 0x3ea5
movq 0x8(%rbx), %rdi
leaq 0x91c2(%rip), %rsi      # 0xd049
leaq 0x99bf(%rip), %rdx      # 0xd84d
xorl %eax, %eax
callq 0x536c
movq %rbx, %rdi
callq 0x4edd
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x9d94(%rip), %rsi      # 0xdc40
movq %r14, %rdi
callq 0x22e0
testl %eax, %eax
je 0x3edf
leaq 0x916a(%rip), %rsi      # 0xd029
movq %r14, %rdi
callq 0x22e0
movq 0x8(%rbx), %rdi
leaq 0x9177(%rip), %rsi      # 0xd049
testl %eax, %eax
je 0x3ef3
leaq 0x99f4(%rip), %rdx      # 0xd8d1
jmp 0x3e8e
movq 0x8(%rbx), %rdi
leaq 0x915f(%rip), %rsi      # 0xd049
leaq 0x99a4(%rip), %rdx      # 0xd895
jmp 0x3e8e
leaq 0x99c0(%rip), %rdx      # 0xd8ba
xorl %eax, %eax
callq 0x5516
movl $0x1, 0xd8(%rbx)
movq 0xe8(%rbx), %r8
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq *0xe0(%rbx)
jmp 0x3e9d
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/auth.c
// Function: handle_session
static int _handle_session(xmpp_conn_t * const conn,
			   xmpp_stanza_t * const stanza,
			   void * const userdata)
{
    char *type;

    /* delete missing session handler */
    xmpp_timed_handler_delete(conn, _handle_missing_session);

    /* server has replied to the session request */
    type = xmpp_stanza_get_type(stanza);
    if (type && strcmp(type, "error") == 0) {
	xmpp_error(conn->ctx, "xmpp", "Session establishment failed.");
	xmpp_disconnect(conn);
    } else if (type && strcmp(type, "result") == 0) {
	xmpp_debug(conn->ctx, "xmpp", "Session establishment successful.");

	conn->authenticated = 1;
	
	/* call connection handler */
	conn->conn_handler(conn, XMPP_CONN_CONNECT, 0, NULL, conn->userdata);
    } else {
	xmpp_error(conn->ctx, "xmpp", "Server sent malformed session reply.");
	xmpp_disconnect(conn);
    }

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xb5(%rip), %rsi        # 0x44d2
callq 0x5f99
movq %r14, %rdi
callq 0xbbb5
testq %rax, %rax
je 0x4458
movq %rax, %r14
leaq 0x9807(%rip), %rsi      # 0xdc40
movq %rax, %rdi
callq 0x22e0
testl %eax, %eax
je 0x446c
leaq 0x8bdd(%rip), %rsi      # 0xd029
movq %r14, %rdi
callq 0x22e0
testl %eax, %eax
je 0x4497
movq 0x8(%rbx), %rdi
leaq 0x8be6(%rip), %rsi      # 0xd049
leaq 0x92d5(%rip), %rdx      # 0xd73f
jmp 0x447e
movq 0x8(%rbx), %rdi
leaq 0x8bd2(%rip), %rsi      # 0xd049
leaq 0x9281(%rip), %rdx      # 0xd6ff
xorl %eax, %eax
callq 0x536c
movq %rbx, %rdi
callq 0x4edd
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x8(%rbx), %rdi
leaq 0x8ba7(%rip), %rsi      # 0xd049
leaq 0x9274(%rip), %rdx      # 0xd71d
xorl %eax, %eax
callq 0x5516
movl $0x1, 0xd8(%rbx)
movq 0xe8(%rbx), %r8
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq *0xe0(%rbx)
jmp 0x448d
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/auth.c
// Function: handle_digestmd5_rspauth
static int _handle_digestmd5_rspauth(xmpp_conn_t * const conn,
			      xmpp_stanza_t * const stanza,
			      void * const userdata)
{
    xmpp_stanza_t *auth;
    char *name;

    name = xmpp_stanza_get_name(stanza);
    xmpp_debug(conn->ctx, "xmpp",
	"handle digest-md5 (rspauth) called for %s", name);


    if (strcmp(name, "challenge") == 0) {
	/* assume it's an rspauth response */
	auth = xmpp_stanza_new(conn->ctx);
	if (!auth) {
	    disconnect_mem_error(conn);
	    return 0;
	}	
	xmpp_stanza_set_name(auth, "response");
	xmpp_stanza_set_ns(auth, XMPP_NS_SASL);
	xmpp_send(conn, auth);
	xmpp_stanza_release(auth);
    } else {
	return _handle_sasl_result(conn, stanza, "DIGEST-MD5");
    }

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xb97a
movq %rax, %r15
movq 0x8(%rbx), %rdi
leaq 0x8b2b(%rip), %rsi      # 0xd049
leaq 0x92fe(%rip), %rdx      # 0xd823
xorl %ebp, %ebp
movq %rax, %rcx
xorl %eax, %eax
callq 0x5516
leaq 0x98a9(%rip), %rsi      # 0xdde1
movq %r15, %rdi
callq 0x22e0
testl %eax, %eax
je 0x4558
leaq 0x8f66(%rip), %rdx      # 0xd4b1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3c34
jmp 0x45a9
movq 0x8(%rbx), %rdi
callq 0xb40c
testq %rax, %rax
je 0x45a1
movq %rax, %r14
leaq 0x92aa(%rip), %rsi      # 0xd81a
movq %rax, %rdi
callq 0xb932
leaq 0x8f01(%rip), %rsi      # 0xd480
movq %r14, %rdi
callq 0xba89
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5145
movq %r14, %rdi
callq 0xb5a8
movl $0x1, %ebp
jmp 0x45a9
movq %rbx, %rdi
callq 0xc184
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/conn.c
// Function: handle_stream_start
static void _handle_stream_start(char *name, char **attrs, 
                                 void * const userdata)
{
    xmpp_conn_t *conn = (xmpp_conn_t *)userdata;
    char *id;

    if (strcmp(name, "stream:stream") != 0) {
        printf("name = %s\n", name);
        xmpp_error(conn->ctx, "conn", "Server did not open valid stream.");
        conn_disconnect(conn);
    } else {
        _log_open_tag(conn, attrs);
        
        if (conn->stream_id) xmpp_free(conn->ctx, conn->stream_id);

        id = _get_stream_attribute(attrs, "id");
        if (id)
            conn->stream_id = xmpp_strdup(conn->ctx, id);

        if (!conn->stream_id) {
            xmpp_error(conn->ctx, "conn", "Memory allocation failed.");
            conn_disconnect(conn);
        }
    }
    
    /* call stream open handler */
    conn->open_handler(conn);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x943b(%rip), %rsi      # 0xdbc6
callq 0x22e0
testl %eax, %eax
je 0x47cb
leaq 0x93e3(%rip), %rdi      # 0xdb7e
movq %r15, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x8(%rbx), %rdi
leaq 0x92eb(%rip), %rsi      # 0xda9b
leaq 0x93d2(%rip), %rdx      # 0xdb89
xorl %eax, %eax
callq 0x536c
movq %rbx, %rdi
callq 0x4e5c
jmp 0x48e6
testq %r14, %r14
je 0x4866
leaq 0x93ea(%rip), %rdx      # 0xdbc5
movq %rsp, %rdi
movl $0x1000, %r15d          # imm = 0x1000
movl $0x1000, %esi           # imm = 0x1000
xorl %eax, %eax
callq 0xa765
movslq %eax, %r13
movq (%r14), %rcx
testq %rcx, %rcx
je 0x4832
leaq 0x10(%r14), %rbp
leaq 0x93ce(%rip), %r12      # 0xdbd4
leaq (%rsp,%r13), %rdi
movl $0x1000, %esi           # imm = 0x1000
subq %r13, %rsi
movq -0x8(%rbp), %r8
movq %r12, %rdx
xorl %eax, %eax
callq 0xa765
cltq
addq %rax, %r13
movq (%rbp), %rcx
addq $0x10, %rbp
testq %rcx, %rcx
jne 0x4806
leaq (%rsp,%r13), %rdi
subq %r13, %r15
leaq 0x92cd(%rip), %rdx      # 0xdb0d
movq %r15, %rsi
xorl %eax, %eax
callq 0xa765
movq 0x8(%rbx), %rdi
leaq 0x87f4(%rip), %rsi      # 0xd049
leaq 0x9381(%rip), %rdx      # 0xdbdd
movq %rsp, %rcx
xorl %eax, %eax
callq 0x5516
movq 0x90(%rbx), %rsi
testq %rsi, %rsi
je 0x487b
movq 0x8(%rbx), %rdi
callq 0x5263
testq %r14, %r14
je 0x48da
movq (%r14), %rcx
testq %rcx, %rcx
je 0x48da
xorl %eax, %eax
movzbl (%rcx), %edx
subl $0x69, %edx
jne 0x489f
movzbl 0x1(%rcx), %edx
subl $0x64, %edx
jne 0x489f
movzbl 0x2(%rcx), %edx
negl %edx
testl %edx, %edx
je 0x48b5
movq 0x10(%r14,%rax,8), %rcx
addq $0x2, %rax
testq %rcx, %rcx
jne 0x488a
jmp 0x48da
movl %eax, %eax
shlq $0x3, %rax
orq $0x8, %rax
movq (%r14,%rax), %rsi
testq %rsi, %rsi
je 0x48da
movq 0x8(%rbx), %rdi
callq 0xc0d0
movq %rax, 0x90(%rbx)
jmp 0x48e1
movq 0x90(%rbx), %rax
testq %rax, %rax
je 0x4901
movq %rbx, %rdi
callq *0xd0(%rbx)
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rdi
leaq 0x918f(%rip), %rsi      # 0xda9b
leaq 0x9298(%rip), %rdx      # 0xdbab
jmp 0x47b7
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/conn.c
// Function: handle_stream_stanza
static void _handle_stream_stanza(xmpp_stanza_t *stanza,
                                  void * const userdata)
{
    xmpp_conn_t *conn = (xmpp_conn_t *)userdata;
    char *buf;
    size_t len;

    if (xmpp_stanza_to_text(stanza, &buf, &len) == 0) {
        xmpp_debug(conn->ctx, "xmpp", "RECV: %s", buf);
        xmpp_free(conn->ctx, buf);
    }

    handler_fire_stanza(conn, stanza);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0xb62f
testl %eax, %eax
jne 0x4999
movq 0x8(%r14), %rdi
movq 0x8(%rsp), %rcx
leaq 0x86cc(%rip), %rsi      # 0xd049
leaq 0x9259(%rip), %rdx      # 0xdbdd
xorl %eax, %eax
callq 0x5516
movq 0x8(%r14), %rdi
movq 0x8(%rsp), %rsi
callq 0x5263
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5c50
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/conn.c
// Function: conn_disconnect
void conn_disconnect(xmpp_conn_t * const conn) 
{
    xmpp_debug(conn->ctx, "xmpp", "Closing socket.");
    conn->state = XMPP_STATE_DISCONNECTED;
    if (conn->tls) {
	tls_stop(conn->tls);
	tls_free(conn->tls);
	conn->tls = NULL;
    }
    sock_close(conn->sock);

    /* fire off connection handler */
    conn->conn_handler(conn, XMPP_CONN_DISCONNECT, conn->error,
		       conn->stream_error, conn->userdata);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
leaq 0x81de(%rip), %rsi      # 0xd049
leaq 0x8beb(%rip), %rdx      # 0xda5d
xorl %eax, %eax
callq 0x5516
movl $0x0, 0x14(%rbx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x4e9f
callq 0xc022
movq 0x38(%rbx), %rdi
callq 0xbf20
movq $0x0, 0x38(%rbx)
movl 0x30(%rbx), %edi
callq 0xaab2
movq 0xe0(%rbx), %rax
movl 0x20(%rbx), %edx
movq 0x28(%rbx), %rcx
movq 0xe8(%rbx), %r8
movq %rbx, %rdi
movl $0x1, %esi
popq %rbx
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/conn.c
// Function: xmpp_send_raw_string
void xmpp_send_raw_string(xmpp_conn_t * const conn, 
			  const char * const fmt, ...)
{
    va_list ap;
    size_t len;
    char buf[1024]; /* small buffer for common case */
    char *bigbuf;

    va_start(ap, fmt);
    len = xmpp_vsnprintf(buf, 1024, fmt, ap);
    va_end(ap);

    if (len >= 1024) {
	/* we need more space for this data, so we allocate a big 
	 * enough buffer and print to that */
	len++; /* account for trailing \0 */
	bigbuf = xmpp_alloc(conn->ctx, len);
	if (!bigbuf) {
	    xmpp_debug(conn->ctx, "xmpp", "Could not allocate memory for send_raw_string");
	    return;
	}
	va_start(ap, fmt);
	xmpp_vsnprintf(bigbuf, len, fmt, ap);
	va_end(ap);

	xmpp_debug(conn->ctx, "conn", "SENT: %s", bigbuf);

	/* len - 1 so we don't send trailing \0 */
	xmpp_send_raw(conn, bigbuf, len - 1);

	xmpp_free(conn->ctx, bigbuf);
    } else {
	xmpp_debug(conn->ctx, "conn", "SENT: %s", buf);

	xmpp_send_raw(conn, buf, len);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4d8, %rsp            # imm = 0x4D8
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x20(%rsp), %rbp
movq %rdx, 0x10(%rbp)
movq %rcx, 0x18(%rbp)
movq %r8, 0x20(%rbp)
movq %r9, 0x28(%rbp)
testb %al, %al
je 0x4f78
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rsp, %rcx
movq %rax, (%rcx)
leaq 0x510(%rsp), %rax
movq %rax, 0x8(%rcx)
movq %rbp, 0x10(%rcx)
leaq 0xd0(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x99b0
movslq %eax, %r14
cmpl $0x400, %r14d           # imm = 0x400
jb 0x503f
leaq 0x1(%r14), %r13
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x5251
testq %rax, %rax
je 0x5073
movq %rax, %r12
movq %rsp, %rcx
movq %rbp, 0x10(%rcx)
leaq 0x510(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x99b0
movq 0x8(%rbx), %rdi
leaq 0x8a89(%rip), %rsi      # 0xda9b
leaq 0x8a87(%rip), %rdx      # 0xdaa0
movq %r12, %rcx
xorl %eax, %eax
callq 0x5516
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x509e
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x5263
jmp 0x508c
movq 0x8(%rbx), %rdi
leaq 0x8a51(%rip), %rsi      # 0xda9b
leaq 0x8a4f(%rip), %rdx      # 0xdaa0
leaq 0xd0(%rsp), %r15
movq %r15, %rcx
xorl %eax, %eax
callq 0x5516
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x509e
jmp 0x508c
movq 0x8(%rbx), %rdi
leaq 0x7fcb(%rip), %rsi      # 0xd049
leaq 0x89e8(%rip), %rdx      # 0xda6d
xorl %eax, %eax
callq 0x5516
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/conn.c
// Function: xmpp_send_raw
void xmpp_send_raw(xmpp_conn_t * const conn,
		   const char * const data, const size_t len)
{
    xmpp_send_queue_t *item;

    if (conn->state != XMPP_STATE_CONNECTED) return;

    /* create send queue item for queue */
    item = xmpp_alloc(conn->ctx, sizeof(xmpp_send_queue_t));
    if (!item) return;

    item->data = xmpp_alloc(conn->ctx, len);
    if (!item->data) {
	xmpp_free(conn->ctx, item);
	return;
    }
    memcpy(item->data, data, len);
    item->len = len;
    item->next = NULL;
    item->written = 0;

    /* add item to the send queue */
    if (!conn->send_queue_tail) {
	/* first item, set head and tail */
	conn->send_queue_head = item;
	conn->send_queue_tail = item;
    } else {
	/* add to the tail */
	conn->send_queue_tail->next = item;
	conn->send_queue_tail = item;
    }
    conn->send_queue_len++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x2, 0x14(%rdi)
jne 0x5122
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movl $0x20, %esi
callq 0x5251
testq %rax, %rax
je 0x5122
movq %rax, %r15
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x5251
movq %rax, (%r15)
testq %rax, %rax
je 0x512e
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2050
movq %r14, 0x8(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
movq 0xb0(%rbx), %rax
leaq 0x18(%rax), %rcx
leaq 0xa8(%rbx), %rdx
testq %rax, %rax
cmoveq %rdx, %rcx
movq %r15, (%rcx)
movq %r15, 0xb0(%rbx)
incl 0xa0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x8(%rbx), %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5263
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/conn.c
// Function: xmpp_send
void xmpp_send(xmpp_conn_t * const conn,
	       xmpp_stanza_t * const stanza)
{
    char *buf;
    size_t len;
    int ret;

    if (conn->state == XMPP_STATE_CONNECTED) {
	if ((ret = xmpp_stanza_to_text(stanza, &buf, &len)) == 0) {
	    xmpp_send_raw(conn, buf, len);
	    xmpp_debug(conn->ctx, "conn", "SENT: %s", buf);
	    xmpp_free(conn->ctx, buf);
	}
    }
}

// Assembly:
cmpl $0x2, 0x14(%rdi)
jne 0x51aa
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsp, %rax
leaq 0x8(%rsp), %rdx
movq %rsi, %rdi
movq %rax, %rsi
callq 0xb62f
testl %eax, %eax
jne 0x51a5
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x509e
movq 0x8(%rbx), %rdi
movq (%rsp), %rcx
leaq 0x8911(%rip), %rsi      # 0xda9b
leaq 0x890f(%rip), %rdx      # 0xdaa0
xorl %eax, %eax
callq 0x5516
movq 0x8(%rbx), %rdi
movq (%rsp), %rsi
callq 0x5263
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/ctx.c
// Function: xmpp_log
void xmpp_log(const xmpp_ctx_t * const ctx,
	      const xmpp_log_level_t level,
	      const char * const area,
	      const char * const fmt,
	      va_list ap)
{
    int oldret, ret;
    char smbuf[1024];
    char *buf;
    va_list copy;

    buf = smbuf;
    va_copy(copy, ap);
    ret = xmpp_vsnprintf(buf, 1023, fmt, ap);
    if (ret > 1023) {
	buf = (char *)xmpp_alloc(ctx, ret + 1);
	if (!buf) {
	    buf = NULL;
	    xmpp_error(ctx, "log", "Failed allocating memory for log message.");
            va_end(copy);
	    return;
	}
	oldret = ret;
	ret = xmpp_vsnprintf(buf, ret + 1, fmt, copy);
	if (ret > oldret) {
	    xmpp_error(ctx, "log", "Unexpected error");
	    return;
	}
    } else {
        va_end(copy);
    }

    if (ctx->log->handler)
        ctx->log->handler(ctx->log->userdata, level, area, buf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movq %rcx, %r12
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movq 0x10(%r8), %rax
movq %rax, 0x20(%rsp)
movups (%r8), %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x30(%rsp), %r15
movl $0x3ff, %esi            # imm = 0x3FF
movq %r15, %rdi
movq %rcx, %rdx
movq %r8, %rcx
callq 0x99b0
cmpl $0x400, %eax            # imm = 0x400
jl 0x5326
movl %eax, %r13d
movq %r14, 0x8(%rsp)
leal 0x1(%r13), %r14d
movq (%rbx), %rax
movq 0x18(%rax), %rsi
movq %r14, %rdi
callq *(%rax)
testq %rax, %rax
je 0x5342
movq %rax, %r15
leaq 0x10(%rsp), %rcx
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x99b0
cmpl %r13d, %eax
movq 0x8(%rsp), %r14
jle 0x5326
leaq 0x88ea(%rip), %rsi      # 0xdc07
leaq 0x8911(%rip), %rdx      # 0xdc35
jmp 0x5350
movq 0x8(%rbx), %rcx
movq (%rcx), %rax
testq %rax, %rax
je 0x535a
movq 0x8(%rcx), %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %r15, %rcx
callq *%rax
jmp 0x535a
leaq 0x88be(%rip), %rsi      # 0xdc07
leaq 0x88bb(%rip), %rdx      # 0xdc0b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x536c
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/ctx.c
// Function: xmpp_ctx_new
xmpp_ctx_t *xmpp_ctx_new(const xmpp_mem_t * const mem, 
			 const xmpp_log_t * const log)
{
    xmpp_ctx_t *ctx = NULL;

    if (mem == NULL)
	ctx = xmpp_default_mem.alloc(sizeof(xmpp_ctx_t), NULL);
    else
	ctx = mem->alloc(sizeof(xmpp_ctx_t), mem->userdata);

    if (ctx != NULL) {
	if (mem != NULL) 
	    ctx->mem = mem;
	else 
	    ctx->mem = &xmpp_default_mem;

	if (log == NULL)
	    ctx->log = &xmpp_default_log;
	else
	    ctx->log = log;

	ctx->connlist = NULL;
	ctx->loop_status = XMPP_LOOP_NOTSTARTED;
    }

    return ctx;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rdi, %rdi
je 0x55be
movq 0x18(%r14), %rsi
movl $0x20, %edi
callq *(%r14)
jmp 0x55cb
movl $0x20, %edi
xorl %esi, %esi
callq *0xcc7d(%rip)           # 0x12248
testq %rax, %rax
je 0x5602
testq %r14, %r14
leaq 0xcc6e(%rip), %rcx      # 0x12248
cmovneq %r14, %rcx
testq %rbx, %rbx
leaq 0xccf0(%rip), %rdx      # 0x122d8
cmovneq %rbx, %rdx
movq %rcx, (%rax)
movq %rdx, 0x8(%rax)
movq $0x0, 0x18(%rax)
movl $0x0, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/event.c
// Function: xmpp_run
void xmpp_run(xmpp_ctx_t *ctx)
{
    if (ctx->loop_status != XMPP_LOOP_NOTSTARTED) return;

    ctx->loop_status = XMPP_LOOP_RUNNING;
    while (ctx->loop_status == XMPP_LOOP_RUNNING) {
	xmpp_run_once(ctx, DEFAULT_TIMEOUT);
    }

    xmpp_debug(ctx, "event", "Event loop completed.");
}

// Assembly:
cmpl $0x0, 0x10(%rdi)
je 0x5bf1
retq
pushq %rbx
movq %rdi, %rbx
movl $0x1, 0x10(%rdi)
movl $0x1, %esi
movq %rbx, %rdi
callq 0x5628
cmpl $0x1, 0x10(%rbx)
je 0x5bfc
leaq 0x8149(%rip), %rsi      # 0xdd5f
leaq 0x8148(%rip), %rdx      # 0xdd65
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
jmp 0x5516
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/handler.c
// Function: handler_fire_timed
uint64_t handler_fire_timed(xmpp_ctx_t * const ctx)
{
    xmpp_connlist_t *connitem;
    xmpp_handlist_t *handitem, *temp;
    int ret, fired;
    uint64_t elapsed, min;

    min = (uint64_t)(-1);

    connitem = ctx->connlist;
    while (connitem) {
	if (connitem->conn->state != XMPP_STATE_CONNECTED) {
	    connitem = connitem->next;
	    continue;
	}
	
	/* enable all handlers that were added */
	for (handitem = connitem->conn->timed_handlers; handitem;
	     handitem = handitem->next)
	    handitem->enabled = 1;

	handitem = connitem->conn->timed_handlers;
	while (handitem) {
	    /* skip newly added handlers */
	    if (!handitem->enabled) {
		handitem = handitem->next;
		continue;
	    }

	    /* only fire user handlers after authentication */
	    if (handitem->user_handler && !connitem->conn->authenticated) {
		handitem = handitem->next;
		continue;
	    }

	    fired = 0;
	    elapsed = time_elapsed(handitem->last_stamp, time_stamp());
	    if (elapsed >= handitem->period) {
		/* fire! */
		fired = 1;
		handitem->last_stamp = time_stamp();
		ret = ((xmpp_timed_handler)handitem->handler)(connitem->conn, handitem->userdata);
	    } else if (min > (handitem->period - elapsed))
		min = handitem->period - elapsed;
		
	    temp = handitem;
	    handitem = handitem->next;

	    /* delete handler if it returned false */
	    if (fired && !ret)
		xmpp_timed_handler_delete(connitem->conn, temp->handler);
	}

	connitem = connitem->next;
    }

    return min;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x18(%rdi), %r15
movq $-0x1, %rbx
testq %r15, %r15
je 0x5f8a
movq (%r15), %rax
cmpl $0x2, 0x14(%rax)
je 0x5ed9
movq 0x8(%r15), %r15
jmp 0x5ec1
movq 0xf0(%rax), %rcx
testq %rcx, %rcx
je 0x5ed3
movl $0x1, 0x18(%rcx)
movq 0x20(%rcx), %rcx
testq %rcx, %rcx
jne 0x5ee5
movq 0xf0(%rax), %r14
testq %r14, %r14
je 0x5ed3
movq %r14, %r12
cmpl $0x0, 0x18(%r12)
je 0x5f1f
cmpl $0x0, (%r12)
je 0x5f2b
movq (%r15), %rax
cmpl $0x0, 0xd8(%rax)
jne 0x5f2b
movq 0x20(%r12), %r12
testq %r12, %r12
jne 0x5f04
jmp 0x5ed3
movq 0x30(%r12), %r14
callq 0xc13f
movq %r14, %rdi
movq %rax, %rsi
callq 0xc17d
movq 0x28(%r12), %rcx
subq %rax, %rcx
jbe 0x5f58
cmpq %rcx, %rbx
cmovaeq %rcx, %rbx
movq 0x20(%r12), %r14
jmp 0x5efc
callq 0xc13f
movq %rax, 0x30(%r12)
movq (%r15), %rdi
movq 0x10(%r12), %rsi
callq *0x8(%r12)
movq 0x20(%r12), %r14
testl %eax, %eax
jne 0x5efc
movq (%r15), %rdi
movq 0x8(%r12), %rsi
callq 0x5f99
jmp 0x5efc
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/handler.c
// Function: handler_reset_timed
void handler_reset_timed(xmpp_conn_t *conn, int user_only)
{
    xmpp_handlist_t *handitem;

    handitem = conn->timed_handlers;
    while (handitem) {
	if ((user_only && handitem->user_handler) || !user_only)
	    handitem->last_stamp = time_stamp();
	
	handitem = handitem->next;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0xf0(%rdi), %r14
testq %r14, %r14
je 0x6015
movl %esi, %ebx
testl %ebx, %ebx
je 0x6003
cmpl $0x0, (%r14)
je 0x600c
callq 0xc13f
movq %rax, 0x30(%r14)
movq 0x20(%r14), %r14
testq %r14, %r14
jne 0x5ff9
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/handler.c
// Function: xmpp_id_handler_delete
void xmpp_id_handler_delete(xmpp_conn_t * const conn,
			    xmpp_handler handler,
			    const char * const id)
{
    xmpp_handlist_t *item, *prev;

    prev = NULL;
    item = (xmpp_handlist_t *)hash_get(conn->id_handlers, id);
    if (!item) return;

    while (item) {
	if (item->handler == (void *)handler)
	    break;

	prev = item;
	item = item->next;
    }

    if (item) {
	if (prev)
	    prev->next = item->next;
	else {
	    hash_drop(conn->id_handlers, id);
	    hash_add(conn->id_handlers, id, item->next);
	}
	xmpp_free(conn->ctx, item->id);
	xmpp_free(conn->ctx, item);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0xf8(%rdi), %rdi
movq %rdx, %rsi
callq 0x6766
testq %rax, %rax
je 0x605f
movq %rax, %r14
cmpq %r12, 0x8(%rax)
je 0x606b
movq %r14, %rax
movq 0x20(%r14), %r14
testq %r14, %r14
je 0x605f
cmpq %r12, 0x8(%r14)
jne 0x604b
jmp 0x606d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %eax, %eax
testq %rax, %rax
je 0x607c
movq 0x20(%r14), %rcx
movq %rcx, 0x20(%rax)
jmp 0x609e
movq 0xf8(%rbx), %rdi
movq %r15, %rsi
callq 0x6688
movq 0xf8(%rbx), %rdi
movq 0x20(%r14), %rdx
movq %r15, %rsi
callq 0x65bd
movq 0x8(%rbx), %rdi
movq 0x28(%r14), %rsi
callq 0x5263
movq 0x8(%rbx), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5263
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/handler.c
// Function: xmpp_handler_delete
void xmpp_handler_delete(xmpp_conn_t * const conn,
			 xmpp_handler handler)
{
    xmpp_handlist_t *prev, *item;

    if (!conn->handlers) return;

    prev = NULL;
    item = conn->handlers;
    while (item) {
	if (item->handler == (void *)handler)
	    break;
	
	prev = item;
	item = item->next;
    }

    if (item) {
	if (prev)
	    prev->next = item->next;
	else
	    conn->handlers = item->next;

	if (item->ns) xmpp_free(conn->ctx, item->ns);
	if (item->name) xmpp_free(conn->ctx, item->name);
	if (item->type) xmpp_free(conn->ctx, item->type);
	xmpp_free(conn->ctx, item);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x100(%rdi), %r14
testq %r14, %r14
je 0x60ef
movq %rdi, %rbx
cmpq %rsi, 0x8(%r14)
je 0x60f7
movq %r14, %rax
movq 0x20(%r14), %r14
testq %r14, %r14
je 0x60ef
cmpq %rsi, 0x8(%r14)
jne 0x60db
jmp 0x60f9
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
leaq 0x100(%rbx), %rcx
leaq 0x20(%rax), %rdx
testq %rax, %rax
cmoveq %rcx, %rdx
movq 0x20(%r14), %rax
movq %rax, (%rdx)
movq 0x28(%r14), %rsi
testq %rsi, %rsi
je 0x6124
movq 0x8(%rbx), %rdi
callq 0x5263
movq 0x30(%r14), %rsi
testq %rsi, %rsi
je 0x6136
movq 0x8(%rbx), %rdi
callq 0x5263
movq 0x38(%r14), %rsi
testq %rsi, %rsi
je 0x6148
movq 0x8(%rbx), %rdi
callq 0x5263
movq 0x8(%rbx), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5263
// File: /workspace/github_c_makefile_star2_O3/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, %r12
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
movq 0xf0(%rdi), %rax
testq %rax, %rax
je 0x6195
cmpq %r13, 0x8(%rax)
je 0x61f3
movq 0x20(%rax), %rax
jmp 0x6184
movq 0x8(%rbx), %rdi
movl $0x40, %esi
callq 0x5251
testq %rax, %rax
je 0x61f3
movq %rax, %r15
addq $0xf0, %rbx
movl %ebp, (%rax)
movq %r13, 0x8(%rax)
movq %r12, 0x10(%rax)
movl $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
movq %r14, 0x28(%rax)
callq 0xc13f
movq %rax, 0x30(%r15)
movq (%rbx), %rax
testq %rax, %rax
je 0x61f0
movq %rax, %rbx
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0x61e0
addq $0x20, %rbx
movq %r15, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/liuhaotian[P]xmppsh/libstrophe/src/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 0x6766
testq %rax, %rax
je 0x624c
cmpq %r13, 0x8(%rax)
je 0x62b4
movq 0x20(%rax), %rax
jmp 0x623b
movq 0x8(%r14), %rdi
movl $0x40, %esi
callq 0x5251
testq %rax, %rax
je 0x62b4
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 0xc0d0
movq %rax, 0x28(%r15)
testq %rax, %rax
je 0x62c3
movq 0xf8(%r14), %rdi
movq %rbx, %rsi
callq 0x6766
testq %rax, %rax
je 0x62dd
movq %rax, %rcx
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0x62a4
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 0x5263
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 0x65bd
// File: /workspace/github_c_makefile_star2_O3/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 0x5251
testq %rax, %rax
je 0x650b
movq %rax, %rbx
movslq %ebp, %r12
shlq $0x3, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x5251
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x6500
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 0x650d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5263
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x6540
decl %eax
movl %eax, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8(%rbx), %r14
movl 0x18(%rbx), %eax
testl %eax, %eax
jle 0x659d
xorl %r12d, %r12d
movq 0x20(%rbx), %rcx
movq (%rcx,%r12,8), %r15
testq %r15, %r15
je 0x6592
movq (%r15), %r13
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x5263
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x657c
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq *%rax
movq %r14, %rdi
movq %r15, %rsi
callq 0x5263
movq %r13, %r15
testq %r13, %r13
jne 0x655b
movl 0x18(%rbx), %eax
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x654e
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x5263
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5263
// File: /workspace/github_c_makefile_star2_O3/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 0x6607
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 0x65e9
jmp 0x6609
xorl %eax, %eax
cltd
idivl 0x18(%rbx)
movl %edx, %ebp
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6688
movl $0x18, %esi
movq %r15, %rdi
callq 0x5251
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x6676
movq %rax, %r14
movq %r15, %rdi
movq %r12, %rsi
callq 0xc0d0
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x666b
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 0x6676
movq %r15, %rdi
movq %r14, %rsi
callq 0x5263
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_O3/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 0x66c9
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 0x66ab
jmp 0x66cb
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 0x6752
movq %rcx, %rbp
movq 0x8(%r12), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x22e0
movq %r12, %rcx
testl %eax, %eax
jne 0x66e7
movq (%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x5263
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x672c
movq 0x10(%r12), %rsi
movq %r14, %rdi
callq *%rax
movq (%r12), %rax
testq %rbp, %rbp
jne 0x673c
addq 0x20(%rbx), %r15
movq %r15, %rbp
movq %rax, (%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x5263
decl 0x1c(%rbx)
xorl %eax, %eax
jmp 0x6757
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_O3/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 0x67a0
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 0x6780
jmp 0x67a2
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 0x67d0
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x22e0
testl %eax, %eax
jne 0x67b4
movq 0x10(%r15), %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5251
testq %rax, %rax
je 0x680f
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_O3/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 0x682c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x651f
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5263
// File: /workspace/github_c_makefile_star2_O3/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), %rax
movq 0x10(%rdi), %rdx
movl 0x18(%rdi), %ecx
incl %ecx
testq %rdx, %rdx
je 0x6862
movq (%rdx), %rsi
testq %rsi, %rsi
je 0x6862
movl 0x18(%rax), %edx
jmp 0x688c
movl 0x18(%rax), %edx
cmpl %edx, %ecx
jge 0x6899
movslq %ecx, %r8
shlq $0x3, %r8
addq 0x20(%rax), %r8
xorl %eax, %eax
movq (%r8), %rsi
testq %rsi, %rsi
jne 0x6889
incl %ecx
addq $0x8, %r8
cmpl %ecx, %edx
jne 0x6876
retq
movl %ecx, 0x18(%rdi)
cmpl %edx, %ecx
jge 0x6899
movq %rsi, 0x10(%rdi)
movq 0x8(%rsi), %rax
retq
xorl %eax, %eax
retq