	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___videobuf_mmap_setup          ## -- Begin function __videobuf_mmap_setup
	.p2align	4, 0x90
___videobuf_mmap_setup:                 ## @__videobuf_mmap_setup
	.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	%ecx, %r15d
	movl	%edx, %r14d
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	movq	_MAGIC_QTYPE_OPS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MAGIC_CHECK
	movq	%r13, %rdi
	callq	___videobuf_free
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	testl	%r12d, %r12d
	je	LBB0_9
## %bb.2:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%ebx
	movl	%r14d, %r12d
	cmpl	%ebx, %r14d
	je	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %r14d
	movq	%r13, %rdi
	callq	_videobuf_alloc_vb
	movq	(%r13), %rcx
	movl	%ebx, %r12d
	movq	%rax, (%rcx,%r12,8)
	movq	(%r13), %rax
	movq	(%rax,%r12,8), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, (%rax)
	movl	%r15d, 4(%rax)
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, 8(%rax)
	cmpl	$130, %r15d
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_PAGE_ALIGN
	imull	%ebx, %eax
	movq	(%r13), %rcx
	movq	(%rcx,%r12,8), %rcx
	movl	%eax, 12(%rcx)
	jmp	LBB0_6
LBB0_7:
	movl	%r12d, %ebx
LBB0_8:
	testl	%ebx, %ebx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	je	LBB0_9
## %bb.10:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movl	%ebx, %edx
	callq	_dprintk
	jmp	LBB0_11
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAGIC_QTYPE_OPS,4,2            ## @MAGIC_QTYPE_OPS
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mmap setup: %d buffers, %d bytes each\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___videobuf_mmap_setup          ; -- Begin function __videobuf_mmap_setup
	.p2align	2
___videobuf_mmap_setup:                 ; @__videobuf_mmap_setup
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x3
	mov	x19, x2
	mov	x22, x1
	mov	x23, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
Lloh0:
	adrp	x8, _MAGIC_QTYPE_OPS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAGIC_QTYPE_OPS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_MAGIC_CHECK
	mov	x0, x23
	bl	___videobuf_free
	mov	x20, x0
	cbnz	w0, LBB0_11
; %bb.1:
	cbz	w22, LBB0_10
; %bb.2:
	mov	w20, #0
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w20, w20, #1
	cmp	w22, w20
	b.eq	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_videobuf_alloc_vb
	ldr	x8, [x23]
	mov	w24, w20
	lsl	x9, x24, #3
	str	x0, [x8, x9]
	ldr	x8, [x23]
	ldr	x8, [x8, x9]
	cbz	x8, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	stp	w20, w21, [x8]
	str	w19, [x8, #8]
	cmp	w21, #130
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	bl	_PAGE_ALIGN
	mul	w8, w0, w20
	ldr	x9, [x23]
	ldr	x9, [x9, x24, lsl #3]
	str	w8, [x9, #12]
	b	LBB0_3
LBB0_7:
	mov	x20, x22
LBB0_8:
	cbz	w20, LBB0_10
; %bb.9:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	mov	x3, x19
	bl	_dprintk
	b	LBB0_11
LBB0_10:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MAGIC_QTYPE_OPS,4,2            ; @MAGIC_QTYPE_OPS
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mmap setup: %d buffers, %d bytes each\n"

.subsections_via_symbols
