// File: /workspace/github_c_makefile_star2_O3/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, %rcx
movq 0x103c8(%rip), %rdi     # 0x1a2a0
leaq 0x82c5(%rip), %rsi      # 0x121a4
movq %rcx, %rdx
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0xa0c3
movq 0x103a8(%rip), %rdi     # 0x1a2a0
leaq 0x889a(%rip), %rsi      # 0x12799
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0xa0c8
movl $0x1, %edi
callq 0xa3ac
movq 0x10381(%rip), %rdi     # 0x1a2a0
leaq 0x82ad(%rip), %rsi      # 0x121d3
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0xa0cd
testq %rbx, %rbx
je 0xa078
leaq -0x38(%rbp), %r14
leaq 0x7c1c(%rip), %r15      # 0x11b65
leaq 0x6ef1(%rip), %r12      # 0x10e41
cmpl $0x0, 0x40(%rbx)
jne 0x9f61
cmpq $0x0, 0x38(%rbx)
je 0xa06c
movl 0x8(%rbx), %eax
cmpq $0x4, %rax
ja 0xa06c
leaq 0x60fb(%rip), %rcx      # 0x10070
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x38(%rbp)
jmp 0xa04f
leaq 0x10(%rbx), %r13
movq (%r13), %r13
testq %r13, %r13
je 0xa06c
movl $0x1, %edi
callq 0xa3ac
movq 0x102f4(%rip), %rdi     # 0x1a2a0
movq 0x18(%rbx), %rdx
movq 0x38(%r13), %rcx
movq %r15, %rsi
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0xa0be
movl 0x8(%r13), %eax
cmpl $0x2, %eax
je 0x9fea
cmpl $0x1, %eax
je 0x9fe1
testl %eax, %eax
jne 0xa00e
movl $0x0, -0x38(%rbp)
jmp 0x9ff1
movl $0x1, -0x38(%rbp)
jmp 0x9ff1
movl $0x2, -0x38(%rbp)
movq 0x10(%r13), %rax
movq %rax, -0x30(%rbp)
leaq 0x28(%r13), %rdi
movq 0x20(%r13), %rdx
movq %r14, %rsi
movl $0x2, %ecx
callq 0xc328
movl $0x1, %edi
callq 0xa3ac
movq 0x10281(%rip), %rdi     # 0x1a2a0
movq %r12, %rsi
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
jns 0x9f8e
jmp 0xa0b9
movl $0x2, -0x38(%rbp)
jmp 0xa04f
movl $0x3, -0x38(%rbp)
jmp 0xa04f
movl $0x1, -0x38(%rbp)
movq 0x10(%rbx), %rax
movq %rax, -0x30(%rbp)
leaq 0x28(%rbx), %rdi
movq 0x20(%rbx), %rdx
movq %r14, %rsi
movl $0x1, %ecx
callq 0xc328
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x9f50
movq 0x10221(%rip), %rdi     # 0x1a2a0
leaq 0x6dbb(%rip), %rsi      # 0x10e41
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0xa0d2
movq 0x10208(%rip), %rdi     # 0x1a2a0
leaq 0x70e8(%rip), %rsi      # 0x11187
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0xa0d7
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3d05
callq 0x3d30
callq 0x3e07
callq 0x3ddc
callq 0x3db1
callq 0x3d86
callq 0x3d5b