	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stbrp__skyline_find_best_pos
_stbrp__skyline_find_best_pos:          ## @stbrp__skyline_find_best_pos
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rdi, %r14
	movl	(%rdi), %ecx
	leal	(%rsi,%rcx), %ebx
	decl	%ebx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	subl	%edx, %ebx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	xorl	%edi, %edi
	testl	%edx, %edx
	sete	%dil
	callq	_STBRP_ASSERT
	movq	%r14, %rsi
	leaq	32(%r14), %r12
	movq	32(%r14), %r13
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movslq	%ebx, %r14
	movq	(%r13), %rdx
	leaq	(%rdx,%r14), %rax
	cmpq	8(%rsi), %rax
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	jle	LBB0_2
## %bb.1:
	xorl	%r15d, %r15d
	movl	$1073741824, -48(%rbp)          ## 4-byte Folded Spill
                                        ## imm = 0x40000000
	movl	$1073741824, %eax               ## imm = 0x40000000
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_15
LBB0_2:
	movl	$1073741824, -48(%rbp)          ## 4-byte Folded Spill
                                        ## imm = 0x40000000
	xorl	%r15d, %r15d
	movq	%r12, %rbx
	movl	$1073741824, %eax               ## imm = 0x40000000
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpl	%ecx, %eax
	cmovll	%eax, %ecx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	cmovlq	%rbx, %r15
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rbx
	movq	8(%r13), %r13
	addq	$8, %rbx
	movq	(%r13), %rdx
	leaq	(%rdx,%r14), %rax
	cmpq	8(%rsi), %rax
	jg	LBB0_12
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	leaq	-68(%rbp), %r8
	callq	_stbrp__skyline_find_min_y
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $eax killed $eax def $rax
	movq	16(%rsi), %rcx
	movq	_STBRP_HEURISTIC_Skyline_BL_sortHeight@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	addl	%eax, %ecx
	cmpl	24(%rsi), %ecx
	jg	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	-56(%rbp), %eax                 ## 4-byte Folded Reload
	jge	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-68(%rbp), %ecx
	jmp	LBB0_11
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	jne	LBB0_4
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	-68(%rbp), %ecx
	cmpl	-48(%rbp), %ecx                 ## 4-byte Folded Reload
	jge	LBB0_4
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
                                        ## kill: def $eax killed $eax killed $rax def $rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r15
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_4
LBB0_12:
	testq	%r15, %r15
	je	LBB0_14
## %bb.13:
	movq	(%r15), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_16
LBB0_14:
	xorl	%r15d, %r15d
LBB0_15:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_16:
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movq	16(%rsi), %rax
	movq	_STBRP_HEURISTIC_Skyline_BF_sortHeight@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_30
## %bb.17:
	movq	(%r12), %rbx
	movq	%rbx, %r15
	cmpq	%r14, (%rbx)
	jge	LBB0_22
## %bb.18:
	movq	%rbx, %r15
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %r15
	cmpq	%r14, (%r15)
	jl	LBB0_19
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_22 Depth=1
	movl	$1, %edi
	callq	_STBRP_ASSERT
	movl	-64(%rbp), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
                                        ## kill: def $r14d killed $r14d killed $r14 def $r14
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
LBB0_21:                                ##   in Loop: Header=BB0_22 Depth=1
	movq	8(%r15), %r15
	testq	%r15, %r15
	je	LBB0_30
LBB0_22:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_23 Depth 2
	movl	(%r15), %r14d
	subl	-60(%rbp), %r14d                ## 4-byte Folded Reload
	movl	%r14d, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_STBRP_ASSERT
	movl	%r14d, -84(%rbp)                ## 4-byte Spill
	movslq	%r14d, %r14
	movq	%r12, %rax
	movq	%rbx, %rcx
	.p2align	4, 0x90
LBB0_23:                                ##   Parent Loop BB0_22 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rcx, %rbx
	movq	%rax, %r12
	leaq	8(%rcx), %rax
	movq	8(%rcx), %rcx
	cmpq	%r14, (%rcx)
	jle	LBB0_23
