	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function videobuf_dma_init_kernel
_videobuf_dma_init_kernel:              ## @videobuf_dma_init_kernel
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %r12d
	movq	%rdi, %r13
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_dprintk
	movl	%r12d, (%r13)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	%r14d, %edi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 8(%r13)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %edx
	movl	%r14d, %edi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 16(%r13)
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	testl	%r14d, %r14d
	jle	LBB0_4
## %bb.5:
	movl	24(%r13), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%rbx), %ecx
	movq	%rax, %rdx
	callq	_dma_alloc_coherent
	testq	%rax, %rax
	je	LBB0_6
## %bb.8:
	movl	%r14d, %r15d
	shlq	$2, %r15
	xorl	%ebx, %ebx
	movl	$4, %r12d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rdi
	callq	_virt_to_page
	movq	8(%r13), %rdi
	movl	%eax, -4(%rdi,%r12)
	cmpq	%r12, %r15
	je	LBB0_10
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	24(%r13), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	16(%r13), %rdx
	addq	%r12, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	incl	%ebx
	addq	$4, %r12
	testq	%rax, %rax
	jne	LBB0_9
	jmp	LBB0_15
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_7:
	movq	8(%r13), %rdi
	callq	_kfree
	jmp	LBB0_19
LBB0_4:
	movq	8(%r13), %rdi
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_6:
	xorl	%ebx, %ebx
LBB0_15:
	testl	%ebx, %ebx
	jg	LBB0_16
	jmp	LBB0_18
LBB0_10:
	movl	%r14d, %ebx
LBB0_11:
	movq	_VM_MAP@GOTPCREL(%rip), %rax
	movq	_VM_IOREMAP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_PAGE_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r14d, %esi
	callq	_vmap
	movq	%rax, 32(%r13)
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rbx
	movb	(%rbx), %cl
	movl	%r14d, %r8d
	shll	%cl, %r8d
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	movl	$1, %edi
	movl	%eax, %edx
	movl	%r8d, %ecx
	xorl	%eax, %eax
	callq	_dprintk
	movq	32(%r13), %rdi
	movb	(%rbx), %cl
	movl	%r14d, %edx
	shll	%cl, %edx
	xorl	%esi, %esi
	callq	_memset
	movl	%r14d, 4(%r13)
	jmp	LBB0_21
LBB0_12:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dprintk
	testl	%ebx, %ebx
	jle	LBB0_18
LBB0_16:
	movl	%ebx, %ebx
	incq	%rbx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movl	-8(%rax,%rbx,4), %edi
	callq	_page_address
	movl	24(%r13), %edi
	movl	(%r14), %esi
	movq	16(%r13), %rcx
	movl	-8(%rcx,%rbx,4), %ecx
	movq	%rax, %rdx
	callq	_dma_free_coherent
	decq	%rbx
	cmpq	$1, %rbx
	ja	LBB0_17
LBB0_18:
	movq	16(%r13), %rdi
	callq	_kfree
	movq	$0, 16(%r13)
	movq	8(%r13), %rdi
	callq	_kfree
	movq	$0, 8(%r13)
LBB0_19:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
LBB0_20:
	subl	(%rax), %r15d
LBB0_21:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"init kernel [%d pages]\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_VM_MAP,4,2                     ## @VM_MAP
	.comm	_VM_IOREMAP,4,2                 ## @VM_IOREMAP
	.comm	_PAGE_KERNEL,4,2                ## @PAGE_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"vmalloc_32(%d pages) failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"vmalloc is at addr %p, size=%d\n"

	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.no_dead_strip	_videobuf_dma_init_kernel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function videobuf_dma_init_kernel
_videobuf_dma_init_kernel:              ; @videobuf_dma_init_kernel
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_dprintk
	str	w21, [x19]
Lloh2:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x20
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_18
; %bb.1:
	ldr	w2, [x23]
	mov	x0, x20
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_7
; %bb.2:
Lloh4:
	adrp	x21, _PAGE_SIZE@GOTPAGE
