// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x6b05(%rip), %r15      # 0x9150
leaq 0x1(%r15), %rax
movq %rax, 0x6afa(%rip)      # 0x9150
callq 0x15be
movl 0x2dc0b(%rip), %eax     # 0x3026c
movq 0x6ae8(%rip), %rcx      # 0x9150
leaq 0x5ae1(%rip), %rdx      # 0x8150
cmpq %rdx, %rcx
jbe 0x2687
xorl %esi, %esi
cmpb $0xa, (%rdx)
sete %sil
addl %esi, %eax
incq %rdx
cmpq %rcx, %rdx
jne 0x2674
cltq
leaq 0x1(,%rax,2), %rdi
callq 0x1c58
movl $0x4, %edi
movl %eax, %esi
callq 0x1bd9
movl 0x38e38(%rip), %esi     # 0x3b4e0
movl $0xc, %edi
callq 0x1bd9
movl 0x37a58(%rip), %ebx     # 0x3a110
xorl %edi, %edi
callq 0x1b0d
xorl %edi, %edi
callq 0x1b0d
movl 0x38e14(%rip), %ebp     # 0x3b4e0
movq 0x6a7d(%rip), %rax      # 0x9150
cmpb $0x3a, (%rax)
jne 0x273c
leaq 0x2db91(%rip), %r14     # 0x30270
incq 0x6a6a(%rip)            # 0x9150
callq 0x15be
movq 0x6a5e(%rip), %rax      # 0x9150
movb (%rax), %al
andb $-0x21, %al
addb $-0x5b, %al
cmpb $-0x1b, %al
jbe 0x27e4
callq 0x16b9
testl %eax, %eax
jne 0x27f0
movq %r14, %rdi
callq 0x1d42
movq 0x6a34(%rip), %rax      # 0x9150
movzbl (%rax), %ecx
cmpl $0x3a, %ecx
je 0x26df
cmpl $0x7c, %ecx
jne 0x27fc
incq %rax
movq %rax, 0x6a19(%rip)      # 0x9150
callq 0x15be
movq 0x6a0d(%rip), %rax      # 0x9150
cmpb $0x5d, (%rax)
jne 0x2754
movl $0x5a, %edi
callq 0x1b0d
jmp 0x27a4
movl 0x38ded(%rip), %r14d    # 0x3b548
movl $0x3, 0x38de3(%rip)     # 0x3b548
callq 0x2808
movq 0x69df(%rip), %rax      # 0x9150
cmpb $0x2e, (%rax)
jne 0x2785
incq %rax
movq %rax, 0x69d0(%rip)      # 0x9150
callq 0x15be
movq 0x69c4(%rip), %rax      # 0x9150
cmpb $0x5d, (%rax)
je 0x279d
movl $0xf5, %edi
callq 0x1b0d
jmp 0x2765
movl %r14d, 0x38da4(%rip)    # 0x3b548
incq 0x69a5(%rip)            # 0x9150
callq 0x15be
movl $0xf2, %edi
callq 0x1b0d
movl 0x37950(%rip), %esi     # 0x3a110
movl %ebx, %edi
callq 0x1b9b
movl %ebp, 0x38d13(%rip)     # 0x3b4e0
movq %r15, 0x38d7c(%rip)     # 0x3b550
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2a16(%rip), %rdi      # 0x5201
callq 0x13c6
leaq 0x2a1d(%rip), %rdi      # 0x5214
callq 0x13c6
leaq 0x2a21(%rip), %rdi      # 0x5224
callq 0x13c6