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

/* Variables and functions */
int /*<<< orphan*/ Cyc_Tcutil_rsubsexp(struct _RegionHandle *,
                                       struct Cyc_List_List *,
                                       struct Cyc_Absyn_Exp *);
struct Cyc_Absyn_Exp *Cyc_Tcutil_rsubs_exp_opt(struct _RegionHandle *r,
                                               struct Cyc_List_List *inst,
                                               struct Cyc_Absyn_Exp *e) {
  if (e == 0)
    return 0;
  else {
    return ({ Cyc_Tcutil_rsubsexp(r, inst, e); });
  }
}


x86 assembly (clang, -O0):
<Cyc_Tcutil_rsubs_exp_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    113c <Cyc_Tcutil_rsubs_exp_opt+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1158 <Cyc_Tcutil_rsubs_exp_opt+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <Cyc_Tcutil_rsubsexp@plt>
mov    %eax,-0x24(%rbp)
movslq -0x24(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Tcutil_rsubs_exp_opt>:
test   %rdx,%rdx
je     1122 <Cyc_Tcutil_rsubs_exp_opt+0x12>
push   %rax
call   1030 <Cyc_Tcutil_rsubsexp@plt>
cltq
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

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