Lloh5:
	ldr	x21, [x21, _PAGE_SIZE@GOTPAGEOFF]
	cmp	w20, #0
	b.le	LBB0_8
; %bb.3:
	mov	x2, x0
	ldr	w0, [x19, #24]
	ldr	w1, [x21]
	ldr	w3, [x23]
	bl	_dma_alloc_coherent
	cbz	x0, LBB0_9
; %bb.4:
	mov	x24, #0
	mov	w22, #0
	mov	w8, w20
	lsl	x8, x8, #2
	sub	x25, x8, #4
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	bl	_virt_to_page
	mov	x8, x0
	ldr	x0, [x19, #8]
	str	w8, [x0, x24]
	cmp	x25, x24
	b.eq	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #16]
	ldr	w0, [x19, #24]
	ldr	w1, [x21]
	add	x8, x8, x24
	add	x2, x8, #4
	ldr	w3, [x23]
	bl	_dma_alloc_coherent
	add	w22, w22, #1
	add	x24, x24, #4
	cbnz	x0, LBB0_5
	b	LBB0_10
LBB0_7:
	ldr	x0, [x19, #8]
	bl	_kfree
	b	LBB0_18
LBB0_8:
	mov	w22, #0
	ldr	x0, [x19, #8]
	b	LBB0_12
LBB0_9:
	mov	w22, #0
LBB0_10:
	cmp	w22, #1
	b.ge	LBB0_15
	b	LBB0_17
LBB0_11:
	mov	x22, x20
LBB0_12:
Lloh6:
	adrp	x8, _VM_MAP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VM_MAP@GOTPAGEOFF]
Lloh8:
	adrp	x9, _VM_IOREMAP@GOTPAGE
Lloh9:
	ldr	x9, [x9, _VM_IOREMAP@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh12:
	adrp	x8, _PAGE_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PAGE_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	mov	x1, x20
	bl	_vmap
	str	x0, [x19, #32]
	cbz	x0, LBB0_14
; %bb.13:
	mov	x2, x0
Lloh15:
	adrp	x21, _PAGE_SHIFT@GOTPAGE
Lloh16:
	ldr	x21, [x21, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	w8, [x21]
	lsl	w8, w20, w8
	str	x8, [sp]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_dprintk
	ldr	x0, [x19, #32]
	ldr	w8, [x21]
	lsl	w2, w20, w8
	mov	w1, #0
	bl	_memset
	mov	w0, #0
	str	w20, [x19, #4]
	b	LBB0_19
LBB0_14:
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_dprintk
	cmp	w22, #1
	b.lt	LBB0_17
LBB0_15:
	mov	w8, w22
	sub	x20, x8, #1
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	lsl	x22, x20, #2
	ldr	w0, [x8, x22]
	bl	_page_address
	mov	x2, x0
	ldr	w0, [x19, #24]
	ldr	w1, [x21]
	ldr	x8, [x19, #16]
	ldr	w3, [x8, x22]
	bl	_dma_free_coherent
	add	x8, x20, #1
	sub	x20, x20, #1
	cmp	x8, #1
	b.hi	LBB0_16
LBB0_17:
	ldr	x0, [x19, #16]
	bl	_kfree
	str	xzr, [x19, #16]
	ldr	x0, [x19, #8]
	bl	_kfree
	str	xzr, [x19, #8]
LBB0_18:
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_19:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"init kernel [%d pages]\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_VM_MAP,4,2                     ; @VM_MAP
	.comm	_VM_IOREMAP,4,2                 ; @VM_IOREMAP
	.comm	_PAGE_KERNEL,4,2                ; @PAGE_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"vmalloc_32(%d pages) failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"vmalloc is at addr %p, size=%d\n"

	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_videobuf_dma_init_kernel
.subsections_via_symbols
