// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x11dc4(%rip), %rsi     # 0x1433b
callq 0x12e50
movq %rax, %rsi
leaq 0x11a7e(%rip), %rdi     # 0x14004
movb $0x0, %al
callq 0x2030
movq -0x50(%rbp), %rdi
callq 0x11cb0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x11a81(%rip), %rsi     # 0x14026
callq 0x12550
movq -0x20(%rbp), %rdi
leaq 0x11a74(%rip), %rsi     # 0x14029
callq 0x12e20
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
callq 0x12a20
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x12df0
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x11d51(%rip), %rsi     # 0x1433b
callq 0x12e50
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x11a33(%rip), %rsi     # 0x14030
callq 0x12760
movq -0x50(%rbp), %rdi
callq 0x11cb0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x11a19(%rip), %rsi     # 0x14033
callq 0x12550
movq -0x10(%rbp), %rdi
callq 0x12c20
movq %rax, %rdi
callq 0x12a80
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x2648
movq -0x28(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x12820
movq -0x50(%rbp), %rdi
callq 0x11cb0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x11eb6(%rip), %rsi     # 0x14516
callq 0x12550
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x12850
movq -0x50(%rbp), %rdi
callq 0x11cb0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq 0x119af(%rip), %rsi     # 0x14039
callq 0x128e0
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x12850
movq -0x50(%rbp), %rdi
callq 0x11cb0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
leaq 0x11d7d(%rip), %rsi     # 0x14431
callq 0x12550
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x12850
movq -0x50(%rbp), %rdi
callq 0x11cb0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq 0x11962(%rip), %rsi     # 0x14040
callq 0x128e0
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x12850
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x12850
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x6290
movq -0x20(%rbp), %rdi
callq 0x11f80
movl $0x1, %eax
addq $0x60, %rsp
popq %rbp
retq
nop