	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx18_s_fmt_vid_cap
_cx18_s_fmt_vid_cap:                    ## @cx18_s_fmt_vid_cap
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	%rsi, %rdi
	callq	_fh2id
	movq	8(%rax), %rbx
	movq	_V4L2_SUBDEV_FORMAT_ACTIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -60(%rbp)
	movq	16(%rbx), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rax), %r15
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_cx18_try_fmt_vid_cap
	testl	%eax, %eax
	jne	LBB0_10
## %bb.1:
	shlq	$4, %r15
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r15), %r13
	movl	(%r14), %edx
	movl	4(%r14), %edi
	cmpl	%edx, 4(%rbx)
	jne	LBB0_4
## %bb.2:
	cmpl	%edi, 8(%rbx)
	jne	LBB0_4
## %bb.3:
	movq	(%r13), %rcx
	xorl	%eax, %eax
	cmpq	8(%r14), %rcx
	je	LBB0_10
LBB0_4:
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	leaq	12(%rbx), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jle	LBB0_6
## %bb.5:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_6:
	movq	8(%r14), %rax
	movq	%rax, (%r13)
	movq	_V4L2_PIX_FMT_HM12@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	imull	$2160, %esi, %eax               ## imm = 0x870
	sarl	%eax
	movl	$720, %ecx                      ## imm = 0x2D0
	jmp	LBB0_9
LBB0_8:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	imull	$1440, %esi, %eax               ## imm = 0x5A0
	movl	$1440, %ecx                     ## imm = 0x5A0
LBB0_9:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, 8(%rdx,%r15)
	movl	%ecx, 12(%rdx,%r15)
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%rbx)
	movl	%eax, -72(%rbp)
	movl	%esi, 8(%rbx)
	movl	%esi, -68(%rbp)
	movq	_MEDIA_BUS_FMT_FIXED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movl	(%rbx), %edi
	movq	_pad@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_set_fmt@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-72(%rbp), %r8
	xorl	%ecx, %ecx
	callq	_v4l2_subdev_call
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_cx18_g_fmt_vid_cap
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_SUBDEV_FORMAT_ACTIVE,4,2  ## @V4L2_SUBDEV_FORMAT_ACTIVE
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_V4L2_PIX_FMT_HM12,8,3          ## @V4L2_PIX_FMT_HM12
	.comm	_MEDIA_BUS_FMT_FIXED,4,2        ## @MEDIA_BUS_FMT_FIXED
	.comm	_pad,4,2                        ## @pad
	.comm	_set_fmt,4,2                    ## @set_fmt
	.no_dead_strip	_cx18_s_fmt_vid_cap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx18_s_fmt_vid_cap
_cx18_s_fmt_vid_cap:                    ; @cx18_s_fmt_vid_cap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	x0, x1
	bl	_fh2id
	ldr	x22, [x0, #8]
Lloh0:
	adrp	x8, _V4L2_SUBDEV_FORMAT_ACTIVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_SUBDEV_FORMAT_ACTIVE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #12]
	ldr	x23, [x22, #16]
	ldr	x24, [x0]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_cx18_try_fmt_vid_cap
	cbnz	w0, LBB0_8
; %bb.1:
	add	x27, x23, x24, lsl #4
	ldp	w25, w26, [x19]
	ldr	w8, [x22, #4]
	cmp	w8, w25
	b.ne	LBB0_5
; %bb.2:
	ldr	w8, [x22, #8]
	cmp	w8, w26
	b.ne	LBB0_5
; %bb.3:
	ldr	x8, [x27]
	ldr	x9, [x19, #8]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
	mov	w0, #0
	b	LBB0_8
LBB0_5:
	add	x0, x22, #12
	bl	_atomic_read
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.6:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_7:
	ldr	x8, [x19, #8]
	str	x8, [x27]
Lloh6:
	adrp	x9, _V4L2_PIX_FMT_HM12@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V4L2_PIX_FMT_HM12@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	mov	w10, #1440
	mul	w11, w26, w10
	dup.2s	v0, w10
	mov.s	v0[0], w11
	mov	w10, #2160
	mul	w10, w26, w10
	orr	w11, w10, #0x1
	cmp	w10, #0
	csel	w10, w11, w10, lt
	asr	w10, w10, #1
	mov	w11, #720
	dup.2s	v1, w11
	mov.s	v1[0], w10
	cmp	x8, x9
	fcsel	d0, d0, d1, ne
	add	x8, x23, x24, lsl #4
	str	d0, [x8, #8]
	stp	w25, w26, [x22, #4]
	stp	w25, w26, [sp]
Lloh9:
	adrp	x8, _MEDIA_BUS_FMT_FIXED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MEDIA_BUS_FMT_FIXED@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [sp, #8]
	ldr	w0, [x22]
Lloh12:
	adrp	x8, _pad@GOTPAGE
Lloh13:
	ldr	x8, [x8, _pad@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _set_fmt@GOTPAGE
Lloh16:
	ldr	x8, [x8, _set_fmt@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x4, sp
	mov	x3, #0
	bl	_v4l2_subdev_call
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_cx18_g_fmt_vid_cap
LBB0_8:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_SUBDEV_FORMAT_ACTIVE,4,2  ; @V4L2_SUBDEV_FORMAT_ACTIVE
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_V4L2_PIX_FMT_HM12,8,3          ; @V4L2_PIX_FMT_HM12
	.comm	_MEDIA_BUS_FMT_FIXED,4,2        ; @MEDIA_BUS_FMT_FIXED
	.comm	_pad,4,2                        ; @pad
	.comm	_set_fmt,4,2                    ; @set_fmt
	.no_dead_strip	_cx18_s_fmt_vid_cap
.subsections_via_symbols
