// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: create_queue_t
Queue_t *create_queue_t(const char *name, uint32_t max_msg, uint32_t max_msg_size, uint32_t flags)
{
	Queue_t *queue_t = (Queue_t*)xmalloc(sizeof(*queue_t));

	memcpy(queue_t->name, name, strlenz(name));

	queue_t->max_msg = max_msg;
	queue_t->max_msg_size = max_msg_size;
	queue_t->flags = flags;

	queue_t->auto_delete = 0;
	queue_t->force_push = 0;
	queue_t->round_robin = 0;

	if (BIT_CHECK(queue_t->flags, EG_QUEUE_AUTODELETE_FLAG)) {
		queue_t->auto_delete = 1;
	}

	if (BIT_CHECK(queue_t->flags, EG_QUEUE_FORCE_PUSH_FLAG)) {
		queue_t->force_push = 1;
	}

	if (BIT_CHECK(queue_t->flags, EG_QUEUE_ROUND_ROBIN_FLAG)) {
		queue_t->round_robin = 1;
	}

	queue_t->queue = queue_create();
	queue_t->expire_messages = list_create();
	queue_t->confirm_messages = list_create();
	queue_t->declared_clients = list_create();
	queue_t->subscribed_clients_msg = list_create();
	queue_t->subscribed_clients_notify = list_create();
	queue_t->routes = keylist_create();

	EG_QUEUE_SET_FREE_METHOD(queue_t->queue, free_message_list_handler);
	EG_KEYLIST_SET_FREE_METHOD(queue_t->routes, free_route_keylist_handler);
	EG_KEYLIST_SET_MATCH_METHOD(queue_t->routes, match_route_keylist_handler);

	return queue_t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl $0x90, %edi
callq 0x5090
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2160
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x22c0
movl -0xc(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x40(%rax)
movl -0x10(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x44(%rax)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x4c(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x50(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x54(%rax)
movq -0x20(%rbp), %rax
movl 0x48(%rax), %eax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xcdfb
movq -0x20(%rbp), %rax
movl $0x1, 0x4c(%rax)
movq -0x20(%rbp), %rax
movl 0x48(%rax), %eax
andq $0x2, %rax
cmpq $0x0, %rax
je 0xce17
movq -0x20(%rbp), %rax
movl $0x1, 0x50(%rax)
movq -0x20(%rbp), %rax
movl 0x48(%rax), %eax
andq $0x4, %rax
cmpq $0x0, %rax
je 0xce33
movq -0x20(%rbp), %rax
movl $0x1, 0x54(%rax)
callq 0xc550
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x58(%rax)
callq 0xbfe0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x60(%rax)
callq 0xbfe0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x68(%rax)
callq 0xbfe0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x70(%rax)
callq 0xbfe0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x78(%rax)
callq 0xbfe0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x80(%rax)
callq 0xbc60
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x88(%rax)
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
leaq -0x188(%rip), %rcx      # 0xcd30
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
leaq 0x32(%rip), %rcx        # 0xcf00
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
leaq 0x4c(%rip), %rcx        # 0xcf30
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)