	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cafe_vidioc_reqbufs
_cafe_vidioc_reqbufs:                   ## @cafe_vidioc_reqbufs
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdx), %rax
	movq	_V4L2_MEMORY_MMAP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	%rdx, %r15
	movq	%rdi, %rbx
	movq	(%rdi), %r12
	leaq	16(%r12), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	8(%r15), %rdi
	movq	(%r12), %rax
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.6:
	movq	_S_IDLE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.7:
	movq	32(%r12), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	cmpq	%rbx, %rax
	je	LBB0_11
LBB0_9:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_10:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_27
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_28
LBB0_3:
	movq	_S_STREAMING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	movq	%r12, %rdi
	callq	_cafe_ctlr_stop_dma
LBB0_5:
	movq	%r12, %rdi
	callq	_cafe_free_sio_buffers
	movl	%eax, %ebx
LBB0_27:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_28:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%rbx, 32(%r12)
	movq	_min_buffers@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdi
	jl	LBB0_13
## %bb.12:
	movq	_max_buffers@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdi
	jle	LBB0_14
LBB0_13:
	movq	%rax, 8(%r15)
	movq	%rax, %rdi
LBB0_14:
	cmpq	$0, 8(%r12)
	jle	LBB0_17
## %bb.15:
	movq	%r12, %rdi
	callq	_cafe_free_sio_buffers
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_27
## %bb.16:
	movq	8(%r15), %rdi
LBB0_17:
	shll	$2, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_kzalloc
	movq	%rax, 24(%r12)
	testq	%rax, %rax
	je	LBB0_20
## %bb.18:
	movq	$0, 8(%r12)
	cmpq	$0, 8(%r15)
	jle	LBB0_19
## %bb.21:
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_cafe_setup_siobuf
	movl	%eax, %ebx
	movq	8(%r12), %rsi
	testl	%eax, %eax
	jne	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	incq	%rsi
	movq	%rsi, 8(%r12)
	cmpq	8(%r15), %rsi
	jl	LBB0_22
LBB0_24:
	testq	%rsi, %rsi
	jne	LBB0_26
	jmp	LBB0_25
LBB0_20:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_19:
	xorl	%ebx, %ebx
LBB0_25:
	movq	24(%r12), %rdi
	callq	_kfree
	movq	8(%r12), %rsi
LBB0_26:
	movq	%rsi, 8(%r15)
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_MEMORY_MMAP,8,3           ## @V4L2_MEMORY_MMAP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_S_STREAMING,8,3                ## @S_STREAMING
	.comm	_S_IDLE,8,3                     ## @S_IDLE
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_min_buffers,8,3                ## @min_buffers
	.comm	_max_buffers,8,3                ## @max_buffers
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_cafe_vidioc_reqbufs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cafe_vidioc_reqbufs
_cafe_vidioc_reqbufs:                   ; @cafe_vidioc_reqbufs
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x2]
Lloh0:
	adrp	x9, _V4L2_MEMORY_MMAP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_MEMORY_MMAP@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.1:
	mov	x20, x2
	mov	x22, x0
	ldr	x21, [x0]
	add	x19, x21, #16
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x20, #8]
	ldr	x9, [x21]
	cbz	x8, LBB0_19
; %bb.2:
Lloh3:
	adrp	x10, _S_IDLE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _S_IDLE@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_17
; %bb.3:
	ldr	x9, [x21, #32]
	cmp	x9, #0
	ccmp	x9, x22, #4, ne
	b.ne	LBB0_17
; %bb.4:
	str	x22, [x21, #32]
Lloh6:
	adrp	x9, _min_buffers@GOTPAGE
Lloh7:
	ldr	x9, [x9, _min_buffers@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_6
; %bb.5:
Lloh9:
	adrp	x9, _max_buffers@GOTPAGE
Lloh10:
	ldr	x9, [x9, _max_buffers@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_7
LBB0_6:
	str	x9, [x20, #8]
	mov	x8, x9
LBB0_7:
	ldr	x9, [x21, #8]
	cmp	x9, #1
	b.lt	LBB0_10
; %bb.8:
	mov	x0, x21
	bl	_cafe_free_sio_buffers
	mov	x22, x0
	cbnz	w0, LBB0_22
; %bb.9:
	ldr	x8, [x20, #8]
LBB0_10:
	lsl	w0, w8, #2
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_kzalloc
	str	x0, [x21, #24]
	cbz	x0, LBB0_24
; %bb.11:
	str	xzr, [x21, #8]
	ldr	x8, [x20, #8]
	cmp	x8, #1
	b.lt	LBB0_25
; %bb.12:
	mov	x1, #0
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_cafe_setup_siobuf
	mov	x22, x0
	ldr	x1, [x21, #8]
	cbnz	w0, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x1, x1, #1
	str	x1, [x21, #8]
	ldr	x8, [x20, #8]
	cmp	x1, x8
	b.lt	LBB0_13
LBB0_15:
	cbnz	x1, LBB0_27
	b	LBB0_26
LBB0_16:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_23
LBB0_17:
Lloh18:
	adrp	x8, _EBUSY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_22
LBB0_19:
Lloh20:
	adrp	x8, _S_STREAMING@GOTPAGE
Lloh21:
	ldr	x8, [x8, _S_STREAMING@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.20:
	mov	x0, x21
	bl	_cafe_ctlr_stop_dma
LBB0_21:
	mov	x0, x21
	bl	_cafe_free_sio_buffers
	mov	x22, x0
LBB0_22:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_23:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_24:
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_18
LBB0_25:
	mov	w22, #0
LBB0_26:
	ldr	x0, [x21, #24]
	bl	_kfree
	ldr	x1, [x21, #8]
LBB0_27:
	str	x1, [x20, #8]
	b	LBB0_22
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_MEMORY_MMAP,8,3           ; @V4L2_MEMORY_MMAP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_S_STREAMING,8,3                ; @S_STREAMING
	.comm	_S_IDLE,8,3                     ; @S_IDLE
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_min_buffers,8,3                ; @min_buffers
	.comm	_max_buffers,8,3                ; @max_buffers
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_cafe_vidioc_reqbufs
.subsections_via_symbols