## %bb.24:                              ##   in Loop: Header=BB0_22 Depth=1
	xorl	%edi, %edi
	cmpq	%r14, (%rbx)
	setle	%dil
	callq	_STBRP_ASSERT
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	leaq	-64(%rbp), %r8
	callq	_stbrp__skyline_find_min_y
	movl	%eax, %r14d
	movq	-104(%rbp), %rax                ## 8-byte Reload
	addl	%r14d, %eax
	cmpl	24(%r13), %eax
	jge	LBB0_21
## %bb.25:                              ##   in Loop: Header=BB0_22 Depth=1
	cmpl	-56(%rbp), %r14d                ## 4-byte Folded Reload
	jg	LBB0_21
## %bb.26:                              ##   in Loop: Header=BB0_22 Depth=1
	movl	-84(%rbp), %r13d                ## 4-byte Reload
	jl	LBB0_20
## %bb.27:                              ##   in Loop: Header=BB0_22 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, -64(%rbp)
	jl	LBB0_20
## %bb.28:                              ##   in Loop: Header=BB0_22 Depth=1
	jne	LBB0_21
## %bb.29:                              ##   in Loop: Header=BB0_22 Depth=1
	cmpl	-44(%rbp), %r13d                ## 4-byte Folded Reload
	jl	LBB0_20
	jmp	LBB0_21
