	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_P_NewChaseDir                  ## -- Begin function P_NewChaseDir
	.p2align	4, 0x90
_P_NewChaseDir:                         ## @P_NewChaseDir
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	16(%rdi), %rax
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_I_Error
	movq	16(%r14), %rax
LBB0_2:
	movl	(%rax), %r15d
	subl	8(%r14), %r15d
	movl	4(%rax), %ebx
	subl	12(%r14), %ebx
	movq	_FRACUNIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,4), %eax
	cmpl	%eax, %r15d
	jle	LBB0_4
## %bb.3:
	movq	_DI_EAST@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %r13
	leal	(%rcx,%rcx,4), %ecx
	negl	%ecx
	jmp	LBB0_8
LBB0_4:
	leal	(%rcx,%rcx,4), %ecx
	negl	%ecx
	cmpl	%ecx, %r15d
	jge	LBB0_6
## %bb.5:
	movq	_DI_WEST@GOTPCREL(%rip), %rdx
	jmp	LBB0_7
LBB0_6:
	movq	_DI_NODIR@GOTPCREL(%rip), %rdx
LBB0_7:
	movq	(%rdx), %r13
LBB0_8:
	movq	_opposite@GOTPCREL(%rip), %rsi
	movq	_DI_NODIR@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, %r12
	cmpl	%eax, %ebx
	jle	LBB0_10
## %bb.9:
	movq	_DI_NORTH@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
LBB0_10:
	movq	(%r14), %rdi
	movq	(%rsi), %rax
	cmpl	%ecx, %ebx
	jge	LBB0_12
## %bb.11:
	movq	_DI_SOUTH@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r12
LBB0_12:
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rax,%rdi,8), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpq	%rdx, %r13
	je	LBB0_16
## %bb.13:
	cmpq	%rdx, %r12
	je	LBB0_16
## %bb.14:
	movq	_diags@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%ebx, %ecx
	shrl	$31, %ecx
	xorl	%edx, %edx
	testl	%r15d, %r15d
	setg	%dl
	leal	(%rdx,%rcx,2), %ecx
	movq	(%rax,%rcx,8), %rax
	movq	%rax, (%r14)
	cmpq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	je	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	callq	_P_TryWalk
	testq	%rax, %rax
	jne	LBB0_43
LBB0_16:
	xorl	%eax, %eax
	callq	_P_Random
	cmpl	$200, %eax
	jg	LBB0_18
## %bb.17:
	movl	%ebx, %edi
	callq	_abs
	movq	%rax, %rbx
	movl	%r15d, %edi
	callq	_abs
	cmpq	%rax, %rbx
	jle	LBB0_19
LBB0_18:
	movslq	%r13d, %rax
	movq	%r12, %r13
	movq	%rax, %r12
LBB0_19:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, %r13
	movq	_DI_NODIR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmoveq	%rax, %r13
	cmpq	%rcx, %r12
	cmoveq	%rax, %r12
	cmpq	%rax, %r13
	je	LBB0_22
## %bb.20:
	movq	%r13, (%r14)
	movq	%r14, %rdi
	callq	_P_TryWalk
	testq	%rax, %rax
	jne	LBB0_43
## %bb.21:
	movq	_DI_NODIR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_22:
	cmpq	%rax, %r12
	je	LBB0_25
## %bb.23:
	movq	%r12, (%r14)
	movq	%r14, %rdi
	callq	_P_TryWalk
	testq	%rax, %rax
	jne	LBB0_43
## %bb.24:
	movq	_DI_NODIR@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
LBB0_25:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	%r12, %rax
	je	LBB0_27
## %bb.26:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r14)
	movq	%r14, %rdi
	callq	_P_TryWalk
	testq	%rax, %rax
	jne	LBB0_43
LBB0_27:
	xorl	%eax, %eax
	callq	_P_Random
	testb	$1, %al
	jne	LBB0_28
## %bb.33:
	movq	_DI_SOUTHEAST@GOTPCREL(%rip), %rax
	movslq	(%rax), %r12
	movq	_DI_EAST@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	leal	-1(%rax), %ecx
	cmpl	%ecx, %r12d
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	je	LBB0_39
## %bb.34:
	leal	1(%r12), %ebx
	jmp	LBB0_35
	.p2align	4, 0x90
LBB0_38:                                ##   in Loop: Header=BB0_35 Depth=1
	decq	%r12
	decl	%ebx
	cmpl	%eax, %ebx
	je	LBB0_39
LBB0_35:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%r12, %rsi
	je	LBB0_38
## %bb.36:                              ##   in Loop: Header=BB0_35 Depth=1
	movq	%r12, (%r14)
	movq	%r14, %rdi
	callq	_P_TryWalk
	testq	%rax, %rax
	jne	LBB0_43
