// File: /workspace/github_cpp_makefile_star2_O2/Unreality3D[P]Unreality3D/indie-studio/source/MapGenerator/MapGenerator.cpp
// Function: Map::draw_hallways()
void	Map::draw_hallways()
{
  Size	r1;
  Size	r2;
  int	w = 0;
  int	h = 0;

  for (size_t i = 0;i < _rooms.size() - 1;i++)
    {
      r1.y = (_rooms[i]._size.y / 2) + _rooms[i]._pos.y + 2;
      r1.x = (_rooms[i]._size.x / 2) + _rooms[i]._pos.x + 2;
      r2.y = (_rooms[i + 1]._size.y / 2) + _rooms[i + 1]._pos.y + 2;
      r2.x = (_rooms[i + 1]._size.x / 2) + _rooms[i + 1]._pos.x + 2;

      w = r2.x - r1.x;
      h = r2.y - r1.y;
      if (w > 0 && h > 0)
	{
	  for (int x = 0; x < w; x++)
	    _map[r1.y][r1.x + x] = ' ';
	  for (int y = h; y > 0; y--)
	    _map[r2.y - y][r2.x] = ' ';
	}
      else if (w > 0 && h < 0)
	{
	  for (int x = 0; x < w; x++)
	    _map[r1.y][r1.x + x] = ' ';
	  for (int y = (h * -1); y > 0; y--)
	    _map[r2.y + y][r2.x] = ' ';
	}
      else if (w < 0 && h > 0)
	{
	  for (int x = 0; x < (w * -1); x++)
	    _map[r1.y][r1.x - x] = ' ';
	  for (int y = h; y > 0; y--)
	    _map[r2.y - y][r2.x] = ' ';
	}
      else
	{
	  for (int x = 0; x < (w * -1); x++)
	    _map[r1.y][r1.x - x] = ' ';
	  for (int y = (h * -1); y > 0; y--)
	    _map[r2.y + y][r2.x] = ' ';
	}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movabsq $0x14, %rsi
movl $0x2, %r8d
xorl %r9d, %r9d
movq 0x40(%rdi), %r10
movq 0x48(%rdi), %rax
subq %r10, %rax
cqto
idivq %rsi
decq %rax
cmpq %rax, %r9
jae 0x3cd0
imulq $0x14, %r9, %r11
movl 0xc(%r10,%r11), %eax
cltd
idivl %r8d
movl (%r10,%r11), %ebx
movl 0x4(%r10,%r11), %edx
leal (%rax,%rdx), %r14d
leal (%rax,%rdx), %r15d
addl $0x2, %r15d
movl 0x8(%r10,%r11), %eax
cltd
idivl %r8d
leal (%rax,%rbx), %r12d
leal (%rax,%rbx), %ebp
addl $0x2, %ebp
incq %r9
movl 0x20(%r10,%r11), %eax
cltd
idivl %r8d
movl 0x18(%r10,%r11), %edx
leal (%rax,%rdx), %ebx
leal (%rax,%rdx), %ecx
addl $0x2, %ecx
movl 0x1c(%r10,%r11), %eax
cltd
idivl %r8d
movslq 0x14(%r10,%r11), %rdx
cltq
addq %rdx, %rax
movl %eax, %r13d
subl %r12d, %r13d
subl %r14d, %ebx
movslq %r15d, %r11
movl %r13d, %r14d
movl %ebx, %r10d
movslq %ecx, %rdx
testl %r13d, %r13d
jle 0x3b87
testl %ebx, %ebx
jle 0x3b87
movslq %ebp, %rbx
shlq $0x5, %r11
subq $0x1, %r14
jb 0x3baf
movq 0x58(%rdi), %rcx
movq (%rcx,%r11), %rcx
movb $0x20, (%rcx,%rbx)
incq %rbx
jmp 0x3b70
testl %r13d, %r13d
jle 0x3bdc
testl %ebx, %ebx
jns 0x3bdc
movslq %ebp, %r10
shlq $0x5, %r11
subq $0x1, %r14
jb 0x3c14
movq 0x58(%rdi), %rcx
movq (%rcx,%r11), %rcx
movb $0x20, (%rcx,%r10)
incq %r10
jmp 0x3b97
shlq $0x5, %rdx
movq %r10, %rcx
shlq $0x5, %rcx
subq %rcx, %rdx
testq %r10, %r10
jle 0x3acd
movq 0x58(%rdi), %rcx
movq (%rcx,%rdx), %rcx
movb $0x20, 0x2(%rcx,%rax)
decq %r10
addq $0x20, %rdx
jmp 0x3bbd
movslq %ebp, %r14
movl %r13d, %r15d
negl %r15d
testl %r13d, %r13d
jns 0x3c46
testl %ebx, %ebx
jle 0x3c46
movl %r15d, %ebx
subq $0x1, %rbx
jb 0x3ca3
movq 0x58(%rdi), %rcx
movq %r11, %r15
shlq $0x5, %r15
movq (%rcx,%r15), %rcx
movb $0x20, (%rcx,%r14)
decq %r14
jmp 0x3bf1
negl %ebx
movslq %ebx, %r10
movq %r10, %rcx
shlq $0x5, %rcx
shlq $0x5, %rdx
addq %rcx, %rdx
testq %r10, %r10
jle 0x3acd
movq 0x58(%rdi), %rcx
movq (%rcx,%rdx), %rcx
movb $0x20, 0x2(%rcx,%rax)
decq %r10
addq $-0x20, %rdx
jmp 0x3c27
testl %r15d, %r15d
movl $0x0, %ecx
cmovlel %ecx, %r15d
subq $0x1, %r15
jb 0x3c71
movq 0x58(%rdi), %rcx
movq %r11, %r10
shlq $0x5, %r10
movq (%rcx,%r10), %rcx
movb $0x20, (%rcx,%r14)
decq %r14
jmp 0x3c52
negl %ebx
movslq %ebx, %r10
movq %r10, %rcx
shlq $0x5, %rcx
shlq $0x5, %rdx
addq %rcx, %rdx
testq %r10, %r10
jle 0x3acd
movq 0x58(%rdi), %rcx
movq (%rcx,%rdx), %rcx
movb $0x20, 0x2(%rcx,%rax)
decq %r10
addq $-0x20, %rdx
jmp 0x3c84
shlq $0x5, %rdx
movq %r10, %rcx
shlq $0x5, %rcx
subq %rcx, %rdx
testq %r10, %r10
jle 0x3acd
movq 0x58(%rdi), %rcx
movq (%rcx,%rdx), %rcx
movb $0x20, 0x2(%rcx,%rax)
decq %r10
addq $0x20, %rdx
jmp 0x3cb1
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop