struct object *z_primitive_cons(struct object *args) {
  (z_assert_arity(__func__, (args), (2)));
  struct object *ret = cons(car(args), (car(cdr((args)))));
  return ret;
}


x86 assembly (clang, -O0):
<z_primitive_cons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x2,%edx
mov    $0x0,%al
call   1050 <z_assert_arity@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1060 <car@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <cdr@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1060 <car@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    $0x0,%al
call   1040 <cons@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<z_primitive_cons>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1050 <z_assert_arity@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <car@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <cdr@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1060 <car@plt>
mov    %ebp,%edi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <cons@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.object = type opaque
@__func__.z_primitive_cons = [17 x i8] c"z_primitive_cons\00"
define %struct.object* @z_primitive_cons(%struct.object* %0) {
%2 = alloca %struct.object*
%3 = alloca %struct.object*
store %struct.object* %0, %struct.object** %2
%4 = load %struct.object*, %struct.object** %2
%5 = call i32 (i8*, %struct.object*, i32, ...) bitcast (i32 (...)* @z_assert_arity to i32 (i8*, %struct.object*, i32, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.z_primitive_cons, i64 0, i64 0), %struct.object* %4, i32 2)
%6 = load %struct.object*, %struct.object** %2
%7 = call i32 (%struct.object*, ...) bitcast (i32 (...)* @car to i32 (%struct.object*, ...)*)(%struct.object* %6)
%8 = load %struct.object*, %struct.object** %2
%9 = call i32 (%struct.object*, ...) bitcast (i32 (...)* @cdr to i32 (%struct.object*, ...)*)(%struct.object* %8)
%10 = call i32 (i32, ...) bitcast (i32 (...)* @car to i32 (i32, ...)*)(i32 %9)
%11 = call i32 (i32, i32, ...) bitcast (i32 (...)* @cons to i32 (i32, i32, ...)*)(i32 %7, i32 %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to %struct.object*
store %struct.object* %13, %struct.object** %3
%14 = load %struct.object*, %struct.object** %3
ret %struct.object* %14
}

LLVM IR (-O2):
%struct.object = type opaque
@__func__.z_primitive_cons = [17 x i8] c"z_primitive_cons\00"
define %struct.object* @z_primitive_cons(%struct.object* %0) {
%2 = tail call i32 (i8*, %struct.object*, i32, ...) bitcast (i32 (...)* @z_assert_arity to i32 (i8*, %struct.object*, i32, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.z_primitive_cons, i64 0, i64 0), %struct.object* %0, i32 2)
%3 = tail call i32 (%struct.object*, ...) bitcast (i32 (...)* @car to i32 (%struct.object*, ...)*)(%struct.object* %0)
%4 = tail call i32 (%struct.object*, ...) bitcast (i32 (...)* @cdr to i32 (%struct.object*, ...)*)(%struct.object* %0)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @car to i32 (i32, ...)*)(i32 %4)
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @cons to i32 (i32, i32, ...)*)(i32 %3, i32 %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %struct.object*
ret %struct.object* %8
}