	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_omap_gem_init                  ## -- Begin function omap_gem_init
	.p2align	4, 0x90
_omap_gem_init:                         ## @omap_gem_init
	.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
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r14
	movq	_TILFMT_8BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	movq	_TILFMT_16BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_TILFMT_32BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	xorl	%eax, %eax
	callq	_dmm_is_available
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$3, %edi
	movl	$32, %esi
	callq	_kcalloc
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_12
## %bb.4:
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	leaq	-60(%rbp), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_11
## %bb.5:
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%r15
	leaq	-60(%rbp), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r15
	movq	%r15, %rbx
	jge	LBB0_11
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	movl	%ebx, %ecx
	sarl	%cl, %eax
	movl	$1, -64(%rbp)
	movl	%eax, -68(%rbp)
	movl	-60(%rbp,%rbx,4), %edi
	leaq	-68(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	callq	_tiler_align
	movl	-64(%rbp), %eax
	movq	%rbx, %r14
	shlq	$5, %r14
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movl	%eax, (%r15,%r14)
	movl	-64(%rbp), %edi
	callq	_ilog2
	movq	%rax, 24(%r15,%r14)
	movl	-60(%rbp,%rbx,4), %edi
	xorl	%esi, %esi
	callq	_tiler_stride
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movl	%eax, 4(%r15,%r14)
	movl	(%r12), %eax
	cltd
	idivl	-64(%rbp)
	movl	%ebx, %ecx
	sarl	%cl, %eax
	movl	%eax, %edi
	callq	_ilog2
	movq	%rax, 16(%r15,%r14)
	movq	_NUM_USERGART_ENTRIES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movq	%rbx, %r15
	jle	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14), %rbx
	addq	$4, %rbx
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rax
	movq	%rbx, %r15
	movq	4(%rbx), %rbx
	movl	-60(%rbp,%rax,4), %edi
	movl	-68(%rbp), %esi
	movl	-64(%rbp), %edx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_tiler_reserve_2d
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	movq	%r14, %rdi
	callq	_tiler_ssptr
	leaq	(%rbx,%r12), %r9
	movl	%eax, (%rbx,%r12)
	movq	%r14, 8(%rbx,%r12)
	movl	-68(%rbp), %eax
	movl	-64(%rbp), %r8d
	movq	%r15, %rbx
	movl	(%r15), %edx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %edx
	movl	%edx, (%rsp)
	leaq	L_.str.2(%rip), %rdi
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	movl	%r15d, %esi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_DBG
	incq	%r13
	movq	_NUM_USERGART_ENTRIES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$16, %r12
	cmpq	%rax, %r13
	jl	LBB0_8
	jmp	LBB0_10
LBB0_1:
	movl	(%rbx), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.2:
	leaq	L_.str(%rip), %rsi
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_warn                       ## TAILCALL
LBB0_14:
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_PTR_ERR
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movl	%r13d, %ecx
	movl	%eax, %r8d
	callq	_dev_err
	jmp	LBB0_12
LBB0_11:
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 8(%rax)
	movl	$1, (%rax)
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.13:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TILFMT_8BIT,4,2                ## @TILFMT_8BIT
	.comm	_TILFMT_16BIT,4,2               ## @TILFMT_16BIT
	.comm	_TILFMT_32BIT,4,2               ## @TILFMT_32BIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMM not available, disable DMM support\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_NUM_USERGART_ENTRIES,4,2       ## @NUM_USERGART_ENTRIES
L_.str.1:                               ## @.str.1
	.asciz	"reserve failed: %d, %d, %ld\n"

L_.str.2:                               ## @.str.2
	.asciz	"%d:%d: %dx%d: dma_addr=%pad stride=%d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_omap_gem_init                  ; -- Begin function omap_gem_init
	.p2align	2
