// File: /workspace/github_c_makefile_star2_O0/GregorR[P]lstg/ImageBuilder/imageBuilder.c
// Function: parseBlock
int parseBlock(void)
{
  int             savedLocation,
                  saveTop,
                  argCount,
                  blockLineNo;
  char           *savestart, *lnp;

  savestart = p;
  p++;
  skipSpaces();

  /* FIXME: This is a stupid way of getting the line number */
  blockLineNo = methodLineNo;
  for(lnp = inputBuffer; lnp < p; lnp++)
  {
    if(*lnp == '\n')
    {
      blockLineNo++;
    }
  }
  genInstruction(PushLiteral, addLiteral(newInteger(blockLineNo)));
  genInstruction(PushBlock, tempTop);
  savedLocation = byteTop;
  genVal(0);

  saveTop = tempTop;
  argCount = 0;
  if(*p == ':')
  {
    while(1)
    {
      p++;
      skipSpaces();
      if(!isIdentifierChar(*p))
        return parseError("missing identifier");
      if(readIdentifier())
        return parseError("keyword illegal");
      addTemporary(tokenBuffer);
      argCount++;
      if(*p == '|')
        break;
      if(*p != ':')
        return parseError("missing colon:");
    }
    p++;
    skipSpaces();
  }
  if(*p == ']')
  {
    genInstruction(PushConstant, nilConst);
  }
  else
  {
    int             saveReturnOp = returnOp;

    returnOp = BlockReturn;
    while(1)
    {
      if(!parseStatement())
      {
        parseError("Statement syntax inside block");
      }
      if(*p == '.')
      {
        p++;
        skipSpaces();
      }
      if(*p == ']')
      {
        break;
      }
      else
      {
        genInstruction(DoSpecial, PopTop);
      }
    }
    returnOp = saveReturnOp;
  }
  p++;
  skipSpaces();                 /* skip over ] */
  genInstruction(DoSpecial, StackReturn);
  genValPos(savedLocation, byteTop);
  tempTop = saveTop;

  /*
     set blockbackup to textual start of block 
   */
  blockbackup = savestart;
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq 0x7385(%rip), %rax      # 0xa140
movq %rax, 0x18(%rsp)
movq 0x7379(%rip), %rax      # 0xa140
addq $0x1, %rax
movq %rax, 0x736e(%rip)      # 0xa140
callq 0x1630
movl 0x2e47f(%rip), %eax     # 0x3125c
movl %eax, 0x24(%rsp)
leaq 0x6358(%rip), %rax      # 0x9140
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x7347(%rip), %rax      # 0xa140
jae 0x2e25
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x2e13
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x2e15
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x2ded
movslq 0x24(%rsp), %rdi
shlq %rdi
orq $0x1, %rdi
callq 0x2040
movl %eax, %esi
movl $0x4, %edi
callq 0x1f80
movl 0x39688(%rip), %esi     # 0x3c4d0
movl $0xc, %edi
callq 0x1f80
movl 0x382a8(%rip), %eax     # 0x3b100
movl %eax, 0x30(%rsp)
xorl %edi, %edi
callq 0x1ec0
movl 0x39667(%rip), %eax     # 0x3c4d0
movl %eax, 0x2c(%rsp)
movl $0x0, 0x28(%rsp)
movq 0x72c4(%rip), %rax      # 0xa140
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0x2f51
jmp 0x2e8a
movq 0x72af(%rip), %rax      # 0xa140
addq $0x1, %rax
movq %rax, 0x72a4(%rip)      # 0xa140
callq 0x1630
movq 0x7298(%rip), %rax      # 0xa140
movsbl (%rax), %edi
callq 0x1790
cmpl $0x0, %eax
jne 0x2eca
leaq 0x3460(%rip), %rdi      # 0x631c
callq 0x1350
movl %eax, 0x34(%rsp)
jmp 0x3040
callq 0x18a0
cmpl $0x0, %eax
je 0x2ee9
leaq 0x3454(%rip), %rdi      # 0x632f
callq 0x1350
movl %eax, 0x34(%rsp)
jmp 0x3040
leaq 0x2e370(%rip), %rdi     # 0x31260
callq 0x2190
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
movq 0x7239(%rip), %rax      # 0xa140
movsbl (%rax), %eax
cmpl $0x7c, %eax
jne 0x2f11
jmp 0x2f3a
movq 0x7228(%rip), %rax      # 0xa140
movsbl (%rax), %eax
cmpl $0x3a, %eax
je 0x2f35
leaq 0x3418(%rip), %rdi      # 0x633f
callq 0x1350
movl %eax, 0x34(%rsp)
jmp 0x3040
jmp 0x2e8a
movq 0x71ff(%rip), %rax      # 0xa140
addq $0x1, %rax
movq %rax, 0x71f4(%rip)      # 0xa140
callq 0x1630
movq 0x71e8(%rip), %rax      # 0xa140
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0x2f71
movl $0x5, %edi
movl $0xa, %esi
callq 0x1f80
jmp 0x2fed
movl 0x395c1(%rip), %eax     # 0x3c538
movl %eax, 0xc(%rsp)
movl $0x3, 0x395b3(%rip)     # 0x3c538
callq 0x3050
cmpl $0x0, %eax
jne 0x2f9b
leaq 0x33b8(%rip), %rdi      # 0x634e
callq 0x1350
movq 0x719e(%rip), %rax      # 0xa140
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x2fc1
movq 0x718f(%rip), %rax      # 0xa140
addq $0x1, %rax
movq %rax, 0x7184(%rip)      # 0xa140
callq 0x1630
movq 0x7178(%rip), %rax      # 0xa140
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0x2fd2
jmp 0x2fe3
movl $0xf, %edi
movl $0x5, %esi
callq 0x1f80
jmp 0x2f85
movl 0xc(%rsp), %eax
movl %eax, 0x3954b(%rip)     # 0x3c538
movq 0x714c(%rip), %rax      # 0xa140
addq $0x1, %rax
movq %rax, 0x7141(%rip)      # 0xa140
callq 0x1630
movl $0xf, %edi
movl $0x2, %esi
callq 0x1f80
movl 0x30(%rsp), %edi
movl 0x380e3(%rip), %esi     # 0x3b100
callq 0x1f10
movl 0x2c(%rsp), %eax
movl %eax, 0x394a4(%rip)     # 0x3c4d0
movq 0x18(%rsp), %rax
movq %rax, 0x39508(%rip)     # 0x3c540
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)