## %bb.37:                              ##   in Loop: Header=BB0_35 Depth=1
	movl	(%r15), %eax
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_38
LBB0_28:
	movq	_DI_EAST@GOTPCREL(%rip), %rax
	movslq	(%rax), %rbx
	movq	_DI_SOUTHEAST@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	cmpl	%eax, %ebx
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	jle	LBB0_29
LBB0_39:
	movq	_DI_NODIR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_42
## %bb.40:
	movq	%rsi, (%r14)
	movq	%r14, %rdi
	callq	_P_TryWalk
	testq	%rax, %rax
	jne	LBB0_43
## %bb.41:
	movq	_DI_NODIR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
LBB0_42:
	movq	%rsi, (%r14)
LBB0_43:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_32:                                ##   in Loop: Header=BB0_29 Depth=1
	leaq	1(%rbx), %rcx
	movslq	%eax, %rdx
	cmpq	%rdx, %rbx
	movq	%rcx, %rbx
	jge	LBB0_39
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rbx, %rsi
	je	LBB0_32
## %bb.30:                              ##   in Loop: Header=BB0_29 Depth=1
	movq	%rbx, (%r14)
	movq	%r14, %rdi
	callq	_P_TryWalk
	testq	%rax, %rax
	jne	LBB0_43
## %bb.31:                              ##   in Loop: Header=BB0_29 Depth=1
	movl	(%r15), %eax
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_32
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"P_NewChaseDir: called with no target"

	.comm	_opposite,8,3                   ## @opposite
	.comm	_FRACUNIT,4,2                   ## @FRACUNIT
	.comm	_DI_EAST,4,2                    ## @DI_EAST
	.comm	_DI_WEST,8,3                    ## @DI_WEST
	.comm	_DI_NODIR,8,3                   ## @DI_NODIR
	.comm	_DI_SOUTH,8,3                   ## @DI_SOUTH
	.comm	_DI_NORTH,8,3                   ## @DI_NORTH
	.comm	_diags,8,3                      ## @diags
	.comm	_DI_SOUTHEAST,4,2               ## @DI_SOUTHEAST
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_P_NewChaseDir                  ; -- Begin function P_NewChaseDir
	.p2align	2
