// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/preprocessor/gen.c
// Function: gen_elifxdef
static bool _gen_elifxdef(
	PPGeneratorContext *ctx,
	ParserASTNode *node,
	bool not
) {
	assert(ctx);
	assert(node);
	if (not) {
		assert(node->type == PP_NODE_DIRECTIVE_ELIFNDEF);
	} else {
		assert(node->type == PP_NODE_DIRECTIVE_ELIFDEF);
	}
	assert(node->nchilds == 1);

	const char *content = node->token->content;
	int len = node->token->len;

	ResizableString key;
	rstr_init(&key);
	int idx;
	if (not) {
		char cmd[] = "#elifndef";
		idx = sizeof(cmd);
	} else {
		char cmd[] = "#elifdef";
		idx = sizeof(cmd);
	}

	#define	_GET_CHAR(i) ((i) >= len ? -1 : content[(i)])

	while (isspace(_GET_CHAR(idx))) {
		idx++;
	}

	while (_GET_CHAR(idx) != -1 && !isspace(_GET_CHAR(idx))) {
		rstr_append_with_char(&key, _GET_CHAR(idx));
		idx++;
	}

	if (RSTR_LEN(&key) == 0) {
		_SYNERR_NODE(ctx, node, "expect key.");
	}

	bool cond;
	if (not) {
		cond = !map_exists_key(ctx->map_kv, &key);
	} else {
		cond = map_exists_key(ctx->map_kv, &key);
	}

	if (cond) {
		ParserASTNode *node_block = node->childs[0];
		assert(node_block->type == PP_NODE_BLOCK);

		_gen_if_block(ctx, node_block);
	}

	rstr_free(&key);

	#undef	_GET_CHAR

	return cond;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x490, %rsp            # imm = 0x490
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x40493
jmp 0x404b2
leaq 0xd6c7(%rip), %rdi      # 0x4db61
leaq 0xea54(%rip), %rsi      # 0x4eef5
movl $0x1ef, %edx            # imm = 0x1EF
leaq 0xf239(%rip), %rcx      # 0x4f6e6
callq 0xa0b0
cmpq $0x0, -0x10(%rbp)
je 0x404bb
jmp 0x404da
leaq 0xabc5(%rip), %rdi      # 0x4b087
leaq 0xea2c(%rip), %rsi      # 0x4eef5
movl $0x1f0, %edx            # imm = 0x1F0
leaq 0xf211(%rip), %rcx      # 0x4f6e6
callq 0xa0b0
testb $0x1, -0x11(%rbp)
je 0x4050f
movq -0x10(%rbp), %rax
cmpl $0x208, (%rax)          # imm = 0x208
jne 0x404ee
jmp 0x4050d
leaq 0xf233(%rip), %rdi      # 0x4f728
leaq 0xe9f9(%rip), %rsi      # 0x4eef5
movl $0x1f2, %edx            # imm = 0x1F2
leaq 0xf1de(%rip), %rcx      # 0x4f6e6
callq 0xa0b0
jmp 0x4053e
movq -0x10(%rbp), %rax
cmpl $0x207, (%rax)          # imm = 0x207
jne 0x4051d
jmp 0x4053c
leaq 0xf22d(%rip), %rdi      # 0x4f751
leaq 0xe9ca(%rip), %rsi      # 0x4eef5
movl $0x1f4, %edx            # imm = 0x1F4
leaq 0xf1af(%rip), %rcx      # 0x4f6e6
callq 0xa0b0
jmp 0x4053e
movq -0x10(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x4054a
jmp 0x40569
leaq 0xa525(%rip), %rdi      # 0x4aa76
leaq 0xe99d(%rip), %rsi      # 0x4eef5
movl $0x1f6, %edx            # imm = 0x1F6
leaq 0xf182(%rip), %rcx      # 0x4f6e6
callq 0xa0b0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x24(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xfca0
testb $0x1, -0x11(%rbp)
je 0x405b5
movq 0xf1dc(%rip), %rax      # 0x4f779
movq %rax, -0x46(%rbp)
movw 0xf1d9(%rip), %ax       # 0x4f781
movw %ax, -0x3e(%rbp)
movl $0xa, -0x3c(%rbp)
jmp 0x405d0
movq 0xf1c7(%rip), %rax      # 0x4f783
movq %rax, -0x4f(%rbp)
movb 0xf1c5(%rip), %al       # 0x4f78b
movb %al, -0x47(%rbp)
movl $0x9, -0x3c(%rbp)
jmp 0x405d2
callq 0xa1a0
movq (%rax), %rax
movq %rax, -0x468(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jl 0x405f6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x46c(%rbp)
jmp 0x40608
movq -0x20(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x46c(%rbp)
movq -0x468(%rbp), %rax
movl -0x46c(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x40631
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x405d2
jmp 0x40633
movl -0x3c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jl 0x40648
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x470(%rbp)
jmp 0x4065a
movq -0x20(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x470(%rbp)
movl -0x470(%rbp), %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
movb %al, -0x471(%rbp)
je 0x406ca
callq 0xa1a0
movq (%rax), %rax
movq %rax, -0x480(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jl 0x40691
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x484(%rbp)
jmp 0x406a3
movq -0x20(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x484(%rbp)
movq -0x480(%rbp), %rax
movl -0x484(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x471(%rbp)
movb -0x471(%rbp), %al
testb $0x1, %al
jne 0x406d6
jmp 0x4071d
movl -0x3c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jl 0x406eb
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x488(%rbp)
jmp 0x406fd
movq -0x20(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x488(%rbp)
movl -0x488(%rbp), %eax
leaq -0x38(%rbp), %rdi
movsbl %al, %esi
callq 0xfeb0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x40633
cmpl $0x0, -0x34(%rbp)
jne 0x40757
leaq -0x450(%rbp), %rdi
leaq 0xecc6(%rip), %rsi      # 0x4f3f7
movb $0x0, %al
callq 0xa170
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rdi
movq -0x10(%rbp), %rsi
leaq -0x450(%rbp), %rdx
callq *%rax
testb $0x1, -0x11(%rbp)
je 0x4077a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0xd8f0
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x451(%rbp)
jmp 0x40793
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0xd8f0
andb $0x1, %al
movb %al, -0x451(%rbp)
testb $0x1, -0x451(%rbp)
je 0x407ee
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x460(%rbp)
movq -0x460(%rbp), %rax
cmpl $0x300, (%rax)          # imm = 0x300
jne 0x407bf
jmp 0x407de
leaq 0xedd9(%rip), %rdi      # 0x4f59f
leaq 0xe728(%rip), %rsi      # 0x4eef5
movl $0x21e, %edx            # imm = 0x21E
leaq 0xef0d(%rip), %rcx      # 0x4f6e6
callq 0xa0b0
movq -0x8(%rbp), %rdi
movq -0x460(%rbp), %rsi
callq 0x3fd40
leaq -0x38(%rbp), %rdi
callq 0x10320
movb -0x451(%rbp), %al
andb $0x1, %al
addq $0x490, %rsp            # imm = 0x490
popq %rbp
retq
nopl (%rax,%rax)