// File: /workspace/github_c_makefile_star2_O3/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 $0x408, %rsp            # imm = 0x408
cmpl $0xba0, (%rsi)          # imm = 0xBA0
jne 0x33dc7
movq %rsi, %r12
movl 0x44(%rsi), %eax
testl %eax, %eax
jle 0x33de6
movq 0x48(%r12), %rcx
movq (%rcx), %rcx
cmpl $0x303, (%rcx)          # imm = 0x303
jne 0x33e05
cmpl $0x1, %eax
je 0x33d1a
movq %rdi, %r14
movl $0x1, %ebx
movq %r12, -0x30(%rbp)
movq 0x48(%r12), %rax
movq (%rax,%rbx,8), %r15
cmpl $0xba1, (%r15)          # imm = 0xBA1
jne 0x33d89
cmpl $0x2, 0x44(%r15)
jne 0x33d6a
movq 0x48(%r15), %rax
movq 0x8(%rax), %r13
cmpl $0xe00, (%r13)          # imm = 0xE00
jne 0x33d4b
movq %r14, %rdi
movq %r13, %rsi
callq 0x2bd91
movq 0x48(%r15), %rax
movq (%rax), %r15
cmpl $0x303, (%r15)          # imm = 0x303
jne 0x33d2c
movq 0x10(%r15), %rax
cmpl $0x4, 0x4(%rax)
jl 0x33baf
movq 0x8(%rax), %r12
incq %r12
movl $0x4, %edx
leaq 0xfae7(%rip), %rdi      # 0x43638
movq %r12, %rsi
callq 0x3030
testl %eax, %eax
je 0x33bd6
movl $0x4, %edx
leaq 0xfaeb(%rip), %rdi      # 0x43654
movq %r12, %rsi
callq 0x3030
testl %eax, %eax
je 0x33c48
movups 0x19630(%rip), %xmm0    # 0x4d1b0
movups %xmm0, -0x422(%rbp)
movups 0x19614(%rip), %xmm0    # 0x4d1a2
movaps %xmm0, -0x430(%rbp)
movq %r14, %rdi
movq %r15, %rsi
leaq -0x430(%rbp), %rdx
callq *0x58(%r14)
movq -0x30(%rbp), %r12
jmp 0x33d09
movups 0x195fa(%rip), %xmm0    # 0x4d1b0
movups %xmm0, -0x422(%rbp)
movups 0x195de(%rip), %xmm0    # 0x4d1a2
movaps %xmm0, -0x430(%rbp)
movq %r14, %rdi
movq %r15, %rsi
jmp 0x33cfe
movq %r13, %rdi
callq 0x2d742
testb %al, %al
movq -0x30(%rbp), %r12
jne 0x33d09
movzbl 0x1(%r13), %eax
shll $0x8, %eax
cmpl $0xe00, %eax            # imm = 0xE00
jne 0x33da8
cmpb $0x10, 0x60(%r13)
je 0x33d09
movups 0x1955e(%rip), %xmm0    # 0x4d16d
movaps %xmm0, -0x410(%rbp)
movups 0x19540(%rip), %xmm0    # 0x4d15d
movaps %xmm0, -0x420(%rbp)
movups 0x19522(%rip), %xmm0    # 0x4d14d
movaps %xmm0, -0x430(%rbp)
movabsq $0x2e657079742072, %rax # imm = 0x2E657079742072
movq %rax, -0x401(%rbp)
jmp 0x33cf8
movq %r13, %rdi
callq 0x2d742
testb %al, %al
movq -0x30(%rbp), %r12
jne 0x33cbe
movzbl 0x1(%r13), %eax
shll $0x8, %eax
cmpl $0xe00, %eax            # imm = 0xE00
jne 0x33da8
cmpb $0x10, 0x60(%r13)
je 0x33cbe
movups 0x194f4(%rip), %xmm0    # 0x4d16d
movaps %xmm0, -0x410(%rbp)
movups 0x194d6(%rip), %xmm0    # 0x4d15d
movaps %xmm0, -0x420(%rbp)
movups 0x194b8(%rip), %xmm0    # 0x4d14d
movaps %xmm0, -0x430(%rbp)
movabsq $0x2e657079742072, %rax # imm = 0x2E657079742072
movq %rax, -0x401(%rbp)
movq %r14, %rdi
movq %r13, %rsi
leaq -0x430(%rbp), %rdx
callq *0x58(%r14)
movq 0x48(%r13), %rax
movq (%rax), %rax
cmpl $0xee0, (%rax)          # imm = 0xEE0
jne 0x33cdc
movq 0x48(%rax), %rax
movq (%rax), %rax
cmpl $0x200, (%rax)          # imm = 0x200
je 0x33d09
movups 0x194af(%rip), %xmm0    # 0x4d192
movups %xmm0, -0x422(%rbp)
movups 0x19493(%rip), %xmm0    # 0x4d184
movaps %xmm0, -0x430(%rbp)
movq %r14, %rdi
movq %r13, %rsi
leaq -0x430(%rbp), %rdx
callq *0x58(%r14)
incq %rbx
movslq 0x44(%r12), %rax
cmpq %rax, %rbx
jl 0x33ade
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf8d6(%rip), %rdi      # 0x43609
leaq 0x16bc0(%rip), %rsi     # 0x4a8fa
leaq 0x193a9(%rip), %rcx     # 0x4d0ea
movl $0x621, %edx            # imm = 0x621
callq 0x30a0
leaq 0xf5ab(%rip), %rdi      # 0x432fd
leaq 0x16ba1(%rip), %rsi     # 0x4a8fa
leaq 0x1938a(%rip), %rcx     # 0x4d0ea
movl $0x61d, %edx            # imm = 0x61D
callq 0x30a0
leaq 0xf87a(%rip), %rdi      # 0x435eb
leaq 0x16b82(%rip), %rsi     # 0x4a8fa
leaq 0x1936b(%rip), %rcx     # 0x4d0ea
movl $0x61a, %edx            # imm = 0x61A
callq 0x30a0
leaq 0xf82a(%rip), %rdi      # 0x435ba
leaq 0x16b63(%rip), %rsi     # 0x4a8fa
leaq 0x1934c(%rip), %rcx     # 0x4d0ea
movl $0x619, %edx            # imm = 0x619
callq 0x30a0
leaq 0x17ce8(%rip), %rdi     # 0x4ba97
leaq 0x16b44(%rip), %rsi     # 0x4a8fa
leaq 0x182c1(%rip), %rcx     # 0x4c07e
movl $0x1ff, %edx            # imm = 0x1FF
callq 0x30a0
leaq 0x1934d(%rip), %rdi     # 0x4d11b
leaq 0x16b25(%rip), %rsi     # 0x4a8fa
leaq 0x1930e(%rip), %rcx     # 0x4d0ea
movl $0x611, %edx            # imm = 0x611
callq 0x30a0
leaq 0x1934d(%rip), %rdi     # 0x4d13a
leaq 0x16b06(%rip), %rsi     # 0x4a8fa
leaq 0x192ef(%rip), %rcx     # 0x4d0ea
movl $0x612, %edx            # imm = 0x612
callq 0x30a0
leaq 0xf780(%rip), %rdi      # 0x4358c
leaq 0x16ae7(%rip), %rsi     # 0x4a8fa
leaq 0x192d0(%rip), %rcx     # 0x4d0ea
movl $0x615, %edx            # imm = 0x615
callq 0x30a0