_P_NewChaseDir:                         ; @P_NewChaseDir
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x9, [x0, #16]
	cbnz	x9, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_I_Error
	ldr	x9, [x19, #16]
LBB0_2:
	ldr	x24, [x19]
Lloh2:
	adrp	x8, _opposite@GOTPAGE
Lloh3:
	ldr	x8, [x8, _opposite@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldp	w11, w9, [x9]
	ldp	w12, w10, [x19, #8]
	sub	w21, w9, w10
Lloh5:
	adrp	x9, _FRACUNIT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _FRACUNIT@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x9]
	add	w9, w10, w10, lsl #2
	lsl	w9, w9, #1
	sub	w20, w11, w12
	cmp	w20, w9
Lloh8:
	adrp	x22, _DI_NODIR@GOTPAGE
Lloh9:
	ldr	x22, [x22, _DI_NODIR@GOTPAGEOFF]
	b.le	LBB0_4
; %bb.3:
Lloh10:
	adrp	x11, _DI_EAST@GOTPAGE
Lloh11:
	ldr	x11, [x11, _DI_EAST@GOTPAGEOFF]
Lloh12:
	ldrsw	x25, [x11]
	mov	w11, #-10
	mul	w10, w10, w11
	b	LBB0_7
LBB0_4:
	mov	w11, #-10
	mul	w10, w10, w11
	cmp	w20, w10
	b.ge	LBB0_6
; %bb.5:
Lloh13:
	adrp	x11, _DI_WEST@GOTPAGE
Lloh14:
	ldr	x11, [x11, _DI_WEST@GOTPAGEOFF]
Lloh15:
	ldr	x25, [x11]
	b	LBB0_7
LBB0_6:
	ldr	x25, [x22]
LBB0_7:
	ldr	x23, [x8, x24, lsl #3]
Lloh16:
	adrp	x8, _DI_SOUTH@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DI_SOUTH@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
Lloh19:
	adrp	x11, _DI_NORTH@GOTPAGE
Lloh20:
	ldr	x11, [x11, _DI_NORTH@GOTPAGEOFF]
Lloh21:
	ldr	x11, [x11]
	ldr	x12, [x22]
	cmp	w21, w9
	csel	x9, x11, x12, gt
	cmp	w21, w10
	csel	x26, x8, x9, lt
	cmp	x25, x12
	ccmp	x26, x12, #4, ne
	b.eq	LBB0_10
; %bb.8:
Lloh22:
	adrp	x8, _diags@GOTPAGE
Lloh23:
	ldr	x8, [x8, _diags@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	lsr	w9, w21, #30
	and	w9, w9, #0x2
	cmp	w20, #0
	cset	w10, gt
	orr	w9, w9, w10
	ldr	x8, [x8, w9, uxtw #3]
	str	x8, [x19]
	cmp	x8, x23
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_P_TryWalk
	cbnz	x0, LBB0_33
LBB0_10:
	bl	_P_Random
	cmp	w0, #200
	b.gt	LBB0_12
; %bb.11:
	mov	x0, x21
	bl	_abs
	mov	x21, x0
	mov	x0, x20
	bl	_abs
	cmp	x21, x0
	b.le	LBB0_13
LBB0_12:
	sxtw	x8, w25
	mov	x25, x26
	mov	x26, x8
LBB0_13:
	ldr	x8, [x22]
	cmp	x25, x23
	csel	x9, x8, x25, eq
	cmp	x26, x23
	csel	x20, x8, x26, eq
	cmp	x9, x8
	b.eq	LBB0_16
; %bb.14:
	str	x9, [x19]
	mov	x0, x19
	bl	_P_TryWalk
	cbnz	x0, LBB0_33
; %bb.15:
	ldr	x8, [x22]
LBB0_16:
	cmp	x20, x8
	b.eq	LBB0_19
; %bb.17:
	str	x20, [x19]
	mov	x0, x19
	bl	_P_TryWalk
	cbnz	x0, LBB0_33
; %bb.18:
	ldr	x20, [x22]
LBB0_19:
	cmp	x24, x20
	b.eq	LBB0_21
; %bb.20:
	str	x24, [x19]
	mov	x0, x19
	bl	_P_TryWalk
	cbnz	x0, LBB0_33
LBB0_21:
	bl	_P_Random
	tbnz	w0, #0, LBB0_28
; %bb.22:
Lloh25:
	adrp	x8, _DI_SOUTHEAST@GOTPAGE
Lloh26:
	ldr	x8, [x8, _DI_SOUTHEAST@GOTPAGEOFF]
Lloh27:
	ldrsw	x20, [x8]
Lloh28:
	adrp	x21, _DI_EAST@GOTPAGE
Lloh29:
	ldr	x21, [x21, _DI_EAST@GOTPAGEOFF]
	ldr	w8, [x21]
	sub	w9, w8, #1
	cmp	w20, w9
	b.eq	LBB0_29
; %bb.23:
	add	w24, w20, #1
	b	LBB0_25
LBB0_24:                                ;   in Loop: Header=BB0_25 Depth=1
	sub	x20, x20, #1
	sub	w24, w24, #1
	cmp	w24, w8
	b.eq	LBB0_29
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	cmp	x23, x20
	b.eq	LBB0_24
; %bb.26:                               ;   in Loop: Header=BB0_25 Depth=1
	str	x20, [x19]
	mov	x0, x19
	bl	_P_TryWalk
	cbnz	x0, LBB0_33
; %bb.27:                               ;   in Loop: Header=BB0_25 Depth=1
	ldr	w8, [x21]
	b	LBB0_24
LBB0_28:
Lloh30:
	adrp	x8, _DI_EAST@GOTPAGE
Lloh31:
	ldr	x8, [x8, _DI_EAST@GOTPAGEOFF]
Lloh32:
	ldrsw	x20, [x8]
Lloh33:
	adrp	x21, _DI_SOUTHEAST@GOTPAGE
Lloh34:
	ldr	x21, [x21, _DI_SOUTHEAST@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w20, w8
	b.le	LBB0_35
LBB0_29:
	ldr	x8, [x22]
	cmp	x23, x8
	b.eq	LBB0_32
; %bb.30:
	str	x23, [x19]
	mov	x0, x19
	bl	_P_TryWalk
	cbnz	x0, LBB0_33
; %bb.31:
	ldr	x23, [x22]
LBB0_32:
	str	x23, [x19]
LBB0_33:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_34:                                ;   in Loop: Header=BB0_35 Depth=1
	cmp	x20, w8, sxtw
	add	x20, x20, #1
	b.ge	LBB0_29
LBB0_35:                                ; =>This Inner Loop Header: Depth=1
	cmp	x23, x20
	b.eq	LBB0_34
; %bb.36:                               ;   in Loop: Header=BB0_35 Depth=1
	str	x20, [x19]
	mov	x0, x19
	bl	_P_TryWalk
	cbnz	x0, LBB0_33
; %bb.37:                               ;   in Loop: Header=BB0_35 Depth=1
	ldr	w8, [x21]
	b	LBB0_34
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"P_NewChaseDir: called with no target"

	.comm	_opposite,8,3                   ; @opposite
	.comm	_FRACUNIT,4,2                   ; @FRACUNIT
	.comm	_DI_EAST,4,2                    ; @DI_EAST
	.comm	_DI_WEST,8,3                    ; @DI_WEST
	.comm	_DI_NODIR,8,3                   ; @DI_NODIR
	.comm	_DI_SOUTH,8,3                   ; @DI_SOUTH
	.comm	_DI_NORTH,8,3                   ; @DI_NORTH
	.comm	_diags,8,3                      ; @diags
	.comm	_DI_SOUTHEAST,4,2               ; @DI_SOUTHEAST
.subsections_via_symbols
