LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_publish_command_handler
void channel_publish_command_handler(EagleClient *client)
{
	ProtocolRequestChannelPublish *req = (ProtocolRequestChannelPublish*)client->request;
	Channel_t *channel;
	Object *msg;

	if (client->pos < (sizeof(*req) + 1)) {
		add_status_response(client, 0, EG_PROTOCOL_STATUS_ERROR_PACKET);
		return;
	}

	if (!BIT_CHECK(client->perm, EG_USER_ADMIN_PERM) && !BIT_CHECK(client->perm, EG_USER_CHANNEL_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_CHANNEL_PUBLISH_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	if (!check_input_buffer2(req->body.name, 64) || !check_input_buffer1(req->body.topic, 32)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	channel = find_channel_t(server->channels, req->body.name);
	if (!channel) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	msg = create_dup_object(client->request + sizeof(*req), client->pos - sizeof(*req));

	publish_message_channel_t(channel, req->body.topic, msg);

	decrement_references_count(msg);

	add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x69, 0x20(%rax)
jae 0xa468
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0xa5a6
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x20, %rax
cmpq $0x0, %rax
jne 0xa4bf
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
jne 0xa4bf
movq -0x8(%rbp), %rcx
movabsq $0x800000000000, %rax   # imm = 0x800000000000
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
jne 0xa4bf
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x5, %edx
callq 0x6980
jmp 0xa5a6
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x40, %esi
callq 0x63b0
cmpl $0x0, %eax
je 0xa4f1
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
addq $0x40, %rdi
movl $0x20, %esi
callq 0x62a0
cmpl $0x0, %eax
jne 0xa50c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x7, %edx
callq 0x6980
jmp 0xa5a6
leaq 0xcd9d(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0xe5c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xa54d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x9, %edx
callq 0x6980
jmp 0xa5a6
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x68, %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
subq $0x68, %rsi
callq 0x6760
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
addq $0x40, %rsi
movq -0x20(%rbp), %rdx
callq 0xe440
movq -0x20(%rbp), %rdi
callq 0x6820
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_subscribe_command_handler
void channel_subscribe_command_handler(EagleClient *client)
{
	ProtocolRequestChannelSubscribe *req = (ProtocolRequestChannelSubscribe*)client->request;
	Channel_t *channel;

	if (client->pos < sizeof(*req)) {
		add_status_response(client, 0, EG_PROTOCOL_STATUS_ERROR_PACKET);
		return;
	}

	if (!BIT_CHECK(client->perm, EG_USER_ADMIN_PERM) && !BIT_CHECK(client->perm, EG_USER_CHANNEL_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_CHANNEL_SUBSCRIBE_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	if (!check_input_buffer2(req->body.name, 64) || !check_input_buffer1(req->body.topic, 32)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	channel = find_channel_t(server->channels, req->body.name);
	if (!channel) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	subscribe_channel_t(channel, client, req->body.topic);

	add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x68, 0x20(%rax)
jae 0xa5e8
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0xa6f9
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x20, %rax
cmpq $0x0, %rax
jne 0xa63f
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
jne 0xa63f
movq -0x8(%rbp), %rcx
movabsq $0x1000000000000, %rax  # imm = 0x1000000000000
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
jne 0xa63f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x5, %edx
callq 0x6980
jmp 0xa6f9
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x40, %esi
callq 0x63b0
cmpl $0x0, %eax
je 0xa671
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
addq $0x40, %rdi
movl $0x20, %esi
callq 0x62a0
cmpl $0x0, %eax
jne 0xa689
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x7, %edx
callq 0x6980
jmp 0xa6f9
leaq 0xcc20(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0xe5c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xa6ca
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x9, %edx
callq 0x6980
jmp 0xa6f9
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
addq $0x40, %rdx
callq 0xe680
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_psubscribe_command_handler
void channel_psubscribe_command_handler(EagleClient *client)
{
	ProtocolRequestChannelPatternSubscribe *req = (ProtocolRequestChannelPatternSubscribe*)client->request;
	Channel_t *channel;

	if (client->pos < sizeof(*req)) {
		add_status_response(client, 0, EG_PROTOCOL_STATUS_ERROR_PACKET);
		return;
	}

	if (!BIT_CHECK(client->perm, EG_USER_ADMIN_PERM) && !BIT_CHECK(client->perm, EG_USER_CHANNEL_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_CHANNEL_PSUBSCRIBE_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	if (!check_input_buffer2(req->body.name, 64) || !check_input_buffer3(req->body.pattern, 32)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	channel = find_channel_t(server->channels, req->body.name);
	if (!channel) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	psubscribe_channel_t(channel, client, req->body.pattern);

	add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x68, 0x20(%rax)
jae 0xa738
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0xa849
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x20, %rax
cmpq $0x0, %rax
jne 0xa78f
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
jne 0xa78f
movq -0x8(%rbp), %rcx
movabsq $0x2000000000000, %rax  # imm = 0x2000000000000
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
jne 0xa78f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x5, %edx
callq 0x6980
jmp 0xa849
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x40, %esi
callq 0x63b0
cmpl $0x0, %eax
je 0xa7c1
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
addq $0x40, %rdi
movl $0x20, %esi
callq 0x65b0
cmpl $0x0, %eax
jne 0xa7d9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x7, %edx
callq 0x6980
jmp 0xa849
leaq 0xcad0(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0xe5c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xa81a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x9, %edx
callq 0x6980
jmp 0xa849
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
addq $0x40, %rdx
callq 0xe800
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_unsubscribe_command_handler
void channel_unsubscribe_command_handler(EagleClient *client)
{
	ProtocolRequestChannelUnsubscribe *req = (ProtocolRequestChannelUnsubscribe*)client->request;
	Channel_t *channel;

	if (client->pos < sizeof(*req)) {
		add_status_response(client, 0, EG_PROTOCOL_STATUS_ERROR_PACKET);
		return;
	}

	if (!BIT_CHECK(client->perm, EG_USER_ADMIN_PERM) && !BIT_CHECK(client->perm, EG_USER_CHANNEL_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_CHANNEL_UNSUBSCRIBE_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	if (!check_input_buffer2(req->body.name, 64) || !check_input_buffer1(req->body.topic, 32)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	channel = find_channel_t(server->channels, req->body.name);
	if (!channel) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	if (unsubscribe_channel_t(channel, client, req->body.topic) != EG_STATUS_OK) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
	}

	add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x68, 0x20(%rax)
jae 0xa888
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0xa9b7
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x20, %rax
cmpq $0x0, %rax
jne 0xa8df
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
jne 0xa8df
movq -0x8(%rbp), %rcx
movabsq $0x4000000000000, %rax  # imm = 0x4000000000000
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
jne 0xa8df
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x5, %edx
callq 0x6980
jmp 0xa9b7
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x40, %esi
callq 0x63b0
cmpl $0x0, %eax
je 0xa911
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
addq $0x40, %rdi
movl $0x20, %esi
callq 0x62a0
cmpl $0x0, %eax
jne 0xa92c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x7, %edx
callq 0x6980
jmp 0xa9b7
leaq 0xc97d(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0xe5c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xa96d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x9, %edx
callq 0x6980
jmp 0xa9b7
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
addq $0x40, %rdx
callq 0xe8e0
cmpl $0x0, %eax
je 0xa9a1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x9, %edx
callq 0x6980
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_punsubscribe_command_handler
void channel_punsubscribe_command_handler(EagleClient *client)
{
	ProtocolRequestChannelPatternUnsubscribe *req = (ProtocolRequestChannelPatternUnsubscribe*)client->request;
	Channel_t *channel;

	if (client->pos < sizeof(*req)) {
		add_status_response(client, 0, EG_PROTOCOL_STATUS_ERROR_PACKET);
		return;
	}

	if (!BIT_CHECK(client->perm, EG_USER_ADMIN_PERM) && !BIT_CHECK(client->perm, EG_USER_CHANNEL_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_CHANNEL_PUNSUBSCRIBE_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	if (!check_input_buffer2(req->body.name, 64) || !check_input_buffer3(req->body.pattern, 32)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	channel = find_channel_t(server->channels, req->body.name);
	if (!channel) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	if (punsubscribe_channel_t(channel, client, req->body.pattern) != EG_STATUS_OK) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
	}

	add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x68, 0x20(%rax)
jae 0xa9f8
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0xab27
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x20, %rax
cmpq $0x0, %rax
jne 0xaa4f
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
jne 0xaa4f
movq -0x8(%rbp), %rcx
movabsq $0x8000000000000, %rax  # imm = 0x8000000000000
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
jne 0xaa4f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x5, %edx
callq 0x6980
jmp 0xab27
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x40, %esi
callq 0x63b0
cmpl $0x0, %eax
je 0xaa81
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
addq $0x40, %rdi
movl $0x20, %esi
callq 0x65b0
cmpl $0x0, %eax
jne 0xaa9c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x7, %edx
callq 0x6980
jmp 0xab27
leaq 0xc80d(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0xe5c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xaadd
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x9, %edx
callq 0x6980
jmp 0xab27
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
addq $0x40, %rdx
callq 0xea40
cmpl $0x0, %eax
je 0xab11
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x9, %edx
callq 0x6980
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_delete_command_handler
void channel_delete_command_handler(EagleClient *client)
{
	ProtocolRequestChannelDelete *req = (ProtocolRequestChannelDelete*)client->request;
	Channel_t *channel;

	if (client->pos < sizeof(*req)) {
		add_status_response(client, 0, EG_PROTOCOL_STATUS_ERROR_PACKET);
		return;
	}

	if (!BIT_CHECK(client->perm, EG_USER_ADMIN_PERM) && !BIT_CHECK(client->perm, EG_USER_CHANNEL_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_CHANNEL_DELETE_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	if (!check_input_buffer2(req->body.name, 64)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	channel = find_channel_t(server->channels, req->body.name);
	if (!channel) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	if (list_delete_value(server->channels, channel) == EG_STATUS_ERR) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		return;
	}

	add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x48, 0x20(%rax)
jae 0xab68
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0xac7f
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x20, %rax
cmpq $0x0, %rax
jne 0xabbf
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
jne 0xabbf
movq -0x8(%rbp), %rcx
movabsq $0x10000000000000, %rax # imm = 0x10000000000000
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
jne 0xabbf
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x5, %edx
callq 0x6980
jmp 0xac7f
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x40, %esi
callq 0x63b0
cmpl $0x0, %eax
jne 0xabf1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x7, %edx
callq 0x6980
jmp 0xac7f
leaq 0xc6b8(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0xe5c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xac32
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x9, %edx
callq 0x6980
jmp 0xac7f
leaq 0xc677(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xc220
cmpl $-0x1, %eax
jne 0xac69
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x2, %edx
callq 0x6980
jmp 0xac7f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_client_event_notify
void queue_client_event_notify(EagleClient *client, Queue_t *queue_t)
{
	ProtocolEventQueueNotify *event = (ProtocolEventQueueNotify*)xcalloc(sizeof(*event));

	set_event_header(&event->header, EG_PROTOCOL_CMD_QUEUE_SUBSCRIBE, EG_PROTOCOL_EVENT_NOTIFY, sizeof(event->body));

	memcpy(event->body.name, queue_t->name, strlenz(queue_t->name));

	add_response(client, event, sizeof(*event));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x48, %edi
callq 0x5160
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2d, %esi
movl $0x1, %edx
movl $0x40, %ecx
callq 0xad10
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2160
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x22c0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x48, %edx
callq 0x6cb0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_client_event_message
void queue_client_event_message(EagleClient *client, Queue_t *queue_t, Message *msg)
{
	ProtocolEventHeader header;
	char *buffer;

	set_event_header(&header, EG_PROTOCOL_CMD_QUEUE_SUBSCRIBE, EG_PROTOCOL_EVENT_MESSAGE, 64 + EG_MESSAGE_SIZE(msg));

	buffer = (char*)xcalloc(sizeof(header) + 64);

	memcpy(buffer, &header, sizeof(header));
	memcpy(buffer + sizeof(header), queue_t->name, strlenz(queue_t->name));

	add_response(client, buffer, sizeof(header) + 64);
	add_object_response(client, EG_MESSAGE_OBJECT(msg));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
addq $0x40, %rax
movl %eax, %ecx
leaq -0x20(%rbp), %rdi
movl $0x2d, %esi
movl $0x2, %edx
callq 0xad10
movl $0x48, %edi
callq 0x5160
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2160
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x22c0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0x48, %edx
callq 0x6cb0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x85f0
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_client_event_message
void channel_client_event_message(EagleClient *client, Channel_t *channel, const char *topic, Object *msg)
{
	ProtocolEventHeader header;
	char *buffer;

	set_event_header(&header, EG_PROTOCOL_CMD_CHANNEL_SUBSCRIBE, EG_PROTOCOL_EVENT_MESSAGE, 96 + EG_OBJECT_SIZE(msg));

	buffer = (char*)xcalloc(sizeof(header) + 96);

	memcpy(buffer, &header, sizeof(header));
	memcpy(buffer + sizeof(header), channel->name, strlenz(channel->name));
	memcpy(buffer + sizeof(header) + 64, topic, strlenz(topic));

	add_response(client, buffer, sizeof(header) + 96);
	add_object_response(client, msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x60, %rax
movl %eax, %ecx
leaq -0x28(%rbp), %rdi
movl $0x3f, %esi
movl $0x2, %edx
callq 0xad10
movl $0x68, %edi
callq 0x5160
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2160
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x22c0
movq -0x30(%rbp), %rax
addq $0x8, %rax
addq $0x40, %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2160
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x22c0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0x68, %edx
callq 0x6cb0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x85f0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_client_event_pattern_message
void channel_client_event_pattern_message(EagleClient *client, Channel_t *channel,
	const char *topic, const char *pattern, Object *msg)
{
	ProtocolEventHeader header;
	char *buffer;

	set_event_header(&header, EG_PROTOCOL_CMD_CHANNEL_PSUBSCRIBE, EG_PROTOCOL_EVENT_MESSAGE, 128 + EG_OBJECT_SIZE(msg));

	buffer = (char*)xcalloc(sizeof(header) + 128);

	memcpy(buffer, &header, sizeof(header));
	memcpy(buffer + sizeof(header), channel->name, strlenz(channel->name));
	memcpy(buffer + sizeof(header) + 64, topic, strlenz(topic));
	memcpy(buffer + sizeof(header) + 96, pattern, strlenz(pattern));

	add_response(client, buffer, sizeof(header) + 128);
	add_object_response(client, msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x80, %rax
movl %eax, %ecx
leaq -0x30(%rbp), %rdi
movl $0x40, %esi
movl $0x2, %edx
callq 0xad10
movl $0x88, %edi
callq 0x5160
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2160
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x22c0
movq -0x38(%rbp), %rax
addq $0x8, %rax
addq $0x40, %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2160
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x22c0
movq -0x38(%rbp), %rax
addq $0x8, %rax
addq $0x60, %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2160
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x22c0
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x88, %edx
callq 0x6cb0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x85f0
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: parse_command
static inline void parse_command(EagleClient *client, ProtocolRequestHeader* req)
{
	commandHandler *handler = commands[req->cmd];

	if (handler) {
		client->noack = req->noack;
		handler(client);
	} else {
		add_status_response(client, req->cmd, EG_PROTOCOL_STATUS_ERROR_COMMAND);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %eax
movl %eax, %ecx
leaq 0xbeaf(%rip), %rax      # 0x172c0
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xb43b
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rdi
callq *%rax
jmp 0xb451
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x4, %edx
callq 0x6980
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: read_request
void read_request(EventLoop *loop, int fd, void *data, int mask)
{
	EagleClient *client = (EagleClient*)data;
	int nread;

	EG_NOTUSED(loop);
	EG_NOTUSED(mask);

	nread = read(fd, client->buffer, EG_BUF_SIZE);

	if (nread == -1) {
		if (errno == EAGAIN) {
			nread = 0;
		} else {
			free_client(client);
			return;
		}
	} else if (nread == 0) {
		free_client(client);
		return;
	}

	if (nread) {
		client->nread = nread;
		client->last_action = time(NULL);
	} else {
		return;
	}

	process_request(client);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %edi
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rsi
movl $0x8000, %edx           # imm = 0x8000
callq 0x2230
movl %eax, -0x2c(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0xb4bc
callq 0x2050
cmpl $0xb, (%rax)
jne 0xb4af
movl $0x0, -0x2c(%rbp)
jmp 0xb4ba
movq -0x28(%rbp), %rdi
callq 0x70e0
jmp 0xb502
jmp 0xb4cf
cmpl $0x0, -0x2c(%rbp)
jne 0xb4cd
movq -0x28(%rbp), %rdi
callq 0x70e0
jmp 0xb502
jmp 0xb4cf
cmpl $0x0, -0x2c(%rbp)
je 0xb4f7
movslq -0x2c(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x40(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x22e0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x78(%rax)
jmp 0xb4f9
jmp 0xb502
movq -0x28(%rbp), %rdi
callq 0xb000
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: client_timeout
void client_timeout(void)
{
	EagleClient *client;
	ListIterator iterator;
	ListNode *node;

	if (server->client_timeout)
	{
		list_rewind(server->clients, &iterator);
		while ((node = list_next_node(&iterator)) != NULL)
		{
			client = EG_LIST_NODE_VALUE(node);
			if ((server->now_time - client->last_action) > server->client_timeout) {
				free_client(client);
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0xbd91(%rip), %rax      # 0x172b0
movq (%rax), %rax
cmpl $0x0, 0x58(%rax)
je 0xb59a
leaq 0xbd81(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x160(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0xc520
leaq -0x18(%rbp), %rdi
callq 0xc450
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0xb598
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
leaq 0xbd48(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x188(%rax), %rax
movq -0x8(%rbp), %rcx
subq 0x78(%rcx), %rax
leaq 0xbd2f(%rip), %rcx      # 0x172b0
movq (%rcx), %rcx
movslq 0x58(%rcx), %rcx
cmpq %rcx, %rax
jle 0xb596
movq -0x8(%rbp), %rdi
callq 0x70e0
jmp 0xb542
jmp 0xb59a
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: create_client
EagleClient *create_client(int fd)
{
	EagleClient *client = (EagleClient*)xmalloc(sizeof(*client));

	net_set_nonblock(NULL, fd);
	net_tcp_nodelay(NULL, fd);

	if (create_file_event(server->loop, fd, EG_EVENT_READABLE, read_request, client) == EG_EVENT_ERR) {
		close(fd);
		xfree(client);
		return NULL;
	}

	client->fd = fd;
	client->perm = 0;
	client->request = (char*)xmalloc(EG_BUF_SIZE);
	client->length = EG_BUF_SIZE;
	client->pos = 0;
	client->noack = 0;
	client->offset = 0;
	client->buffer = (char*)xmalloc(EG_BUF_SIZE);
	client->bodylen = 0;
	client->nread = 0;
	client->responses = list_create();
	client->declared_queues = list_create();
	client->subscribed_queues = list_create();
	client->subscribed_topics = keylist_create();
	client->subscribed_patterns = keylist_create();
	client->sentlen = 0;
	client->last_action = time(NULL);

	EG_LIST_SET_FREE_METHOD(client->responses, free_object_list_handler);

	list_add_value_tail(server->clients, client);

	return client;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl $0x80, %edi
callq 0x5090
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %esi
xorl %eax, %eax
movl %eax, %edi
callq 0x49d0
movl -0xc(%rbp), %esi
xorl %eax, %eax
movl %eax, %edi
callq 0x4b40
leaq 0xbcd8(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %r8
movl $0x1, %edx
leaq -0x191(%rip), %rcx      # 0xb460
callq 0x3c60
cmpl $-0x1, %eax
jne 0xb619
movl -0xc(%rbp), %edi
callq 0x2200
movq -0x18(%rbp), %rdi
callq 0x5410
movq $0x0, -0x8(%rbp)
jmp 0xb743
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movl $0x8000, %edi           # imm = 0x8000
callq 0x5090
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x8000, 0x18(%rax)     # imm = 0x8000
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x2c(%rax)
movl $0x8000, %edi           # imm = 0x8000
callq 0x5090
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x40(%rax)
callq 0xbfe0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
callq 0xbfe0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
callq 0xbfe0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x58(%rax)
callq 0xbc60
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x60(%rax)
callq 0xbc60
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x70(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x22e0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
leaq -0x4ebd(%rip), %rcx     # 0x6860
movq %rcx, 0x10(%rax)
leaq 0xbb88(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x160(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xc170
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: eject_queue_client
static void eject_queue_client(EagleClient *client)
{
	ListIterator iterator;
	ListNode *node;
	Queue_t *queue_t;

	list_rewind(client->subscribed_queues, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		queue_t = EG_LIST_NODE_VALUE(node);
		unsubscribe_client_queue_t(queue_t, client);
	}

	list_rewind(client->declared_queues, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		queue_t = EG_LIST_NODE_VALUE(node);

		undeclare_client_queue_t(queue_t, client);
		process_queue_t(queue_t);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0xc520
leaq -0x18(%rbp), %rdi
callq 0xc450
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0xb79b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xd730
jmp 0xb76d
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0xc520
leaq -0x18(%rbp), %rdi
callq 0xc450
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0xb7e3
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xd690
movq -0x28(%rbp), %rdi
callq 0xd920
jmp 0xb7ac
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: eject_channel_client
static void eject_channel_client(EagleClient *client)
{
	ListIterator list_iterator;
	ListNode *list_node;
	KeylistIterator keylist_iterator;
	KeylistNode *keylist_node;
	Channel_t *channel;
	List *list;

	keylist_rewind(client->subscribed_topics, &keylist_iterator);
	while ((keylist_node = keylist_next_node(&keylist_iterator)) != NULL)
	{
		channel = EG_KEYLIST_NODE_KEY(keylist_node);
		list = EG_KEYLIST_NODE_VALUE(keylist_node);

		list_rewind(list, &list_iterator);
		while ((list_node = list_next_node(&list_iterator)) != NULL)
		{
			keylist_node = EG_LIST_NODE_VALUE(list_node);
			unsubscribe_channel_t(channel, client, EG_KEYLIST_NODE_KEY(keylist_node));
		}
	}

	keylist_rewind(client->subscribed_patterns, &keylist_iterator);
	while ((keylist_node = keylist_next_node(&keylist_iterator)) != NULL)
	{
		channel = EG_KEYLIST_NODE_KEY(keylist_node);
		list = EG_KEYLIST_NODE_VALUE(keylist_node);

		list_rewind(list, &list_iterator);
		while ((list_node = list_next_node(&list_iterator)) != NULL)
		{
			keylist_node = EG_LIST_NODE_VALUE(list_node);
			punsubscribe_channel_t(channel, client, EG_KEYLIST_NODE_KEY(keylist_node));
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0xbde0
leaq -0x28(%rbp), %rdi
callq 0xbe00
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0xb87d
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xc520
leaq -0x18(%rbp), %rdi
callq 0xc450
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0xb87b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0xe8e0
jmp 0xb845
jmp 0xb80d
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0xbde0
leaq -0x28(%rbp), %rdi
callq 0xbe00
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0xb8fe
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xc520
leaq -0x18(%rbp), %rdi
callq 0xc450
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0xb8fc
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0xea40
jmp 0xb8c6
jmp 0xb88e
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: accept_tcp_handler
void accept_tcp_handler(EventLoop *loop, int fd, void *data, int mask)
{
	int port, cfd;
	char ip[128];

	EG_NOTUSED(loop);
	EG_NOTUSED(mask);
	EG_NOTUSED(data);

	cfd = net_tcp_accept(server->error, fd, ip, &port);
	if (cfd == EG_NET_ERR) {
		warning("Error accept client: %s", server->error);
		return;
	}

	accept_common_handler(cfd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
leaq 0xb980(%rip), %rax      # 0x172b0
movq (%rax), %rdi
addq $0x60, %rdi
movl -0xc(%rbp), %esi
leaq -0xb0(%rbp), %rdx
leaq -0x20(%rbp), %rcx
callq 0x4f10
movl %eax, -0x24(%rbp)
cmpl $-0x1, -0x24(%rbp)
jne 0xb971
leaq 0xb956(%rip), %rax      # 0x172b0
movq (%rax), %rsi
addq $0x60, %rsi
leaq 0x6d70(%rip), %rdi      # 0x126d8
movb $0x0, %al
callq 0x5840
jmp 0xb979
movl -0x24(%rbp), %edi
callq 0xb990
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: accept_common_handler
static void accept_common_handler(int fd)
{
	EagleClient *client;

	if ((client = create_client(fd)) == NULL) {
		close(fd);
		return;
	}

	if (EG_LIST_LENGTH(server->clients) > server->max_clients) {
		free_client(client);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edi
callq 0xb5a0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0xb9b7
movl -0x4(%rbp), %edi
callq 0x2200
jmp 0xb9e4
leaq 0xb8f2(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x160(%rax), %rax
movl 0x20(%rax), %eax
leaq 0xb8de(%rip), %rcx      # 0x172b0
movq (%rcx), %rcx
cmpq 0x48(%rcx), %rax
jbe 0xb9e4
movq -0x10(%rbp), %rdi
callq 0x70e0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: accept_unix_handler
void accept_unix_handler(EventLoop *loop, int fd, void *data, int mask)
{
	int cfd;

	EG_NOTUSED(loop);
	EG_NOTUSED(mask);
	EG_NOTUSED(data);

	cfd = net_unix_accept(server->error, fd);
	if (cfd == EG_NET_ERR) {
		warning("Accepting client connection: %s", server->error);
		return;
	}

	accept_common_handler(cfd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
leaq 0xb8a3(%rip), %rax      # 0x172b0
movq (%rax), %rdi
addq $0x60, %rdi
movl -0xc(%rbp), %esi
callq 0x5030
movl %eax, -0x20(%rbp)
cmpl $-0x1, -0x20(%rbp)
jne 0xba43
leaq 0xb884(%rip), %rax      # 0x172b0
movq (%rax), %rsi
addq $0x60, %rsi
leaq 0x6cb6(%rip), %rdi      # 0x126f0
movb $0x0, %al
callq 0x5840
jmp 0xba4b
movl -0x20(%rbp), %edi
callq 0xb990
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: set_write_event
static int set_write_event(EagleClient *client)
{
	if (client->fd <= 0) {
		return EG_STATUS_ERR;
	}

	if (create_file_event(server->loop, client->fd, EG_EVENT_WRITABLE, send_response, client) == EG_EVENT_ERR &&
			EG_LIST_LENGTH(client->responses) == 0) {
		return EG_STATUS_ERR;
	}

    return EG_STATUS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jg 0xba7e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xbac9
leaq 0xb82b(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %esi
movq -0x10(%rbp), %r8
movl $0x2, %edx
leaq 0x3f(%rip), %rcx        # 0xbae0
callq 0x3c60
cmpl $-0x1, %eax
jne 0xbac2
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
cmpl $0x0, 0x20(%rax)
jne 0xbac2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xbac9
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: send_response
static void send_response(EventLoop *loop, int fd, void *data, int mask)
{
	EagleClient *client = data;
	Object *object;
	int nwritten = 0, totwritten = 0;

	EG_NOTUSED(loop);
	EG_NOTUSED(mask);

	while (EG_LIST_LENGTH(client->responses))
	{
		object = EG_LIST_NODE_VALUE(EG_LIST_FIRST(client->responses));

		if (EG_OBJECT_SIZE(object) == 0) {
			list_delete_node(client->responses, EG_LIST_FIRST(client->responses));
			continue;
		}

		nwritten = write(fd, ((char*)EG_OBJECT_DATA(object)) + client->sentlen, EG_OBJECT_SIZE(object) - client->sentlen);
		if (nwritten <= 0) {
			break;
		}

		client->sentlen += nwritten;
		totwritten += nwritten;

		if (client->sentlen == EG_OBJECT_SIZE(object)) {
			list_delete_node(client->responses, EG_LIST_FIRST(client->responses));
			client->sentlen = 0;
		}
	}

	if (nwritten == -1) {
		if (errno == EAGAIN) {
			nwritten = 0;
		} else {
			free_client(client);
			return;
		}
	}

	if (totwritten > 0) {
		client->last_action = time(NULL);
	}

	if (EG_LIST_LENGTH(client->responses) == 0) {
		client->sentlen = 0;
		delete_file_event(server->loop, client->fd, EG_EVENT_WRITABLE);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
cmpl $0x0, 0x20(%rax)
je 0xbbdc
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xbb56
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rsi
callq 0xc320
jmp 0xbb0c
movl -0xc(%rbp), %edi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq -0x28(%rbp), %rax
addq 0x70(%rax), %rsi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x28(%rbp), %rax
subq 0x70(%rax), %rdx
callq 0x2100
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jg 0xbb88
jmp 0xbbdc
movslq -0x34(%rbp), %rcx
movq -0x28(%rbp), %rax
addq 0x70(%rax), %rcx
movq %rcx, 0x70(%rax)
movl -0x34(%rbp), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xbbd7
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rsi
callq 0xc320
movq -0x28(%rbp), %rax
movq $0x0, 0x70(%rax)
jmp 0xbb0c
cmpl $-0x1, -0x34(%rbp)
jne 0xbc02
callq 0x2050
cmpl $0xb, (%rax)
jne 0xbbf5
movl $0x0, -0x34(%rbp)
jmp 0xbc00
movq -0x28(%rbp), %rdi
callq 0x70e0
jmp 0xbc53
jmp 0xbc02
cmpl $0x0, -0x38(%rbp)
jle 0xbc1c
xorl %eax, %eax
movl %eax, %edi
callq 0x22e0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
cmpl $0x0, 0x20(%rax)
jne 0xbc53
movq -0x28(%rbp), %rax
movq $0x0, 0x70(%rax)
leaq 0xb673(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movl (%rax), %esi
movl $0x2, %edx
callq 0x3e10
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/keylist.c
// Function: keylist_create
Keylist *keylist_create(void)
{
	Keylist *keylist;

	keylist = (Keylist*)xmalloc(sizeof(*keylist));

	keylist->head = keylist->tail = NULL;
	keylist->len = 0;
	keylist->free = NULL;
	keylist->match = NULL;

	return keylist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x28, %edi
callq 0x5090
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/keylist.c
// Function: keylist_release
void keylist_release(Keylist *keylist)
{
	unsigned int len;
	KeylistNode *current, *next;

	current = keylist->head;
	len = keylist->len;

	while (len--) {
		next = current->next;

		if (keylist->free) {
			keylist->free(current->key, current->value);
		}

		xfree(current);
		current = next;
	}

	xfree(keylist);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0xc(%rbp)
cmpl $0x0, %eax
je 0xbd35
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xbd22
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rdi
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rsi
callq *%rax
movq -0x18(%rbp), %rdi
callq 0x5410
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0xbce1
movq -0x8(%rbp), %rdi
callq 0x5410
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/keylist.c
// Function: keylist_get_value
KeylistNode *keylist_get_value(Keylist *keylist, void *key)
{
	KeylistIterator iter;
	KeylistNode *node;

	keylist_rewind(keylist, &iter);
	while ((node = keylist_next_node(&iter)) != NULL)
	{
		if (keylist->match) {
			if (keylist->match(node->key, key)) {
				return node;
			}
		} else {
			if (node->key == key) {
				return node;
			}
		}
	}

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xbde0
leaq -0x20(%rbp), %rdi
callq 0xbe00
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0xbdce
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xbdb2
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
cmpl $0x0, %eax
je 0xbdb0
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xbdd6
jmp 0xbdcc
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0xbdca
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xbdd6
jmp 0xbdcc
jmp 0xbd6d
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/keylist.c
// Function: keylist_next_node
KeylistNode *keylist_next_node(KeylistIterator *iter)
{
	KeylistNode *current = iter->next;

	if (current != NULL) {
		iter->next = current->next;
	}

	return current;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xbe29
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/keylist.c
// Function: keylist_set_value
Keylist *keylist_set_value(Keylist *keylist, void *key, void *value)
{
	KeylistNode *node = keylist_get_value(keylist, key);

	if (node != NULL) {
		node->value = value;
		return keylist;
	}

	node = (KeylistNode*)xmalloc(sizeof(*node));

	node->key = key;
	node->value = value;

	if (keylist->len == 0) {
		keylist->head = keylist->tail = node;
		node->prev = node->next = NULL;
	} else {
		node->prev = keylist->tail;
		node->next = NULL;
		keylist->tail->next = node;
		keylist->tail = node;
	}

	keylist->len++;

	return keylist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xbd50
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xbe75
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xbf1d
movl $0x20, %edi
callq 0x5090
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0xbed1
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
jmp 0xbf08
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)