// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_output.c
// Function: prv_tab_one_arg
static void prv_tab_one_arg(subtilis_parser_t *p, subtilis_token_t *t,
			    subtilis_exp_t *e, subtilis_error_t *err)
{
	size_t reg;
	subtilis_ir_operand_t gt_label;
	subtilis_ir_operand_t lt_label;
	subtilis_ir_operand_t end_label;
	subtilis_exp_t *cond = NULL;
	subtilis_exp_t *pos = NULL;
	subtilis_exp_t *zero = NULL;
	subtilis_exp_t *e_dup = NULL;

	gt_label.label = subtilis_ir_section_new_label(p->current);
	lt_label.label = subtilis_ir_section_new_label(p->current);
	end_label.label = subtilis_ir_section_new_label(p->current);

	reg = subtilis_ir_section_add_instr1(p->current, SUBTILIS_OP_INSTR_POS,
					     err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	pos = subtilis_exp_new_int32_var(reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	zero = subtilis_exp_new_int32(0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e = subtilis_type_if_sub(p, e, pos, err);
	pos = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e_dup = subtilis_type_if_dup(e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	cond = subtilis_type_if_gte(p, zero, e_dup, err);
	zero = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;
	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC,
					  cond->exp.ir_op, lt_label, gt_label,
					  err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_label(p->current, gt_label.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	prv_spc(p, e, err);
	e = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_instr_no_reg(p->current, SUBTILIS_OP_INSTR_JMP,
					     end_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_label(p->current, lt_label.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_instr_no_arg(p->current,
					     SUBTILIS_OP_INSTR_PRINT_NL, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_label(p->current, end_label.label, err);

cleanup:

	subtilis_exp_delete(cond);
	subtilis_exp_delete(zero);
	subtilis_exp_delete(pos);
	subtilis_exp_delete(e);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movq 0x48(%rdi), %rdi
callq 0x2cc99
movq %rax, %rbp
movq 0x48(%r12), %rdi
callq 0x2cc99
movq %rax, %r13
movq 0x48(%r12), %rdi
callq 0x2cc99
movq %rax, %r14
movq 0x48(%r12), %rdi
movl $0x7f, %esi
movq %r15, %rdx
callq 0x2be13
cmpl $0x0, (%r15)
je 0x26d88
xorl %r14d, %r14d
xorl %ebp, %ebp
jmp 0x26da3
movq %rbp, 0x10(%rsp)
movl %eax, %edi
movq %r15, %rsi
callq 0x2b71f
movq %rax, %rbp
cmpl $0x0, (%r15)
je 0x26dd4
xorl %r14d, %r14d
xorl %r13d, %r13d
movq %r14, %rdi
callq 0x2b166
movq %r13, %rdi
callq 0x2b166
movq %rbp, %rdi
callq 0x2b166
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2b166
movq %r13, 0x8(%rsp)
movq %r14, (%rsp)
xorl %r14d, %r14d
xorl %edi, %edi
movq %r15, %rsi
callq 0x2b7af
movq %rax, %r13
cmpl $0x0, (%r15)
jne 0x26da6
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
movq %r15, %rcx
callq 0x36de4
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x26e1e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x36182
cmpl $0x0, (%r15)
je 0x26e25
xorl %r14d, %r14d
xorl %ebp, %ebp
jmp 0x26da6
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x37164
movq %rax, %r14
cmpl $0x0, (%r15)
jne 0x26d84
movq 0x48(%r12), %rdi
movq 0x148(%r14), %rdx
movl $0x43, %esi
movq 0x8(%rsp), %r13
movq %r13, %rcx
movq 0x10(%rsp), %rbp
movq %rbp, %r8
movq %r15, %r9
callq 0x2bd42
cmpl $0x0, (%r15)
jne 0x26d84
movq 0x48(%r12), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x2cca6
cmpl $0x0, (%r15)
jne 0x26d84
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x26f06
cmpl $0x0, (%r15)
jne 0x26eff
movq 0x48(%r12), %rdi
movl $0x45, %esi
movq (%rsp), %rdx
movq %r15, %rcx
callq 0x2be1f
cmpl $0x0, (%r15)
jne 0x26eff
movq 0x48(%r12), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x2cca6
cmpl $0x0, (%r15)
jne 0x26eff
movq 0x48(%r12), %rdi
movl $0x20, %esi
movq %r15, %rdx
callq 0x2be37
cmpl $0x0, (%r15)
jne 0x26eff
movq 0x48(%r12), %rdi
movq (%rsp), %rsi
movq %r15, %rdx
callq 0x2cca6
xorl %ebx, %ebx
jmp 0x26d84