	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s2250_set_fmt
_s2250_set_fmt:                         ## @s2250_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, %r13
	movq	%rdi, %rbx
	callq	_to_state
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_v4l2_get_subdevdata
	cmpq	$0, 8(%r13)
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_7
LBB0_2:
	movq	%rax, %r14
	movq	(%r13), %rax
	movq	_V4L2_SUBDEV_FORMAT_TRY@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.3:
	cmpl	$639, 16(%r13)                  ## imm = 0x27F
	movl	(%r12), %edx
	jg	LBB0_5
## %bb.4:
	orl	$1024, %edx                     ## imm = 0x400
	jmp	LBB0_6
LBB0_5:
	andl	$-1025, %edx                    ## imm = 0xFBFF
LBB0_6:
	movq	%r14, %rdi
	movl	$299, %esi                      ## imm = 0x12B
	callq	_write_reg_fp
	movq	%r14, %rdi
	movl	$320, %esi                      ## imm = 0x140
	movl	$96, %edx
	callq	_write_reg_fp
LBB0_7:
	movl	%r15d, %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_SUBDEV_FORMAT_TRY,8,3     ## @V4L2_SUBDEV_FORMAT_TRY
	.no_dead_strip	_s2250_set_fmt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s2250_set_fmt
_s2250_set_fmt:                         ; @s2250_set_fmt
	.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
	mov	x20, x2
	mov	x19, x0
	bl	_to_state
	mov	x21, x0
	mov	x0, x19
	bl	_v4l2_get_subdevdata
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_2:
	ldr	x8, [x20]
Lloh3:
	adrp	x9, _V4L2_SUBDEV_FORMAT_TRY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_SUBDEV_FORMAT_TRY@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_7
; %bb.3:
	mov	x19, x0
	ldr	w9, [x20, #16]
	ldr	w8, [x21]
	cmp	w9, #639
	b.gt	LBB0_5
; %bb.4:
	orr	w2, w8, #0x400
	b	LBB0_6
LBB0_5:
	and	w2, w8, #0xfffffbff
LBB0_6:
	mov	x0, x19
	mov	w1, #299
	bl	_write_reg_fp
	mov	x0, x19
	mov	w1, #320
	mov	w2, #96
	bl	_write_reg_fp
LBB0_7:
	mov	w0, #0
LBB0_8:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_SUBDEV_FORMAT_TRY,8,3     ; @V4L2_SUBDEV_FORMAT_TRY
	.no_dead_strip	_s2250_set_fmt
.subsections_via_symbols
