	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pd_vidioc_s_fmt
_pd_vidioc_s_fmt:                       ## @pd_vidioc_s_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	$0, -32(%rbp)
	movq	(%rsi), %rax
	movq	_V4L2_PIX_FMT_RGB565@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_TLG_TUNER_VID_FORMAT_RGB_565@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_V4L2_PIX_FMT_YUYV@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	_TLG_TUNER_VID_FORMAT_YUV@GOTPCREL(%rip), %rax
LBB0_3:
	movq	(%rax), %rdx
	movq	_VIDEO_STREAM_FMT_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_send_set_req
	movq	%rax, %r15
	movq	_TLG_TUNE_VID_RES_720@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	8(%r14), %eax
	cmpl	$720, %eax                      ## imm = 0x2D0
	je	LBB0_7
## %bb.4:
	cmpl	$704, %eax                      ## imm = 0x2C0
	jne	LBB0_6
## %bb.5:
	movq	_TLG_TUNE_VID_RES_704@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	jmp	LBB0_7
LBB0_6:
	movl	$720, 8(%r14)                   ## imm = 0x2D0
LBB0_7:
	movq	_VIDEO_ROSOLU_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_send_set_req
	orq	%r15, %rax
	orq	-32(%rbp), %rax
	je	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_13
LBB0_9:
	leaq	16(%rbx), %rax
	movq	(%r14), %rcx
	movq	%rcx, 16(%rbx)
	movq	_V4L2_STD_525_60@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	8(%rbx), %ecx
	movl	$576, %edx                      ## imm = 0x240
	movl	$480, %ecx                      ## imm = 0x1E0
	cmovel	%edx, %ecx
	movl	%ecx, 12(%r14)
	movl	8(%r14), %edx
	cmpl	%edx, 24(%rbx)
	jne	LBB0_11
## %bb.10:
	cmpl	%ecx, 28(%rbx)
	je	LBB0_12
LBB0_11:
	movl	%edx, 24(%rbx)
	movl	%ecx, 28(%rbx)
	movl	8(%r14), %ecx
	addl	%ecx, %ecx
	movl	%ecx, 32(%rbx)
	imull	12(%r14), %ecx
	movl	%ecx, 36(%rbx)
LBB0_12:
	movq	16(%rax), %rcx
	movq	%rcx, 16(%r14)
	movups	(%rax), %xmm0
	movups	%xmm0, (%r14)
	xorl	%eax, %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_PIX_FMT_RGB565,8,3        ## @V4L2_PIX_FMT_RGB565
	.comm	_TLG_TUNER_VID_FORMAT_RGB_565,8,3 ## @TLG_TUNER_VID_FORMAT_RGB_565
	.comm	_V4L2_PIX_FMT_YUYV,8,3          ## @V4L2_PIX_FMT_YUYV
	.comm	_TLG_TUNER_VID_FORMAT_YUV,8,3   ## @TLG_TUNER_VID_FORMAT_YUV
	.comm	_VIDEO_STREAM_FMT_SEL,4,2       ## @VIDEO_STREAM_FMT_SEL
	.comm	_TLG_TUNE_VID_RES_720,8,3       ## @TLG_TUNE_VID_RES_720
	.comm	_TLG_TUNE_VID_RES_704,8,3       ## @TLG_TUNE_VID_RES_704
	.comm	_VIDEO_ROSOLU_SEL,4,2           ## @VIDEO_ROSOLU_SEL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_V4L2_STD_525_60,4,2            ## @V4L2_STD_525_60
	.no_dead_strip	_pd_vidioc_s_fmt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pd_vidioc_s_fmt
_pd_vidioc_s_fmt:                       ; @pd_vidioc_s_fmt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	str	xzr, [sp, #8]
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _V4L2_PIX_FMT_RGB565@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_PIX_FMT_RGB565@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _TLG_TUNER_VID_FORMAT_RGB_565@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TLG_TUNER_VID_FORMAT_RGB_565@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
Lloh5:
	adrp	x8, _V4L2_PIX_FMT_YUYV@GOTPAGE
Lloh6:
	ldr	x8, [x8, _V4L2_PIX_FMT_YUYV@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	str	x8, [x19]
Lloh8:
	adrp	x8, _TLG_TUNER_VID_FORMAT_YUV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TLG_TUNER_VID_FORMAT_YUV@GOTPAGEOFF]
LBB0_3:
	ldr	x2, [x8]
Lloh10:
	adrp	x8, _VIDEO_STREAM_FMT_SEL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VIDEO_STREAM_FMT_SEL@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	add	x3, sp, #8
	mov	x0, x20
	bl	_send_set_req
	mov	x21, x0
Lloh13:
	adrp	x8, _TLG_TUNE_VID_RES_720@GOTPAGE
Lloh14:
	ldr	x8, [x8, _TLG_TUNE_VID_RES_720@GOTPAGEOFF]
Lloh15:
	ldr	x2, [x8]
	ldr	w8, [x19, #8]
	cmp	w8, #720
	b.eq	LBB0_7
; %bb.4:
	cmp	w8, #704
	b.ne	LBB0_6
; %bb.5:
Lloh16:
	adrp	x8, _TLG_TUNE_VID_RES_704@GOTPAGE
Lloh17:
	ldr	x8, [x8, _TLG_TUNE_VID_RES_704@GOTPAGEOFF]
Lloh18:
	ldr	x2, [x8]
	b	LBB0_7
LBB0_6:
	mov	w8, #720
	str	w8, [x19, #8]
LBB0_7:
Lloh19:
	adrp	x8, _VIDEO_ROSOLU_SEL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _VIDEO_ROSOLU_SEL@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	add	x3, sp, #8
	mov	x0, x20
	bl	_send_set_req
	orr	x8, x0, x21
	ldr	x9, [sp, #8]
	orr	x8, x8, x9
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x20
	bl	_mutex_unlock
Lloh22:
	adrp	x8, _EBUSY@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
LBB0_9:
	add	x8, x20, #16
	ldr	x9, [x19]
	str	x9, [x20, #16]
	ldr	w9, [x20, #8]
Lloh25:
	adrp	x10, _V4L2_STD_525_60@GOTPAGE
Lloh26:
	ldr	x10, [x10, _V4L2_STD_525_60@GOTPAGEOFF]
Lloh27:
	ldr	w10, [x10]
	tst	w10, w9
	mov	w9, #480
	mov	w10, #576
	csel	w9, w10, w9, eq
	str	w9, [x19, #12]
	ldr	w11, [x20, #24]
	ldr	w10, [x19, #8]
	cmp	w11, w10
	b.ne	LBB0_11
; %bb.10:
	ldr	w11, [x20, #28]
	cmp	w11, w9
	b.eq	LBB0_12
LBB0_11:
	stp	w10, w9, [x20, #24]
	ldp	w9, w10, [x19, #8]
	lsl	w9, w9, #1
	mul	w10, w9, w10
	stp	w9, w10, [x20, #32]
LBB0_12:
	mov	w0, #0
	ldr	q0, [x8]
	ldr	x8, [x8, #16]
	str	x8, [x19, #16]
	str	q0, [x19]
LBB0_13:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_PIX_FMT_RGB565,8,3        ; @V4L2_PIX_FMT_RGB565
	.comm	_TLG_TUNER_VID_FORMAT_RGB_565,8,3 ; @TLG_TUNER_VID_FORMAT_RGB_565
	.comm	_V4L2_PIX_FMT_YUYV,8,3          ; @V4L2_PIX_FMT_YUYV
	.comm	_TLG_TUNER_VID_FORMAT_YUV,8,3   ; @TLG_TUNER_VID_FORMAT_YUV
	.comm	_VIDEO_STREAM_FMT_SEL,4,2       ; @VIDEO_STREAM_FMT_SEL
	.comm	_TLG_TUNE_VID_RES_720,8,3       ; @TLG_TUNE_VID_RES_720
	.comm	_TLG_TUNE_VID_RES_704,8,3       ; @TLG_TUNE_VID_RES_704
	.comm	_VIDEO_ROSOLU_SEL,4,2           ; @VIDEO_ROSOLU_SEL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_V4L2_STD_525_60,4,2            ; @V4L2_STD_525_60
	.no_dead_strip	_pd_vidioc_s_fmt
.subsections_via_symbols
