// File: /workspace/github_c_makefile_star2_O2/OstCollector[P]config2c/config2c.c
// Function: free_struct
static void free_struct(string name, const struct node_member_list *list)
{
	const struct node_member_list *memb;
	const struct node_alter_list *alt;
	struct type_decl decl;

	osi(0, "static void free__struct_%s(struct %s *value)\n", name, name);
	osi(0, "{\n");
	osi(1, "long i;\n");
	for (memb = list; memb; memb = memb->next) {
		if (!memb->visible && !memb->default_val) {
			continue;
		}
		switch (memb->type) {
		case NODE_MEMBER_DEF_PRIM:
			decl.type = TYPE_DECL_PRIM;
			decl.type_name = memb->type_name;
			helper_free(&memb->vec, &decl, memb->mapped, 1);
			break;
		case NODE_MEMBER_DEF_ENUM:
			decl.type = TYPE_DECL_ENUM;
			decl.type_name = memb->type_name;
			helper_free(&memb->vec, &decl, memb->mapped, 1);
			break;
		case NODE_MEMBER_DEF_STRUCT:
			decl.type = TYPE_DECL_STRUCT;
			decl.type_name = memb->type_name;
			helper_free(&memb->vec, &decl, memb->mapped, 1);
			break;
		case NODE_MEMBER_DEF_UNION:
			decl.type = TYPE_DECL_UNION;
			decl.type_name = memb->type_name;
			helper_free(&memb->vec, &decl, memb->mapped, 1);
			break;
		case NODE_MEMBER_DEF_UNNAMED_UNION:
			for (alt = memb->alters; alt; alt = alt->next) {
				osi(1, "if (value->%s == %s) {\n",
						memb->alt_enum, alt->enum_val);
				switch (alt->type) {
				case NODE_ALTER_DEF_PRIM:
					decl.type = TYPE_DECL_PRIM;
					decl.type_name = alt->type_name;
					helper_free(&alt->vec, &decl,
							alt->mapped, 2);
					break;
				case NODE_ALTER_DEF_ENUM:
					decl.type = TYPE_DECL_ENUM;
					decl.type_name = alt->type_name;
					helper_free(&alt->vec, &decl,
							alt->mapped, 2);
					break;
				case NODE_ALTER_DEF_STRUCT:
					decl.type = TYPE_DECL_STRUCT;
					decl.type_name = alt->type_name;
					helper_free(&alt->vec, &decl,
							alt->mapped, 2);
					break;
				}
				osi(1, "}\n");
			}
		}
	}
	osi(0, "}\n");
	osi(0, "\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %edi, %edi
callq 0x4593
movq 0xd1e1(%rip), %rdi      # 0x112a0
leaq 0x90de(%rip), %rsi      # 0xd1a4
movq %r14, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x42a5
xorl %edi, %edi
callq 0x4593
movq 0xd1b7(%rip), %rdi      # 0x112a0
leaq 0x96a9(%rip), %rsi      # 0xd799
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x42a5
pushq $0x1
popq %rdi
callq 0x4593
movq 0xd192(%rip), %rdi      # 0x112a0
leaq 0x90be(%rip), %rsi      # 0xd1d3
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x42a5
pushq $0x1
popq %r15
leaq 0x8a36(%rip), %r12      # 0xcb65
leaq 0x7d0b(%rip), %r13      # 0xbe41
testq %rbx, %rbx
je 0x4256
cmpl $0x0, 0x40(%rbx)
jne 0x4150
cmpq $0x0, 0x38(%rbx)
je 0x424e
movl 0x8(%rbx), %eax
cmpq $0x4, %rax
ja 0x424e
leaq 0x6f0c(%rip), %rcx      # 0xb070
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
andl $0x0, -0x38(%rbp)
jmp 0x4232
leaq 0x10(%rbx), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x424e
movl %r15d, %edi
callq 0x4593
movq 0xd10b(%rip), %rdi      # 0x112a0
movq 0x18(%rbx), %rdx
movq 0x38(%r14), %rcx
movq %r12, %rsi
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x42a5
movl 0x8(%r14), %eax
cmpl $0x2, %eax
je 0x41d0
cmpl $0x1, %eax
je 0x41c7
testl %eax, %eax
jne 0x41f3
andl $0x0, -0x38(%rbp)
jmp 0x41d7
movl $0x1, -0x38(%rbp)
jmp 0x41d7
movl $0x2, -0x38(%rbp)
movq 0x10(%r14), %rax
movq %rax, -0x30(%rbp)
leaq 0x28(%r14), %rdi
movq 0x20(%r14), %rdx
leaq -0x38(%rbp), %rsi
pushq $0x2
popq %rcx
callq 0x77fb
movl %r15d, %edi
callq 0x4593
movq 0xd09e(%rip), %rdi      # 0x112a0
movq %r13, %rsi
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
jns 0x417a
jmp 0x42a5
movl $0x2, -0x38(%rbp)
jmp 0x4232
movl $0x3, -0x38(%rbp)
jmp 0x4232
movl $0x1, -0x38(%rbp)
movq 0x10(%rbx), %rax
movq %rax, -0x30(%rbp)
leaq 0x28(%rbx), %rdi
movq 0x20(%rbx), %rdx
leaq -0x38(%rbp), %rsi
movl %r15d, %ecx
callq 0x77fb
movq (%rbx), %rbx
jmp 0x4136
xorl %edi, %edi
callq 0x4593
movq 0xd03c(%rip), %rdi      # 0x112a0
leaq 0x7bd6(%rip), %rsi      # 0xbe41
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x42a5
xorl %edi, %edi
callq 0x4593
movq 0xd01c(%rip), %rdi      # 0x112a0
leaq 0x7efc(%rip), %rsi      # 0xc187
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x42a5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xcd44(%rip), %rax      # 0x10ff0
movq (%rax), %rdi
leaq 0x7682(%rip), %rsi      # 0xb938
leaq 0x7693(%rip), %rdx      # 0xb950
xorl %eax, %eax
callq 0x2100
pushq $0x1
popq %rdi
callq 0x2180