	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tiler_reserve_2d               ## -- Begin function tiler_reserve_2d
	.p2align	4, 0x90
_tiler_reserve_2d:                      ## @tiler_reserve_2d
	.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	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r12
	movl	%edi, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$12, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, %edi
	callq	_validfmt
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_BUG_ON
	movq	_geom@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %ecx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	leaq	(,%rcx,8), %rcx
	movq	%r12, %rdi
	movq	%r14, %r12
	leaq	(%rcx,%rcx,2), %r14
	movq	(%rax,%r14), %rsi
	callq	_DIV_ROUND_UP
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rax
	movq	8(%rax,%r14), %rsi
	movq	%r15, %rdi
	callq	_DIV_ROUND_UP
	movq	%rax, %r15
	movq	(%r13), %rax
	movq	16(%rax,%r14), %rbx
	imulq	(%rax,%r14), %rbx
	movl	$128, %edi
	movq	%rbx, %rsi
	callq	_max
	cmpq	%r12, %rax
	jge	LBB0_3
## %bb.2:
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_ALIGN
LBB0_3:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%rax, %rcx
	orq	%rbx, %rcx
	shrq	$32, %rcx
	je	LBB0_4
## %bb.5:
	cqto
	idivq	%rbx
	jmp	LBB0_6
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ebx
                                        ## kill: def $eax killed $eax def $rax
LBB0_6:
	movl	%edi, (%r14)
	movq	_containers@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%r8,4), %edi
	leaq	8(%r14), %rcx
	movq	%rcx, (%rsp)
	movq	%r15, %rdx
	movq	%rax, %rcx
	movl	$-1, %r8d
	movq	%rbx, %r9
	callq	_tcm_reserve_2d
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movq	%r14, %rdi
	callq	_kfree
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_9:
	movq	_list_lock@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	addq	$4, %rdi
	movq	_omap_dmm@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_list_add
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r14, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_geom,8,3                       ## @geom
	.comm	_containers,8,3                 ## @containers
	.comm	_list_lock,4,2                  ## @list_lock
	.comm	_omap_dmm,8,3                   ## @omap_dmm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tiler_reserve_2d               ; -- Begin function tiler_reserve_2d
	.p2align	2
_tiler_reserve_2d:                      ; @tiler_reserve_2d
	.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	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #12
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	mov	x0, x20
	bl	_validfmt
	cmp	w0, #0
	cset	w0, eq
	bl	_BUG_ON
Lloh3:
	adrp	x24, _geom@GOTPAGE
Lloh4:
	ldr	x24, [x24, _geom@GOTPAGEOFF]
	ldr	x8, [x24]
	mov	w25, w20
	add	x9, x25, w20, uxtw #1
	lsl	x26, x9, #3
	ldr	x1, [x8, x26]
	mov	x0, x22
	bl	_DIV_ROUND_UP
	mov	x22, x0
	ldr	x8, [x24]
	add	x8, x8, x26
	ldr	x1, [x8, #8]
	mov	x0, x23
	bl	_DIV_ROUND_UP
	mov	x23, x0
	ldr	x8, [x24]
	add	x8, x8, x26
	ldr	x9, [x8]
	ldr	x8, [x8, #16]
	mul	x24, x8, x9
	mov	w0, #128
	mov	x1, x24
	bl	_max
	mov	x1, x0
	cmp	x0, x21
	b.ge	LBB0_3
; %bb.2:
	mov	x0, x21
	bl	_ALIGN
	mov	x1, x0
LBB0_3:
	mov	x6, x19
	str	w20, [x6], #8
Lloh5:
	adrp	x8, _containers@GOTPAGE
Lloh6:
	ldr	x8, [x8, _containers@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	w0, [x8, x25, lsl #2]
	sdiv	x3, x1, x24
	mov	x1, x22
	mov	x2, x23
	mov	w4, #-1
	mov	x5, x24
	bl	_tcm_reserve_2d
	cbz	w0, LBB0_6
; %bb.4:
	mov	x0, x19
	bl	_kfree
LBB0_5:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	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
	b	_ERR_PTR
LBB0_6:
Lloh11:
	adrp	x20, _list_lock@GOTPAGE
Lloh12:
	ldr	x20, [x20, _list_lock@GOTPAGEOFF]
	mov	x0, x20
	bl	_spin_lock_irqsave
	add	x0, x19, #4
Lloh13:
	adrp	x8, _omap_dmm@GOTPAGE
Lloh14:
	ldr	x8, [x8, _omap_dmm@GOTPAGEOFF]
Lloh15:
	ldr	x1, [x8]
	bl	_list_add
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_geom,8,3                       ; @geom
	.comm	_containers,8,3                 ; @containers
	.comm	_list_lock,4,2                  ; @list_lock
	.comm	_omap_dmm,8,3                   ; @omap_dmm
.subsections_via_symbols
