#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 */
int ell_check(struct ell *, struct ell_v *);
struct ell_v *ell_clone_seq(struct ell_v *);
struct ell_v *ell_list(struct ell_v *);
bool ell_fn_list(struct ell *ell, struct ell_v *args, struct ell_v **result) {
  struct ell_v *values = NULL;
  if (args && !ell_check(ell, (values = ell_clone_seq(args))))
    return false;
  return ell_check(ell, (*result = ell_list(values)));
}


x86 assembly (clang, -O0):
<ell_fn_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118d <ell_fn_list+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ell_clone_seq@plt>
mov    -0x30(%rbp),%rdi
mov    %rax,%rsi
mov    %rsi,-0x28(%rbp)
call   1030 <ell_check@plt>
cmp    $0x0,%eax
jne    118d <ell_fn_list+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    11b4 <ell_fn_list+0x84>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <ell_list@plt>
mov    -0x38(%rbp),%rdi
mov    %rax,%rsi
mov    -0x20(%rbp),%rax
mov    %rsi,(%rax)
call   1030 <ell_check@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ell_fn_list>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%r15
test   %rsi,%rsi
je     1162 <ell_fn_list+0x32>
mov    %rsi,%rdi
call   1040 <ell_clone_seq@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <ell_check@plt>
test   %eax,%eax
jne    1164 <ell_fn_list+0x34>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
xor    %ebx,%ebx
mov    %rbx,%rdi
call   1050 <ell_list@plt>
mov    %rax,(%r14)
mov    %r15,%rdi
mov    %rax,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <ell_check@plt>

LLVM IR (-O0):
%struct.ell = type { i32 }
%struct.ell_v = type { i32 }
define i32 @ell_fn_list(%struct.ell* %0, %struct.ell_v* %1, %struct.ell_v** %2) {
%4 = alloca i32
%5 = alloca %struct.ell*
%6 = alloca %struct.ell_v*
%7 = alloca %struct.ell_v**
%8 = alloca %struct.ell_v*
store %struct.ell* %0, %struct.ell** %5
store %struct.ell_v* %1, %struct.ell_v** %6
store %struct.ell_v** %2, %struct.ell_v*** %7
store %struct.ell_v* null, %struct.ell_v** %8
%9 = load %struct.ell_v*, %struct.ell_v** %6
%10 = icmp ne %struct.ell_v* %9, null
br i1 %10, label %11, label %18
11: ; preds = %3
%12 = load %struct.ell*, %struct.ell** %5
%13 = load %struct.ell_v*, %struct.ell_v** %6
%14 = call %struct.ell_v* @ell_clone_seq(%struct.ell_v* %13)
store %struct.ell_v* %14, %struct.ell_v** %8
%15 = call i32 @ell_check(%struct.ell* %12, %struct.ell_v* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %11
store i32 0, i32* %4
br label %24
18: ; preds = %11, %3
%19 = load %struct.ell*, %struct.ell** %5
%20 = load %struct.ell_v*, %struct.ell_v** %8
%21 = call %struct.ell_v* @ell_list(%struct.ell_v* %20)
%22 = load %struct.ell_v**, %struct.ell_v*** %7
store %struct.ell_v* %21, %struct.ell_v** %22
%23 = call i32 @ell_check(%struct.ell* %19, %struct.ell_v* %21)
store i32 %23, i32* %4
br label %24
24: ; preds = %18, %17
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
%struct.ell = type { i32 }
%struct.ell_v = type { i32 }
define i32 @ell_fn_list(%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 %9, label %5
5: ; preds = %3
%6 = tail call %struct.ell_v* @ell_clone_seq(%struct.ell_v* %1)
%7 = tail call i32 @ell_check(%struct.ell* %0, %struct.ell_v* %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5, %3
%10 = phi %struct.ell_v* [ %6, %5 ], [ null, %3 ]
%11 = tail call %struct.ell_v* @ell_list(%struct.ell_v* %10)
store %struct.ell_v* %11, %struct.ell_v** %2
%12 = tail call i32 @ell_check(%struct.ell* %0, %struct.ell_v* %11)
br label %13
13: ; preds = %5, %9
%14 = phi i32 [ %12, %9 ], [ 0, %5 ]
ret i32 %14
}