// File: /workspace/github_c_makefile_star2_O0/liuhaotian[P]xmppsh/libstrophe/examples/bot.c
// Function: message_handler
int message_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata)
{
	xmpp_stanza_t *reply, *body, *text;
	char *intext, *replytext;
	xmpp_ctx_t *ctx = (xmpp_ctx_t*)userdata;
	
	if(!xmpp_stanza_get_child_by_name(stanza, "body")) return 1;
	if(!strcmp(xmpp_stanza_get_attribute(stanza, "type"), "error")) return 1;
	
	intext = xmpp_stanza_get_text(xmpp_stanza_get_child_by_name(stanza, "body"));
	
	printf("Incoming message from %s: %s\n", xmpp_stanza_get_attribute(stanza, "from"), intext);
	
	reply = xmpp_stanza_new(ctx);
	xmpp_stanza_set_name(reply, "message");
	xmpp_stanza_set_type(reply, xmpp_stanza_get_type(stanza)?xmpp_stanza_get_type(stanza):"chat");
	xmpp_stanza_set_attribute(reply, "to", xmpp_stanza_get_attribute(stanza, "from"));
	
	body = xmpp_stanza_new(ctx);
	xmpp_stanza_set_name(body, "body");
	
	replytext = malloc(strlen(" to you too!") + strlen(intext) + 1);
	strcpy(replytext, intext);
	strcat(replytext, " to you too!");
	
	text = xmpp_stanza_new(ctx);
	xmpp_stanza_set_text(text, replytext);
	xmpp_stanza_add_child(body, text);
	xmpp_stanza_add_child(reply, body);
	
	xmpp_send(conn, reply);
	xmpp_stanza_release(reply);
	free(replytext);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x109fd(%rip), %rsi     # 0x13054
callq 0x123d0
cmpq $0x0, %rax
jne 0x266e
movl $0x1, -0x4(%rbp)
jmp 0x2818
movq -0x18(%rbp), %rdi
leaq 0x10c24(%rip), %rsi     # 0x1329d
callq 0x126e0
movq %rax, %rdi
leaq 0x1141f(%rip), %rsi     # 0x13aa7
callq 0x2280
cmpl $0x0, %eax
jne 0x269e
movl $0x1, -0x4(%rbp)
jmp 0x2818
movq -0x18(%rbp), %rdi
leaq 0x109ab(%rip), %rsi     # 0x13054
callq 0x123d0
movq %rax, %rdi
callq 0x124f0
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x10af3(%rip), %rsi     # 0x131b8
callq 0x126e0
movq %rax, %rsi
movq -0x40(%rbp), %rdx
leaq 0x10981(%rip), %rdi     # 0x13059
movb $0x0, %al
callq 0x2030
movq -0x50(%rbp), %rdi
callq 0x11540
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x10980(%rip), %rsi     # 0x13077
callq 0x11de0
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
callq 0x12370
cmpq $0x0, %rax
je 0x2722
movq -0x18(%rbp), %rdi
callq 0x12370
movq %rax, -0x60(%rbp)
jmp 0x272f
leaq 0x10956(%rip), %rax     # 0x1307f
movq %rax, -0x60(%rbp)
jmp 0x272f
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x126b0
movq -0x28(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x10a69(%rip), %rsi     # 0x131b8
callq 0x126e0
movq -0x68(%rbp), %rdi
movq %rax, %rdx
leaq 0x108ce(%rip), %rsi     # 0x13030
callq 0x11ff0
movq -0x50(%rbp), %rdi
callq 0x11540
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x108d5(%rip), %rsi     # 0x13054
callq 0x11de0
movq -0x40(%rbp), %rdi
callq 0x2160
movq %rax, %rdi
addq $0xc, %rdi
addq $0x1, %rdi
callq 0x2290
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x2170
movq -0x48(%rbp), %rdi
leaq 0x108cb(%rip), %rsi     # 0x13084
callq 0x2240
movq -0x50(%rbp), %rdi
callq 0x11540
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x12170
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x120e0
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x120e0
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x5b20
movq -0x28(%rbp), %rdi
callq 0x11810
movq -0x48(%rbp), %rdi
callq 0x20c0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)