	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov2640_set_fmt
_ov2640_set_fmt:                        ## @ov2640_set_fmt
	.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
	movq	%rdx, %rbx
	movq	%rsi, %r14
	callq	_v4l2_get_subdevdata
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_to_ov2640
	cmpq	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_2:
	movq	%rax, %r15
	leaq	16(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	addq	$4, %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	40(%rbx), %esi
	movl	44(%rbx), %edi
	callq	_ov2640_select_win
	movq	%rax, %r13
	movl	4(%rax), %eax
	movl	%eax, 44(%rbx)
	movl	(%r13), %eax
	movl	%eax, 40(%rbx)
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%rbx)
	movq	_V4L2_COLORSPACE_SRGB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_V4L2_YCBCR_ENC_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movq	_V4L2_QUANTIZATION_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_V4L2_XFER_FUNC_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movl	16(%rbx), %eax
	addl	$-128, %eax
	cmpl	$6, %eax
	jb	LBB0_4
## %bb.3:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$131, (%rax)
LBB0_4:
	movq	(%rbx), %rax
	movq	_V4L2_SUBDEV_FORMAT_ACTIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.5:
	movq	%r12, %rdi
	callq	_to_ov2640
	cmpq	$0, 16(%rax)
	je	LBB0_7
## %bb.6:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_8:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movups	(%rax), %xmm0
	movups	16(%rax), %xmm1
	movups	%xmm1, 16(%r14)
	movups	%xmm0, (%r14)
	jmp	LBB0_9
LBB0_7:
	movq	%r13, 8(%rax)
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
LBB0_9:
	xorl	%ebx, %ebx
LBB0_10:
	movq	%r15, %rdi
	callq	_mutex_unlock
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	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.comm	_V4L2_COLORSPACE_SRGB,4,2       ## @V4L2_COLORSPACE_SRGB
	.comm	_V4L2_YCBCR_ENC_DEFAULT,4,2     ## @V4L2_YCBCR_ENC_DEFAULT
	.comm	_V4L2_QUANTIZATION_DEFAULT,4,2  ## @V4L2_QUANTIZATION_DEFAULT
	.comm	_V4L2_XFER_FUNC_DEFAULT,4,2     ## @V4L2_XFER_FUNC_DEFAULT
	.comm	_V4L2_SUBDEV_FORMAT_ACTIVE,8,3  ## @V4L2_SUBDEV_FORMAT_ACTIVE
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_ov2640_set_fmt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov2640_set_fmt
_ov2640_set_fmt:                        ; @ov2640_set_fmt
	.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	x22, x2
	mov	x20, x1
	bl	_v4l2_get_subdevdata
	mov	x21, x0
	bl	_to_ov2640
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_2:
	add	x24, x22, #16
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldp	w1, w0, [x22, #40]
	bl	_ov2640_select_win
	mov	x23, x0
	ldr	d0, [x0]
	str	d0, [x22, #40]
Lloh3:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _V4L2_COLORSPACE_SRGB@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V4L2_COLORSPACE_SRGB@GOTPAGEOFF]
	str	w8, [x22, #36]
Lloh8:
	ldr	w8, [x9]
Lloh9:
	adrp	x9, _V4L2_YCBCR_ENC_DEFAULT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _V4L2_YCBCR_ENC_DEFAULT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [x22, #28]
Lloh12:
	adrp	x8, _V4L2_QUANTIZATION_DEFAULT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _V4L2_QUANTIZATION_DEFAULT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _V4L2_XFER_FUNC_DEFAULT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _V4L2_XFER_FUNC_DEFAULT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	stp	w9, w8, [x22, #20]
	ldr	w8, [x22, #16]
	sub	w8, w8, #128
	cmp	w8, #6
	b.lo	LBB0_4
; %bb.3:
	mov	w8, #131
	str	w8, [x24]
LBB0_4:
	ldr	x8, [x22]
Lloh18:
	adrp	x9, _V4L2_SUBDEV_FORMAT_ACTIVE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _V4L2_SUBDEV_FORMAT_ACTIVE@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	mov	x0, x21
	bl	_to_ov2640
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_8
; %bb.6:
Lloh21:
	adrp	x8, _EBUSY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_7:
	mov	w21, #0
	ldp	q0, q1, [x24]
	stp	q0, q1, [x20]
	b	LBB0_9
LBB0_8:
	mov	w21, #0
	str	x23, [x0, #8]
	ldr	w8, [x24]
	str	w8, [x0]
LBB0_9:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_10:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.comm	_V4L2_COLORSPACE_SRGB,4,2       ; @V4L2_COLORSPACE_SRGB
	.comm	_V4L2_YCBCR_ENC_DEFAULT,4,2     ; @V4L2_YCBCR_ENC_DEFAULT
	.comm	_V4L2_QUANTIZATION_DEFAULT,4,2  ; @V4L2_QUANTIZATION_DEFAULT
	.comm	_V4L2_XFER_FUNC_DEFAULT,4,2     ; @V4L2_XFER_FUNC_DEFAULT
	.comm	_V4L2_SUBDEV_FORMAT_ACTIVE,8,3  ; @V4L2_SUBDEV_FORMAT_ACTIVE
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_ov2640_set_fmt
.subsections_via_symbols
