// File: /workspace/github_c_makefile_star2_O2/Ihsoh[P]ilang/compiler/frontend/semantics.c
// Function: stat_asm
static void _stat_asm(
	ParserContext *ctx,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);
	assert(node->type == FE_NODE_STAT_ASM);
	assert(node->nchilds >= 1);

	ParserASTNode *node_asm_code = node->childs[0];
	assert(node_asm_code->type == FE_NODE_LITERAL_STRING);

	for (int i = 1; i < node->nchilds; i++) {
		ParserASTNode *node_asm_option = node->childs[i];
		assert(node_asm_option->type == FE_NODE_STAT_ASM_OPTION);
		assert(node_asm_option->nchilds == 2);

		ParserASTNode *node_expr = node_asm_option->childs[1];
		assert(node_expr->type == FE_NODE_EXPR);
		_expr_wrapper(ctx, node_expr);

		ParserASTNode *node_specifier = node_asm_option->childs[0];
		assert(node_specifier->type == FE_NODE_LITERAL_STRING);
		LexerToken *tk_specifier = node_specifier->token;
		if (tk_specifier->len >= 4) {
			if (strncmp("set#", tk_specifier->content + 1, 4) == 0) {
				if (!_is_primitive_type_node(ctx, node_expr)
						&& !_is_pointer_type_node(ctx, node_expr)) {
					_SYNERR_NODE(
						ctx,
						node_expr,
						"parameter type must be primitive type or pointer type."
					);
				}
			} else if (strncmp("get#", tk_specifier->content + 1, 4) == 0) {
				if (!_is_primitive_type_node(ctx, node_expr)
						&& !_is_pointer_type_node(ctx, node_expr)) {
					_SYNERR_NODE(
						ctx,
						node_expr,
						"parameter type must be primitive type or pointer type."
					);
				}

				if (node_expr->childs[0]->type != FE_NODE_EXPR_ATOM
						|| node_expr->childs[0]->childs[0]->type != FE_NODE_IDENTIFIER) {
					_SYNERR_NODE(
						ctx,
						node_expr,
						"parameter must be identifier."
					);
				}
			} else {
				_SYNERR_NODE(
					ctx,
					node_specifier,
					"invalid asm option specifier."
				);
			}
		} else {
			_SYNERR_NODE(
				ctx,
				node_specifier,
				"invalid asm option specifier."
			);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
cmpl $0xba0, (%rsi)          # imm = 0xBA0
jne 0x318d4
movq %rsi, %r13
movl 0x44(%rsi), %eax
testl %eax, %eax
jle 0x318f3
movq 0x48(%r13), %rcx
movq (%rcx), %rcx
cmpl $0x303, (%rcx)          # imm = 0x303
jne 0x31912
movq %rdi, %rbx
pushq $0x1
popq %rcx
pushq $0x4
popq %r14
movq %r13, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
cltq
cmpq %rax, %rcx
jge 0x31846
movq 0x48(%r13), %rax
movq (%rax,%rcx,8), %r12
cmpl $0xba1, (%r12)          # imm = 0xBA1
jne 0x31877
cmpl $0x2, 0x44(%r12)
jne 0x31858
movq %rcx, -0x40(%rbp)
movq 0x48(%r12), %rax
movq 0x8(%rax), %r15
cmpl $0xe00, (%r15)          # imm = 0xE00
jne 0x31896
movq %rbx, %rdi
movq %r15, %rsi
callq 0x29bc2
movq 0x48(%r12), %rax
movq (%rax), %r12
cmpl $0x303, (%r12)          # imm = 0x303
jne 0x318b5
movq 0x10(%r12), %rax
cmpl $0x4, 0x4(%rax)
jl 0x316f2
movq 0x8(%rax), %r13
incq %r13
leaq 0xefbb(%rip), %rdi      # 0x40648
movq %r13, %rsi
movq %r14, %rbx
movq %r14, %rdx
callq 0x3030
testl %eax, %eax
je 0x31719
leaq 0xefbe(%rip), %rdi      # 0x40664
movq %r13, %rsi
movq %rbx, %rdx
callq 0x3030
testl %eax, %eax
je 0x31781
movups 0x18b30(%rip), %xmm0    # 0x4a1f0
movups %xmm0, -0x432(%rbp)
movups 0x18b14(%rip), %xmm0    # 0x4a1e2
movaps %xmm0, -0x440(%rbp)
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
leaq -0x440(%rbp), %rdx
callq *0x58(%rbx)
movq -0x38(%rbp), %r13
jmp 0x31836
movups 0x18af7(%rip), %xmm0    # 0x4a1f0
movups %xmm0, -0x432(%rbp)
movups 0x18adb(%rip), %xmm0    # 0x4a1e2
movaps %xmm0, -0x440(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
jmp 0x3182c
movq %r15, %rdi
callq 0x2b493
testb %al, %al
movq -0x38(%rbp), %r13
movq -0x30(%rbp), %rbx
jne 0x31836
movq %r15, %rdi
callq 0x2b435
testb %al, %al
jne 0x31836
movups 0x18a65(%rip), %xmm0    # 0x4a1ad
movaps %xmm0, -0x420(%rbp)
movups 0x18a47(%rip), %xmm0    # 0x4a19d
movaps %xmm0, -0x430(%rbp)
movups 0x18a29(%rip), %xmm0    # 0x4a18d
movaps %xmm0, -0x440(%rbp)
movabsq $0x2e657079742072, %rax # imm = 0x2E657079742072
movq %rax, -0x411(%rbp)
jmp 0x31826
movq %r15, %rdi
callq 0x2b493
testb %al, %al
movq -0x38(%rbp), %r13
movq -0x30(%rbp), %rbx
jne 0x317ec
movq %r15, %rdi
callq 0x2b435
testb %al, %al
jne 0x317ec
movups 0x18a05(%rip), %xmm0    # 0x4a1ad
movaps %xmm0, -0x420(%rbp)
movups 0x189e7(%rip), %xmm0    # 0x4a19d
movaps %xmm0, -0x430(%rbp)
movups 0x189c9(%rip), %xmm0    # 0x4a18d
movaps %xmm0, -0x440(%rbp)
movabsq $0x2e657079742072, %rax # imm = 0x2E657079742072
movq %rax, -0x411(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
leaq -0x440(%rbp), %rdx
callq *0x58(%rbx)
movq 0x48(%r15), %rax
movq (%rax), %rax
cmpl $0xee0, (%rax)          # imm = 0xEE0
jne 0x3180a
movq 0x48(%rax), %rax
movq (%rax), %rax
cmpl $0x200, (%rax)          # imm = 0x200
je 0x31836
movups 0x189c1(%rip), %xmm0    # 0x4a1d2
movups %xmm0, -0x432(%rbp)
movups 0x189a5(%rip), %xmm0    # 0x4a1c4
movaps %xmm0, -0x440(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
leaq -0x440(%rbp), %rdx
callq *0x58(%rbx)
movq -0x40(%rbp), %rcx
incq %rcx
movl 0x44(%r13), %eax
jmp 0x3160c
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xed9c(%rip), %rdi      # 0x405fb
leaq 0x160d4(%rip), %rsi     # 0x4793a
leaq 0x188bd(%rip), %rcx     # 0x4a12a
movl $0x61a, %edx            # imm = 0x61A
callq 0x30a0
leaq 0xed4c(%rip), %rdi      # 0x405ca
leaq 0x160b5(%rip), %rsi     # 0x4793a
leaq 0x1889e(%rip), %rcx     # 0x4a12a
movl $0x619, %edx            # imm = 0x619
callq 0x30a0
leaq 0xea70(%rip), %rdi      # 0x4030d
leaq 0x16096(%rip), %rsi     # 0x4793a
leaq 0x1887f(%rip), %rcx     # 0x4a12a
movl $0x61d, %edx            # imm = 0x61D
callq 0x30a0
leaq 0xed5d(%rip), %rdi      # 0x40619
leaq 0x16077(%rip), %rsi     # 0x4793a
leaq 0x18860(%rip), %rcx     # 0x4a12a
movl $0x621, %edx            # imm = 0x621
callq 0x30a0
leaq 0x18880(%rip), %rdi     # 0x4a15b
leaq 0x16058(%rip), %rsi     # 0x4793a
leaq 0x18841(%rip), %rcx     # 0x4a12a
movl $0x611, %edx            # imm = 0x611
callq 0x30a0
leaq 0x18880(%rip), %rdi     # 0x4a17a
leaq 0x16039(%rip), %rsi     # 0x4793a
leaq 0x18822(%rip), %rcx     # 0x4a12a
movl $0x612, %edx            # imm = 0x612
callq 0x30a0
leaq 0xec83(%rip), %rdi      # 0x4059c
leaq 0x1601a(%rip), %rsi     # 0x4793a
leaq 0x18803(%rip), %rcx     # 0x4a12a
movl $0x615, %edx            # imm = 0x615
callq 0x30a0