// File: /workspace/github_c_makefile_star2_O1/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 0x2d00a
movq %rax, %rbp
movq 0x48(%r12), %rdi
callq 0x2d00a
movq %rax, %r13
movq 0x48(%r12), %rdi
callq 0x2d00a
movq %rax, %r14
movq 0x48(%r12), %rdi
movl $0x7f, %esi
movq %r15, %rdx
callq 0x2c193
cmpl $0x0, (%r15)
je 0x26f33
xorl %r14d, %r14d
xorl %ebp, %ebp
jmp 0x26f4e
movq %rbp, 0x10(%rsp)
movl %eax, %edi
movq %r15, %rsi
callq 0x2ba99
movq %rax, %rbp
cmpl $0x0, (%r15)
je 0x26f7f
xorl %r14d, %r14d
xorl %r13d, %r13d
movq %r14, %rdi
callq 0x2b4c3
movq %r13, %rdi
callq 0x2b4c3
movq %rbp, %rdi
callq 0x2b4c3
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2b4c3
movq %r13, 0x8(%rsp)
movq %r14, (%rsp)
xorl %r14d, %r14d
xorl %edi, %edi
movq %r15, %rsi
callq 0x2bb29
movq %rax, %r13
cmpl $0x0, (%r15)
jne 0x26f51
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
movq %r15, %rcx
callq 0x36f23
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x26fc9
movq %rbx, %rdi
movq %r15, %rsi
callq 0x362d2
cmpl $0x0, (%r15)
je 0x26fd0
xorl %r14d, %r14d
xorl %ebp, %ebp
jmp 0x26f51
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x372a2
movq %rax, %r14
cmpl $0x0, (%r15)
jne 0x26f2f
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 0x2c0c2
cmpl $0x0, (%r15)
jne 0x26f2f
movq 0x48(%r12), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x2d017
cmpl $0x0, (%r15)
jne 0x26f2f
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x270b1
cmpl $0x0, (%r15)
jne 0x270aa
movq 0x48(%r12), %rdi
movl $0x45, %esi
movq (%rsp), %rdx
movq %r15, %rcx
callq 0x2c19f
cmpl $0x0, (%r15)
jne 0x270aa
movq 0x48(%r12), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x2d017
cmpl $0x0, (%r15)
jne 0x270aa
movq 0x48(%r12), %rdi
movl $0x20, %esi
movq %r15, %rdx
callq 0x2c1b7
cmpl $0x0, (%r15)
jne 0x270aa
movq 0x48(%r12), %rdi
movq (%rsp), %rsi
movq %r15, %rdx
callq 0x2d017
xorl %ebx, %ebx
jmp 0x26f2f