// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/slgh_compile.cc
// Function: ConsistencyChecker::checkSubtable(SubtableSymbol*)
bool ConsistencyChecker::checkSubtable(SubtableSymbol *sym)

{
  int4 tablesize = 0;
  int4 numconstruct = sym->getNumConstructors();
  Constructor *ct;
  bool testresult = true;
  bool seenemptyexport = false;
  bool seennonemptyexport = false;

  for(int4 i=0;i<numconstruct;++i) {
    ct = sym->getConstructor(i);
    if (!checkConstructorSection(ct,ct->getTempl()))
      testresult = false;
    int4 numsection = ct->getNumSections();
    for(int4 j=0;j<numsection;++j) {
      if (!checkConstructorSection(ct,ct->getNamedTempl(j)))
	testresult = false;
    }

    if (ct->getTempl() == (ConstructTpl *)0) continue;	// Unimplemented
    HandleTpl *exportres = ct->getTempl()->getResult();
    if (exportres != (HandleTpl *)0) {
      if (seenemptyexport && (!seennonemptyexport)) {
	cerr << "Table " << sym->getName() << " exports inconsistently" << endl;
	cerr << "Constructor starting at line " << dec << ct->getLineno() << " is first inconsistency" << endl;
	testresult = false;
      }
      seennonemptyexport = true;
      int4 exsize = recoverSize(exportres->getSize(),ct);
      if (tablesize == 0)
	tablesize = exsize;
      if ((exsize!=0)&&(exsize != tablesize)) {
	cerr << "Table " << sym->getName() << " has inconsistent export size." << endl;
	cerr << "Constructor starting at line " << dec << ct->getLineno() << " is first conflict" << endl;
	testresult = false;
      }
    }
    else {
      if (seennonemptyexport && (!seenemptyexport)) {
	cerr << "Table " << sym->getName() << " exports inconsistently" << endl;
	cerr << "Constructor starting at line " << dec << ct->getLineno() << " is first inconsistency" << endl;
	testresult = false;
      }
      seenemptyexport = true;
    }
  }
  if (seennonemptyexport) {
    if (tablesize == 0)
      cerr << "Warning: Table " << sym->getName() << " exports size 0" << endl;
    sizemap[sym] = tablesize;	// Remember recovered size
  }
  else
    sizemap[sym] = -1;
  
  return testresult;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq %rsi, 0x20(%rsp)
movq 0x48(%rsi), %rax
subq 0x40(%rsi), %rax
shrq $0x3, %rax
testl %eax, %eax
jle 0x2c249
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movb $0x1, %bpl
xorl %r14d, %r14d
xorl %ecx, %ecx
movl $0x0, 0xc(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rax
movq %rcx, 0x18(%rsp)
movq (%rax,%rcx,8), %r12
movq 0x60(%r12), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2bb70
movzbl %bpl, %ebp
testb %al, %al
cmovel %r14d, %ebp
movq 0x70(%r12), %r13
subq 0x68(%r12), %r13
shrq $0x3, %r13
testl %r13d, %r13d
jle 0x2beff
xorl %r15d, %r15d
movq %r12, %rdi
movl %r15d, %esi
callq 0x4cf22
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x2bb70
movzbl %bpl, %ebp
testb %al, %al
cmovel %r14d, %ebp
incl %r15d
cmpl %r15d, %r13d
jne 0x2bed4
movq 0x60(%r12), %rax
testq %rax, %rax
je 0x2c22c
movq 0x20(%rax), %r15
testq %r15, %r15
je 0x2c121
testb $0x1, 0x28(%rsp)
movq 0x30(%rsp), %rax
je 0x2c01e
testb $0x1, %al
jne 0x2c01e
movl $0x6, %edx
movq 0x610aa(%rip), %r13     # 0x8cfe8
movq %r13, %rdi
leaq 0x360bb(%rip), %rsi     # 0x62003
callq 0xf420
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r13, %rdi
callq 0xf420
movq %rax, %rbp
movl $0x17, %edx
movq %rax, %rdi
leaq 0x36006(%rip), %rsi     # 0x61f7a
callq 0xf420
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0xf340
movsbl %al, %esi
movq %rbp, %rdi
callq 0xf040
movq %rax, %rdi
callq 0xf260
movl $0x1d, %edx
movq %r13, %rdi
leaq 0x35fe2(%rip), %rsi     # 0x61f92
callq 0xf420
movq (%r13), %rax
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%r13,%rax)
movl 0x90(%r12), %esi
movq %r13, %rdi
callq 0xf6e0
movq %rax, %rbp
movl $0x17, %edx
movq %rax, %rdi
leaq 0x35fc1(%rip), %rsi     # 0x61fb0
callq 0xf420
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0xf340
movsbl %al, %esi
movq %rbp, %rdi
callq 0xf040
movq %rax, %rdi
callq 0xf260
xorl %ebp, %ebp
addq $0x20, %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2a25e
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
cmovel %eax, %ecx
movb $0x1, %dl
movq %rdx, 0x30(%rsp)
testl %eax, %eax
movl %ecx, 0xc(%rsp)
je 0x2c22c
cmpl %ecx, %eax
je 0x2c22c
movl $0x6, %edx
movq 0x60f88(%rip), %r13     # 0x8cfe8
movq %r13, %rdi
leaq 0x35f99(%rip), %rsi     # 0x62003
callq 0xf420
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r13, %rdi
callq 0xf420
movq %rax, %r15
movl $0x1e, %edx
movq %rax, %rdi
leaq 0x35f32(%rip), %rsi     # 0x61fc8
callq 0xf420
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xf340
movsbl %al, %esi
movq %r15, %rdi
callq 0xf040
movq %rax, %rdi
callq 0xf260
movl $0x1d, %edx
movq %r13, %rdi
leaq 0x35ec1(%rip), %rsi     # 0x61f92
callq 0xf420
movq (%r13), %rax
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%r13,%rax)
movl 0x90(%r12), %esi
movq %r13, %rdi
callq 0xf6e0
movq %rax, %r15
movl $0x12, %edx
movq %rax, %rdi
leaq 0x35ed7(%rip), %rsi     # 0x61fe7
callq 0xf420
movb $0x1, %al
movq %rax, 0x30(%rsp)
jmp 0x2c203
testb $0x1, 0x30(%rsp)
je 0x2c12f
testb $0x1, 0x28(%rsp)
je 0x2c13b
movb $0x1, %al
movq %rax, 0x28(%rsp)
jmp 0x2c22c
movl $0x6, %edx
movq 0x60ea1(%rip), %r13     # 0x8cfe8
movq %r13, %rdi
leaq 0x35eb2(%rip), %rsi     # 0x62003
callq 0xf420
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r13, %rdi
callq 0xf420
movq %rax, %r15
movl $0x17, %edx
movq %rax, %rdi
leaq 0x35dfd(%rip), %rsi     # 0x61f7a
callq 0xf420
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xf340
movsbl %al, %esi
movq %r15, %rdi
callq 0xf040
movq %rax, %rdi
callq 0xf260
movl $0x1d, %edx
movq %r13, %rdi
leaq 0x35dda(%rip), %rsi     # 0x61f92
callq 0xf420
movq (%r13), %rax
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%r13,%rax)
movl 0x90(%r12), %esi
movq %r13, %rdi
callq 0xf6e0
movq %rax, %r15
movl $0x17, %edx
movq %rax, %rdi
leaq 0x35db9(%rip), %rsi     # 0x61fb0
callq 0xf420
movb $0x1, %al
movq %rax, 0x28(%rsp)
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xf340
movsbl %al, %esi
movq %r15, %rdi
callq 0xf040
movq %rax, %rdi
callq 0xf260
xorl %ebp, %ebp
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
incq %rcx
cmpq %rax, %rcx
jne 0x2be92
movq 0x30(%rsp), %rax
jmp 0x2c256
xorl %eax, %eax
movb $0x1, %bpl
movl $0x0, 0xc(%rsp)
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testb $0x1, %al
je 0x2c2de
movl 0xc(%rsp), %r14d
testl %r14d, %r14d
jne 0x2c2de
movl %r14d, %r15d
movq 0x60d74(%rip), %r14     # 0x8cfe8
leaq 0x35d7f(%rip), %rsi     # 0x61ffa
movl $0xf, %edx
movq %r14, %rdi
callq 0xf420
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r14, %rdi
callq 0xf420
movq %rax, %r14
leaq 0x35d63(%rip), %rsi     # 0x6200a
movl $0xf, %edx
movq %rax, %rdi
callq 0xf420
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xf340
movsbl %al, %esi
movq %r14, %rdi
callq 0xf040
movq %rax, %rdi
callq 0xf260
movl %r15d, %r14d
addq $0x30, %rbx
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x3461e
movl %r14d, (%rax)
andb $0x1, %bpl
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop