// File: /workspace/github_c_makefile_star2_O3/OstCollector[P]config2c/config2c.c
// Function: verify_def_union
static void verify_def_union(const struct node_alter_list *list,
		int top, const char *name, int seq)
{
	long i, j, m, n;
	const struct node_mapping *map;

	const char *unnamed = "struct %s has an unnamed union (%ld-th "
		"field) that contains an unnamed struct (%ld-th field), "
		"which is unsupported\n";
	const char *multimap = "alternative %s.%s is mapped to "
		"multiple values, which is not supported in unnamed union\n";
	const char *vararr = "alternative %s.%s is vararray, "
		"which is not supported in unnamed union\n";
	const char *notexist = "member %s.%s has a unknown type %s\n";
	const char *unmatch = "member %s.%s is unmatched to its type %s\n";

	const char *empty_top = "union %s has no alternative, which is meaningless\n";
	const char *empty_unnamed = "struct %s has an unnamed union "
		"(%ld-th field) that is empty, which is meaningless\n";

	if (!list) {
		if (top) {
			fprintf(stderr, empty_top, name);
		} else {
			fprintf(stderr, empty_unnamed, name, seq);
		}
	}

	for (i = 0; list; ++i, list = list->next) {
		switch (list->type) {
		case NODE_ALTER_DEF_UNNAMED_STRUCT:
			if (!top) {
				fprintf(stderr, unnamed, seq, i);
				exit(EXIT_FAILURE);
			} else {
				verify_def_struct(list->members,
						0, name, i);
			}
			break;
		case NODE_ALTER_DEF_PRIM:
			map = lookup_map(list->type_name);
			if (!map) {
				fprintf(stderr, notexist, name,
						list->in_name,
						list->type_name);
				exit(EXIT_FAILURE);
			}
			m = len_string_list(map->mapped_types);
			n = len_string_list(list->mapped);
			if (m != n) {
				fprintf(stderr, unmatch, name,
						list->in_name,
						list->type_name);
				exit(EXIT_FAILURE);
			}
			if (m > 1 && !top) {
				fprintf(stderr, multimap, name,
						list->in_name);
				exit(EXIT_FAILURE);
			} /* pass through */
			break;
		case NODE_ALTER_DEF_ENUM:
			if (!lookup_enum(list->type_name)) {
				fprintf(stderr, notexist, name,
						list->in_name,
						list->type_name);
				exit(EXIT_FAILURE);
			}
			break;
		case NODE_ALTER_DEF_STRUCT:
			if (!lookup_struct(list->type_name)) {
				fprintf(stderr, notexist, name,
						list->in_name,
						list->type_name);
				exit(EXIT_FAILURE);
			}
			break;
		}
		if (list->type != NODE_ALTER_DEF_UNNAMED_STRUCT) {
			if (list->vec.type == NODE_TYPE_VAR_ARR && !top) {
				fprintf(stderr, vararr, name,
						list->in_name);
				exit(EXIT_FAILURE);
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, -0x30(%rbp)
movl %esi, %r12d
testq %rdi, %rdi
je 0xce7a
movq %rdi, %r15
movl %ecx, -0x34(%rbp)
xorl %r13d, %r13d
leaq 0x3388(%rip), %rbx      # 0x10120
movl 0x8(%r15), %eax
cmpq $0x3, %rax
ja 0xce01
movslq (%rbx,%rax,4), %rax
addq %rbx, %rax
jmpq *%rax
movq 0x10(%r15), %r14
movq %r14, %rdi
callq 0xaba0
testq %rax, %rax
je 0xced5
movq 0x20(%rax), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0xce1e
incq %rax
movq 0x8(%rcx), %rcx
jmp 0xcdc6
movq 0x10(%r15), %r14
movq %r14, %rdi
callq 0xcf6e
jmp 0xce14
testl %r12d, %r12d
je 0xceec
movq 0x10(%r15), %rdi
xorl %esi, %esi
movq -0x30(%rbp), %rdx
movl %r13d, %ecx
callq 0xcb7e
movl 0x8(%r15), %eax
cmpl $0x3, %eax
jne 0xce50
jmp 0xce5c
movq 0x10(%r15), %r14
movq %r14, %rdi
callq 0xcf30
testq %rax, %rax
jne 0xce50
jmp 0xced5
movq 0x20(%r15), %rcx
xorl %edx, %edx
testq %rcx, %rcx
je 0xce32
incq %rdx
movq 0x8(%rcx), %rcx
jmp 0xce24
cmpq %rdx, %rax
jne 0xcef7
testl %r12d, %r12d
setne %cl
cmpq $0x2, %rax
setl %al
orb %cl, %al
je 0xcf24
testl %r12d, %r12d
jne 0xce5c
cmpl $0x3, 0x28(%r15)
je 0xcec9
incq %r13
movq (%r15), %r15
testq %r15, %r15
jne 0xcd98
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd16f(%rip), %rax      # 0x19ff0
movq (%rax), %rdi
testl %r12d, %r12d
jne 0xcea9
leaq 0x57da(%rip), %rsi      # 0x1266a
movq -0x30(%rbp), %rdx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
leaq 0x5787(%rip), %rsi      # 0x12637
movq -0x30(%rbp), %rdx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
movq %r15, %rdi
movq -0x30(%rbp), %rsi
callq 0x7778
movq 0xd114(%rip), %rax      # 0x19ff0
movq (%rax), %rdi
movq 0x18(%r15), %rcx
leaq 0x5532(%rip), %rsi      # 0x1241c
jmp 0xcf0c
movl -0x34(%rbp), %edi
movq %r13, %rsi
callq 0x774f
movq 0xd0f2(%rip), %rax      # 0x19ff0
movq (%rax), %rdi
movq 0x18(%r15), %rcx
leaq 0x5534(%rip), %rsi      # 0x12440
movq -0x30(%rbp), %rdx
movq %r14, %r8
xorl %eax, %eax
callq 0x2100
movl $0x1, %edi
callq 0x2180
movq %r15, %rdi
movq -0x30(%rbp), %rsi
callq 0x7721