// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x125d0
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x48(%rbp), %rcx
leaq 0xfc75(%rip), %rsi      # 0x14049
leaq 0x10414(%rip), %rdx     # 0x147ef
movb $0x0, %al
callq 0x6a80
movq -0x48(%rbp), %rdi
leaq 0x109c4(%rip), %rsi     # 0x14db1
callq 0x22e0
cmpl $0x0, %eax
jne 0x4545
movq -0x18(%rbp), %rdi
callq 0x12c60
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rcx
callq 0xadd0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x444c
movq -0x10(%rbp), %rdi
callq 0x13650
movl $0x0, -0x4(%rbp)
jmp 0x4565
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x66c0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x11cb0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x448a
movq -0x10(%rbp), %rdi
callq 0x13650
movl $0x0, -0x4(%rbp)
jmp 0x4565
movq -0x38(%rbp), %rdi
leaq 0x10386(%rip), %rsi     # 0x1481b
callq 0x12550
movq -0x38(%rbp), %rdi
leaq 0xffdc(%rip), %rsi      # 0x14481
callq 0x12820
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x11cb0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x44d7
movq -0x10(%rbp), %rdi
callq 0x13650
movl $0x0, -0x4(%rbp)
jmp 0x4565
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x128e0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x66c0
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x12850
movq -0x40(%rbp), %rdi
callq 0x11f80
movq -0x10(%rbp), %rdi
leaq 0xa5a(%rip), %rsi       # 0x4f70
leaq 0xff64(%rip), %rdx      # 0x14481
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %rcx
movq %r9, %r8
callq 0x85a0
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x6290
movq -0x38(%rbp), %rdi
callq 0x11f80
jmp 0x455e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq 0xff5e(%rip), %rdx      # 0x144b2
callq 0x42b0
movl %eax, -0x4(%rbp)
jmp 0x4565
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop