#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 ell_v {
  int dummy;
};
struct ell {
  int dummy;
};

/* Variables and functions */
scalar_t__ ell_check(struct ell *, struct ell_v *);
struct ell_v *ell_clone_seq(struct ell_v *);
bool ell_fn_values(struct ell *ell, struct ell_v *args, struct ell_v **result) {
  return !args || ell_check(ell, (*result = ell_clone_seq(args)));
}


x86 assembly (clang, -O0):
<ell_fn_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
je     1172 <ell_fn_values+0x52>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ell_clone_seq@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rsi
mov    -0x18(%rbp),%rax
mov    %rsi,(%rax)
call   1030 <ell_check@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ell_fn_values>:
test   %rsi,%rsi
je     1158 <ell_fn_values+0x38>
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <ell_clone_seq@plt>
mov    %rax,(%r14)
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <ell_check@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.ell = type { i32 }
%struct.ell_v = type { i32 }
define i32 @ell_fn_values(%struct.ell* %0, %struct.ell_v* %1, %struct.ell_v** %2) {
%4 = alloca %struct.ell*
%5 = alloca %struct.ell_v*
%6 = alloca %struct.ell_v**
store %struct.ell* %0, %struct.ell** %4
store %struct.ell_v* %1, %struct.ell_v** %5
store %struct.ell_v** %2, %struct.ell_v*** %6
%7 = load %struct.ell_v*, %struct.ell_v** %5
%8 = icmp ne %struct.ell_v* %7, null
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = load %struct.ell*, %struct.ell** %4
%11 = load %struct.ell_v*, %struct.ell_v** %5
%12 = call %struct.ell_v* @ell_clone_seq(%struct.ell_v* %11)
%13 = load %struct.ell_v**, %struct.ell_v*** %6
store %struct.ell_v* %12, %struct.ell_v** %13
%14 = call i64 @ell_check(%struct.ell* %10, %struct.ell_v* %12)
%15 = icmp ne i64 %14, 0
br label %16
16: ; preds = %9, %3
%17 = phi i1 [ true, %3 ], [ %15, %9 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
%struct.ell = type { i32 }
%struct.ell_v = type { i32 }
define i32 @ell_fn_values(%struct.ell* %0, %struct.ell_v* %1, %struct.ell_v** nocapture writeonly %2) {
%4 = icmp eq %struct.ell_v* %1, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call %struct.ell_v* @ell_clone_seq(%struct.ell_v* %1)
store %struct.ell_v* %6, %struct.ell_v** %2
%7 = tail call i64 @ell_check(%struct.ell* %0, %struct.ell_v* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %3
%11 = phi i32 [ 1, %3 ], [ %9, %5 ]
ret i32 %11
}