// File: /workspace/github_c_makefile_star2_O2/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 0x5f54(%rip), %r15      # 0x8150
leaq 0x1(%r15), %rax
movq %rax, 0x5f49(%rip)      # 0x8150
callq 0x149d
movl 0x2d05a(%rip), %eax     # 0x2f26c
leaq 0x4f37(%rip), %rcx      # 0x7150
movq 0x5f30(%rip), %rdx      # 0x8150
cmpq %rdx, %rcx
jae 0x2235
xorl %esi, %esi
cmpb $0xa, (%rcx)
sete %sil
addl %esi, %eax
incq %rcx
jmp 0x2220
cltq
leaq 0x1(,%rax,2), %rdi
callq 0x1984
pushq $0x4
popq %rdi
movl %eax, %esi
callq 0x191c
movl 0x3828c(%rip), %esi     # 0x3a4e0
pushq $0xc
popq %rdi
callq 0x191c
movl 0x36eae(%rip), %ebx     # 0x39110
xorl %edi, %edi
callq 0x18c0
movl 0x38271(%rip), %ebp     # 0x3a4e0
movq 0x5eda(%rip), %rax      # 0x8150
movb (%rax), %cl
cmpb $0x3a, %cl
jne 0x22ed
leaq 0x2cfec(%rip), %r14     # 0x2f270
incq %rax
movq %rax, 0x5ec2(%rip)      # 0x8150
callq 0x149d
movq 0x5eb6(%rip), %rax      # 0x8150
movb (%rax), %al
andb $-0x21, %al
addb $-0x5b, %al
cmpb $-0x1b, %al
jbe 0x2398
callq 0x1582
testl %eax, %eax
jne 0x23a4
movq %r14, %rdi
callq 0x1a55
movq 0x5e8c(%rip), %rax      # 0x8150
movzbl (%rax), %ecx
cmpl $0x3a, %ecx
je 0x2284
cmpl $0x7c, %ecx
jne 0x23b0
incq %rax
movq %rax, 0x5e71(%rip)      # 0x8150
callq 0x149d
movq 0x5e65(%rip), %rax      # 0x8150
movb (%rax), %cl
cmpb $0x5d, %cl
jne 0x2303
pushq $0x5a
popq %rdi
callq 0x1889
movq 0x5e4f(%rip), %rax      # 0x8150
jmp 0x2357
movl 0x3823e(%rip), %r14d    # 0x3a548
movl $0x3, 0x38234(%rip)     # 0x3a548
callq 0x23bc
movq 0x5e30(%rip), %rax      # 0x8150
movb (%rax), %cl
cmpb $0x2e, %cl
jne 0x233f
incq %rax
movq %rax, 0x5e1f(%rip)      # 0x8150
callq 0x149d
movq 0x5e13(%rip), %rax      # 0x8150
movb (%rax), %cl
cmpb $0x5d, %cl
je 0x2350
movl $0xf5, %edi
callq 0x1889
jmp 0x2314
movl %r14d, 0x381f1(%rip)    # 0x3a548
incq %rax
movq %rax, 0x5def(%rip)      # 0x8150
callq 0x149d
movl $0xf2, %edi
callq 0x1889
movl 0x36d9a(%rip), %esi     # 0x39110
movl %ebx, %edi
callq 0x18f1
movl %ebp, 0x3815d(%rip)     # 0x3a4e0
movq %r15, 0x381c6(%rip)     # 0x3a550
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e26(%rip), %rdi      # 0x41c5
callq 0x12ef
leaq 0x1e2d(%rip), %rdi      # 0x41d8
callq 0x12ef
leaq 0x1e31(%rip), %rdi      # 0x41e8
callq 0x12ef