_omap_gem_init:                         ; @omap_gem_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	ldr	x20, [x0, #8]
Lloh3:
	adrp	x8, _TILFMT_8BIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TILFMT_8BIT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _TILFMT_16BIT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TILFMT_16BIT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #44]
Lloh9:
	adrp	x8, _TILFMT_32BIT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TILFMT_32BIT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [sp, #52]
	bl	_dmm_is_available
	cbz	w0, LBB0_9
; %bb.1:
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	w0, #3
	mov	w1, #32
	bl	_kcalloc
	cbz	x0, LBB0_13
; %bb.2:
	mov	x22, x0
	stp	x20, x19, [sp, #8]              ; 16-byte Folded Spill
	add	x26, sp, #44
	add	x0, sp, #44
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_12
; %bb.3:
	mov	x21, #0
Lloh15:
	adrp	x28, _PAGE_SIZE@GOTPAGE
Lloh16:
	ldr	x28, [x28, _PAGE_SIZE@GOTPAGEOFF]
Lloh17:
	adrp	x25, _NUM_USERGART_ENTRIES@GOTPAGE
Lloh18:
	ldr	x25, [x25, _NUM_USERGART_ENTRIES@GOTPAGEOFF]
	str	x22, [sp, #24]                  ; 8-byte Folded Spill
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x21, x21, #1
	add	x0, sp, #44
	bl	_ARRAY_SIZE
	cmp	x21, w0, sxtw
	ldr	x22, [sp, #24]                  ; 8-byte Folded Reload
	b.ge	LBB0_12
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	mov	w9, #1
	ldr	w8, [x28]
	asr	w8, w8, w21
	stp	w8, w9, [sp, #36]
	lsl	x19, x21, #2
	ldr	w0, [x26, x19]
	add	x1, sp, #36
	add	x2, sp, #40
	bl	_tiler_align
	ldr	w8, [sp, #40]
	add	x22, x22, x21, lsl #5
	str	w8, [x22]
	ldr	w0, [sp, #40]
	bl	_ilog2
	str	x0, [x22, #24]
	ldr	w0, [x26, x19]
	mov	w1, #0
	bl	_tiler_stride
Lloh19:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	asr	w8, w0, w8
	mov	x20, x22
	str	w8, [x20, #4]!
	ldr	w8, [x28]
	ldr	w9, [sp, #40]
	sdiv	w8, w8, w9
	asr	w0, w8, w21
	bl	_ilog2
	stur	x0, [x20, #12]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x19, #0
	mov	x23, #0
	add	x22, x22, #8
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x27, [x22]
	ldr	w0, [x26, x21, lsl #2]
	ldp	w1, w2, [sp, #36]
	ldr	w3, [x28]
	bl	_tiler_reserve_2d
	mov	x24, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x24
	bl	_tiler_ssptr
	add	x5, x27, x19
	str	w0, [x5]
	str	x24, [x5, #8]
	ldp	w3, w4, [sp, #36]
	ldr	w8, [x20]
Lloh22:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh23:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	lsl	w6, w8, w9
Lloh25:
	adrp	x0, l_.str.2@PAGE
Lloh26:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	mov	x2, x23
	bl	_DBG
	add	x23, x23, #1
	ldrsw	x8, [x25]
	add	x19, x19, #16
	cmp	x23, x8
	b.lt	LBB0_7
	b	LBB0_4
LBB0_9:
	ldr	w0, [x19]
	ldr	x8, [sp, #56]
Lloh27:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh28:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.10:
Lloh30:
	adrp	x1, l_.str@PAGE
Lloh31:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	b	_dev_warn
LBB0_11:
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldr	w19, [x8]
	mov	x0, x24
	bl	_PTR_ERR
	mov	x4, x0
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	mov	x3, x23
	bl	_dev_err
	b	LBB0_13
LBB0_12:
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	str	x22, [x9, #8]
	mov	w8, #1
	str	w8, [x9]
LBB0_13:
	ldr	x8, [sp, #56]
Lloh34:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh35:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_TILFMT_8BIT,4,2                ; @TILFMT_8BIT
	.comm	_TILFMT_16BIT,4,2               ; @TILFMT_16BIT
	.comm	_TILFMT_32BIT,4,2               ; @TILFMT_32BIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMM not available, disable DMM support\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_NUM_USERGART_ENTRIES,4,2       ; @NUM_USERGART_ENTRIES
l_.str.1:                               ; @.str.1
	.asciz	"reserve failed: %d, %d, %ld\n"

l_.str.2:                               ; @.str.2
	.asciz	"%d:%d: %dx%d: dma_addr=%pad stride=%d"

.subsections_via_symbols