LBB0_30:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	shlq	$32, %rcx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	orq	%rcx, %rax
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STBRP_HEURISTIC_Skyline_BL_sortHeight,8,3 ## @STBRP_HEURISTIC_Skyline_BL_sortHeight
	.comm	_STBRP_HEURISTIC_Skyline_BF_sortHeight,8,3 ## @STBRP_HEURISTIC_Skyline_BF_sortHeight
	.no_dead_strip	_stbrp__skyline_find_best_pos
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stbrp__skyline_find_best_pos
_stbrp__skyline_find_best_pos:          ; @stbrp__skyline_find_best_pos
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x0
	ldr	w8, [x0]
	add	w9, w1, w8
	sub	w9, w9, #1
	sdiv	w9, w9, w8
	mul	w21, w9, w8
	sdiv	w9, w21, w8
	msub	w8, w9, w8, w21
	cmp	w8, #0
	cset	w0, eq
	bl	_STBRP_ASSERT
	mov	x26, x20
	ldr	x23, [x26, #32]!
	sxtw	x21, w21
	ldr	x2, [x23]
	ldur	x8, [x26, #-24]
	add	x9, x2, x21
	cmp	x9, x8
	b.le	LBB0_2
; %bb.1:
	mov	x22, #0
	str	wzr, [sp]                       ; 4-byte Folded Spill
	mov	w28, #1073741824
	mov	w27, #1073741824
	b	LBB0_15
LBB0_2:
	mov	x22, #0
	mov	w28, #1073741824
Lloh0:
	adrp	x24, _STBRP_HEURISTIC_Skyline_BL_sortHeight@GOTPAGE
Lloh1:
	ldr	x24, [x24, _STBRP_HEURISTIC_Skyline_BL_sortHeight@GOTPAGEOFF]
	mov	x25, x26
	mov	w27, #1073741824
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	cmp	w0, w27
	csel	w27, w0, w27, lt
	csel	x22, x25, x22, lt
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x23, #8]!
	mov	x25, x23
	ldr	x2, [x8]
	ldr	x9, [x20, #8]
	add	x10, x2, x21
	cmp	x10, x9
	mov	x23, x8
	b.gt	LBB0_12
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x4, sp, #12
	mov	x0, x20
	mov	x1, x23
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	x3, x21
	bl	_stbrp__skyline_find_min_y
	ldr	x8, [x20, #16]
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20, #24]
	add	w9, w0, w19
	cmp	w9, w8
	b.gt	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w0, w27
	b.ge	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [sp, #12]
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	b.ne	LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [sp, #12]
	cmp	w8, w28
	b.ge	LBB0_4
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, x0
	mov	x22, x25
	mov	x28, x8
	b	LBB0_4
LBB0_12:
	cbz	x22, LBB0_14
; %bb.13:
	ldr	x8, [x22]
	ldr	w8, [x8]
	str	w8, [sp]                        ; 4-byte Folded Spill
	b	LBB0_15
LBB0_14:
	str	wzr, [sp]                       ; 4-byte Folded Spill
LBB0_15:
	ldr	x8, [x20, #16]
Lloh2:
	adrp	x9, _STBRP_HEURISTIC_Skyline_BF_sortHeight@GOTPAGE
Lloh3:
	ldr	x9, [x9, _STBRP_HEURISTIC_Skyline_BF_sortHeight@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_28
; %bb.16:
	str	w28, [sp, #4]                   ; 4-byte Folded Spill
	ldr	x23, [x26]
	ldr	x8, [x23]
	mov	x28, x23
	cmp	x8, x21
	b.ge	LBB0_21
; %bb.17:
	mov	x28, x23
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x28, [x28, #8]
	ldr	x8, [x28]
	cmp	x8, x21
	b.lt	LBB0_18
	b	LBB0_21
LBB0_19:                                ;   in Loop: Header=BB0_21 Depth=1
	mov	w0, #1
	bl	_STBRP_ASSERT
	ldr	w8, [sp, #8]
	stp	w24, w8, [sp]                   ; 8-byte Folded Spill
	mov	x27, x25
	mov	x22, x26
	mov	x8, x24
LBB0_20:                                ;   in Loop: Header=BB0_21 Depth=1
	ldr	x28, [x28, #8]
	cbz	x28, LBB0_28
LBB0_21:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_22 Depth 2
	ldr	w8, [x28]
	sub	w24, w8, w21
	mvn	w8, w24
	lsr	w0, w8, #31
	bl	_STBRP_ASSERT
	sxtw	x8, w24
	mov	x9, x26
	mov	x10, x23
LBB0_22:                                ;   Parent Loop BB0_21 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x23, x10
	mov	x26, x9
	mov	x9, x10
	ldr	x10, [x9, #8]!
	ldr	x11, [x10]
	cmp	x11, x8
	b.le	LBB0_22
; %bb.23:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	x9, [x23]
	cmp	x9, x8
	cset	w0, le
	bl	_STBRP_ASSERT
	add	x4, sp, #8
	mov	x0, x20
	mov	x1, x23
	mov	x2, x24
	mov	x3, x21
	bl	_stbrp__skyline_find_min_y
	ldr	w8, [x20, #24]
	add	w9, w0, w19
	cmp	w9, w8
	ccmp	w0, w27, #0, lt
	b.gt	LBB0_20
; %bb.24:                               ;   in Loop: Header=BB0_21 Depth=1
	mov	x25, x0
	cmp	w0, w27
	b.lt	LBB0_19
; %bb.25:                               ;   in Loop: Header=BB0_21 Depth=1
	ldp	w9, w8, [sp, #4]                ; 4-byte Folded Reload
	cmp	w8, w9
	b.lt	LBB0_19
; %bb.26:                               ;   in Loop: Header=BB0_21 Depth=1
	b.ne	LBB0_20
; %bb.27:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	w8, [sp]                        ; 4-byte Folded Reload
	cmp	w24, w8
	b.lt	LBB0_19
	b	LBB0_20
LBB0_28:
	ldr	w8, [sp]                        ; 4-byte Folded Reload
	mov	w0, w8
	bfi	x0, x27, #32, #32
	mov	x1, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_STBRP_HEURISTIC_Skyline_BL_sortHeight,8,3 ; @STBRP_HEURISTIC_Skyline_BL_sortHeight
	.comm	_STBRP_HEURISTIC_Skyline_BF_sortHeight,8,3 ; @STBRP_HEURISTIC_Skyline_BF_sortHeight
	.no_dead_strip	_stbrp__skyline_find_best_pos
.subsections_via_symbols
