// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/frontend/irgen_c.c
// Function: ir_stat_va_start
static void _ir_stat_va_start(
	IRGeneratorCContext *ctx,
	int indentLevel,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);
	assert(node->type == FE_NODE_STAT_VA_START);
	assert(node->nchilds == 1);

	ParserASTNode *node_expr = node->childs[0];

	_OUT_INDENT(ctx, indentLevel);

	_OUT_CSTR(ctx, "va_start(");

	ResizableString rstr_expr;
	rstr_init(&rstr_expr);
	_ir_expr_wrapper(ctx, &rstr_expr, node_expr);
	_OUT_STR(ctx, rstr_expr.buffer, rstr_expr.len);
	rstr_free(&rstr_expr);

	_OUT_CSTR(ctx, ", ");

	ParserSymbol *func_symbol = fe_sem_get_func_symbol_by_node(ctx->psrctx, node);
	ParserASTNode *params_node = FE_FUNC_SYMBOL_GET_PARAMS_NODE(func_symbol);
	assert(params_node->nchilds >= 2);

	ParserASTNode *penult_param_node = params_node->childs[params_node->nchilds - 2];
	_OUT_STR(
		ctx,
		penult_param_node->childs[0]->token->content,
		penult_param_node->childs[0]->token->len
	);

	_OUT_CSTR(ctx, ");\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x274fc
jmp 0x2751b
leaq 0x55053(%rip), %rdi     # 0x7c556
leaq 0x4f8de(%rip), %rsi     # 0x76de8
movl $0x639, %edx            # imm = 0x639
leaq 0x5089a(%rip), %rcx     # 0x77db0
callq 0x30a0
cmpq $0x0, -0x18(%rbp)
je 0x27524
jmp 0x27543
leaq 0x4eaa8(%rip), %rdi     # 0x75fd3
leaq 0x4f8b6(%rip), %rsi     # 0x76de8
movl $0x63a, %edx            # imm = 0x63A
leaq 0x50872(%rip), %rcx     # 0x77db0
callq 0x30a0
movq -0x18(%rbp), %rax
cmpl $0xbd0, (%rax)          # imm = 0xBD0
jne 0x27551
jmp 0x27570
leaq 0x4f68a(%rip), %rdi     # 0x76be2
leaq 0x4f889(%rip), %rsi     # 0x76de8
movl $0x63b, %edx            # imm = 0x63B
leaq 0x50845(%rip), %rcx     # 0x77db0
callq 0x30a0
movq -0x18(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x2757c
jmp 0x2759b
leaq 0x57b6d(%rip), %rdi     # 0x7f0f0
leaq 0x4f85e(%rip), %rsi     # 0x76de8
movl $0x63c, %edx            # imm = 0x63C
leaq 0x5081a(%rip), %rcx     # 0x77db0
callq 0x30a0
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x25d00
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rax
cmpq $0x9, %rax
jae 0x275ee
movslq -0x24(%rbp), %rcx
leaq 0x50822(%rip), %rax     # 0x77df4
movsbl (%rax,%rcx), %edi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x30d0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x275bd
leaq -0x38(%rbp), %rdi
callq 0x8c90
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x38(%rbp), %rsi
callq 0x21d00
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x2763b
movq -0x30(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsbl (%rax,%rcx), %edi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x30d0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x2760f
leaq -0x38(%rbp), %rdi
callq 0x9310
movl $0x0, -0x40(%rbp)
movslq -0x40(%rbp), %rax
cmpq $0x2, %rax
jae 0x2767c
movslq -0x40(%rbp), %rcx
leaq 0x4db69(%rip), %rax     # 0x751c9
movsbl (%rax,%rcx), %edi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x30d0
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x2764b
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x4dbc0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jl 0x276a8
jmp 0x276c7
leaq 0x5074f(%rip), %rdi     # 0x77dfe
leaq 0x4f732(%rip), %rsi     # 0x76de8
movl $0x64e, %edx            # imm = 0x64E
leaq 0x506ee(%rip), %rcx     # 0x77db0
callq 0x30a0
movq -0x50(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x50(%rbp), %rcx
movl 0x44(%rcx), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x58(%rbp), %rcx
movq 0x48(%rcx), %rcx
movq (%rcx), %rcx
movq 0x10(%rcx), %rcx
cmpl 0x4(%rcx), %eax
jge 0x27735
movq -0x58(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x5c(%rbp), %rcx
movsbl (%rax,%rcx), %edi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x30d0
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x276eb
movl $0x0, -0x60(%rbp)
movslq -0x60(%rbp), %rax
cmpq $0x3, %rax
jae 0x2776d
movslq -0x60(%rbp), %rcx
leaq 0x5017d(%rip), %rax     # 0x778ce
movsbl (%rax,%rcx), %edi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x30d0
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x2773c
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)