	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov2659_set_fmt
_ov2659_set_fmt:                        ## @ov2659_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rdi, %r15
	callq	_v4l2_get_subdevdata
	movq	%rax, %r14
	movq	_ov2659_formats@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %r13d
	leaq	8(%r12), %rbx
	movq	$0, -48(%rbp)
	movq	%r15, %rdi
	callq	_to_ov2659
	movq	%rax, %r15
	leaq	L_.str(%rip), %rsi
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movq	_ov2659_formats@GOTPCREL(%rip), %r14
	callq	_dev_dbg
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	___ov2659_try_frame_size
	movq	(%r14), %rax
	movl	%r13d, %ecx
	movq	%rcx, %rdx
	shlq	$4, %rdx
	addq	%rax, %rdx
	addq	$-16, %rdx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	testl	%ecx, %ecx
	jle	LBB0_12
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	decq	%rcx
	movq	(%rdx), %rsi
	addq	$-16, %rdx
	cmpq	(%rbx), %rsi
	jne	LBB0_1
## %bb.3:
	movl	%ecx, %r13d
	jmp	LBB0_4
LBB0_12:
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	xorl	%r13d, %r13d
LBB0_4:
	movq	_V4L2_COLORSPACE_SRGB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r12)
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r12)
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	(%r12), %rax
	movq	_V4L2_SUBDEV_FORMAT_TRY@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	cmpq	(%rcx), %rax
	jne	LBB0_5
LBB0_10:
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_11
LBB0_5:
	cmpq	$0, 48(%r15)
	je	LBB0_6
## %bb.13:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_11:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	-48(%rbp), %rax
	movq	%rax, 40(%r15)
	movups	(%rbx), %xmm0
	movups	%xmm0, 16(%r15)
	movq	(%r14), %rax
	shlq	$4, %r13
	movl	8(%rax,%r13), %eax
	movl	%eax, 32(%r15)
	movq	16(%r15), %rax
	movq	_MEDIA_BUS_FMT_SBGGR8_1X8@GOTPCREL(%rip), %rcx
	movq	8(%r15), %rdx
	movl	(%rdx), %esi
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.7:
	movl	%esi, %eax
	shrl	$31, %eax
	addl	%esi, %eax
	sarl	%eax
	movl	%eax, %esi
LBB0_8:
	movl	4(%r15), %edi
	callq	_v4l2_ctrl_s_ctrl_int64
	movl	%eax, %r12d
	testl	%eax, %eax
	jns	LBB0_10
## %bb.9:
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_dev_warn
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_ov2659_formats,8,3             ## @ov2659_formats
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ov2659_set_fmt\n"

	.comm	_V4L2_COLORSPACE_SRGB,4,2       ## @V4L2_COLORSPACE_SRGB
	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.comm	_V4L2_SUBDEV_FORMAT_TRY,8,3     ## @V4L2_SUBDEV_FORMAT_TRY
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_MEDIA_BUS_FMT_SBGGR8_1X8,8,3   ## @MEDIA_BUS_FMT_SBGGR8_1X8
L_.str.1:                               ## @.str.1
	.asciz	"failed to set link_frequency rate (%d)\n"

	.no_dead_strip	_ov2659_set_fmt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov2659_set_fmt
_ov2659_set_fmt:                        ; @ov2659_set_fmt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x2
	mov	x19, x0
	bl	_v4l2_get_subdevdata
	mov	x20, x0
Lloh0:
	adrp	x24, _ov2659_formats@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ov2659_formats@GOTPAGEOFF]
	ldr	x0, [x24]
	bl	_ARRAY_SIZE
	mov	x23, x0
	add	x22, x21, #8
	str	xzr, [sp, #8]
	mov	x0, x19
	bl	_to_ov2659
	mov	x19, x0
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	add	x1, sp, #8
	mov	x0, x22
	bl	___ov2659_try_frame_size
	ldr	x8, [x24]
	mov	w9, w23
	add	x10, x8, w23, uxtw #4
	sub	x10, x10, #16
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	sub	x9, x9, #1
	ldr	x11, [x10], #-16
	ldr	x12, [x22]
	cmp	x11, x12
	b.ne	LBB0_1
; %bb.3:
	and	x23, x9, #0xffffffff
	b	LBB0_5
LBB0_4:
	mov	x23, #0
	ldr	x8, [x8]
	str	x8, [x22]
LBB0_5:
Lloh4:
	adrp	x8, _V4L2_COLORSPACE_SRGB@GOTPAGE
Lloh5:
	ldr	x8, [x8, _V4L2_COLORSPACE_SRGB@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _V4L2_FIELD_NONE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	stp	w9, w8, [x21, #16]
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x21]
Lloh10:
	adrp	x9, _V4L2_SUBDEV_FORMAT_TRY@GOTPAGE
Lloh11:
	ldr	x9, [x9, _V4L2_SUBDEV_FORMAT_TRY@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.6:
	mov	w21, #0
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_10
LBB0_8:
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_11
; %bb.9:
	mov	x0, x19
	bl	_mutex_unlock
Lloh13:
	adrp	x8, _EBUSY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
	ldr	x8, [sp, #8]
	str	x8, [x19, #40]
	ldr	q0, [x22]
	str	q0, [x19, #16]
	ldr	x8, [x24]
	add	x8, x8, x23, lsl #4
	ldr	w8, [x8, #8]
	str	w8, [x19, #32]
Lloh16:
	adrp	x8, _MEDIA_BUS_FMT_SBGGR8_1X8@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MEDIA_BUS_FMT_SBGGR8_1X8@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldp	x10, x9, [x19, #8]
	ldr	w10, [x10]
	cmp	w10, #0
	cinc	w11, w10, lt
	asr	w11, w11, #1
	cmp	x9, x8
	csel	w1, w10, w11, eq
	ldr	w0, [x19, #4]
	bl	_v4l2_ctrl_s_ctrl_int64
	mov	x21, x0
	tbz	w0, #31, LBB0_7
; %bb.12:
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_dev_warn
	b	LBB0_7
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_ov2659_formats,8,3             ; @ov2659_formats
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ov2659_set_fmt\n"

	.comm	_V4L2_COLORSPACE_SRGB,4,2       ; @V4L2_COLORSPACE_SRGB
	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.comm	_V4L2_SUBDEV_FORMAT_TRY,8,3     ; @V4L2_SUBDEV_FORMAT_TRY
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_MEDIA_BUS_FMT_SBGGR8_1X8,8,3   ; @MEDIA_BUS_FMT_SBGGR8_1X8
l_.str.1:                               ; @.str.1
	.asciz	"failed to set link_frequency rate (%d)\n"

	.no_dead_strip	_ov2659_set_fmt
.subsections_via_symbols
