// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: delete_expr
static void delete_expr(expr_t* exp)
{
	if(!exp->is_shallow_copy)
	{
		switch(exp->type)
		{
			case EXP_ATOMIC:
			{
				delete_expr(exp->atomx);
			} break;

			case EXP_VAR:
			{
				free(exp->varx.name);
			} break;
			
			case EXP_DOT: case EXP_COLON:
			{
				delete_expr(exp->dotx.value);
				free(exp->dotx.name);
			} break;
			
			case EXP_STRUCT_NEW:
			{
				for(int i = 0; i < exp->newx.init.length; ++i)
					delete_expr(vec_get_value(&exp->newx.init, i, expr_t*));
				vec_destroy(&exp->newx.init);
			} break;
			
			// NOTE: Nothing is destroyed here because the expressions will be deleted in the 
			// delete_type_tag function
			case EXP_STRUCT_DECL: break;
			
			case EXP_NULL:
			case EXP_EXTERN:
			case EXP_BOOL:
			case EXP_CHAR:
			case EXP_NUMBER:
			case EXP_STRING: break;

			case EXP_EXTERN_LIST:
			{
				for (int i = 0; i < exp->extern_array.length; ++i)
					delete_expr(vec_get_value(&exp->extern_array, i, expr_t*));
				vec_destroy(&exp->extern_array);
			} break;

			case EXP_PAREN: delete_expr(exp->paren); break;
			case EXP_BLOCK:
			{
				for(int i = 0; i < exp->block.length; ++i)
				{
					expr_t* e = vec_get_value(&exp->block, i, expr_t*);
					delete_expr(e);
				}
				vec_destroy(&exp->block);
			} break;
			
			case EXP_ARRAY_INDEX:
			{
				delete_expr(exp->array_index.array);
				delete_expr(exp->array_index.index);
			} break;
			
			case EXP_ARRAY_LITERAL:
			{
				for(int i = 0; i < exp->array_literal.values.length; ++i)
					delete_expr(vec_get_value(&exp->array_literal.values, i, expr_t*));
				vec_destroy(&exp->array_literal.values);
			} break;
			
			case EXP_LEN:
			{
				delete_expr(exp->len);
			} break;
			
			case EXP_UNARY:
			{
				delete_expr(exp->unaryx.rhs);
			} break;
			
			case EXP_BINARY:
			{
				delete_expr(exp->binx.lhs);
				delete_expr(exp->binx.rhs);
			} break;
			
			case EXP_CALL:
			{
				delete_expr(exp->callx.func);
				for(int i = 0; i < exp->callx.args.length; ++i)
					delete_expr(vec_get_value(&exp->callx.args, i, expr_t*));
				vec_destroy(&exp->callx.args);
			} break;
			
			case EXP_IF:
			{
				delete_expr(exp->ifx.cond);
				delete_expr(exp->ifx.body);
				if(exp->ifx.alt)
					delete_expr(exp->ifx.alt);
			} break;
			
			case EXP_WHILE:
			{
				delete_expr(exp->whilex.cond);
				delete_expr(exp->whilex.body);
			} break;

			case EXP_FOR:
			{
				delete_expr(exp->forx.init);
				delete_expr(exp->forx.cond);
				delete_expr(exp->forx.step);
				delete_expr(exp->forx.body);
			} break;
			
			case EXP_RETURN:
			{
				if(exp->retx.value)
					delete_expr(exp->retx.value);
			} break;
			
			case EXP_FUNC:
			{
				delete_expr(exp->funcx.body);
			} break;
			
			case EXP_WRITE:
			{
				delete_expr(exp->write);
			} break;
		}
	}
	
	free(exp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, (%rax)
jne 0xc118
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
movq %rax, -0x30(%rbp)
subq $0x1a, %rax
ja 0xc116
movq -0x30(%rbp), %rax
leaq 0x766b(%rip), %rcx      # 0x13454
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbdb0
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x2030
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbdb0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x2030
jmp 0xc116
movl $0x0, -0xc(%rbp)
movslq -0xc(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0xbe72
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
movslq -0xc(%rbp), %rsi
callq 0x11890
movq (%rax), %rdi
callq 0xbdb0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xbe3c
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
callq 0x11dc0
jmp 0xc116
jmp 0xc116
jmp 0xc116
movl $0x0, -0x10(%rbp)
movslq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0xbecb
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
movslq -0x10(%rbp), %rsi
callq 0x11890
movq (%rax), %rdi
callq 0xbdb0
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xbe99
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
callq 0x11dc0
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbdb0
jmp 0xc116
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0xbf30
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
movslq -0x14(%rbp), %rsi
callq 0x11890
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xbdb0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xbef6
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
callq 0x11dc0
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbdb0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0xbdb0
jmp 0xc116
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0xbf9e
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
movslq -0x24(%rbp), %rsi
callq 0x11890
movq (%rax), %rdi
callq 0xbdb0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xbf68
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
callq 0x11dc0
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbdb0
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbdb0
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbdb0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0xbdb0
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbdb0
movl $0x0, -0x28(%rbp)
movslq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0xc041
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
movslq -0x28(%rbp), %rsi
callq 0x11890
movq (%rax), %rdi
callq 0xbdb0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xc00b
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
callq 0x11dc0
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbdb0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0xbdb0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0xc089
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0xbdb0
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbdb0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0xbdb0
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbdb0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0xbdb0
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0xbdb0
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0xbdb0
jmp 0xc116
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0xc0f8
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0xbdb0
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0xbdb0
jmp 0xc116
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbdb0
jmp 0xc118
movq -0x8(%rbp), %rdi
callq 0x2030
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)