// File: /workspace/github_c_makefile_star2_O0/MikeyLHolm[P]Hive-lem-in/source/parse.c
// Function: room_info
static void	room_info(t_info *info, char *line, int i, int start_end)
{
	char		**room_data;

	if (line[0] == 'L')
		exit_error(ERR_ROOM_STARTS_L, info);
	room_data = ft_strsplit(line, ' ');
	room_error_check(info, room_data);
	if (!(info->rooms[i] = (t_room*)malloc(sizeof(t_room))))
		exit_error(ERR_MALLOC, info);
	info->rooms[i]->name = ft_strdup(room_data[0]);
	info->rooms[i]->x = ft_atoi(room_data[1]);
	info->rooms[i]->y = ft_atoi(room_data[2]);
	info->rooms[i]->start_or_end = start_end;
	init_room_info(info, i);
	if (!(info->rooms[i]->link_string = ft_strnew(0)))
		exit_error(ERR_MALLOC, info);
	if (start_end > 0)
		info->rooms[i]->level = start_end == 1 ? 0 : INT_MAX;
	else
		info->rooms[i]->level = -1;
	if (start_end == 1 && !info->start)
		info->start = ft_strdup(room_data[0]);
	else if (start_end == 2 && !info->end)
		info->end = ft_strdup(room_data[0]);
	free_2d_array(room_data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x4c, %eax
jne 0x57c2
movq -0x8(%rbp), %rsi
leaq 0x7068(%rip), %rdi      # 0xc825
callq 0x4f60
movq -0x10(%rbp), %rdi
movl $0x20, %esi
callq 0x7260
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4130
movl $0x68, %edi
callq 0x1070
movq -0x8(%rbp), %rcx
movq 0x18a8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
cmpq $0x0, %rax
jne 0x5814
movq -0x8(%rbp), %rsi
leaq 0x6d9a(%rip), %rdi      # 0xc5a9
callq 0x4f60
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x6fd0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x6a20
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x60(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x6a20
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x64(%rax)
movl -0x18(%rbp), %ecx
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x58(%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x41b0
xorl %eax, %eax
movl %eax, %edi
callq 0x7220
movq -0x8(%rbp), %rcx
movq 0x18a8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x58de
movq -0x8(%rbp), %rsi
leaq 0x6cd0(%rip), %rdi      # 0xc5a9
callq 0x4f60
cmpl $0x0, -0x18(%rbp)
jle 0x590c
movl -0x18(%rbp), %edx
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %eax, %eax
cmpl $0x1, %edx
cmovel %eax, %ecx
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x4c(%rax)
jmp 0x5926
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl $0xffffffff, 0x4c(%rax) # imm = 0xFFFFFFFF
cmpl $0x1, -0x18(%rbp)
jne 0x5950
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x5950
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x6fd0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x5978
cmpl $0x2, -0x18(%rbp)
jne 0x5976
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x5976
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x6fd0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
jmp 0x5978
movq -0x20(%rbp), %rdi
callq 0x3a10
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)