#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct alisp_object {
  int dummy;
};
struct alisp_instance {
  int dummy;
};

/* Variables and functions */
struct alisp_object *car(struct alisp_object *);
struct alisp_object *cdr(struct alisp_object *);
int /*<<< orphan*/ delete_object(struct alisp_instance *,
                                 struct alisp_object *);
int /*<<< orphan*/ delete_tree(struct alisp_instance *, struct alisp_object *);
struct alisp_object *eval(struct alisp_instance *, struct alisp_object *);
struct alisp_object *F_ahandle(struct alisp_instance *instance,
                               struct alisp_object *args) {
  struct alisp_object *p1;
  p1 = eval(instance, car(args));
  delete_tree(instance, cdr(args));
  delete_object(instance, args);
  args = car(cdr(p1));
  delete_tree(instance, cdr(cdr(p1)));
  delete_object(instance, cdr(p1));
  delete_tree(instance, car(p1));
  delete_object(instance, p1);
  return args;
}


x86 assembly (clang, -O0):
<F_ahandle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <car@plt>
mov    -0x40(%rbp),%rdi
mov    %rax,%rsi
call   1060 <eval@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cdr@plt>
mov    -0x38(%rbp),%rdi
mov    %rax,%rsi
call   1050 <delete_tree@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <delete_object@plt>
mov    -0x18(%rbp),%rdi
call   1030 <cdr@plt>
mov    %rax,%rdi
call   1070 <car@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <cdr@plt>
mov    %rax,%rdi
call   1030 <cdr@plt>
mov    -0x30(%rbp),%rdi
mov    %rax,%rsi
call   1050 <delete_tree@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <cdr@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rsi
call   1040 <delete_object@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <car@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1050 <delete_tree@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <delete_object@plt>
mov    -0x10(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_ahandle>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1070 <car@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1060 <eval@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1030 <cdr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <delete_tree@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <delete_object@plt>
mov    %r14,%rdi
call   1030 <cdr@plt>
mov    %rax,%rdi
call   1070 <car@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <cdr@plt>
mov    %rax,%rdi
call   1030 <cdr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <delete_tree@plt>
mov    %r14,%rdi
call   1030 <cdr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <delete_object@plt>
mov    %r14,%rdi
call   1070 <car@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <delete_tree@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <delete_object@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.alisp_instance = type { i32 }
%struct.alisp_object = type { i32 }
define %struct.alisp_object* @F_ahandle(%struct.alisp_instance* %0, %struct.alisp_object* %1) {
%3 = alloca %struct.alisp_instance*
%4 = alloca %struct.alisp_object*
%5 = alloca %struct.alisp_object*
store %struct.alisp_instance* %0, %struct.alisp_instance** %3
store %struct.alisp_object* %1, %struct.alisp_object** %4
%6 = load %struct.alisp_instance*, %struct.alisp_instance** %3
%7 = load %struct.alisp_object*, %struct.alisp_object** %4
%8 = call %struct.alisp_object* @car(%struct.alisp_object* %7)
%9 = call %struct.alisp_object* @eval(%struct.alisp_instance* %6, %struct.alisp_object* %8)
store %struct.alisp_object* %9, %struct.alisp_object** %5
%10 = load %struct.alisp_instance*, %struct.alisp_instance** %3
%11 = load %struct.alisp_object*, %struct.alisp_object** %4
%12 = call %struct.alisp_object* @cdr(%struct.alisp_object* %11)
%13 = call i32 @delete_tree(%struct.alisp_instance* %10, %struct.alisp_object* %12)
%14 = load %struct.alisp_instance*, %struct.alisp_instance** %3
%15 = load %struct.alisp_object*, %struct.alisp_object** %4
%16 = call i32 @delete_object(%struct.alisp_instance* %14, %struct.alisp_object* %15)
%17 = load %struct.alisp_object*, %struct.alisp_object** %5
%18 = call %struct.alisp_object* @cdr(%struct.alisp_object* %17)
%19 = call %struct.alisp_object* @car(%struct.alisp_object* %18)
store %struct.alisp_object* %19, %struct.alisp_object** %4
%20 = load %struct.alisp_instance*, %struct.alisp_instance** %3
%21 = load %struct.alisp_object*, %struct.alisp_object** %5
%22 = call %struct.alisp_object* @cdr(%struct.alisp_object* %21)
%23 = call %struct.alisp_object* @cdr(%struct.alisp_object* %22)
%24 = call i32 @delete_tree(%struct.alisp_instance* %20, %struct.alisp_object* %23)
%25 = load %struct.alisp_instance*, %struct.alisp_instance** %3
%26 = load %struct.alisp_object*, %struct.alisp_object** %5
%27 = call %struct.alisp_object* @cdr(%struct.alisp_object* %26)
%28 = call i32 @delete_object(%struct.alisp_instance* %25, %struct.alisp_object* %27)
%29 = load %struct.alisp_instance*, %struct.alisp_instance** %3
%30 = load %struct.alisp_object*, %struct.alisp_object** %5
%31 = call %struct.alisp_object* @car(%struct.alisp_object* %30)
%32 = call i32 @delete_tree(%struct.alisp_instance* %29, %struct.alisp_object* %31)
%33 = load %struct.alisp_instance*, %struct.alisp_instance** %3
%34 = load %struct.alisp_object*, %struct.alisp_object** %5
%35 = call i32 @delete_object(%struct.alisp_instance* %33, %struct.alisp_object* %34)
%36 = load %struct.alisp_object*, %struct.alisp_object** %4
ret %struct.alisp_object* %36
}

LLVM IR (-O2):
%struct.alisp_instance = type { i32 }
%struct.alisp_object = type { i32 }
define %struct.alisp_object* @F_ahandle(%struct.alisp_instance* %0, %struct.alisp_object* %1) {
%3 = tail call %struct.alisp_object* @car(%struct.alisp_object* %1)
%4 = tail call %struct.alisp_object* @eval(%struct.alisp_instance* %0, %struct.alisp_object* %3)
%5 = tail call %struct.alisp_object* @cdr(%struct.alisp_object* %1)
%6 = tail call i32 @delete_tree(%struct.alisp_instance* %0, %struct.alisp_object* %5)
%7 = tail call i32 @delete_object(%struct.alisp_instance* %0, %struct.alisp_object* %1)
%8 = tail call %struct.alisp_object* @cdr(%struct.alisp_object* %4)
%9 = tail call %struct.alisp_object* @car(%struct.alisp_object* %8)
%10 = tail call %struct.alisp_object* @cdr(%struct.alisp_object* %4)
%11 = tail call %struct.alisp_object* @cdr(%struct.alisp_object* %10)
%12 = tail call i32 @delete_tree(%struct.alisp_instance* %0, %struct.alisp_object* %11)
%13 = tail call %struct.alisp_object* @cdr(%struct.alisp_object* %4)
%14 = tail call i32 @delete_object(%struct.alisp_instance* %0, %struct.alisp_object* %13)
%15 = tail call %struct.alisp_object* @car(%struct.alisp_object* %4)
%16 = tail call i32 @delete_tree(%struct.alisp_instance* %0, %struct.alisp_object* %15)
%17 = tail call i32 @delete_object(%struct.alisp_instance* %0, %struct.alisp_object* %4)
ret %struct.alisp_object* %9
}