// File: /workspace/github_cpp_makefile_star2_O2/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 0x5a0a
movq %rbx, %rdi
callq 0x7062
movq 0x65bf(%rip), %rax      # 0xbfd0
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x33f0
movl $0x1, 0x40(%rbx)
movl 0x8(%rbx), %eax
decl %eax
cmpl $0x9, %eax
ja 0x620d
leaq 0x26fa(%rip), %rcx      # 0x8134
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x4, 0xc(%rbx)
movq 0x28(%rbx), %rdi
leaq -0x30(%rbp), %r14
andl $0x0, (%r14)
leaq -0x38(%rbp), %r15
andl $0x0, (%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 0x3896
movq 0x28(%rbx), %rdi
addq $0x18, %rdi
movl (%rbx), %eax
decl %eax
movl %eax, (%r14)
andl $0x0, (%r15)
movb $0x48, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movq 0x28(%rbx), %rdi
addq $0x30, %rdi
andl $0x0, (%r15)
pushq $0x1
popq %rax
movl %eax, (%r14)
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 0x3896
movq 0x28(%rbx), %rdi
addq $0x48, %rdi
pushq $0x1
popq %rax
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 0x61f8
movl $0xc, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
pushq $0x1
popq %rax
leaq -0x30(%rbp), %r14
movl %eax, (%r14)
pushq $0x14
popq %rax
leaq -0x38(%rbp), %r15
movl %eax, (%r15)
pushq $0xf
popq %rax
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 0x3896
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
pushq $0x1
popq %rax
movl %eax, (%r14)
pushq $0x28
popq %rax
movl %eax, (%r15)
pushq $0xf
popq %rax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0x90, %edi
addq 0x28(%rbx), %rdi
pushq $0x1
popq %rax
movl %eax, (%r14)
pushq $0x3c
popq %rax
movl %eax, (%r15)
pushq $0xf
popq %rax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0xa8, %edi
addq 0x28(%rbx), %rdi
pushq $0x1
popq %rax
movl %eax, (%r14)
pushq $0x50
popq %rax
movl %eax, (%r15)
pushq $0xf
popq %rax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0xc0, %edi
addq 0x28(%rbx), %rdi
pushq $0x15
popq %rax
movl %eax, (%r14)
pushq $0x14
popq %rax
movl %eax, (%r15)
pushq $0xf
popq %rax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0xd8, %edi
addq 0x28(%rbx), %rdi
pushq $0x15
popq %rax
movl %eax, (%r14)
pushq $0x28
popq %rax
movl %eax, (%r15)
pushq $0xf
popq %rax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0xf0, %edi
addq 0x28(%rbx), %rdi
pushq $0x15
popq %rax
movl %eax, (%r14)
pushq $0x3c
popq %rax
movl %eax, (%r15)
pushq $0xf
popq %rax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0x108, %edi            # imm = 0x108
addq 0x28(%rbx), %rdi
pushq $0x15
popq %rax
movl %eax, (%r14)
pushq $0x50
popq %rax
movl %eax, (%r15)
pushq $0xf
jmp 0x6040
movl $0xa, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
pushq $0x1
popq %rax
leaq -0x30(%rbp), %r14
movl %eax, (%r14)
leaq -0x38(%rbp), %r15
movl $0xe, (%r15)
pushq $0x22
popq %rax
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 0x3896
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
pushq $0x2
popq %rax
movl %eax, (%r14)
movl $0x1c, (%r15)
pushq $0x22
popq %rax
movl %eax, (%r12)
movb $0x49, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0x90, %edi
addq 0x28(%rbx), %rdi
pushq $0x1
popq %rax
movl %eax, (%r14)
movl $0x2a, (%r15)
pushq $0x22
popq %rax
movl %eax, (%r12)
movb $0x49, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0xa8, %edi
addq 0x28(%rbx), %rdi
pushq $0x2
popq %rax
movl %eax, (%r14)
movl $0x38, (%r15)
pushq $0x22
popq %rax
movl %eax, (%r12)
movb $0x49, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0xc0, %edi
addq 0x28(%rbx), %rdi
pushq $0x1
popq %rax
movl %eax, (%r14)
movl $0x46, (%r15)
pushq $0x22
popq %rax
movl %eax, (%r12)
movb $0x49, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0xd8, %edi
addq 0x28(%rbx), %rdi
pushq $0x2
popq %rax
movl %eax, (%r14)
movl $0x54, (%r15)
pushq $0x22
popq %rax
movl %eax, (%r12)
movb $0x49, %al
jmp 0x61f4
pushq $0x6
popq %rax
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)
pushq $0x18
popq %rax
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 0x3896
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
pushq $0x6
popq %rax
movl %eax, (%r14)
movl $0x45, (%r15)
pushq $0x18
jmp 0x6040
movl $0x8, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
pushq $0x1
popq %rax
leaq -0x30(%rbp), %r14
movl %eax, (%r14)
leaq -0x38(%rbp), %r15
movl $0x1e, (%r15)
pushq $0x10
popq %rax
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 0x3896
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
movl $0x14, (%r14)
movl $0x46, (%r15)
pushq $0x10
popq %rax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0x90, %edi
addq 0x28(%rbx), %rdi
movl $0x19, (%r14)
pushq $0x1
popq %rax
movl %eax, (%r15)
pushq $0x2d
popq %rax
movl %eax, (%r12)
movb $0x48, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0xa8, %edi
addq 0x28(%rbx), %rdi
movl $0xb, (%r14)
movl $0x37, (%r15)
pushq $0x2d
jmp 0x614d
movl $0xa, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
pushq $0x1
popq %rax
leaq -0x30(%rbp), %r14
movl %eax, (%r14)
leaq -0x38(%rbp), %r15
movl $0xe, (%r15)
pushq $0x1c
popq %rax
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 0x3896
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
pushq $0x7
popq %rax
movl %eax, (%r14)
pushq $0x1c
popq %rax
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 0x3896
movl $0x90, %edi
addq 0x28(%rbx), %rdi
pushq $0x1
popq %rax
movl %eax, (%r14)
movl $0x2a, (%r15)
pushq $0x1c
popq %rax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0xa8, %edi
addq 0x28(%rbx), %rdi
pushq $0x7
popq %rax
movl %eax, (%r14)
movl $0x38, (%r15)
pushq $0x1c
popq %rax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0xc0, %edi
addq 0x28(%rbx), %rdi
pushq $0x1
popq %rax
movl %eax, (%r14)
movl $0x46, (%r15)
pushq $0x1c
popq %rax
movl %eax, (%r12)
movb $0x56, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0xd8, %edi
addq 0x28(%rbx), %rdi
pushq $0x7
popq %rax
movl %eax, (%r14)
movl $0x54, (%r15)
pushq $0x1c
popq %rax
movl %eax, (%r12)
movb $0x56, %al
jmp 0x61f4
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 0x6208
movl $0x8, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
pushq $0xc
popq %r14
leaq -0x30(%rbp), %rax
movl %r14d, (%rax)
movq %rax, %rsi
pushq $0x19
popq %rax
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 0x3896
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 0x3896
movl $0x90, %edi
addq 0x28(%rbx), %rdi
movl $0xa, (%r14)
pushq $0x1b
popq %rax
movl %eax, (%r15)
pushq $0x2f
popq %rax
movl %eax, (%r12)
movb $0x48, %al
movb %al, (%r13)
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x3896
movl $0xa8, %edi
addq 0x28(%rbx), %rdi
pushq $0x19
popq %rax
movl %eax, (%r14)
pushq $0x1b
popq %rax
movl %eax, (%r15)
pushq $0x2f
popq %rax
movl %eax, (%r12)
movb $0x48, %al
jmp 0x61f4
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 0x6208
movl $0x6, 0xc(%rbx)
movq 0x28(%rbx), %rdi
addq $0x60, %rdi
pushq $0x2
popq %rax
leaq -0x30(%rbp), %r14
movl %eax, (%r14)
leaq -0x38(%rbp), %r15
movl %eax, (%r15)
pushq $0x20
popq %rax
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 0x3896
movq 0x28(%rbx), %rdi
addq $0x78, %rdi
pushq $0x2
popq %rax
movl %eax, (%r14)
movl $0x42, (%r15)
pushq $0x20
popq %rax
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 0x3896
leaq 0x8(%rbx), %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0xc(%rbx), %rax
cmpq %rax, %r12
jge 0x6235
movq 0x28(%rbx), %rdi
addq %r15, %rdi
callq 0x3a08
incq %r12
addq $0x18, %r15
jmp 0x6217
xorl %r15d, %r15d
movslq 0x10(%rbx), %rax
cmpq %rax, %r15
jge 0x6257
movq 0x30(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
incq %r15
jmp 0x6238
movq %rbx, %rdi
callq 0x79ec
movq %rbx, %rdi
callq 0x7ab8
callq 0x3400
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop