// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: GenStateCompileSwitchBlock
static sxi32 GenStateCompileSwitchBlock(jx9_gen_state *pGen,sxu32 *pBlockStart)
{
	sxi32 rc = SXRET_OK;
	while( pGen->pIn < pGen->pEnd && (pGen->pIn->nType & (JX9_TK_SEMI/*';'*/|JX9_TK_COLON/*':'*/)) == 0 ){
		/* Unexpected token */
		rc = jx9GenCompileError(&(*pGen), E_ERROR, pGen->pIn->nLine, "Unexpected token '%z'", &pGen->pIn->sData);
		if( rc == SXERR_ABORT ){
			return SXERR_ABORT;
		}
		pGen->pIn++;
	}
	pGen->pIn++;
	/* First instruction to execute in this block. */
	*pBlockStart = jx9VmInstrLength(pGen->pVm);
	/* Compile the block until we hit a case/default/endswitch keyword
	 * or the '}' token */
	for(;;){
		if( pGen->pIn >= pGen->pEnd ){
			/* No more input to process */
			break;
		}
		rc = SXRET_OK;
		if( (pGen->pIn->nType & JX9_TK_KEYWORD) == 0 ){
			if( pGen->pIn->nType & JX9_TK_CCB /*'}' */ ){
				rc = SXERR_EOF;
				break;
			}
		}else{
			sxi32 nKwrd;
			/* Extract the keyword */
			nKwrd = SX_PTR_TO_INT(pGen->pIn->pUserData);
			if( nKwrd == JX9_TKWRD_CASE || nKwrd == JX9_TKWRD_DEFAULT ){
				break;
			}
		}
		/* Compile block */
		rc = jx9CompileBlock(&(*pGen));
		if( rc == SXERR_ABORT ){
			return SXERR_ABORT;
		}
	}
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq 0x160(%rdx), %rcx
movb %al, -0x21(%rbp)
jae 0x85380
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x10(%rax), %eax
andl $0x140000, %eax         # imm = 0x140000
cmpl $0x0, %eax
sete %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x85389
jmp 0x853e9
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x14(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x158(%rax), %r8
movl $0x1, %esi
leaq 0x3eda7(%rip), %rcx     # 0xc4159
movb $0x0, %al
callq 0x7e990
movl %eax, -0x1c(%rbp)
cmpl $-0xa, -0x1c(%rbp)
jne 0x853ce
movl $0xfffffff6, -0x4(%rbp) # imm = 0xFFFFFFF6
jmp 0x854b8
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x158(%rax)
jmp 0x85347
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x158(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7e8d0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x160(%rcx), %rax
jb 0x85430
jmp 0x854b2
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x10(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x85470
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x10(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x8546e
movl $0xffffffee, -0x1c(%rbp) # imm = 0xFFFFFFEE
jmp 0x854b2
jmp 0x85492
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movq 0x18(%rax), %rax
movl %eax, -0x20(%rbp)
cmpl $0x5, -0x20(%rbp)
je 0x8548e
cmpl $0xa, -0x20(%rbp)
jne 0x85490
jmp 0x854b2
jmp 0x85492
movq -0x10(%rbp), %rdi
callq 0x84280
movl %eax, -0x1c(%rbp)
cmpl $-0xa, -0x1c(%rbp)
jne 0x854ad
movl $0xfffffff6, -0x4(%rbp) # imm = 0xFFFFFFF6
jmp 0x854b8
jmp 0x85413
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)