struct l_class_OC_CBaseFSM *
_ZN5small8RetTest4EP9UEC_Event(struct l_class_OC_small *llvm_cbe_this,
                               struct l_struct_OC_UEC_Event *llvm_cbe_ev) {
  struct l_class_OC_CBaseFSM *llvm_cbe_retval;
  struct l_class_OC_small *llvm_cbe_this_2e_addr;
  struct l_struct_OC_UEC_Event *llvm_cbe_ev_2e_addr;
  struct l_class_OC_small *llvm_cbe_this1;
  struct l_class_OC_CBaseFSM *llvm_cbe_tmp__6;
  *(&llvm_cbe_this_2e_addr) = llvm_cbe_this;
  *(&llvm_cbe_ev_2e_addr) = llvm_cbe_ev;
  llvm_cbe_this1 = *(&llvm_cbe_this_2e_addr);
  *(&llvm_cbe_retval) = (((struct l_class_OC_CBaseFSM *)llvm_cbe_this1));
  llvm_cbe_tmp__6 = *(&llvm_cbe_retval);
  return llvm_cbe_tmp__6;
}


x86 assembly (clang, -O0):
<_ZN5small8RetTest4EP9UEC_Event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ZN5small8RetTest4EP9UEC_Event>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.l_class_OC_CBaseFSM = type opaque
%struct.l_class_OC_small = type opaque
%struct.l_struct_OC_UEC_Event = type opaque
define %struct.l_class_OC_CBaseFSM* @_ZN5small8RetTest4EP9UEC_Event(%struct.l_class_OC_small* %0, %struct.l_struct_OC_UEC_Event* %1) {
%3 = alloca %struct.l_class_OC_small*
%4 = alloca %struct.l_struct_OC_UEC_Event*
%5 = alloca %struct.l_class_OC_CBaseFSM*
%6 = alloca %struct.l_class_OC_small*
%7 = alloca %struct.l_struct_OC_UEC_Event*
%8 = alloca %struct.l_class_OC_small*
%9 = alloca %struct.l_class_OC_CBaseFSM*
store %struct.l_class_OC_small* %0, %struct.l_class_OC_small** %3
store %struct.l_struct_OC_UEC_Event* %1, %struct.l_struct_OC_UEC_Event** %4
%10 = load %struct.l_class_OC_small*, %struct.l_class_OC_small** %3
store %struct.l_class_OC_small* %10, %struct.l_class_OC_small** %6
%11 = load %struct.l_struct_OC_UEC_Event*, %struct.l_struct_OC_UEC_Event** %4
store %struct.l_struct_OC_UEC_Event* %11, %struct.l_struct_OC_UEC_Event** %7
%12 = load %struct.l_class_OC_small*, %struct.l_class_OC_small** %6
store %struct.l_class_OC_small* %12, %struct.l_class_OC_small** %8
%13 = load %struct.l_class_OC_small*, %struct.l_class_OC_small** %8
%14 = bitcast %struct.l_class_OC_small* %13 to %struct.l_class_OC_CBaseFSM*
store %struct.l_class_OC_CBaseFSM* %14, %struct.l_class_OC_CBaseFSM** %5
%15 = load %struct.l_class_OC_CBaseFSM*, %struct.l_class_OC_CBaseFSM** %5
store %struct.l_class_OC_CBaseFSM* %15, %struct.l_class_OC_CBaseFSM** %9
%16 = load %struct.l_class_OC_CBaseFSM*, %struct.l_class_OC_CBaseFSM** %9
ret %struct.l_class_OC_CBaseFSM* %16
}

LLVM IR (-O2):
%struct.l_class_OC_CBaseFSM = type opaque
%struct.l_class_OC_small = type opaque
%struct.l_struct_OC_UEC_Event = type opaque
define %struct.l_class_OC_CBaseFSM* @_ZN5small8RetTest4EP9UEC_Event(%struct.l_class_OC_small* readnone %0, %struct.l_struct_OC_UEC_Event* nocapture readnone %1) {
%3 = bitcast %struct.l_class_OC_small* %0 to %struct.l_class_OC_CBaseFSM*
ret %struct.l_class_OC_CBaseFSM* %3
}