	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adv748x_hdmi_set_edid
_adv748x_hdmi_set_edid:                 ## @adv748x_hdmi_set_edid
	.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	%rsi, %r13
	movq	%rdi, %r15
	callq	_adv748x_sd_to_hdmi
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_adv748x_hdmi_to_state
	movq	%rax, %r14
	movl	24(%r13), %edi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	cmpq	$0, (%r13)
	je	LBB0_4
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	subl	(%rax), %ebx
LBB0_3:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	8(%r13), %edx
	testl	%edx, %edx
	je	LBB0_7
## %bb.5:
	cmpl	$5, %edx
	jl	LBB0_8
## %bb.6:
	movl	$4, 8(%r13)
	movq	_E2BIG@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_2
LBB0_7:
	movq	$0, (%r12)
	movabsq	$38654705680, %rax              ## imm = 0x900000010
	movq	%rax, 12(%r12)
	movq	_ADV748X_REPEATER_EDID_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_repeater_write
	movq	_ADV748X_REPEATER_EDID_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_repeater_write
	jmp	LBB0_3
LBB0_8:
	movl	8(%r12), %edi
	movq	16(%r13), %rsi
	shll	$7, %edx
	callq	_memcpy
	movl	8(%r13), %eax
	movl	%eax, (%r12)
	movl	$1, 4(%r12)
	movq	16(%r13), %rax
	movl	84(%rax), %edi
	movl	88(%rax), %esi
	callq	_v4l2_calc_aspect_ratio
	movq	%rax, 12(%r12)
	movl	8(%r13), %esi
	shll	$7, %esi
	movl	8(%r12), %edx
	movq	%r12, %rdi
	callq	_adv748x_hdmi_edid_write_block
	testl	%eax, %eax
	js	LBB0_10
## %bb.9:
	movq	_ADV748X_REPEATER_EDID_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r13), %edx
	movq	_ADV748X_REPEATER_EDID_SZ_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edx
	movq	%r14, %rdi
	callq	_repeater_write
	movq	_ADV748X_REPEATER_EDID_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ADV748X_REPEATER_EDID_CTL_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_repeater_write
	xorl	%ebx, %ebx
	jmp	LBB0_3
LBB0_10:
	movl	%eax, %ebx
	movl	12(%r13), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_v4l2_err
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ADV748X_REPEATER_EDID_SZ,4,2   ## @ADV748X_REPEATER_EDID_SZ
	.comm	_ADV748X_REPEATER_EDID_SZ_SHIFT,4,2 ## @ADV748X_REPEATER_EDID_SZ_SHIFT
	.comm	_ADV748X_REPEATER_EDID_CTL,4,2  ## @ADV748X_REPEATER_EDID_CTL
	.comm	_E2BIG,4,2                      ## @E2BIG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error %d writing edid pad %d\n"

	.comm	_ADV748X_REPEATER_EDID_CTL_EN,4,2 ## @ADV748X_REPEATER_EDID_CTL_EN
	.no_dead_strip	_adv748x_hdmi_set_edid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function adv748x_hdmi_set_edid
lCPI0_0:
	.long	16                              ; 0x10
	.long	9                               ; 0x9
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_adv748x_hdmi_set_edid:                 ; @adv748x_hdmi_set_edid
	.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, x1
	mov	x21, x0
	bl	_adv748x_sd_to_hdmi
	mov	x22, x0
	bl	_adv748x_hdmi_to_state
	mov	x19, x0
	ldr	w0, [x20, #24]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	x8, [x20]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_10
LBB0_3:
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_6
; %bb.4:
	cmp	w8, #5
	b.lt	LBB0_7
; %bb.5:
	mov	w8, #4
	str	w8, [x20, #8]
Lloh2:
	adrp	x8, _E2BIG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
	b	LBB0_2
LBB0_6:
	str	xzr, [x22]
Lloh4:
	adrp	x8, lCPI0_0@PAGE
Lloh5:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [x22, #12]
Lloh6:
	adrp	x8, _ADV748X_REPEATER_EDID_SZ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ADV748X_REPEATER_EDID_SZ@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_repeater_write
Lloh9:
	adrp	x8, _ADV748X_REPEATER_EDID_CTL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ADV748X_REPEATER_EDID_CTL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	b	LBB0_9
LBB0_7:
	ldr	w0, [x22, #8]
	ldr	x1, [x20, #16]
	lsl	w2, w8, #7
	bl	_memcpy
	ldr	w8, [x20, #8]
	mov	w9, #1
	stp	w8, w9, [x22]
	ldr	x8, [x20, #16]
	ldp	w0, w1, [x8, #84]
	bl	_v4l2_calc_aspect_ratio
	stur	x0, [x22, #12]
	ldr	w8, [x20, #8]
	lsl	w1, w8, #7
	ldr	w2, [x22, #8]
	mov	x0, x22
	bl	_adv748x_hdmi_edid_write_block
	tbnz	w0, #31, LBB0_11
; %bb.8:
Lloh12:
	adrp	x8, _ADV748X_REPEATER_EDID_SZ@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ADV748X_REPEATER_EDID_SZ@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	w8, [x20, #8]
Lloh15:
	adrp	x9, _ADV748X_REPEATER_EDID_SZ_SHIFT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ADV748X_REPEATER_EDID_SZ_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	lsl	w2, w8, w9
	mov	x0, x19
	bl	_repeater_write
Lloh18:
	adrp	x8, _ADV748X_REPEATER_EDID_CTL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ADV748X_REPEATER_EDID_CTL@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _ADV748X_REPEATER_EDID_CTL_EN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ADV748X_REPEATER_EDID_CTL_EN@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
LBB0_9:
	bl	_repeater_write
	mov	w22, #0
LBB0_10:
	mov	x0, x22
	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
LBB0_11:
	mov	x22, x0
	ldr	w3, [x20, #12]
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_v4l2_err
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdrp	Lloh4, Lloh6
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ADV748X_REPEATER_EDID_SZ,4,2   ; @ADV748X_REPEATER_EDID_SZ
	.comm	_ADV748X_REPEATER_EDID_SZ_SHIFT,4,2 ; @ADV748X_REPEATER_EDID_SZ_SHIFT
	.comm	_ADV748X_REPEATER_EDID_CTL,4,2  ; @ADV748X_REPEATER_EDID_CTL
	.comm	_E2BIG,4,2                      ; @E2BIG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error %d writing edid pad %d\n"

	.comm	_ADV748X_REPEATER_EDID_CTL_EN,4,2 ; @ADV748X_REPEATER_EDID_CTL_EN
	.no_dead_strip	_adv748x_hdmi_set_edid
.subsections_via_symbols
