	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_P_NightmareRespawn             ## -- Begin function P_NightmareRespawn
	.p2align	4, 0x90
_P_NightmareRespawn:                    ## @P_NightmareRespawn
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_FRACBITS@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	20(%rdi), %r14d
	shll	%cl, %r14d
	movl	24(%rdi), %r15d
	shll	%cl, %r15d
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	_P_CheckPosition
	testl	%eax, %eax
	je	LBB0_7
## %bb.1:
	leaq	20(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %edi
	movl	4(%rbx), %esi
	movq	48(%rbx), %rax
	movq	(%rax), %rax
	movl	(%rax), %edx
	movq	_MT_TFOG@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	callq	_P_SpawnMobj
	movq	_sfx_telept@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rax, %rdi
	callq	_S_StartSound
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_R_PointInSubsector
	movq	(%rax), %rax
	movl	(%rax), %edx
	movl	(%r13), %ecx
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_P_SpawnMobj
	movl	(%r12), %esi
	movq	%rax, %rdi
	callq	_S_StartSound
	movq	40(%rbx), %rax
	movq	_MF_SPAWNCEILING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	jne	LBB0_2
## %bb.3:
	movq	_ONFLOORZ@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_ONCEILINGZ@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %edx
	movl	36(%rbx), %ecx
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_P_SpawnMobj
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movups	(%rcx), %xmm0
	movups	%xmm0, 20(%rax)
	movq	_ANG45@GOTPCREL(%rip), %rcx
	movslq	28(%rbx), %rdx
	imulq	$-1240768329, %rdx, %rsi        ## imm = 0xB60B60B7
	shrq	$32, %rsi
	addl	%edx, %esi
	movl	%esi, %edx
	shrl	$31, %edx
	sarl	$5, %esi
	addl	%edx, %esi
	imull	(%rcx), %esi
	movl	%esi, 8(%rax)
	movq	_MTF_AMBUSH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 32(%rbx)
	je	LBB0_6
## %bb.5:
	movq	_MF_AMBUSH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 16(%rax)
LBB0_6:
	movl	$18, 12(%rax)
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_P_RemoveMobj                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FRACBITS,4,2                   ## @FRACBITS
	.comm	_MT_TFOG,4,2                    ## @MT_TFOG
	.comm	_sfx_telept,4,2                 ## @sfx_telept
	.comm	_MF_SPAWNCEILING,4,2            ## @MF_SPAWNCEILING
	.comm	_ONCEILINGZ,4,2                 ## @ONCEILINGZ
	.comm	_ONFLOORZ,4,2                   ## @ONFLOORZ
	.comm	_ANG45,4,2                      ## @ANG45
	.comm	_MTF_AMBUSH,4,2                 ## @MTF_AMBUSH
	.comm	_MF_AMBUSH,4,2                  ## @MF_AMBUSH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_P_NightmareRespawn             ; -- Begin function P_NightmareRespawn
	.p2align	2
_P_NightmareRespawn:                    ; @P_NightmareRespawn
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	mov	x22, x0
	ldr	w8, [x22, #20]!
Lloh0:
	adrp	x9, _FRACBITS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FRACBITS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	lsl	w20, w8, w9
	ldr	w8, [x0, #24]
	lsl	w21, w8, w9
	mov	x1, x20
	mov	x2, x21
	bl	_P_CheckPosition
	cbz	w0, LBB0_4
; %bb.1:
	ldp	w0, w1, [x19]
	ldr	x8, [x19, #48]
	ldr	x8, [x8]
	ldr	w2, [x8]
Lloh3:
	adrp	x23, _MT_TFOG@GOTPAGE
Lloh4:
	ldr	x23, [x23, _MT_TFOG@GOTPAGEOFF]
	ldr	w3, [x23]
	bl	_P_SpawnMobj
Lloh5:
	adrp	x24, _sfx_telept@GOTPAGE
Lloh6:
	ldr	x24, [x24, _sfx_telept@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_S_StartSound
	mov	x0, x20
	mov	x1, x21
	bl	_R_PointInSubsector
	ldr	x8, [x0]
	ldr	w2, [x8]
	ldr	w3, [x23]
	mov	x0, x20
	mov	x1, x21
	bl	_P_SpawnMobj
	ldr	w1, [x24]
	bl	_S_StartSound
	ldr	x8, [x19, #40]
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _MF_SPAWNCEILING@GOTPAGE
Lloh8:
	ldr	x9, [x9, _MF_SPAWNCEILING@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _ONFLOORZ@GOTPAGE
Lloh11:
	ldr	x10, [x10, _ONFLOORZ@GOTPAGEOFF]
Lloh12:
	adrp	x11, _ONCEILINGZ@GOTPAGE
Lloh13:
	ldr	x11, [x11, _ONCEILINGZ@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x10, x11, eq
	ldr	w2, [x8]
	ldr	w3, [x19, #36]
	mov	x0, x20
	mov	x1, x21
	bl	_P_SpawnMobj
	ldr	q0, [x22]
	stur	q0, [x0, #20]
	mov	x8, #-40777
	movk	x8, #46603, lsl #16
	ldp	w9, w10, [x19, #28]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	mul	x8, x9, x8
	lsr	x8, x8, #32
	add	w8, w8, w9
	asr	w9, w8, #5
	add	w8, w9, w8, lsr #31
Lloh14:
	adrp	x9, _ANG45@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ANG45@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	mul	w8, w8, w9
	str	w8, [x0, #8]
Lloh17:
	adrp	x8, _MTF_AMBUSH@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MTF_AMBUSH@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	tst	w8, w10
	b.eq	LBB0_3
; %bb.2:
Lloh20:
	adrp	x8, _MF_AMBUSH@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MF_AMBUSH@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ldr	w9, [x0, #16]
	orr	w8, w9, w8
	str	w8, [x0, #16]
LBB0_3:
	mov	w8, #18
	str	w8, [x0, #12]
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_P_RemoveMobj
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_FRACBITS,4,2                   ; @FRACBITS
	.comm	_MT_TFOG,4,2                    ; @MT_TFOG
	.comm	_sfx_telept,4,2                 ; @sfx_telept
	.comm	_MF_SPAWNCEILING,4,2            ; @MF_SPAWNCEILING
	.comm	_ONCEILINGZ,4,2                 ; @ONCEILINGZ
	.comm	_ONFLOORZ,4,2                   ; @ONFLOORZ
	.comm	_ANG45,4,2                      ; @ANG45
	.comm	_MTF_AMBUSH,4,2                 ; @MTF_AMBUSH
	.comm	_MF_AMBUSH,4,2                  ; @MF_AMBUSH
.subsections_via_symbols
