struct node *node_fun_retval(struct node *def) {
  return __builtin_choose_expr(
      __builtin_types_compatible_p(__typeof__(node_fun_retval_const(def)),
                                   const struct node *),
      (struct node *)(node_fun_retval_const(def)),
      __builtin_choose_expr(
          __builtin_types_compatible_p(__typeof__(node_fun_retval_const(def)),
                                       const struct module *),
          (struct module *)(node_fun_retval_const(def)),
          __builtin_choose_expr(
              __builtin_types_compatible_p(
                  __typeof__(node_fun_retval_const(def)), const struct typ *),
              (struct typ *)(node_fun_retval_const(def)),
              __builtin_choose_expr(
                  __builtin_types_compatible_p(
                      __typeof__(node_fun_retval_const(def)),
                      const struct toplevel *),
                  (struct toplevel *)(node_fun_retval_const(def)),
                  __builtin_choose_expr(
                      __builtin_types_compatible_p(
                          __typeof__(node_fun_retval_const(def)),
                          const struct scope *),
                      (struct scope *)(node_fun_retval_const(def)),
                      __builtin_choose_expr(
                          __builtin_types_compatible_p(
                              __typeof__(node_fun_retval_const(def)),
                              const struct typset *),
                          (struct typset *)(node_fun_retval_const(def)),
                          __builtin_choose_expr(
                              __builtin_types_compatible_p(
                                  __typeof__(node_fun_retval_const(def)),
                                  const struct constraint *),
                              (struct constraint *)(node_fun_retval_const(def)),
                              __builtin_choose_expr(
                                  __builtin_types_compatible_p(
                                      __typeof__(node_fun_retval_const(def)),
                                      const struct vecancestor *),
                                  (struct vecancestor *)(node_fun_retval_const(
                                      def)),
                                  (node_fun_retval_const(def))))))))));
}


x86 assembly (clang, -O0):
<node_fun_retval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <node_fun_retval_const@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<node_fun_retval>:
push   %rax
xor    %eax,%eax
call   1030 <node_fun_retval_const@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.node = type opaque
define %struct.node* @node_fun_retval(%struct.node* %0) {
%2 = alloca %struct.node*
store %struct.node* %0, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
%4 = call i32 (%struct.node*, ...) bitcast (i32 (...)* @node_fun_retval_const to i32 (%struct.node*, ...)*)(%struct.node* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.node*
ret %struct.node* %6
}

LLVM IR (-O2):
%struct.node = type opaque
define %struct.node* @node_fun_retval(%struct.node* %0) {
%2 = tail call i32 (%struct.node*, ...) bitcast (i32 (...)* @node_fun_retval_const to i32 (%struct.node*, ...)*)(%struct.node* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct.node*
ret %struct.node* %4
}