struct l_class_OC_CBaseFSM *
_ZN5small8RetTest1EP9UEC_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_struct_OC_UEC_Event *llvm_cbe_tmp;
  struct l_class_OC_CBaseFSM *llvm_cbe_tmp__3;
  *(&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_tmp = *(&llvm_cbe_ev_2e_addr);
  *(&llvm_cbe_retval) = (((struct l_class_OC_CBaseFSM *)llvm_cbe_tmp));
  llvm_cbe_tmp__3 = *(&llvm_cbe_retval);
  return llvm_cbe_tmp__3;
}


x86 assembly (clang, -O0):
<_ZN5small8RetTest1EP9UEC_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    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ZN5small8RetTest1EP9UEC_Event>:
mov    %rsi,%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* @_ZN5small8RetTest1EP9UEC_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_struct_OC_UEC_Event*
%10 = 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
%11 = load %struct.l_class_OC_small*, %struct.l_class_OC_small** %3
store %struct.l_class_OC_small* %11, %struct.l_class_OC_small** %6
%12 = load %struct.l_struct_OC_UEC_Event*, %struct.l_struct_OC_UEC_Event** %4
store %struct.l_struct_OC_UEC_Event* %12, %struct.l_struct_OC_UEC_Event** %7
%13 = load %struct.l_class_OC_small*, %struct.l_class_OC_small** %6
store %struct.l_class_OC_small* %13, %struct.l_class_OC_small** %8
%14 = load %struct.l_struct_OC_UEC_Event*, %struct.l_struct_OC_UEC_Event** %7
store %struct.l_struct_OC_UEC_Event* %14, %struct.l_struct_OC_UEC_Event** %9
%15 = load %struct.l_struct_OC_UEC_Event*, %struct.l_struct_OC_UEC_Event** %9
%16 = bitcast %struct.l_struct_OC_UEC_Event* %15 to %struct.l_class_OC_CBaseFSM*
store %struct.l_class_OC_CBaseFSM* %16, %struct.l_class_OC_CBaseFSM** %5
%17 = load %struct.l_class_OC_CBaseFSM*, %struct.l_class_OC_CBaseFSM** %5
store %struct.l_class_OC_CBaseFSM* %17, %struct.l_class_OC_CBaseFSM** %10
%18 = load %struct.l_class_OC_CBaseFSM*, %struct.l_class_OC_CBaseFSM** %10
ret %struct.l_class_OC_CBaseFSM* %18
}

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* @_ZN5small8RetTest1EP9UEC_Event(%struct.l_class_OC_small* nocapture readnone %0, %struct.l_struct_OC_UEC_Event* readnone %1) {
%3 = bitcast %struct.l_struct_OC_UEC_Event* %1 to %struct.l_class_OC_CBaseFSM*
ret %struct.l_class_OC_CBaseFSM* %3
}