// File: /workspace/github_c_makefile_star2_O1/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 0x34be5
movq %rsi, %r12
cmpl $0x0, 0x44(%rsi)
jle 0x34c04
movq 0x48(%r12), %rax
movq (%rax), %rax
cmpl $0x303, (%rax)          # imm = 0x303
jne 0x34c23
cmpl $0x2, 0x44(%r12)
jl 0x34b38
movq %rdi, %r14
movl $0x1, %ebx
movq %rdi, -0x30(%rbp)
movq 0x48(%r12), %rax
movq (%rax,%rbx,8), %r15
cmpl $0xba1, (%r15)          # imm = 0xBA1
jne 0x34ba7
cmpl $0x2, 0x44(%r15)
jne 0x34b88
movq 0x48(%r15), %rax
movq 0x8(%rax), %r13
cmpl $0xe00, (%r13)          # imm = 0xE00
jne 0x34b69
movq %r14, %rdi
movq %r13, %rsi
callq 0x2c76c
movq 0x48(%r15), %rax
movq (%rax), %r15
cmpl $0x303, (%r15)          # imm = 0x303
jne 0x34b4a
movq 0x10(%r15), %rax
cmpl $0x4, 0x4(%rax)
jl 0x349c5
movq %r12, %r14
movq 0x8(%rax), %r12
incq %r12
movl $0x4, %edx
leaq 0xfc8b(%rip), %rdi      # 0x445ec
movq %r12, %rsi
callq 0x3030
testl %eax, %eax
je 0x349ec
movl $0x4, %edx
leaq 0xfc8f(%rip), %rdi      # 0x44608
movq %r12, %rsi
callq 0x3030
testl %eax, %eax
je 0x34a60
movups 0x197d7(%rip), %xmm0    # 0x4e167
movups %xmm0, -0x422(%rbp)
movups 0x197bb(%rip), %xmm0    # 0x4e159
movaps %xmm0, -0x430(%rbp)
movq -0x30(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
leaq -0x430(%rbp), %rdx
callq *0x58(%r13)
movq %r14, %r12
movq %r13, %r14
jmp 0x34b27
movups 0x1979b(%rip), %xmm0    # 0x4e167
movups %xmm0, -0x422(%rbp)
movups 0x1977f(%rip), %xmm0    # 0x4e159
movaps %xmm0, -0x430(%rbp)
movq %r14, %rdi
movq %r15, %rsi
jmp 0x34b1c
movzbl 0x1(%r13), %eax
shll $0x8, %eax
cmpl $0xe00, %eax            # imm = 0xE00
jne 0x34bc6
movq %r14, %r12
movb 0x60(%r13), %al
leal -0x1(%rax), %ecx
cmpb $0xb, %cl
setb %cl
cmpb $0x10, %al
sete %al
orb %cl, %al
movq -0x30(%rbp), %r14
jne 0x34b27
movups 0x196fd(%rip), %xmm0    # 0x4e124
movaps %xmm0, -0x410(%rbp)
movups 0x196df(%rip), %xmm0    # 0x4e114
movaps %xmm0, -0x420(%rbp)
movups 0x196c1(%rip), %xmm0    # 0x4e104
movaps %xmm0, -0x430(%rbp)
movabsq $0x2e657079742072, %rax # imm = 0x2E657079742072
movq %rax, -0x401(%rbp)
jmp 0x34b16
movzbl 0x1(%r13), %eax
shll $0x8, %eax
cmpl $0xe00, %eax            # imm = 0xE00
jne 0x34bc6
movq %r14, %r12
movb 0x60(%r13), %al
leal -0x1(%rax), %ecx
cmpb $0xb, %cl
setb %cl
cmpb $0x10, %al
sete %al
orb %cl, %al
movq -0x30(%rbp), %r14
jne 0x34adc
movups 0x1968d(%rip), %xmm0    # 0x4e124
movaps %xmm0, -0x410(%rbp)
movups 0x1966f(%rip), %xmm0    # 0x4e114
movaps %xmm0, -0x420(%rbp)
movups 0x19651(%rip), %xmm0    # 0x4e104
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 0x34afa
movq 0x48(%rax), %rax
movq (%rax), %rax
cmpl $0x200, (%rax)          # imm = 0x200
je 0x34b27
movups 0x19648(%rip), %xmm0    # 0x4e149
movups %xmm0, -0x422(%rbp)
movups 0x1962c(%rip), %xmm0    # 0x4e13b
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 0x348eb
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xfa6c(%rip), %rdi      # 0x445bd
leaq 0x16d02(%rip), %rsi     # 0x4b85a
leaq 0x19542(%rip), %rcx     # 0x4e0a1
movl $0x621, %edx            # imm = 0x621
callq 0x30a0
leaq 0xf741(%rip), %rdi      # 0x442b1
leaq 0x16ce3(%rip), %rsi     # 0x4b85a
leaq 0x19523(%rip), %rcx     # 0x4e0a1
movl $0x61d, %edx            # imm = 0x61D
callq 0x30a0
leaq 0xfa10(%rip), %rdi      # 0x4459f
leaq 0x16cc4(%rip), %rsi     # 0x4b85a
leaq 0x19504(%rip), %rcx     # 0x4e0a1
movl $0x61a, %edx            # imm = 0x61A
callq 0x30a0
leaq 0xf9c0(%rip), %rdi      # 0x4456e
leaq 0x16ca5(%rip), %rsi     # 0x4b85a
leaq 0x194e5(%rip), %rcx     # 0x4e0a1
movl $0x619, %edx            # imm = 0x619
callq 0x30a0
leaq 0x17e2a(%rip), %rdi     # 0x4c9f7
leaq 0x16c86(%rip), %rsi     # 0x4b85a
leaq 0x18441(%rip), %rcx     # 0x4d01c
movl $0x221, %edx            # imm = 0x221
callq 0x30a0
leaq 0x194e6(%rip), %rdi     # 0x4e0d2
leaq 0x16c67(%rip), %rsi     # 0x4b85a
leaq 0x194a7(%rip), %rcx     # 0x4e0a1
movl $0x611, %edx            # imm = 0x611
callq 0x30a0
leaq 0x194e6(%rip), %rdi     # 0x4e0f1
leaq 0x16c48(%rip), %rsi     # 0x4b85a
leaq 0x19488(%rip), %rcx     # 0x4e0a1
movl $0x612, %edx            # imm = 0x612
callq 0x30a0
leaq 0xf916(%rip), %rdi      # 0x44540
leaq 0x16c29(%rip), %rsi     # 0x4b85a
leaq 0x19469(%rip), %rcx     # 0x4e0a1
movl $0x615, %edx            # imm = 0x615
callq 0x30a0