// File: rofl0r[P]ascc/eval_if.c
// Function: led
static int led(struct tokenizer *t, int left, struct token *tok, int *err) {
	int right;
	switch((unsigned) tok->type) {
		case TT_LAND:
		case TT_LOR:
			right = expr(t, bp(tok->type), err);
			if(tok->type == TT_LAND) return left && right;
			return left || right;
		case TT_LTE:  return left <= expr(t, bp(tok->type), err);
		case TT_GTE:  return left >= expr(t, bp(tok->type), err);
		case TT_SHL:  return left << expr(t, bp(tok->type), err);
		case TT_SHR:  return left >> expr(t, bp(tok->type), err);
		case TT_EQ:   return left == expr(t, bp(tok->type), err);
		case TT_NEQ:  return left != expr(t, bp(tok->type), err);
		case TT_LT:   return left <  expr(t, bp(tok->type), err);
		case TT_GT:   return left >  expr(t, bp(tok->type), err);
		case TT_BAND: return left &  expr(t, bp(tok->type), err);
		case TT_BOR:  return left |  expr(t, bp(tok->type), err);
		case TT_XOR:  return left ^  expr(t, bp(tok->type), err);
		case TT_PLUS: return left +  expr(t, bp(tok->type), err);
		case TT_MINUS:return left -  expr(t, bp(tok->type), err);
		case TT_MUL:  return left *  expr(t, bp(tok->type), err);
		case TT_DIV:
		case TT_MOD:
			right = expr(t, bp(tok->type), err);
			if(right == 0)  {
				error("eval: div by zero");
				*err = 1;
			}
			else if(tok->type == TT_DIV) return left / right;
			else if(tok->type == TT_MOD) return left % right;
			return 0;
		default:
			error("eval: unexpect token");
			*err = 1;
			return 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
addl $0xfffffc18, %eax       # imm = 0xFFFFFC18
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x12, %eax
ja 0x30224
movq -0x38(%rbp), %rax
leaq 0x4921(%rip), %rcx      # 0x34690
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0x40(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x3e8, (%rax)          # imm = 0x3E8
jne 0x2fdce
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x41(%rbp)
je 0x2fdbe
cmpl $0x0, -0x2c(%rbp)
setne %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movb $0x1, %al
cmpl $0x0, -0x14(%rbp)
movb %al, -0x42(%rbp)
jne 0x2fde3
cmpl $0x0, -0x2c(%rbp)
setne %al
movb %al, -0x42(%rbp)
movb -0x42(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0x50(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0x48(%rbp), %eax
cmpl %ecx, %eax
setle %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0x60(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0x54(%rbp), %eax
cmpl %ecx, %eax
setge %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0x70(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0x64(%rbp), %eax
shll %cl, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0x80(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0x74(%rbp), %eax
sarl %cl, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0x90(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0x84(%rbp), %eax
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0x94(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0xa0(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0x94(%rbp), %eax
cmpl %ecx, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0xa4(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0xb0(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0xa4(%rbp), %eax
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0xb4(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0xc0(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0xb4(%rbp), %eax
cmpl %ecx, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0xc4(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0xd0(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0xc4(%rbp), %eax
andl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0xd4(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0xe0(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0xd4(%rbp), %eax
orl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0xe4(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0xf0(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0xe4(%rbp), %eax
xorl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0xf4(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0x100(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0xf4(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0x104(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0x110(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0x104(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movl -0x14(%rbp), %eax
movl %eax, -0x114(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0x120(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, %ecx
movl -0x114(%rbp), %eax
imull %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x30241
movq -0x10(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x2fcf0
movq -0x128(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x2f920
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x301e7
leaq 0x466b(%rip), %rdi      # 0x34841
callq 0x2c740
movq -0x28(%rbp), %rax
movl $0x1, (%rax)
jmp 0x3021b
movq -0x20(%rbp), %rax
cmpl $0x3f9, (%rax)          # imm = 0x3F9
jne 0x301ff
movl -0x14(%rbp), %eax
cltd
idivl -0x2c(%rbp)
movl %eax, -0x4(%rbp)
jmp 0x30241
movq -0x20(%rbp), %rax
cmpl $0x3fa, (%rax)          # imm = 0x3FA
jne 0x30217
movl -0x14(%rbp), %eax
cltd
idivl -0x2c(%rbp)
movl %edx, -0x4(%rbp)
jmp 0x30241
jmp 0x30219
jmp 0x3021b
movl $0x0, -0x4(%rbp)
jmp 0x30241
leaq 0x4628(%rip), %rdi      # 0x34853
callq 0x2c740
movq -0x28(%rbp), %rax
movl $0x1, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopl (%rax)