	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omap24xxcam_vbq_alloc_mmap_buffer
_omap24xxcam_vbq_alloc_mmap_buffer:     ## @omap24xxcam_vbq_alloc_mmap_buffer
	.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	%rdi, %r15
	movq	(%rdi), %rbx
	callq	_videobuf_to_dma
	movq	(%r15), %rdi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrq	%cl, %rdi
	movq	%rax, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$4, %esi
	callq	_kcalloc
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	testq	%rbx, %rbx
	je	LBB0_11
## %bb.2:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
	movq	_GFP_DMA@GOTPCREL(%rip), %r14
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##     Child Loop BB0_10 Depth 2
	movq	%rbx, %rdi
	callq	_get_order
	movl	%eax, %r13d
	movl	(%r12), %eax
	movl	%r13d, %ecx
	shll	%cl, %eax
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	cmpq	%rax, %rbx
	sbbl	$0, %r13d
	movl	(%r14), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movl	%r13d, %esi
	callq	_alloc_pages
	movq	%rax, %rbx
	decl	%r13d
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	testq	%rbx, %rbx
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movl	(%r14), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movl	%r13d, %esi
	callq	_alloc_pages
	movq	%rax, %rbx
	addl	$-1, %r13d
	jb	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=2
	testq	%rbx, %rbx
	jne	LBB0_5
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movl	(%r12), %edx
	incb	%r13b
	movl	%r13d, %ecx
	shll	%cl, %edx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(,%rax,4), %rdi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	addq	24(%r15), %rdi
	movq	%rbx, %rsi
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%ecx, %ecx
	callq	_sg_set_page
	incq	8(%r15)
	movl	(%r12), %r15d
	movl	%r13d, %ecx
	shll	%cl, %r15d
	movq	%rbx, %rdi
	callq	_page_address
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_memset
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%ebx, %edi
	callq	_SetPageReserved
	movl	(%r12), %eax
	addl	$4, %ebx
	subq	%rax, %r15
	jne	LBB0_10
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	-48(%rbp)                       ## 8-byte Folded Spill
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	subq	-64(%rbp), %rbx                 ## 8-byte Folded Reload
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_4
LBB0_11:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rax
	movq	%rax, 16(%rcx)
	movq	_PCI_DMA_FROMDEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_omap24xxcam_vbq_free_mmap_buffer
LBB0_12:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_GFP_DMA,4,2                    ## @GFP_DMA
	.comm	_PCI_DMA_FROMDEVICE,4,2         ## @PCI_DMA_FROMDEVICE
	.no_dead_strip	_omap24xxcam_vbq_alloc_mmap_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omap24xxcam_vbq_alloc_mmap_buffer
_omap24xxcam_vbq_alloc_mmap_buffer:     ; @omap24xxcam_vbq_alloc_mmap_buffer
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x21, [x0]
	bl	_videobuf_to_dma
	mov	x20, x0
Lloh0:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	x9, [x19]
Lloh2:
	ldr	w8, [x8]
	lsr	x0, x9, x8
Lloh3:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x25]
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x20, #24]
	cbz	x0, LBB0_11
; %bb.1:
	cbz	x21, LBB0_10
; %bb.2:
	mov	x26, #0
Lloh5:
	adrp	x27, _PAGE_SIZE@GOTPAGE
Lloh6:
	ldr	x27, [x27, _PAGE_SIZE@GOTPAGEOFF]
Lloh7:
	adrp	x28, _GFP_DMA@GOTPAGE
Lloh8:
	ldr	x28, [x28, _GFP_DMA@GOTPAGEOFF]
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;     Child Loop BB0_8 Depth 2
	mov	x0, x21
	bl	_get_order
	ldr	w8, [x27]
	lsl	w8, w8, w0
	cmp	x21, x8
	cset	w8, lo
	sub	w23, w0, w8
	ldr	w8, [x25]
	ldr	w9, [x28]
	orr	w0, w9, w8
	mov	x1, x23
	bl	_alloc_pages
	mov	x22, x0
	sub	w23, w23, #1
LBB0_4:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cbnz	x22, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	ldr	w8, [x25]
	ldr	w9, [x28]
	orr	w0, w9, w8
	mov	x1, x23
	bl	_alloc_pages
	mov	x22, x0
	subs	w23, w23, #1
	b.hs	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=2
	cbnz	x22, LBB0_4
	b	LBB0_11
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x27]
	add	w24, w23, #1
	lsl	w23, w8, w24
	ldr	x8, [x20, #24]
	add	x0, x8, x26, lsl #2
	mov	x1, x22
	mov	x2, x23
	mov	w3, #0
	bl	_sg_set_page
	ldr	x8, [x20, #8]
	add	x8, x8, #1
	str	x8, [x20, #8]
	ldr	w8, [x27]
	lsl	w24, w8, w24
	mov	x0, x22
	bl	_page_address
	mov	w1, #0
	mov	x2, x24
	bl	_memset
LBB0_8:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	bl	_SetPageReserved
	ldr	w8, [x27]
	add	w22, w22, #4
	subs	x24, x24, x8
	b.ne	LBB0_8
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x26, x26, #1
	subs	x21, x21, x23
	b.ne	LBB0_3
LBB0_10:
	mov	w21, #0
	ldr	x8, [x20, #8]
	str	x8, [x20, #16]
Lloh9:
	adrp	x8, _PCI_DMA_FROMDEVICE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCI_DMA_FROMDEVICE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x20]
	b	LBB0_12
LBB0_11:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
	mov	x0, x19
	bl	_omap24xxcam_vbq_free_mmap_buffer
LBB0_12:
	mov	x0, x21
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_GFP_DMA,4,2                    ; @GFP_DMA
	.comm	_PCI_DMA_FROMDEVICE,4,2         ; @PCI_DMA_FROMDEVICE
	.no_dead_strip	_omap24xxcam_vbq_alloc_mmap_buffer
.subsections_via_symbols
