// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/preprocessor/evaluator.c
// Function: get_string_from_node
static void _get_string_from_node(
	PPGeneratorContext *genctx,
	ResizableString *rstr,
	ParserASTNode *node
) {
	assert(rstr);
	assert(node);

	if (node->type == _NODE_IDENTIFIER) {
		ResizableString rstr_tmp;
		rstr_init(&rstr_tmp);

		ResizableString rstr_tmp_trimed;
		rstr_init(&rstr_tmp_trimed);

		expand_macro_rstr(
			&rstr_tmp,
			genctx,
			node->token->content,
			node->token->len
		);

		rstr_trim_ex(&rstr_tmp_trimed, &rstr_tmp, RSTR_SPACE_CHAR_COMPARER);

		if (util_is_literal_string(RSTR_CSTR(&rstr_tmp_trimed), RSTR_LEN(&rstr_tmp_trimed))) {
			util_get_str_val(
				rstr,
				RSTR_CSTR(&rstr_tmp_trimed),
				RSTR_LEN(&rstr_tmp_trimed)
			);
		} else {
			rstr_append_with_rstr(rstr, &rstr_tmp);
		}

		rstr_free(&rstr_tmp);
		rstr_free(&rstr_tmp_trimed);	
	} else if (node->type == _NODE_LITERAL_STRING) {
		util_get_str_val(
			rstr,
			node->token->content,
			node->token->len
		);
	} else {
		assert(0);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x3c27d
jmp 0x3c29c
leaq 0xb89b(%rip), %rdi      # 0x47b1f
leaq 0x12940(%rip), %rsi     # 0x4ebcb
movl $0x49f, %edx            # imm = 0x49F
leaq 0x12a34(%rip), %rcx     # 0x4eccb
callq 0xa0b0
cmpq $0x0, -0x18(%rbp)
je 0x3c2a5
jmp 0x3c2c4
leaq 0xeddb(%rip), %rdi      # 0x4b087
leaq 0x12918(%rip), %rsi     # 0x4ebcb
movl $0x4a0, %edx            # imm = 0x4A0
leaq 0x12a0c(%rip), %rcx     # 0x4eccb
callq 0xa0b0
movq -0x18(%rbp), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x3c3a3
leaq -0x28(%rbp), %rdi
callq 0xfca0
leaq -0x38(%rbp), %rdi
callq 0xfca0
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x4(%rax), %ecx
leaq -0x28(%rbp), %rdi
callq 0x417e0
leaq -0x38(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x2af09(%rip), %rdx    # 0x11410
callq 0x11730
cmpq $0x0, -0x30(%rbp)
jne 0x3c332
leaq 0xb55b(%rip), %rax      # 0x47887
movq %rax, -0x40(%rbp)
jmp 0x3c33a
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x12e80
testb $0x1, %al
jne 0x3c34c
jmp 0x3c382
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x3c368
leaq 0xb525(%rip), %rax      # 0x47887
movq %rax, -0x50(%rbp)
jmp 0x3c370
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x34(%rbp), %edx
callq 0x13770
jmp 0x3c38f
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x10110
leaq -0x28(%rbp), %rdi
callq 0x10320
leaq -0x38(%rbp), %rdi
callq 0x10320
jmp 0x3c3f2
movq -0x18(%rbp), %rax
cmpl $0x302, (%rax)          # imm = 0x302
jne 0x3c3d1
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x4(%rax), %edx
callq 0x13770
jmp 0x3c3f0
leaq 0xb08d(%rip), %rdi      # 0x47465
leaq 0x127ec(%rip), %rsi     # 0x4ebcb
movl $0x4c5, %edx            # imm = 0x4C5
leaq 0x128e0(%rip), %rcx     # 0x4eccb
callq 0xa0b0
jmp 0x3c3f2
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)