#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 _RegionHandle {
  int dummy;
};
struct Cyc_List_List {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_List_rrevappend(struct _RegionHandle *,
                                       struct Cyc_List_List *,
                                       int /*<<< orphan*/);
struct Cyc_List_List *Cyc_List_rrev(struct _RegionHandle *r2,
                                    struct Cyc_List_List *x) {
  if (x == 0)
    return 0;
  return ({ Cyc_List_rrevappend(r2, x, 0); });
}


x86 assembly (clang, -O0):
<Cyc_List_rrev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <Cyc_List_rrev+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1152 <Cyc_List_rrev+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <Cyc_List_rrevappend@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_List_rrev>:
test   %rsi,%rsi
je     1124 <Cyc_List_rrev+0x14>
push   %rax
xor    %edx,%edx
call   1030 <Cyc_List_rrevappend@plt>
cltq
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct._RegionHandle = type { i32 }
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_List_rrev(%struct._RegionHandle* %0, %struct.Cyc_List_List* %1) {
%3 = alloca %struct.Cyc_List_List*
%4 = alloca %struct._RegionHandle*
%5 = alloca %struct.Cyc_List_List*
%6 = alloca i32
store %struct._RegionHandle* %0, %struct._RegionHandle** %4
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %5
%7 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %5
%8 = icmp eq %struct.Cyc_List_List* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
store %struct.Cyc_List_List* null, %struct.Cyc_List_List** %3
br label %17
10: ; preds = %2
%11 = load %struct._RegionHandle*, %struct._RegionHandle** %4
%12 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %5
%13 = call i32 @Cyc_List_rrevappend(%struct._RegionHandle* %11, %struct.Cyc_List_List* %12, i32 0)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to %struct.Cyc_List_List*
store %struct.Cyc_List_List* %16, %struct.Cyc_List_List** %3
br label %17
17: ; preds = %10, %9
%18 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %3
ret %struct.Cyc_List_List* %18
}

LLVM IR (-O2):
%struct._RegionHandle = type { i32 }
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_List_rrev(%struct._RegionHandle* %0, %struct.Cyc_List_List* %1) {
%3 = icmp eq %struct.Cyc_List_List* %1, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @Cyc_List_rrevappend(%struct._RegionHandle* %0, %struct.Cyc_List_List* %1, i32 0)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.Cyc_List_List*
br label %8
8: ; preds = %2, %4
%9 = phi %struct.Cyc_List_List* [ %7, %4 ], [ null, %2 ]
ret %struct.Cyc_List_List* %9
}