	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_P_FindNextHighestFloor         ## -- Begin function P_FindNextHighestFloor
	.p2align	4, 0x90
_P_FindNextHighestFloor:                ## @P_FindNextHighestFloor
	.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	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movslq	%esi, %r14
	movq	_MAX_ADJOINING_SECTORS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	cmpl	$0, (%rbx)
	jle	LBB0_27
## %bb.1:
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_MAX_ADJOINING_SECTORS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jge	LBB0_6
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	movslq	(%rbx), %rax
	cmpq	%rax, %r13
	jge	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rbx), %rax
	movq	(%rax,%r13,8), %rdi
	movq	%rbx, %rsi
	callq	_getNextSector
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%rax), %rax
	cmpq	%r14, %rax
	jle	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	%r12d, %rcx
	incl	%r12d
	movq	%rax, (%r15,%rcx,8)
	jmp	LBB0_5
LBB0_6:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
LBB0_8:
	testl	%r12d, %r12d
	je	LBB0_27
## %bb.9:
	movl	(%r15), %ecx
	cmpl	$2, %r12d
	jl	LBB0_26
## %bb.10:
	movl	%r12d, %edx
	leaq	-1(%rdx), %rsi
	addq	$-2, %rdx
	movl	%esi, %eax
	andl	$3, %eax
	cmpq	$3, %rdx
	jae	LBB0_12
## %bb.11:
	movl	$1, %edx
	testq	%rax, %rax
	jne	LBB0_24
	jmp	LBB0_26
LBB0_12:
	andq	$-4, %rsi
	xorl	%edx, %edx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_13 Depth=1
	addq	$4, %rdx
	cmpq	%rdx, %rsi
	je	LBB0_22
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movslq	%ecx, %rbx
	movq	8(%r15,%rdx,8), %rdi
	cmpq	%rbx, %rdi
	jl	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%ecx, %edi
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	16(%r15,%rdx,8), %rcx
	movslq	%edi, %rbx
	cmpq	%rbx, %rcx
	jl	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%edi, %ecx
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	24(%r15,%rdx,8), %rdi
	movslq	%ecx, %rbx
	cmpq	%rbx, %rdi
	jl	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%ecx, %edi
LBB0_19:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	32(%r15,%rdx,8), %rcx
	movslq	%edi, %rbx
	cmpq	%rbx, %rcx
	jl	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%edi, %ecx
	jmp	LBB0_21
LBB0_22:
	incq	%rdx
	testq	%rax, %rax
	je	LBB0_26
LBB0_24:
	leaq	(%r15,%rdx,8), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rdx,%rsi,8), %rdi
	movslq	%ecx, %rcx
	cmpq	%rcx, %rdi
	cmovll	%edi, %ecx
	incq	%rsi
	cmpq	%rsi, %rax
	jne	LBB0_25
LBB0_26:
	movslq	%ecx, %r14
LBB0_27:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_29
## %bb.28:
	movq	%r14, %rax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_29:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_ADJOINING_SECTORS,4,2      ## @MAX_ADJOINING_SECTORS
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Sector with more than 20 adjoining sectors\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_P_FindNextHighestFloor         ; -- Begin function P_FindNextHighestFloor
	.p2align	2
_P_FindNextHighestFloor:                ; @P_FindNextHighestFloor
	.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
	sub	sp, sp, #16
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	sxtw	x19, w1
Lloh3:
	adrp	x22, _MAX_ADJOINING_SECTORS@GOTPAGE
Lloh4:
	ldr	x22, [x22, _MAX_ADJOINING_SECTORS@GOTPAGEOFF]
	ldr	w8, [x22]
	lsl	x8, x8, #3
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x21, x9, x8
	mov	sp, x21
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.1:
	mov	x24, #0
	mov	w23, #0
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22]
	cmp	w23, w8
	b.ge	LBB0_7
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x20]
	cmp	x24, x8
	b.ge	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	ldr	x0, [x8, x24, lsl #3]
	mov	x1, x20
	bl	_getNextSector
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x0, #8]
	cmp	x8, x19
	b.le	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	str	x8, [x21, w23, sxtw #3]
	add	w23, w23, #1
	b	LBB0_2
LBB0_7:
Lloh7:
	adrp	x8, _stderr@GOTPAGE
Lloh8:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
LBB0_8:
	cbz	w23, LBB0_13
; %bb.9:
	ldr	w8, [x21]
	cmp	w23, #2
	b.lt	LBB0_12
; %bb.10:
	mov	w10, w23
	add	x9, x21, #8
	sub	x10, x10, #1
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9], #8
	cmp	x11, w8, sxtw
	csel	w8, w11, w8, lt
	subs	x10, x10, #1
	b.ne	LBB0_11
LBB0_12:
	sxtw	x19, w8
LBB0_13:
	ldur	x8, [x29, #-56]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	mov	x0, x19
	sub	sp, x29, #48
	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
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_ADJOINING_SECTORS,4,2      ; @MAX_ADJOINING_SECTORS
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Sector with more than 20 adjoining sectors\n"

.subsections_via_symbols
