// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9CompileBreak
static sxi32 jx9CompileBreak(jx9_gen_state *pGen)
{
	GenBlock *pLoop; /* Target loop */
	sxi32 iLevel;    /* How many nesting loop to skip */
	sxu32 nLine;
	sxi32 rc;
	nLine = pGen->pIn->nLine;
	iLevel = 0;
	/* Jump the 'break' keyword */
	pGen->pIn++;
	if( pGen->pIn < pGen->pEnd && (pGen->pIn->nType & JX9_TK_NUM) ){
		/* optional numeric argument which tells us how many levels
		 * of enclosing loops we should skip to the end of. 
		 */
		iLevel = (sxi32)jx9TokenValueToInt64(&pGen->pIn->sData);
		if( iLevel < 2 ){
			iLevel = 0;
		}
		pGen->pIn++; /* Jump the optional numeric argument */
	}
	/* Extract the target loop */
	pLoop = GenStateFetchBlock(pGen->pCurrent, GEN_BLOCK_LOOP, iLevel);
	if( pLoop == 0 ){
		/* Illegal break */
		rc = jx9GenCompileError(pGen, E_ERROR, pGen->pIn->nLine, "A 'break' statement may only be used within a loop or switch");
		if( rc == SXERR_ABORT ){
			/* Error count limit reached, abort immediately */
			return SXERR_ABORT;
		}
	}else{
		sxu32 nInstrIdx; 
		rc = jx9VmEmitInstr(pGen->pVm, JX9_OP_JMP, 0, 0, 0, &nInstrIdx);
		if( rc == SXRET_OK ){
			/* Fix the jump later when the jump destination is resolved */
			GenStateNewJumpFixup(pLoop, JX9_OP_JMP, nInstrIdx);
		}
	}
	if( pGen->pIn < pGen->pEnd && (pGen->pIn->nType & JX9_TK_SEMI) == 0 ){
		/* Not so fatal, emit a warning only */
		jx9GenCompileError(&(*pGen), E_WARNING, pGen->pIn->nLine, "Expected semi-colon ';' after 'break' statement");
	}
	/* Statement successfully compiled */
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x14(%rax), %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x158(%rax)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x160(%rcx), %rax
jae 0x8349e
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x10(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x8349e
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rdi
callq 0x71110
movl %eax, -0x1c(%rbp)
cmpl $0x2, -0x1c(%rbp)
jge 0x83488
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x158(%rax)
movq -0x10(%rbp), %rax
movq 0xc8(%rax), %rdi
movl -0x1c(%rbp), %edx
movl $0x1, %esi
callq 0x85680
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x834fd
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x14(%rax), %edx
movl $0x1, %esi
leaq 0x40b69(%rip), %rcx     # 0xc4048
movb $0x0, %al
callq 0x7e990
movl %eax, -0x24(%rbp)
cmpl $-0xa, -0x24(%rbp)
jne 0x834fb
movl $0xfffffff6, -0x4(%rbp) # imm = 0xFFFFFFF6
jmp 0x83593
jmp 0x83537
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x8, %esi
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r8d
leaq -0x28(%rbp), %r9
movl %ecx, %edx
callq 0x7e8f0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x83535
movq -0x18(%rbp), %rdi
movl -0x28(%rbp), %edx
movl $0x8, %esi
callq 0x84240
jmp 0x83537
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x160(%rcx), %rax
jae 0x8358c
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x10(%rax), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
jne 0x8358c
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x14(%rax), %edx
movl $0x2, %esi
leaq 0x40b00(%rip), %rcx     # 0xc4085
movb $0x0, %al
callq 0x7e990
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)