LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/zpole[P]IICV/src/generic-driver.h
// Function: vl_file_meta_open
static int
vl_file_meta_open (VlFileMeta * self, char const * basename, char const * mode)
{
  vl_size q ;

  if (! self->active) {
    return VL_ERR_OK ;
  }

  q = vl_string_replace_wildcard (self->name,
                                  sizeof(self->name),
                                  self -> pattern,
                                  '%', '\0',
                                  basename) ;

  if (q >= sizeof(self->name)) {
    return vl_set_last_error (VL_ERR_OVERFLOW, NULL) ;
  }

  if (self->active) {
    self->file = fopen (self->name, mode) ;
    if (! self->file) {
      return vl_set_last_error(VL_ERR_IO, NULL) ;
    }
  }
  return 0 ;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, (%rdi)
je 0x25eb
movq %rsi, %r9
movq %rdi, %rbx
leaq 0x408(%rdi), %r14
leaq 0x4(%rdi), %rdx
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
movl $0x25, %ecx
xorl %r8d, %r8d
callq 0x1190
movl $0x1, %edi
cmpq $0x3ff, %rax            # imm = 0x3FF
jbe 0x25cb
xorl %esi, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1050
cmpl $0x0, (%rbx)
je 0x25eb
leaq 0x28d9(%rip), %rsi      # 0x4eb0
movq %r14, %rdi
callq 0x11c0
movq %rax, 0x808(%rbx)
testq %rax, %rax
je 0x25f5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x4, %edi
jmp 0x25bb
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/xmppsh.c
// Function: version_handler
int version_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata)
{
	xmpp_stanza_t *reply, *query, *name, *version, *text;
	char *ns;
	xmpp_ctx_t *ctx = (xmpp_ctx_t*)userdata;
	printf("Received version request from %s\n", xmpp_stanza_get_attribute(stanza, "from"));
	
	reply = xmpp_stanza_new(ctx);
	xmpp_stanza_set_name(reply, "iq");
	xmpp_stanza_set_type(reply, "result");
	xmpp_stanza_set_id(reply, xmpp_stanza_get_id(stanza));
	xmpp_stanza_set_attribute(reply, "to", xmpp_stanza_get_attribute(stanza, "from"));
	
	query = xmpp_stanza_new(ctx);
	xmpp_stanza_set_name(query, "query");
    ns = xmpp_stanza_get_ns(xmpp_stanza_get_children(stanza));
    if (ns) {
        xmpp_stanza_set_ns(query, ns);
    }

	name = xmpp_stanza_new(ctx);
	xmpp_stanza_set_name(name, "name");
	xmpp_stanza_add_child(query, name);
	
	text = xmpp_stanza_new(ctx);
	xmpp_stanza_set_text(text, "XMPPsh");
	xmpp_stanza_add_child(name, text);
	
	version = xmpp_stanza_new(ctx);
	xmpp_stanza_set_name(version, "version");
	xmpp_stanza_add_child(query, version);
	
	text = xmpp_stanza_new(ctx);
	xmpp_stanza_set_text(text, "1.0");
	xmpp_stanza_add_child(version, text);
	
	xmpp_stanza_add_child(reply, query);

	xmpp_send(conn, reply);
	xmpp_stanza_release(reply);
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
leaq 0xacd3(%rip), %r12      # 0xd33a
movq %rsi, %rdi
movq %r12, %rsi
callq 0xbef9
leaq 0xa98b(%rip), %rdi      # 0xd004
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
movq %r15, %rdi
callq 0xb5a0
movq %rax, %r14
leaq 0xa991(%rip), %rsi      # 0xd026
movq %rax, %rdi
callq 0xbac6
leaq 0xa985(%rip), %rsi      # 0xd029
movq %r14, %rdi
callq 0xbeea
movq %r13, %rdi
callq 0xbd0d
movq %r14, %rdi
movq %rax, %rsi
callq 0xbedb
movq %r13, %rdi
movq %r12, %rsi
callq 0xbef9
leaq 0xa95f(%rip), %rsi      # 0xd030
movq %r14, %rdi
movq %rax, %rdx
callq 0xbbb0
movq %r15, %rdi
callq 0xb5a0
movq %rax, %r12
leaq 0xa945(%rip), %rsi      # 0xd033
movq %rax, %rdi
callq 0xbac6
movq %r13, %rdi
callq 0xbe02
movq %rax, %rdi
callq 0xbd2b
testq %rax, %rax
je 0x2716
movq %r12, %rdi
movq %rax, %rsi
callq 0xbc1d
movq %r15, %rdi
callq 0xb5a0
movq %rax, %r13
leaq 0xaded(%rip), %rsi      # 0xd515
movq %rax, %rdi
callq 0xbac6
movq %r12, %rdi
movq %r13, %rsi
callq 0xbc2c
movq %r15, %rdi
callq 0xb5a0
movq %rax, %rbp
leaq 0xa8ec(%rip), %rsi      # 0xd039
movq %rax, %rdi
callq 0xbc58
movq %r13, %rdi
movq %rbp, %rsi
callq 0xbc2c
movq %r15, %rdi
callq 0xb5a0
movq %rax, %r13
leaq 0xacbe(%rip), %rsi      # 0xd430
movq %rax, %rdi
callq 0xbac6
movq %r12, %rdi
movq %r13, %rsi
callq 0xbc2c
movq %r15, %rdi
callq 0xb5a0
movq %rax, %r15
leaq 0xa8a9(%rip), %rsi      # 0xd040
movq %rax, %rdi
callq 0xbc58
movq %r13, %rdi
movq %r15, %rsi
callq 0xbc2c
movq %r14, %rdi
movq %r12, %rsi
callq 0xbc2c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5174
movq %r14, %rdi
callq 0xb73c
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/xmppsh.c
// Function: ping_handler
int ping_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata)
{
	//printf("get the ping\n");
	xmpp_stanza_t *reply;
	xmpp_ctx_t *ctx = (xmpp_ctx_t*)userdata;

	reply = xmpp_stanza_new(ctx);
	xmpp_stanza_set_name(reply, "iq");
	xmpp_stanza_set_type(reply, "result");
	xmpp_stanza_set_id(reply, xmpp_stanza_get_id(stanza));
	xmpp_stanza_set_attribute(reply, "to", xmpp_stanza_get_attribute(stanza, "from"));

	xmpp_send(conn, reply);
	xmpp_stanza_release(reply);
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, %rdi
callq 0xb5a0
movq %rax, %r14
leaq 0xa82d(%rip), %rsi      # 0xd026
movq %rax, %rdi
callq 0xbac6
leaq 0xa821(%rip), %rsi      # 0xd029
movq %r14, %rdi
callq 0xbeea
movq %r15, %rdi
callq 0xbd0d
movq %r14, %rdi
movq %rax, %rsi
callq 0xbedb
leaq 0xab10(%rip), %rsi      # 0xd33a
movq %r15, %rdi
callq 0xbef9
leaq 0xa7f7(%rip), %rsi      # 0xd030
movq %r14, %rdi
movq %rax, %rdx
callq 0xbbb0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5174
movq %r14, %rdi
callq 0xb73c
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/auth.c
// Function: auth_handle_open
void auth_handle_open(xmpp_conn_t * const conn)
{
    /* reset all timed handlers */
    handler_reset_timed(conn, 0);

    /* setup handler for stream:error */
    handler_add(conn, _handle_error,
		NULL, "stream:error", NULL, NULL);

    /* setup handlers for incoming <stream:features> */
    handler_add(conn, _handle_features,
		NULL, "stream:features", NULL, NULL);
    handler_add_timed(conn, _handle_missing_features,
		      FEATURES_TIMEOUT, NULL);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0x6029
leaq 0x4c(%rip), %rsi        # 0x2f6e
leaq 0xa346(%rip), %rcx      # 0xd26f
movq %rbx, %rdi
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x64cd
leaq 0x4ec(%rip), %rsi       # 0x342c
leaq 0xa335(%rip), %rcx      # 0xd27c
movq %rbx, %rdi
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x64cd
leaq 0x63d(%rip), %rsi       # 0x359b
movl $0x3a98, %edx           # imm = 0x3A98
movq %rbx, %rdi
xorl %ecx, %ecx
popq %rbx
jmp 0x6244
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/auth.c
// Function: handle_features
static int _handle_features(xmpp_conn_t * const conn,
			    xmpp_stanza_t * const stanza,
			    void * const userdata)
{
    xmpp_stanza_t *child, *mech;
    char *text;

    /* remove the handler that detects missing stream:features */
    xmpp_timed_handler_delete(conn, _handle_missing_features);

    /* check for TLS */
    if (!conn->secured) {
        child = xmpp_stanza_get_child_by_name(stanza, "starttls");
        if (child && (strcmp(xmpp_stanza_get_ns(child), XMPP_NS_TLS) == 0))
            conn->tls_support = 1;
    }

    /* check for SASL */
    child = xmpp_stanza_get_child_by_name(stanza, "mechanisms");
    if (child && (strcmp(xmpp_stanza_get_ns(child), XMPP_NS_SASL) == 0)) {
	for (mech = xmpp_stanza_get_children(child); mech; 
	     mech = xmpp_stanza_get_next(mech)) {
	    if (strcmp(xmpp_stanza_get_name(mech), "mechanism") == 0) {
		text = xmpp_stanza_get_text(mech);
		if (strcasecmp(text, "PLAIN") == 0)
		    conn->sasl_support |= SASL_MASK_PLAIN;
		else if (strcasecmp(text, "DIGEST-MD5") == 0)
		    conn->sasl_support |= SASL_MASK_DIGESTMD5;
		else if (strcasecmp(text, "ANONYMOUS") == 0)
		    conn->sasl_support |= SASL_MASK_ANONYMOUS;

		xmpp_free(conn->ctx, text);
	    }
	}
    }

    _auth(conn);
 
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x157(%rip), %rsi       # 0x359b
callq 0x5fdb
cmpl $0x0, 0x4c(%rbx)
je 0x3558
leaq 0xa01b(%rip), %rsi      # 0xd475
movq %r14, %rdi
callq 0xbd67
testq %rax, %rax
je 0x353f
movq %rax, %r14
movq %rax, %rdi
callq 0xbd2b
leaq 0xa003(%rip), %rsi      # 0xd480
movq %rax, %rdi
callq 0x22e0
testl %eax, %eax
jne 0x353f
movq %r14, %rdi
callq 0xbe02
testq %rax, %rax
je 0x353f
movq %rax, %r14
leaq 0x9ff9(%rip), %r15      # 0xd4a1
leaq 0x9ffc(%rip), %r12      # 0xd4ab
leaq 0x9ffb(%rip), %r13      # 0xd4b1
movq %r14, %rdi
callq 0xbb0e
movq %rax, %rdi
movq %r15, %rsi
callq 0x22e0
testl %eax, %eax
jne 0x352b
movq %r14, %rdi
callq 0xbe0c
movq %rax, %rbp
movq %rax, %rdi
movq %r12, %rsi
callq 0x22d0
testl %eax, %eax
je 0x3510
movq %rbp, %rdi
movq %r13, %rsi
callq 0x22d0
testl %eax, %eax
je 0x3517
movq %rbp, %rdi
leaq 0x9fbc(%rip), %rsi      # 0xd4bc
callq 0x22d0
testl %eax, %eax
jne 0x351f
movl $0x4, %eax
jmp 0x351c
movl $0x1, %eax
jmp 0x351c
movl $0x2, %eax
orl %eax, 0x48(%rbx)
movq 0x8(%rbx), %rdi
movq %rbp, %rsi
callq 0x5293
movq %r14, %rdi
callq 0xbe07
movq %rax, %r14
testq %rax, %rax
jne 0x34b6
movq %rbx, %rdi
callq 0x35c4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9eed(%rip), %rsi      # 0xd44c
movq %r14, %rdi
callq 0xbd67
testq %rax, %rax
je 0x3453
movq %rax, %rdi
callq 0xbd2b
leaq 0x9ed6(%rip), %rsi      # 0xd455
movq %rax, %rdi
callq 0x22e0
testl %eax, %eax
jne 0x3453
movl $0x1, 0x40(%rbx)
jmp 0x3453
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/auth.c
// Function: handle_proceedtls_default
static int _handle_proceedtls_default(xmpp_conn_t * const conn,
			      xmpp_stanza_t * const stanza,
			      void * const userdata)
{
    char *name;
    name = xmpp_stanza_get_name(stanza);
    xmpp_debug(conn->ctx, "xmpp", 
	"handle proceedtls called for %s", name);

    if (strcmp(name, "proceed") == 0) {
        xmpp_debug(conn->ctx, "xmpp", "proceeding with TLS");

	conn->tls = tls_new(conn->ctx, conn->sock);

	if (!tls_start(conn->tls))
	{
	    xmpp_debug(conn->ctx, "xmpp", "Couldn't start TLS! error %d", tls_error(conn->tls));
	    tls_free(conn->tls);
	    conn->tls = NULL;
	    conn->tls_failed = 1;
	
	    /* failed tls spoils the connection, so disconnect */
	    xmpp_disconnect(conn);
	}
	else
	{
            conn->secured = 1;
            conn_prepare_reset(conn, auth_handle_open);

	    conn_open_stream(conn);
	}
    }

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xbb0e
movq %rax, %r14
movq 0x8(%rbx), %rdi
leaq 0x9510(%rip), %rsi      # 0xd049
leaq 0x9a08(%rip), %rdx      # 0xd548
movq %rax, %rcx
xorl %eax, %eax
callq 0x5546
leaq 0x9a17(%rip), %rsi      # 0xd568
movq %r14, %rdi
callq 0x22e0
testl %eax, %eax
jne 0x3bfd
movq 0x8(%rbx), %rdi
leaq 0x94dd(%rip), %rsi      # 0xd049
leaq 0x99fd(%rip), %rdx      # 0xd570
xorl %eax, %eax
callq 0x5546
movq 0x8(%rbx), %rdi
movl 0x30(%rbx), %esi
callq 0xc004
movq %rax, 0x38(%rbx)
movq %rax, %rdi
callq 0xc0db
testl %eax, %eax
je 0x3bb6
movl $0x1, 0x4c(%rbx)
leaq -0xc94(%rip), %rsi      # 0x2f10
movq %rbx, %rdi
callq 0x49de
movq %rbx, %rdi
callq 0x51da
jmp 0x3bfd
movq 0x8(%rbx), %r14
movq 0x38(%rbx), %rdi
callq 0xc000
leaq 0x947f(%rip), %rsi      # 0xd049
leaq 0x99b3(%rip), %rdx      # 0xd584
movq %r14, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0x5546
movq 0x38(%rbx), %rdi
callq 0xc0b3
movq $0x0, 0x38(%rbx)
movl $0x1, 0x44(%rbx)
movq %rbx, %rdi
callq 0x4f0c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/auth.c
// Function: make_sasl_auth
static xmpp_stanza_t *_make_sasl_auth(xmpp_conn_t * const conn,
				 const char * const mechanism)
{
    xmpp_stanza_t *auth;

    /* build auth stanza */
    auth = xmpp_stanza_new(conn->ctx);
    if (auth) {
	xmpp_stanza_set_name(auth, "auth");
	xmpp_stanza_set_ns(auth, XMPP_NS_SASL);
	xmpp_stanza_set_attribute(auth, "mechanism", mechanism);
    }
    
    return auth;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x8(%rdi), %rdi
callq 0xb5a0
movq %rax, %r14
testq %rax, %rax
je 0x3c4f
leaq 0x98e6(%rip), %rsi      # 0xd50c
movq %r14, %rdi
callq 0xbac6
leaq 0x984b(%rip), %rsi      # 0xd480
movq %r14, %rdi
callq 0xbc1d
leaq 0x985d(%rip), %rsi      # 0xd4a1
movq %r14, %rdi
movq %rbx, %rdx
callq 0xbbb0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xbb0e
movq %rax, %r15
leaq 0x992a(%rip), %rsi      # 0xd5a1
movq %rax, %rdi
callq 0x22e0
testl %eax, %eax
je 0x3cbc
leaq 0x9933(%rip), %rsi      # 0xd5bd
movq %r15, %rdi
callq 0x22e0
movq 0x8(%rbx), %rdi
leaq 0x93ac(%rip), %rsi      # 0xd049
testl %eax, %eax
je 0x3ce2
leaq 0x9935(%rip), %rdx      # 0xd5dd
movq %r14, %rcx
xorl %eax, %eax
callq 0x539c
movq %rbx, %rdi
callq 0x4f0c
jmp 0x3d0a
movq 0x8(%rbx), %rdi
leaq 0x9382(%rip), %rsi      # 0xd049
leaq 0x98db(%rip), %rdx      # 0xd5a9
movq %r14, %rcx
xorl %eax, %eax
callq 0x5546
movq %rbx, %rdi
callq 0x35c4
jmp 0x3d0a
leaq 0x98dc(%rip), %rdx      # 0xd5c5
movq %r14, %rcx
xorl %eax, %eax
callq 0x5546
leaq 0x27d(%rip), %rsi       # 0x3f77
movq %rbx, %rdi
callq 0x49de
movq %rbx, %rdi
callq 0x51da
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xbb0e
movq %rax, %r15
movq 0x8(%rbx), %rdi
leaq 0x9313(%rip), %rsi      # 0xd049
leaq 0x9ab1(%rip), %rdx      # 0xd7ee
movq %rax, %rcx
xorl %eax, %eax
callq 0x5546
leaq 0xa093(%rip), %rsi      # 0xdde1
movq %r15, %rdi
callq 0x22e0
testl %eax, %eax
je 0x3d71
leaq 0x9750(%rip), %rdx      # 0xd4b1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3c5a
jmp 0x3e54
movq %r14, %rdi
callq 0xbe0c
movq %rax, %r14
movq 0x8(%rbx), %rdi
movq 0x78(%rbx), %rdx
movq 0x80(%rbx), %rcx
movq %rax, %rsi
callq 0x7b34
testq %rax, %rax
je 0x3e4c
movq %rax, %r15
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x5293
movq 0x8(%rbx), %rdi
callq 0xb5a0
testq %rax, %rax
je 0x3e4c
movq %rax, %r14
leaq 0x9a53(%rip), %rsi      # 0xd81a
movq %rax, %rdi
callq 0xbac6
leaq 0x96aa(%rip), %rsi      # 0xd480
movq %r14, %rdi
callq 0xbc1d
movq 0x8(%rbx), %rdi
callq 0xb5a0
testq %rax, %rax
je 0x3e4c
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0xbc58
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x5293
movq %r14, %rdi
movq %r12, %rsi
callq 0xbc2c
movq %r12, %rdi
callq 0xb73c
leaq 0x717(%rip), %rsi       # 0x4537
leaq 0x9659(%rip), %rdx      # 0xd480
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x64cd
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5174
movq %r14, %rdi
callq 0xb73c
jmp 0x3e54
movq %rbx, %rdi
callq 0xc305
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xda(%rip), %rsi        # 0x3f4e
callq 0x5fdb
movq %r15, %rdi
callq 0xbd49
movq %rax, %r14
movq %r15, %rdi
callq 0xbb0e
testq %r14, %r14
je 0x3ea4
leaq 0x918e(%rip), %rsi      # 0xd026
movq %rax, %rdi
callq 0x22e0
testl %eax, %eax
je 0x3ecd
movq 0x8(%rbx), %rdi
leaq 0x919a(%rip), %rsi      # 0xd049
leaq 0x9997(%rip), %rdx      # 0xd84d
xorl %eax, %eax
callq 0x539c
movq %rbx, %rdi
callq 0x4f0c
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x9d6c(%rip), %rsi      # 0xdc40
movq %r14, %rdi
callq 0x22e0
testl %eax, %eax
je 0x3f07
leaq 0x9142(%rip), %rsi      # 0xd029
movq %r14, %rdi
callq 0x22e0
movq 0x8(%rbx), %rdi
leaq 0x914f(%rip), %rsi      # 0xd049
testl %eax, %eax
je 0x3f1b
leaq 0x99cc(%rip), %rdx      # 0xd8d1
jmp 0x3eb6
movq 0x8(%rbx), %rdi
leaq 0x9137(%rip), %rsi      # 0xd049
leaq 0x997c(%rip), %rdx      # 0xd895
jmp 0x3eb6
leaq 0x9998(%rip), %rdx      # 0xd8ba
xorl %eax, %eax
callq 0x5546
movl $0x1, 0xd8(%rbx)
movq 0xe8(%rbx), %r8
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq *0xe0(%rbx)
jmp 0x3ec5
// File: /workspace/github_c_makefile_star2_O1/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        # 0x450e
callq 0x5fdb
movq %r14, %rdi
callq 0xbd49
testq %rax, %rax
je 0x4494
movq %rax, %r14
leaq 0x97cb(%rip), %rsi      # 0xdc40
movq %rax, %rdi
callq 0x22e0
testl %eax, %eax
je 0x44a8
leaq 0x8ba1(%rip), %rsi      # 0xd029
movq %r14, %rdi
callq 0x22e0
testl %eax, %eax
je 0x44d3
movq 0x8(%rbx), %rdi
leaq 0x8baa(%rip), %rsi      # 0xd049
leaq 0x9299(%rip), %rdx      # 0xd73f
jmp 0x44ba
movq 0x8(%rbx), %rdi
leaq 0x8b96(%rip), %rsi      # 0xd049
leaq 0x9245(%rip), %rdx      # 0xd6ff
xorl %eax, %eax
callq 0x539c
movq %rbx, %rdi
callq 0x4f0c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x8(%rbx), %rdi
leaq 0x8b6b(%rip), %rsi      # 0xd049
leaq 0x9238(%rip), %rdx      # 0xd71d
xorl %eax, %eax
callq 0x5546
movl $0x1, 0xd8(%rbx)
movq 0xe8(%rbx), %r8
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq *0xe0(%rbx)
jmp 0x44c9
// File: /workspace/github_c_makefile_star2_O1/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 0xbb0e
movq %rax, %r15
movq 0x8(%rbx), %rdi
leaq 0x8aef(%rip), %rsi      # 0xd049
leaq 0x92c2(%rip), %rdx      # 0xd823
xorl %ebp, %ebp
movq %rax, %rcx
xorl %eax, %eax
callq 0x5546
leaq 0x986d(%rip), %rsi      # 0xdde1
movq %r15, %rdi
callq 0x22e0
testl %eax, %eax
je 0x4594
leaq 0x8f2a(%rip), %rdx      # 0xd4b1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3c5a
jmp 0x45e5
movq 0x8(%rbx), %rdi
callq 0xb5a0
testq %rax, %rax
je 0x45dd
movq %rax, %r14
leaq 0x926e(%rip), %rsi      # 0xd81a
movq %rax, %rdi
callq 0xbac6
leaq 0x8ec5(%rip), %rsi      # 0xd480
movq %r14, %rdi
callq 0xbc1d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5174
movq %r14, %rdi
callq 0xb73c
movl $0x1, %ebp
jmp 0x45e5
movq %rbx, %rdi
callq 0xc305
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/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 0x93ff(%rip), %rsi      # 0xdbc6
callq 0x22e0
testl %eax, %eax
je 0x4807
leaq 0x93a7(%rip), %rdi      # 0xdb7e
movq %r15, %rsi
xorl %eax, %eax
callq 0x2030
leaq 0x93a1(%rip), %rdx      # 0xdb89
movq 0x8(%rbx), %rdi
leaq 0x92a8(%rip), %rsi      # 0xda9b
xorl %eax, %eax
callq 0x539c
movq %rbx, %rdi
callq 0x4e8b
jmp 0x4923
testq %r14, %r14
je 0x48a2
leaq 0x93ae(%rip), %rdx      # 0xdbc5
movq %rsp, %rdi
movl $0x1000, %r15d          # imm = 0x1000
movl $0x1000, %esi           # imm = 0x1000
xorl %eax, %eax
callq 0xa930
movslq %eax, %r13
movq (%r14), %rcx
testq %rcx, %rcx
je 0x486e
leaq 0x10(%r14), %rbp
leaq 0x9392(%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 0xa930
cltq
addq %rax, %r13
movq (%rbp), %rcx
addq $0x10, %rbp
testq %rcx, %rcx
jne 0x4842
leaq (%rsp,%r13), %rdi
subq %r13, %r15
leaq 0x9291(%rip), %rdx      # 0xdb0d
movq %r15, %rsi
xorl %eax, %eax
callq 0xa930
movq 0x8(%rbx), %rdi
leaq 0x87b8(%rip), %rsi      # 0xd049
leaq 0x9345(%rip), %rdx      # 0xdbdd
movq %rsp, %rcx
xorl %eax, %eax
callq 0x5546
movq 0x90(%rbx), %rsi
testq %rsi, %rsi
je 0x48b7
movq 0x8(%rbx), %rdi
callq 0x5293
testq %r14, %r14
je 0x48ed
movq (%r14), %rsi
testq %rsi, %rsi
je 0x48ed
xorl %r15d, %r15d
leaq 0x8a79(%rip), %r12      # 0xd347
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x22e0
testl %eax, %eax
je 0x48f2
movq 0x10(%r14,%r13,8), %rsi
addq $0x2, %r13
testq %rsi, %rsi
jne 0x48d1
jmp 0x4901
xorl %r15d, %r15d
jmp 0x4901
movl %r13d, %eax
shlq $0x3, %rax
orq $0x8, %rax
movq (%r14,%rax), %r15
testq %r15, %r15
je 0x4919
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0xc264
movq %rax, 0x90(%rbx)
cmpq $0x0, 0x90(%rbx)
je 0x493e
movq %rbx, %rdi
callq *0xd0(%rbx)
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9266(%rip), %rdx      # 0xdbab
jmp 0x47e8
// File: /workspace/github_c_makefile_star2_O1/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 0xb7c3
testl %eax, %eax
jne 0x49cb
movq 0x8(%r14), %rdi
movq 0x8(%rsp), %rcx
leaq 0x869a(%rip), %rsi      # 0xd049
leaq 0x9227(%rip), %rdx      # 0xdbdd
xorl %eax, %eax
callq 0x5546
movq 0x8(%r14), %rdi
movq 0x8(%rsp), %rsi
callq 0x5293
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5c78
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x81af(%rip), %rsi      # 0xd049
leaq 0x8bbc(%rip), %rdx      # 0xda5d
xorl %eax, %eax
callq 0x5546
movl $0x0, 0x14(%rbx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x4ece
callq 0xc1b5
movq 0x38(%rbx), %rdi
callq 0xc0b3
movq $0x0, 0x38(%rbx)
movl 0x30(%rbx), %edi
callq 0xac73
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_O1/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 0x4fa7
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 0x9b60
movslq %eax, %r14
cmpl $0x400, %r14d           # imm = 0x400
jb 0x506e
leaq 0x1(%r14), %r13
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x5281
testq %rax, %rax
je 0x50a2
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 0x9b60
movq 0x8(%rbx), %rdi
leaq 0x8a5a(%rip), %rsi      # 0xda9b
leaq 0x8a58(%rip), %rdx      # 0xdaa0
movq %r12, %rcx
xorl %eax, %eax
callq 0x5546
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x50cd
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x5293
jmp 0x50bb
movq 0x8(%rbx), %rdi
leaq 0x8a22(%rip), %rsi      # 0xda9b
leaq 0x8a20(%rip), %rdx      # 0xdaa0
leaq 0xd0(%rsp), %r15
movq %r15, %rcx
xorl %eax, %eax
callq 0x5546
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x50cd
jmp 0x50bb
movq 0x8(%rbx), %rdi
leaq 0x7f9c(%rip), %rsi      # 0xd049
leaq 0x89b9(%rip), %rdx      # 0xda6d
xorl %eax, %eax
callq 0x5546
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/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 0x5151
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movl $0x20, %esi
callq 0x5281
testq %rax, %rax
je 0x5151
movq %rax, %r15
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x5281
movq %rax, (%r15)
testq %rax, %rax
je 0x515d
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 0x5293
// File: /workspace/github_c_makefile_star2_O1/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 0x51d9
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsp, %rax
leaq 0x8(%rsp), %rdx
movq %rsi, %rdi
movq %rax, %rsi
callq 0xb7c3
testl %eax, %eax
jne 0x51d4
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x50cd
movq 0x8(%rbx), %rdi
movq (%rsp), %rcx
leaq 0x88e2(%rip), %rsi      # 0xda9b
leaq 0x88e0(%rip), %rdx      # 0xdaa0
xorl %eax, %eax
callq 0x5546
movq 0x8(%rbx), %rdi
movq (%rsp), %rsi
callq 0x5293
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x9b60
cmpl $0x400, %eax            # imm = 0x400
jl 0x5356
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 0x5372
movq %rax, %r15
leaq 0x10(%rsp), %rcx
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x9b60
cmpl %r13d, %eax
movq 0x8(%rsp), %r14
jle 0x5356
leaq 0x88ba(%rip), %rsi      # 0xdc07
leaq 0x88e1(%rip), %rdx      # 0xdc35
jmp 0x5380
movq 0x8(%rbx), %rcx
movq (%rcx), %rax
testq %rax, %rax
je 0x538a
movq 0x8(%rcx), %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %r15, %rcx
callq *%rax
jmp 0x538a
leaq 0x888e(%rip), %rsi      # 0xdc07
leaq 0x888b(%rip), %rdx      # 0xdc0b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x539c
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/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 0x55ee
movq 0x18(%r14), %rsi
movl $0x20, %edi
callq *(%r14)
jmp 0x55fb
movl $0x20, %edi
xorl %esi, %esi
callq *0xcc4d(%rip)           # 0x12248
testq %rax, %rax
je 0x5632
testq %r14, %r14
leaq 0xcc3e(%rip), %rcx      # 0x12248
cmovneq %r14, %rcx
testq %rbx, %rbx
leaq 0xccc0(%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_O1/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 0x5c17
retq
pushq %rbx
movq %rdi, %rbx
movl $0x1, 0x10(%rdi)
movl $0x1, %esi
movq %rbx, %rdi
callq 0x5658
cmpl $0x1, 0x10(%rbx)
je 0x5c22
leaq 0x8123(%rip), %rsi      # 0xdd5f
leaq 0x8122(%rip), %rdx      # 0xdd65
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
jmp 0x5546
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x18(%rdi), %r15
movq $-0x1, %rbx
testq %r15, %r15
je 0x5fc9
movq (%r15), %rax
cmpl $0x2, 0x14(%rax)
je 0x5f06
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0x5eef
jmp 0x5fc9
movq 0xf0(%rax), %rcx
testq %rcx, %rcx
je 0x5f1f
movl $0x1, 0x18(%rcx)
movq 0x20(%rcx), %rcx
jmp 0x5f0d
movq 0xf0(%rax), %r13
testq %r13, %r13
je 0x5ef8
movq %r13, %r12
cmpl $0x0, 0x18(%r12)
je 0x5f49
cmpl $0x0, (%r12)
je 0x5f55
movq (%r15), %rax
cmpl $0x0, 0xd8(%rax)
jne 0x5f55
movq 0x20(%r12), %r12
testq %r12, %r12
jne 0x5f2e
jmp 0x5ef8
movq 0x30(%r12), %r14
callq 0xc2c0
movq %r14, %rdi
movq %rax, %rsi
callq 0xc2fe
movq %rax, %r14
movq 0x28(%r12), %rbp
movq %rbp, %rax
subq %r14, %rax
jbe 0x5f83
cmpq %rax, %rbx
cmovaeq %rax, %rbx
jmp 0x5f9e
callq 0xc2c0
movq %rax, 0x30(%r12)
movq (%r15), %rdi
movq 0x10(%r12), %rsi
callq *0x8(%r12)
movl %eax, 0x4(%rsp)
movq 0x20(%r12), %r13
cmpq %r14, %rbp
ja 0x5f26
cmpl $0x0, 0x4(%rsp)
jne 0x5f26
movq (%r15), %rdi
movq 0x8(%r12), %rsi
callq 0x5fdb
jmp 0x5f26
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/liuhaotian[P]xmppsh/libstrophe/src/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 0x6057
movl %esi, %ebx
testl %ebx, %ebx
je 0x6045
cmpl $0x0, (%r14)
je 0x604e
callq 0xc2c0
movq %rax, 0x30(%r14)
movq 0x20(%r14), %r14
testq %r14, %r14
jne 0x603b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x67a3
testq %rax, %rax
je 0x60a1
movq %rax, %r14
cmpq %r12, 0x8(%rax)
je 0x60ad
movq %r14, %rax
movq 0x20(%r14), %r14
testq %r14, %r14
je 0x60a1
cmpq %r12, 0x8(%r14)
jne 0x608d
jmp 0x60af
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %eax, %eax
testq %rax, %rax
je 0x60be
movq 0x20(%r14), %rcx
movq %rcx, 0x20(%rax)
jmp 0x60e0
movq 0xf8(%rbx), %rdi
movq %r15, %rsi
callq 0x66c5
movq 0xf8(%rbx), %rdi
movq 0x20(%r14), %rdx
movq %r15, %rsi
callq 0x65fa
movq 0x8(%rbx), %rdi
movq 0x28(%r14), %rsi
callq 0x5293
movq 0x8(%rbx), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5293
// File: /workspace/github_c_makefile_star2_O1/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 0x6131
movq %rdi, %rbx
cmpq %rsi, 0x8(%r14)
je 0x6139
movq %r14, %rax
movq 0x20(%r14), %r14
testq %r14, %r14
je 0x6131
cmpq %rsi, 0x8(%r14)
jne 0x611d
jmp 0x613b
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 0x6166
movq 0x8(%rbx), %rdi
callq 0x5293
movq 0x30(%r14), %rsi
testq %rsi, %rsi
je 0x6178
movq 0x8(%rbx), %rdi
callq 0x5293
movq 0x38(%r14), %rsi
testq %rsi, %rsi
je 0x618a
movq 0x8(%rbx), %rdi
callq 0x5293
movq 0x8(%rbx), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5293
// File: /workspace/github_c_makefile_star2_O1/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 0x61d7
cmpq %r13, 0x8(%rax)
je 0x6235
movq 0x20(%rax), %rax
jmp 0x61c6
movq 0x8(%rbx), %rdi
movl $0x40, %esi
callq 0x5281
testq %rax, %rax
je 0x6235
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 0xc2c0
movq %rax, 0x30(%r15)
movq (%rbx), %rax
testq %rax, %rax
je 0x6232
movq %rax, %rbx
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0x6222
addq $0x20, %rbx
movq %r15, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq