// File: /workspace/github_c_makefile_star2_O1/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
movl %ecx, -0x34(%rbp)
movq %rdx, -0x30(%rbp)
movl %esi, %r12d
movq %rdi, %r14
testq %rdi, %rdi
je 0xcd91
xorl %r13d, %r13d
leaq 0x3473(%rip), %rbx      # 0x10120
movl 0x8(%r14), %eax
cmpq $0x3, %rax
ja 0xcd60
movslq (%rbx,%rax,4), %rax
addq %rbx, %rax
jmpq *%rax
movq 0x10(%r14), %r15
movq %r15, %rdi
callq 0xaab8
testq %rax, %rax
je 0xcdd4
movq 0x20(%rax), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0xcd2e
incq %rax
movq 0x8(%rcx), %rcx
jmp 0xccdf
movq 0x10(%r14), %r15
movq %r15, %rdi
callq 0xce79
jmp 0xcd24
testl %r12d, %r12d
je 0xce03
movq 0x10(%r14), %rdi
xorl %esi, %esi
movq -0x30(%rbp), %rdx
movl %r13d, %ecx
callq 0xcaa1
jmp 0xcd60
movq 0x10(%r14), %r15
movq %r15, %rdi
callq 0xce3b
testq %rax, %rax
jne 0xcd60
jmp 0xcdd4
movq 0x20(%r14), %rcx
xorl %edx, %edx
testq %rcx, %rcx
je 0xcd42
incq %rdx
movq 0x8(%rcx), %rcx
jmp 0xcd34
cmpq %rdx, %rax
jne 0xce0e
testl %r12d, %r12d
setne %cl
cmpq $0x2, %rax
setl %al
orb %cl, %al
je 0xcdf7
cmpl $0x3, 0x8(%r14)
je 0xcd73
testl %r12d, %r12d
jne 0xcd73
cmpl $0x3, 0x28(%r14)
je 0xcdeb
incq %r13
movq (%r14), %r14
testq %r14, %r14
jne 0xccad
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd258(%rip), %rax      # 0x19ff0
movq (%rax), %rdi
testl %r12d, %r12d
jne 0xcdb7
leaq 0x58c3(%rip), %rsi      # 0x1266a
movq -0x30(%rbp), %rdx
movl -0x34(%rbp), %ecx
xorl %eax, %eax
callq 0x2100
jmp 0xcdc9
leaq 0x5879(%rip), %rsi      # 0x12637
movq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x2100
testq %r14, %r14
jne 0xcca3
jmp 0xcd82
movq 0xd215(%rip), %rax      # 0x19ff0
movq (%rax), %rdi
movq 0x18(%r14), %rcx
leaq 0x5633(%rip), %rsi      # 0x1241c
jmp 0xce23
movq %r14, %rdi
movq -0x30(%rbp), %rsi
callq 0x7778
movq %r14, %rdi
movq -0x30(%rbp), %rsi
callq 0x7721
movl -0x34(%rbp), %edi
movq %r13, %rsi
callq 0x774f
movq 0xd1db(%rip), %rax      # 0x19ff0
movq (%rax), %rdi
movq 0x18(%r14), %rcx
leaq 0x561d(%rip), %rsi      # 0x12440
movq -0x30(%rbp), %rdx
movq %r15, %r8
xorl %eax, %eax
callq 0x2100
movl $0x1, %edi
callq 0x2180