	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adv7842_set_edid
_adv7842_set_edid:                      ## @adv7842_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	callq	_to_state
	movq	%rax, %r15
	movq	32(%r12), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	cmpl	$129, (%r12)
	jl	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_2:
	cmpq	$0, 8(%r12)
	je	LBB0_4
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	cmpl	$3, 16(%r12)
	jl	LBB0_9
## %bb.5:
	movl	$2, 16(%r12)
	movq	_E2BIG@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%ebx, %ebx
LBB0_7:
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	24(%r12), %rax
	movl	84(%rax), %edi
	movl	88(%rax), %esi
	callq	_v4l2_calc_aspect_ratio
	movl	%eax, 16(%r15)
	movl	(%r12), %eax
	leal	-129(%rax), %ecx
	cmpl	$2, %ecx
	jae	LBB0_12
## %bb.10:
	movq	%r15, %rbx
	addq	$4, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$256, %edx                      ## imm = 0x100
	callq	_memset
	movl	16(%r12), %edx
	movb	(%r12), %cl
	movl	$4, %eax
	shll	%cl, %eax
	testl	%edx, %edx
	je	LBB0_14
## %bb.11:
	orl	%eax, (%r15)
	jmp	LBB0_15
LBB0_12:
	cmpl	$128, %eax
	jne	LBB0_3
## %bb.13:
	movq	%r15, %rbx
	addq	$12, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$256, %edx                      ## imm = 0x100
	callq	_memset
	movl	16(%r12), %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	setne	%al
	movl	%eax, 8(%r15)
	movq	24(%r12), %rsi
	shll	$7, %edx
	movq	%rbx, %rdi
	callq	_memcpy
	movq	%r14, %rdi
	callq	_edid_write_vga_segment
	jmp	LBB0_16
LBB0_14:
	notl	%eax
	andl	%eax, (%r15)
	movq	%r14, %rdi
	callq	_adv7842_s_detect_tx_5v_ctrl
	movl	16(%r12), %edx
LBB0_15:
	movq	24(%r12), %rsi
	shll	$7, %edx
	movq	%rbx, %rdi
	callq	_memcpy
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_edid_write_hdmi_segment
LBB0_16:
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_8
## %bb.17:
	movl	(%r12), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_v4l2_err
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_E2BIG,4,2                      ## @E2BIG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error %d writing edid on port %d\n"

	.no_dead_strip	_adv7842_set_edid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adv7842_set_edid
_adv7842_set_edid:                      ; @adv7842_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	x19, x1
	mov	x20, x0
	bl	_to_state
	mov	x21, x0
	ldr	x0, [x19, #32]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w8, [x19]
	cmp	w8, #129
	b.ge	LBB0_2
; %bb.1:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_5
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_4:
	mov	x0, x21
	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_5:
	ldr	w8, [x19, #16]
	cmp	w8, #3
	b.lt	LBB0_7
; %bb.6:
	mov	w8, #2
	str	w8, [x19, #16]
Lloh2:
	adrp	x8, _E2BIG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
	b	LBB0_3
LBB0_7:
	ldr	x8, [x19, #24]
	ldp	w0, w1, [x8, #84]
	bl	_v4l2_calc_aspect_ratio
	str	w0, [x21, #16]
	ldr	w8, [x19]
	sub	w9, w8, #129
	cmp	w9, #2
	b.hs	LBB0_10
; %bb.8:
	add	x22, x21, #4
	mov	x0, x22
	mov	w1, #0
	mov	w2, #256
	bl	_memset
	ldr	w8, [x19, #16]
	ldr	w9, [x19]
	mov	w10, #4
	lsl	w9, w10, w9
	cbz	w8, LBB0_12
; %bb.9:
	ldr	w10, [x21]
	orr	w9, w10, w9
	str	w9, [x21]
	b	LBB0_13
LBB0_10:
	cmp	w8, #128
	b.ne	LBB0_2
; %bb.11:
	add	x22, x21, #12
	mov	x0, x22
	mov	w1, #0
	mov	w2, #256
	bl	_memset
	ldr	w8, [x19, #16]
	cmp	w8, #0
	cset	w9, ne
	str	w9, [x21, #8]
	ldr	x1, [x19, #24]
	lsl	w2, w8, #7
	mov	x0, x22
	bl	_memcpy
	mov	x0, x20
	bl	_edid_write_vga_segment
	b	LBB0_14
LBB0_12:
	ldr	w8, [x21]
	bic	w8, w8, w9
	str	w8, [x21]
	mov	x0, x20
	bl	_adv7842_s_detect_tx_5v_ctrl
	ldr	w8, [x19, #16]
LBB0_13:
	ldr	x1, [x19, #24]
	lsl	w2, w8, #7
	mov	x0, x22
	bl	_memcpy
	ldr	w1, [x19]
	mov	x0, x20
	bl	_edid_write_hdmi_segment
LBB0_14:
	mov	x21, x0
	tbz	w0, #31, LBB0_4
; %bb.15:
	ldr	w3, [x19]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_v4l2_err
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_E2BIG,4,2                      ; @E2BIG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error %d writing edid on port %d\n"

	.no_dead_strip	_adv7842_set_edid
.subsections_via_symbols
