#if defined(__loongarch_lp64) && defined(__linux__)
#include "sanitizer_common/sanitizer_asm.h"
ASM_HIDDEN(COMMON_INTERCEPTOR_SPILL_AREA)
ASM_HIDDEN(_ZN14__interception10real_vforkE)
.text
.globl ASM_WRAPPER_NAME(vfork)
ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
ASM_WRAPPER_NAME(vfork):
addi.d $sp, $sp, -16
st.d $ra, $sp, 8
bl COMMON_INTERCEPTOR_SPILL_AREA
ld.d $ra, $sp, 8
addi.d $sp, $sp, 16
st.d $ra, $a0, 0
la.local $a0, _ZN14__interception10real_vforkE
ld.d $a0, $a0, 0
jirl $ra, $a0, 0
addi.d $sp, $sp, -16
st.d $a0, $sp, 8
beqz $a0, .L_exit
addi.d $a0, $sp, 16
bl %plt(COMMON_INTERCEPTOR_HANDLE_VFORK)
.L_exit:
bl COMMON_INTERCEPTOR_SPILL_AREA
ld.d $ra, $a0, 0
ld.d $a0, $sp, 8
addi.d $sp, $sp, 16
jr $ra
ASM_SIZE(vfork)
ASM_INTERCEPTOR_TRAMPOLINE(vfork)
ASM_TRAMPOLINE_ALIAS(vfork, vfork)
#endif