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


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

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

LLVM IR (-O0):
%struct.node = type opaque
define %struct.node* @subs_first(%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 (...)* @subs_first_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* @subs_first(%struct.node* %0) {
%2 = tail call i32 (%struct.node*, ...) bitcast (i32 (...)* @subs_first_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
}