	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_mm_scan_add_block          ## -- Begin function drm_mm_scan_add_block
	.p2align	4, 0x90
_drm_mm_scan_add_block:                 ## @drm_mm_scan_add_block
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	64(%rdi), %r12
	xorl	%edi, %edi
	cmpq	%r12, 16(%rsi)
	setne	%dil
	callq	_DRM_MM_BUG_ON
	xorl	%edi, %edi
	cmpl	$0, 8(%rbx)
	sete	%dil
	callq	_DRM_MM_BUG_ON
	movl	(%rbx), %edi
	callq	_DRM_MM_BUG_ON
	movl	$1, (%rbx)
	incl	8(%r12)
	movq	_node_list@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_list_prev_entry
	movq	%rax, %r14
	movl	(%r13), %esi
	movq	%rax, %rdi
	callq	_list_next_entry
	xorl	%edi, %edi
	cmpq	%rbx, %rax
	setne	%dil
	callq	_DRM_MM_BUG_ON
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	___list_del_entry
	movq	%r14, %rdi
	callq	___drm_mm_hole_node_start
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	___drm_mm_hole_node_end
	movq	%rbx, -56(%rbp)
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, -48(%rbp)
	movq	(%r12), %r8
	testq	%r8, %r8
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movl	56(%r15), %esi
	leaq	-56(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	callq	*%r8
	movq	-56(%rbp), %rdi
	jmp	LBB0_3
LBB0_1:
	movq	%rbx, %rdi
LBB0_3:
	movl	52(%r15), %esi
	callq	_max
	movq	%rax, %r12
	movq	-48(%rbp), %rdi
	movl	48(%r15), %esi
	callq	_min
	movq	%rax, %r14
	xorl	%r13d, %r13d
	subq	%r12, %rax
	jle	LBB0_18
## %bb.4:
	movq	(%r15), %rcx
	cmpq	%rcx, %rax
	jl	LBB0_18
## %bb.5:
	movq	8(%r15), %rax
	movq	_DRM_MM_INSERT_HIGH@GOTPCREL(%rip), %rbx
	movq	%r14, %rdx
	subq	%rcx, %rdx
	cmpq	(%rbx), %rax
	cmoveq	%rdx, %r12
	cmpq	$0, 16(%r15)
	je	LBB0_17
## %bb.6:
	movq	24(%r15), %rdi
	callq	_likely
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	24(%r15), %rax
	andq	%r12, %rax
	movq	%rax, -80(%rbp)
	testq	%rax, %rax
	je	LBB0_10
LBB0_11:
	subq	%rax, %r12
	movq	8(%r15), %rax
	cmpq	(%rbx), %rax
	je	LBB0_13
## %bb.12:
	addq	16(%r15), %r12
LBB0_13:
	movq	-56(%rbp), %rdi
	movl	52(%r15), %esi
	callq	_max
	cmpq	%rax, %r12
	jl	LBB0_18
## %bb.14:
	movq	-48(%rbp), %rdi
	movl	48(%r15), %esi
	callq	_min
	subq	%r12, %rax
	movq	(%r15), %rcx
	cmpq	%rcx, %rax
	jl	LBB0_18
## %bb.15:
	subq	%r12, %r14
	jle	LBB0_18
## %bb.16:
	cmpq	%rcx, %r14
	jge	LBB0_17
	jmp	LBB0_18
LBB0_8:
	movq	16(%r15), %rsi
	leaq	-80(%rbp), %rdx
	movq	%r12, %rdi
	callq	_div64_u64_rem
	movq	-80(%rbp), %rax
	testq	%rax, %rax
	jne	LBB0_11
LBB0_10:
	movq	(%r15), %rcx
LBB0_17:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%r12, 32(%r15)
	addq	%rcx, %r12
	movq	%r12, 40(%r15)
	xorl	%edi, %edi
	testq	%rcx, %rcx
	setle	%dil
	callq	_DRM_MM_BUG_ON
	xorl	%edi, %edi
	cmpq	%rbx, 32(%r15)
	setl	%dil
	callq	_DRM_MM_BUG_ON
	xorl	%edi, %edi
	cmpq	%r14, 40(%r15)
	setg	%dil
	callq	_DRM_MM_BUG_ON
	movl	$1, %r13d
LBB0_18:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_node_list,4,2                  ## @node_list
	.comm	_DRM_MM_INSERT_HIGH,8,3         ## @DRM_MM_INSERT_HIGH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_mm_scan_add_block          ; -- Begin function drm_mm_scan_add_block
	.p2align	2
_drm_mm_scan_add_block:                 ; @drm_mm_scan_add_block
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x1
	mov	x19, x0
	ldr	x23, [x0, #64]
	ldr	x8, [x1, #16]
	cmp	x8, x23
	cset	w0, ne
	bl	_DRM_MM_BUG_ON
	ldr	w8, [x20, #8]
	cmp	w8, #0
	cset	w0, eq
	bl	_DRM_MM_BUG_ON
	ldr	w0, [x20]
	bl	_DRM_MM_BUG_ON
	mov	w8, #1
	str	w8, [x20]
	ldr	w8, [x23, #8]
	add	w8, w8, #1
	str	w8, [x23, #8]
Lloh0:
	adrp	x21, _node_list@GOTPAGE
Lloh1:
	ldr	x21, [x21, _node_list@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_list_prev_entry
	mov	x22, x0
	ldr	w1, [x21]
	bl	_list_next_entry
	cmp	x0, x20
	cset	w0, ne
	bl	_DRM_MM_BUG_ON
	add	x0, x20, #4
	bl	___list_del_entry
	mov	x0, x22
	bl	___drm_mm_hole_node_start
	mov	x21, x0
	mov	x0, x22
	bl	___drm_mm_hole_node_end
	mov	x20, x0
	stp	x0, x21, [sp, #16]
	ldr	x8, [x23]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w1, [x19, #56]
	add	x2, sp, #24
	add	x3, sp, #16
	mov	x0, x22
	blr	x8
	ldr	x0, [sp, #24]
	b	LBB0_3
LBB0_2:
	mov	x0, x21
LBB0_3:
	ldr	w1, [x19, #52]
	bl	_max
	mov	x22, x0
	ldr	x0, [sp, #16]
	ldr	w1, [x19, #48]
	bl	_min
	subs	x9, x0, x22
	b.le	LBB0_5
; %bb.4:
	ldr	x8, [x19]
	cmp	x9, x8
	b.ge	LBB0_7
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_7:
	mov	x23, x0
Lloh2:
	adrp	x24, _DRM_MM_INSERT_HIGH@GOTPAGE
Lloh3:
	ldr	x24, [x24, _DRM_MM_INSERT_HIGH@GOTPAGEOFF]
	ldr	x9, [x24]
	sub	x10, x0, x8
	ldp	x11, x12, [x19, #8]
	cmp	x11, x9
	csel	x22, x10, x22, eq
	cbz	x12, LBB0_18
; %bb.8:
	ldr	x0, [x19, #24]
	bl	_likely
	cbz	x0, LBB0_16
; %bb.9:
	ldr	x8, [x19, #24]
	and	x8, x8, x22
	str	x8, [sp, #8]
	cbz	x8, LBB0_17
LBB0_10:
	sub	x22, x22, x8
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.11:
	ldr	x8, [x19, #16]
	add	x22, x8, x22
LBB0_12:
	ldr	x0, [sp, #24]
	ldr	w1, [x19, #52]
	bl	_max
	cmp	x22, x0
	b.lt	LBB0_5
; %bb.13:
	ldr	x0, [sp, #16]
	ldr	w1, [x19, #48]
	bl	_min
	ldr	x8, [x19]
	sub	x9, x0, x22
	cmp	x9, x8
	b.lt	LBB0_5
; %bb.14:
	subs	x9, x23, x22
	b.le	LBB0_5
; %bb.15:
	cmp	x9, x8
	b.ge	LBB0_18
	b	LBB0_5
LBB0_16:
	ldr	x1, [x19, #16]
	add	x2, sp, #8
	mov	x0, x22
	bl	_div64_u64_rem
	ldr	x8, [sp, #8]
	cbnz	x8, LBB0_10
LBB0_17:
	ldr	x8, [x19]
LBB0_18:
	add	x9, x8, x22
	stp	x22, x9, [x19, #32]
	cmp	x8, #1
	cset	w0, lt
	bl	_DRM_MM_BUG_ON
	ldr	x8, [x19, #32]
	cmp	x8, x21
	cset	w0, lt
	bl	_DRM_MM_BUG_ON
	ldr	x8, [x19, #40]
	cmp	x8, x20
	cset	w0, gt
	bl	_DRM_MM_BUG_ON
	mov	w0, #1
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_node_list,4,2                  ; @node_list
	.comm	_DRM_MM_INSERT_HIGH,8,3         ; @DRM_MM_INSERT_HIGH
.subsections_via_symbols
