// File: /workspace/github_cpp_makefile_star2_O3/matallui[P]nibble-curses/src/CNibbles.cpp
// Function: CNibbles::InitLevel()
void CNibbles::InitLevel ( void )
{
  if ( m_state == 2 ) PresentLevel();
  
  bkgd ( COLOR_PAIR (1) );
  
  m_nfood = 1;
  
  switch ( m_level )
  {
    case 1:
      m_num_obstacles = 4;
      m_obstacles[0].Update ( 0, 0, m_maxCols, 'H' );			// superior horizontal
      m_obstacles[1].Update ( m_maxLines-1, 0, m_maxCols, 'H' );		// inferior horizontal
      m_obstacles[2].Update ( 1, 0, m_maxLines-2, 'V' );			// left vertical
      m_obstacles[3].Update ( 1, m_maxCols-1, m_maxLines-2, 'V' );		// right vertical
      break;
    case 2:
      m_num_obstacles = 5;
      m_obstacles[4].Update ( 17, 25, 50, 'H' );
      break;
    case 3:
      m_num_obstacles = 6;
      m_obstacles[4].Update ( 6, 30, 24, 'V' );
      m_obstacles[5].Update ( 6, 69, 24, 'V' );
      break;
    case 4:
      m_num_obstacles = 8;
      m_obstacles[4].Update ( 1, 30, 16, 'V' );
      m_obstacles[5].Update ( 20, 70, 16, 'V' );
      m_obstacles[6].Update ( 25, 1, 45, 'H' );
      m_obstacles[7].Update ( 11, 55, 45, 'H' );
      break;
    case 5:
      m_num_obstacles = 12;
      m_obstacles[4].Update ( 1, 20, 15, 'V' );
      m_obstacles[5].Update ( 1, 40, 15, 'V' );
      m_obstacles[6].Update ( 1, 60, 15, 'V' );
      m_obstacles[7].Update ( 1, 80, 15, 'V' );
      m_obstacles[8].Update ( 21, 20, 15, 'V' );
      m_obstacles[9].Update ( 21, 40, 15, 'V' );
      m_obstacles[10].Update ( 21, 60, 15, 'V' );
      m_obstacles[11].Update ( 21, 80, 15, 'V' );
      break;
    case 6:
      m_num_obstacles = 8;
      m_obstacles[4].Update ( 12, 25, 12, 'V' );
      m_obstacles[5].Update ( 12, 75, 12, 'V' );
      m_obstacles[6].Update ( 10, 27, 47, 'H' );
      m_obstacles[7].Update ( 25, 27, 47, 'H' );
      break;
    case 7:
      m_num_obstacles = 5;
      m_obstacles[4].Update ( 1, 50, 34, 'I' );
      break;
    case 8:
      m_num_obstacles = 10;
      m_obstacles[4].Update ( 1, 14, 28, 'V' );
      m_obstacles[5].Update ( 7, 28, 28, 'V' );
      m_obstacles[6].Update ( 1, 42, 28, 'V' );
      m_obstacles[7].Update ( 7, 56, 28, 'V' );
      m_obstacles[8].Update ( 1, 70, 28, 'V' );
      m_obstacles[9].Update ( 7, 84, 28, 'V' );
      break;
    case 9:
      m_num_obstacles = 6;
      m_obstacles[4].Update ( 2, 2, 32, 'D' );
      m_obstacles[5].Update ( 2, 66, 32, 'D' );
      break;
    case 10:
      m_num_obstacles = 10;
      m_obstacles[4].Update ( 1, 14, 34, 'I' );
      m_obstacles[5].Update ( 2, 28, 34, 'I' );
      m_obstacles[6].Update ( 1, 42, 34, 'I' );
      m_obstacles[7].Update ( 2, 56, 34, 'I' );
      m_obstacles[8].Update ( 1, 70, 34, 'I' );
      m_obstacles[9].Update ( 2, 84, 34, 'I' );
      break;
  }
  
  for ( int i = 0; i < m_num_obstacles; i++ )
    m_obstacles[i].Draw ();
  
  for ( int i = 0; i < m_nplayers; i++ )
    m_snakes[i]->Initialize ( m_level );
  
  UpdateScores();
  PutFood();
  
  refresh();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpl $0x2, 0x24(%rdi)
jne 0x5da4
movq %rbx, %rdi
callq 0x75e6
movq 0x7225(%rip), %rax      # 0xcfd0
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x33d0
movl $0x1, 0x40(%rbx)
movl 0x8(%rbx), %eax
decl %eax
cmpl $0x9, %eax
ja 0x663d
leaq 0x3360(%rip), %rcx      # 0x9134
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x4, 0xc(%rbx)
movq 0x28(%rbx), %rdi
xorl %eax, %eax
leaq -0x30(%rbp), %r14
movl %eax, (%r14)
leaq -0x38(%rbp), %r15
movl %eax, (%r15)
leaq 0x4(%rbx), %r12
movb $0x48, %al
leaq -0x34(%rbp), %r13
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movq 0x28(%rbx), %rdi
addq $0x18, %rdi
movl (%rbx), %eax
decl %eax
movl %eax, (%r14)
xorl %eax, %eax
movl %eax, (%r15)
movb $0x48, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movq 0x28(%rbx), %rdi
addq $0x30, %rdi
movl $0x1, %eax
movl %eax, (%r14)
xorl %eax, %eax
movl %eax, (%r15)
movl (%rbx), %eax
addl $-0x2, %eax
movl %eax, (%r13)
movb $0x56, %al
leaq -0x29(%rbp), %r14
movb %al, (%r14)
leaq -0x30(%rbp), %r15
leaq -0x38(%rbp), %r12
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %r14, %r8
callq 0x392a
movq 0x28(%rbx), %rdi
addq $0x48, %rdi
movl $0x1, %eax
movl %eax, (%r15)
movl 0x4(%rbx), %eax
decl %eax
movl %eax, (%r12)
movl (%rbx), %eax
addl $-0x2, %eax
movl %eax, (%r13)
movb $0x56, %al
movb %al, (%r14)
jmp 0x6628
movl $0xc, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
movl $0x1, %eax
leaq -0x30(%rbp), %r14
movl %eax, (%r14)
movl $0x14, %eax
leaq -0x38(%rbp), %r15
movl %eax, (%r15)
movl $0xf, %eax
leaq -0x34(%rbp), %r12
movl %eax, (%r12)
movb $0x56, %al
leaq -0x29(%rbp), %r13
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
movl $0x1, %eax
movl %eax, (%r14)
movl $0x28, %eax
movl %eax, (%r15)
movl $0xf, %eax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0x90, %edi
addq 0x28(%rbx), %rdi
movl $0x1, %eax
movl %eax, (%r14)
movl $0x3c, %eax
movl %eax, (%r15)
movl $0xf, %eax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0xa8, %edi
addq 0x28(%rbx), %rdi
movl $0x1, %eax
movl %eax, (%r14)
movl $0x50, %eax
movl %eax, (%r15)
movl $0xf, %eax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0xc0, %edi
addq 0x28(%rbx), %rdi
movl $0x15, %eax
movl %eax, (%r14)
movl $0x14, %eax
movl %eax, (%r15)
movl $0xf, %eax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0xd8, %edi
addq 0x28(%rbx), %rdi
movl $0x15, %eax
movl %eax, (%r14)
movl $0x28, %eax
movl %eax, (%r15)
movl $0xf, %eax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0xf0, %edi
addq 0x28(%rbx), %rdi
movl $0x15, %eax
movl %eax, (%r14)
movl $0x3c, %eax
movl %eax, (%r15)
movl $0xf, %eax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0x108, %edi            # imm = 0x108
addq 0x28(%rbx), %rdi
movl $0x15, %eax
movl %eax, (%r14)
movl $0x50, %eax
movl %eax, (%r15)
movl $0xf, %eax
jmp 0x6458
movl $0xa, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
movl $0x1, %eax
leaq -0x30(%rbp), %r14
movl %eax, (%r14)
leaq -0x38(%rbp), %r15
movl $0xe, (%r15)
movl $0x22, %eax
leaq -0x34(%rbp), %r12
movl %eax, (%r12)
movb $0x49, %al
leaq -0x29(%rbp), %r13
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
movl $0x2, %eax
movl %eax, (%r14)
movl $0x1c, (%r15)
movl $0x22, %eax
movl %eax, (%r12)
movb $0x49, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0x90, %edi
addq 0x28(%rbx), %rdi
movl $0x1, %eax
movl %eax, (%r14)
movl $0x2a, (%r15)
movl $0x22, %eax
movl %eax, (%r12)
movb $0x49, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0xa8, %edi
addq 0x28(%rbx), %rdi
movl $0x2, %eax
movl %eax, (%r14)
movl $0x38, (%r15)
movl $0x22, %eax
movl %eax, (%r12)
movb $0x49, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0xc0, %edi
addq 0x28(%rbx), %rdi
movl $0x1, %eax
movl %eax, (%r14)
movl $0x46, (%r15)
movl $0x22, %eax
movl %eax, (%r12)
movb $0x49, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0xd8, %edi
addq 0x28(%rbx), %rdi
movl $0x2, %eax
movl %eax, (%r14)
movl $0x54, (%r15)
movl $0x22, %eax
movl %eax, (%r12)
movb $0x49, %al
jmp 0x6624
movl $0x6, %eax
movl %eax, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
leaq -0x30(%rbp), %r14
movl %eax, (%r14)
leaq -0x38(%rbp), %r15
movl $0x1e, (%r15)
movl $0x18, %eax
leaq -0x34(%rbp), %r12
movl %eax, (%r12)
movb $0x56, %al
leaq -0x29(%rbp), %r13
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
movl $0x6, %eax
movl %eax, (%r14)
movl $0x45, (%r15)
movl $0x18, %eax
jmp 0x6458
movl $0x8, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
movl $0x1, %eax
leaq -0x30(%rbp), %r14
movl %eax, (%r14)
leaq -0x38(%rbp), %r15
movl $0x1e, (%r15)
movl $0x10, %eax
leaq -0x34(%rbp), %r12
movl %eax, (%r12)
movb $0x56, %al
leaq -0x29(%rbp), %r13
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
movl $0x14, (%r14)
movl $0x46, (%r15)
movl $0x10, %eax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0x90, %edi
addq 0x28(%rbx), %rdi
movl $0x19, (%r14)
movl $0x1, %eax
movl %eax, (%r15)
movl $0x2d, %eax
movl %eax, (%r12)
movb $0x48, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0xa8, %edi
addq 0x28(%rbx), %rdi
movl $0xb, (%r14)
movl $0x37, (%r15)
movl $0x2d, %eax
jmp 0x6573
movl $0xa, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
movl $0x1, %eax
leaq -0x30(%rbp), %r14
movl %eax, (%r14)
leaq -0x38(%rbp), %r15
movl $0xe, (%r15)
movl $0x1c, %eax
leaq -0x34(%rbp), %r12
movl %eax, (%r12)
movb $0x56, %al
leaq -0x29(%rbp), %r13
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
movl $0x7, %eax
movl %eax, (%r14)
movl $0x1c, %eax
movl %eax, (%r15)
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0x90, %edi
addq 0x28(%rbx), %rdi
movl $0x1, %eax
movl %eax, (%r14)
movl $0x2a, (%r15)
movl $0x1c, %eax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0xa8, %edi
addq 0x28(%rbx), %rdi
movl $0x7, %eax
movl %eax, (%r14)
movl $0x38, (%r15)
movl $0x1c, %eax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0xc0, %edi
addq 0x28(%rbx), %rdi
movl $0x1, %eax
movl %eax, (%r14)
movl $0x46, (%r15)
movl $0x1c, %eax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0xd8, %edi
addq 0x28(%rbx), %rdi
movl $0x7, %eax
movl %eax, (%r14)
movl $0x54, (%r15)
movl $0x1c, %eax
movl %eax, (%r12)
movb $0x56, %al
jmp 0x6624
movl $0x5, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
leaq -0x30(%rbp), %rsi
movl $0x11, (%rsi)
leaq -0x38(%rbp), %rdx
movl $0x19, (%rdx)
leaq -0x34(%rbp), %rcx
movl $0x32, (%rcx)
leaq -0x29(%rbp), %r8
movb $0x48, (%r8)
jmp 0x6638
movl $0x8, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
movl $0xc, %r14d
leaq -0x30(%rbp), %rax
movl %r14d, (%rax)
movq %rax, %rsi
movl $0x19, %eax
leaq -0x38(%rbp), %r15
movl %eax, (%r15)
leaq -0x34(%rbp), %r12
movl %r14d, (%r12)
movb $0x56, %al
leaq -0x29(%rbp), %r13
movb %al, (%r13)
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
leaq -0x30(%rbp), %rax
movl %r14d, (%rax)
movl $0x4b, (%r15)
movl %r14d, (%r12)
movb $0x56, %al
movb %al, (%r13)
leaq -0x30(%rbp), %r14
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0x90, %edi
addq 0x28(%rbx), %rdi
movl $0xa, (%r14)
movl $0x1b, %eax
movl %eax, (%r15)
movl $0x2f, %eax
movl %eax, (%r12)
movb $0x48, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movl $0xa8, %edi
addq 0x28(%rbx), %rdi
movl $0x19, %eax
movl %eax, (%r14)
movl $0x1b, %eax
movl %eax, (%r15)
movl $0x2f, %eax
movl %eax, (%r12)
movb $0x48, %al
jmp 0x6624
movl $0x5, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
leaq -0x30(%rbp), %rsi
movl $0x1, (%rsi)
leaq -0x38(%rbp), %rdx
movl $0x32, (%rdx)
leaq -0x34(%rbp), %rcx
movl $0x22, (%rcx)
leaq -0x29(%rbp), %r8
movb $0x49, (%r8)
jmp 0x6638
movl $0x6, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
movl $0x2, %eax
leaq -0x30(%rbp), %r14
movl %eax, (%r14)
leaq -0x38(%rbp), %r15
movl %eax, (%r15)
movl $0x20, %eax
leaq -0x34(%rbp), %r12
movl %eax, (%r12)
movb $0x44, %al
leaq -0x29(%rbp), %r13
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x392a
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
movl $0x2, %eax
movl %eax, (%r14)
movl $0x42, (%r15)
movl $0x20, %eax
movl %eax, (%r12)
movb $0x44, %al
movb %al, (%r13)
leaq -0x30(%rbp), %rsi
leaq -0x38(%rbp), %rdx
leaq -0x34(%rbp), %rcx
leaq -0x29(%rbp), %r8
callq 0x392a
cmpl $0x0, 0xc(%rbx)
jle 0x6665
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x28(%rbx), %rdi
addq %r14, %rdi
callq 0x3aba
incq %r15
movslq 0xc(%rbx), %rax
addq $0x18, %r14
cmpq %rax, %r15
jl 0x6649
cmpl $0x0, 0x10(%rbx)
jle 0x668f
leaq 0x8(%rbx), %r14
xorl %r15d, %r15d
movq 0x30(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
incq %r15
movslq 0x10(%rbx), %rax
cmpq %rax, %r15
jl 0x6672
movq %rbx, %rdi
callq 0x8064
movq %rbx, %rdi
callq 0x813c
callq 0x33e0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop