	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adv7842_get_format
_adv7842_get_format:                    ## @adv7842_get_format
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_to_state
	movq	%rax, %r14
	movq	(%r15), %rax
	movq	_ADV7842_PAD_SOURCE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	(%r14), %rax
	movq	_ADV7842_MODE_SDP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.3:
	movq	%rbx, %rdi
	movl	$90, %esi
	callq	_sdp_read
	testb	$1, %al
	jne	LBB0_4
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_5:
	leaq	16(%r15), %rsi
	movq	%r14, %rdi
	callq	_adv7842_fill_format
	movq	8(%r15), %rax
	movq	_V4L2_SUBDEV_FORMAT_TRY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	movq	(%r15), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_v4l2_subdev_get_try_format
	jmp	LBB0_8
LBB0_4:
	movq	_MEDIA_BUS_FMT_YUYV8_2X8@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r15)
	movl	$720, 16(%r15)                  ## imm = 0x2D0
	movq	_V4L2_STD_525_60@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	8(%r14), %eax
	movl	$576, %eax                      ## imm = 0x240
	movl	$480, %ecx                      ## imm = 0x1E0
	cmovel	%eax, %ecx
	movl	%ecx, 20(%r15)
	movq	_V4L2_COLORSPACE_SMPTE170M@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r15)
	jmp	LBB0_9
LBB0_7:
	movq	16(%r14), %rax
LBB0_8:
	movl	(%rax), %eax
	movl	%eax, 24(%r15)
LBB0_9:
	xorl	%eax, %eax
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADV7842_PAD_SOURCE,8,3         ## @ADV7842_PAD_SOURCE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ADV7842_MODE_SDP,8,3           ## @ADV7842_MODE_SDP
	.comm	_MEDIA_BUS_FMT_YUYV8_2X8,4,2    ## @MEDIA_BUS_FMT_YUYV8_2X8
	.comm	_V4L2_STD_525_60,4,2            ## @V4L2_STD_525_60
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ## @V4L2_COLORSPACE_SMPTE170M
	.comm	_V4L2_SUBDEV_FORMAT_TRY,8,3     ## @V4L2_SUBDEV_FORMAT_TRY
	.no_dead_strip	_adv7842_get_format
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adv7842_get_format
_adv7842_get_format:                    ; @adv7842_get_format
	.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	x19, x2
	mov	x22, x1
	mov	x21, x0
	bl	_to_state
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _ADV7842_PAD_SOURCE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ADV7842_PAD_SOURCE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0]
Lloh3:
	adrp	x9, _ADV7842_MODE_SDP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ADV7842_MODE_SDP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	mov	x0, x21
	mov	w1, #90
	bl	_sdp_read
	tbnz	w0, #0, LBB0_6
LBB0_3:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_4:
	add	x1, x19, #16
	mov	x0, x20
	bl	_adv7842_fill_format
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x9, _V4L2_SUBDEV_FORMAT_TRY@GOTPAGE
Lloh10:
	ldr	x9, [x9, _V4L2_SUBDEV_FORMAT_TRY@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	ldr	x2, [x19]
	mov	x0, x21
	mov	x1, x22
	bl	_v4l2_subdev_get_try_format
	mov	x8, x0
	mov	w0, #0
	b	LBB0_8
LBB0_6:
	mov	w0, #0
Lloh12:
	adrp	x8, _MEDIA_BUS_FMT_YUYV8_2X8@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MEDIA_BUS_FMT_YUYV8_2X8@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
Lloh15:
	adrp	x10, _V4L2_STD_525_60@GOTPAGE
Lloh16:
	ldr	x10, [x10, _V4L2_STD_525_60@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	tst	w10, w9
	mov	w9, #480
	mov	w10, #576
	csel	w9, w10, w9, eq
	mov	w10, #720
	stp	w10, w9, [x19, #16]
Lloh18:
	adrp	x9, _V4L2_COLORSPACE_SMPTE170M@GOTPAGE
Lloh19:
	ldr	x9, [x9, _V4L2_COLORSPACE_SMPTE170M@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	stp	w8, w9, [x19, #24]
	b	LBB0_9
LBB0_7:
	mov	w0, #0
	ldr	x8, [x20, #16]
LBB0_8:
	ldr	w8, [x8]
	str	w8, [x19, #24]
LBB0_9:
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ADV7842_PAD_SOURCE,8,3         ; @ADV7842_PAD_SOURCE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ADV7842_MODE_SDP,8,3           ; @ADV7842_MODE_SDP
	.comm	_MEDIA_BUS_FMT_YUYV8_2X8,4,2    ; @MEDIA_BUS_FMT_YUYV8_2X8
	.comm	_V4L2_STD_525_60,4,2            ; @V4L2_STD_525_60
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ; @V4L2_COLORSPACE_SMPTE170M
	.comm	_V4L2_SUBDEV_FORMAT_TRY,8,3     ; @V4L2_SUBDEV_FORMAT_TRY
	.no_dead_strip	_adv7842_get_format
.subsections_via_symbols
