// File: /workspace/github_c_makefile_star2_O1/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 0x104ac(%rip), %rdi     # 0x1a2a0
leaq 0x83a9(%rip), %rsi      # 0x121a4
movq %rcx, %rdx
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x9fdf
movq 0x1048c(%rip), %rdi     # 0x1a2a0
leaq 0x897e(%rip), %rsi      # 0x12799
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x9fe4
movl $0x1, %edi
callq 0xa2c8
movq 0x10465(%rip), %rdi     # 0x1a2a0
leaq 0x8391(%rip), %rsi      # 0x121d3
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x9fe9
testq %rbx, %rbx
je 0x9f94
leaq -0x38(%rbp), %r14
leaq 0x7d00(%rip), %r15      # 0x11b65
leaq 0x6fd5(%rip), %r12      # 0x10e41
cmpl $0x0, 0x40(%rbx)
jne 0x9e7d
cmpq $0x0, 0x38(%rbx)
je 0x9f88
movl 0x8(%rbx), %eax
cmpq $0x4, %rax
ja 0x9f88
leaq 0x61df(%rip), %rcx      # 0x10070
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x38(%rbp)
jmp 0x9f6b
leaq 0x10(%rbx), %r13
movq (%r13), %r13
testq %r13, %r13
je 0x9f88
movl $0x1, %edi
callq 0xa2c8
movq 0x103d8(%rip), %rdi     # 0x1a2a0
movq 0x18(%rbx), %rdx
movq 0x38(%r13), %rcx
movq %r15, %rsi
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x9fda
movl 0x8(%r13), %eax
cmpl $0x2, %eax
je 0x9f06
cmpl $0x1, %eax
je 0x9efd
testl %eax, %eax
jne 0x9f2a
movl $0x0, -0x38(%rbp)
jmp 0x9f0d
movl $0x1, -0x38(%rbp)
jmp 0x9f0d
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 0xc240
movl $0x1, %edi
callq 0xa2c8
movq 0x10365(%rip), %rdi     # 0x1a2a0
movq %r12, %rsi
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
jns 0x9eaa
jmp 0x9fd5
movl $0x2, -0x38(%rbp)
jmp 0x9f6b
movl $0x3, -0x38(%rbp)
jmp 0x9f6b
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 0xc240
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x9e6c
movq 0x10305(%rip), %rdi     # 0x1a2a0
leaq 0x6e9f(%rip), %rsi      # 0x10e41
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x9fee
movq 0x102ec(%rip), %rdi     # 0x1a2a0
leaq 0x71cc(%rip), %rsi      # 0x11187
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x9ff3
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