	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psb_intel_sdvo_write_cmd
_psb_intel_sdvo_write_cmd:              ## @psb_intel_sdvo_write_cmd
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movq	%rdx, %r13
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_ARG_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leal	(%r14,%r14), %eax
	addl	$2, %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	leal	3(%r14), %eax
	shlq	$5, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	cmpl	%r12d, %r14d
	jge	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_2:
	movq	%r12, %r14
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdx
	movl	%r14d, %ecx
	callq	_psb_intel_sdvo_debug_write
	movl	4(%r12), %r8d
	testl	%r14d, %r14d
	movq	-56(%rbp), %r10                 ## 8-byte Reload
	jle	LBB0_3
## %bb.4:
	movq	_SDVO_I2C_ARG_0@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%r14d, %edx
	shlq	$3, %rdx
	xorl	%esi, %esi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r8d, 24(%rbx,%rdi,4)
	movq	$0, 16(%rbx,%rdi,4)
	movl	$2, (%rbx,%rdi,4)
	leaq	(%r15,%rsi), %rax
	movq	%rax, 8(%rbx,%rdi,4)
	movq	%rcx, (%r15,%rdi,2)
	movq	(%r13,%rdi), %rax
	movq	%rax, 8(%r15,%rdi,2)
	addq	$8, %rdi
	decq	%rcx
	addq	$16, %rsi
	cmpq	%rdi, %rdx
	jne	LBB0_5
	jmp	LBB0_6
LBB0_3:
	xorl	%r14d, %r14d
LBB0_6:
	movl	%r14d, %ecx
	shlq	$5, %rcx
	movl	%r8d, 24(%rbx,%rcx)
	movq	$0, 16(%rbx,%rcx)
	movl	$2, (%rbx,%rcx)
	leal	(%r14,%r14), %eax
	leaq	(%r15,%rax,8), %rdx
	movq	%rdx, 8(%rbx,%rcx)
	movq	_SDVO_I2C_OPCODE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, (%r15,%rax,8)
	leal	1(%r14,%r14), %eax
	movq	%r10, (%r15,%rax,8)
	movq	_SDVO_I2C_CMD_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)
	movl	%r8d, 56(%rbx,%rcx)
	movq	$0, 48(%rbx,%rcx)
	movl	$1, 32(%rbx,%rcx)
	leaq	-72(%rbp), %rax
	movq	%rax, 40(%rbx,%rcx)
	movl	%r8d, 88(%rbx,%rcx)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, 80(%rbx,%rcx)
	movl	$1, 64(%rbx,%rcx)
	movq	%rax, 72(%rbx,%rcx)
	movl	(%r12), %edi
	addl	$3, %r14d
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	_i2c_transfer
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	movl	$1, %ebx
	cmpl	%r14d, %eax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_10
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_ARG_LEN,4,2                ## @MAX_ARG_LEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Need to increase arg length\n"

	.comm	_SDVO_I2C_ARG_0,8,3             ## @SDVO_I2C_ARG_0
	.comm	_SDVO_I2C_OPCODE,8,3            ## @SDVO_I2C_OPCODE
	.comm	_SDVO_I2C_CMD_STATUS,8,3        ## @SDVO_I2C_CMD_STATUS
	.comm	_I2C_M_RD,8,3                   ## @I2C_M_RD
L_.str.1:                               ## @.str.1
	.asciz	"I2c transfer returned %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"I2c transfer returned %d/%d\n"

	.no_dead_strip	_psb_intel_sdvo_write_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psb_intel_sdvo_write_cmd
_psb_intel_sdvo_write_cmd:              ; @psb_intel_sdvo_write_cmd
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #16
	mov	x20, x3
	mov	x23, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _MAX_ARG_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_ARG_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w12, [x8]
	lsl	w8, w12, #1
	add	w8, w8, #2
	lsl	x8, x8, #3
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x24, x9, x8
	mov	sp, x24
	add	w8, w12, #3
	lsl	x8, x8, #5
	mov	x9, x8
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x21, x9, x8
	mov	sp, x21
	cmp	w12, w3
	b.ge	LBB0_2
; %bb.1:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_16
LBB0_2:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	mov	x3, x20
	bl	_psb_intel_sdvo_debug_write
	ldr	w8, [x19, #4]
	cmp	w20, #1
	b.lt	LBB0_5
; %bb.3:
Lloh12:
	adrp	x9, _SDVO_I2C_ARG_0@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SDVO_I2C_ARG_0@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x9]
	mov	w9, w20
	cmp	w20, #4
	b.hs	LBB0_6
; %bb.4:
	mov	x11, #0
	b	LBB0_9
LBB0_5:
	mov	w20, #0
	b	LBB0_11
LBB0_6:
	mov	x12, #0
	and	x11, x9, #0xfffffffc
	lsl	x13, x9, #5
	and	x13, x13, #0x1fffffff80
	add	x14, x24, #56
	add	x15, x23, #16
	mov	w16, #2
	mov	x17, x10
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x21, x12
	str	w8, [x0, #24]
	str	w8, [x0, #56]
	str	w8, [x0, #88]
	str	w8, [x0, #120]
	str	w16, [x0]
	str	w16, [x0, #32]
	str	w16, [x0, #64]
	str	w16, [x0, #96]
	mov	x1, x14
	str	x17, [x1, #-56]!
	stp	x1, xzr, [x0, #8]
	sub	x1, x17, #1
	mov	x2, x14
	str	x1, [x2, #-40]!
	stp	x2, xzr, [x0, #40]
	sub	x1, x17, #2
	mov	x2, x14
	str	x1, [x2, #-24]!
	stp	x2, xzr, [x0, #72]
	sub	x1, x17, #3
	mov	x2, x14
	str	x1, [x2, #-8]!
	ldp	x1, x3, [x15, #-16]
	stur	x1, [x14, #-48]
	stur	x3, [x14, #-32]
	ldp	x1, x3, [x15], #32
	stur	x1, [x14, #-16]
	str	x3, [x14], #64
	add	x12, x12, #128
	sub	x17, x17, #4
	stp	x2, xzr, [x0, #104]
	cmp	x13, x12
	b.ne	LBB0_7
; %bb.8:
	cmp	x11, x9
	b.eq	LBB0_11
LBB0_9:
	add	x12, x23, x11, lsl #3
	sub	x10, x10, x11
	add	x13, x21, x11, lsl #5
	add	x13, x13, #24
	sub	x9, x9, x11
	add	x11, x24, x11, lsl #4
	mov	w14, #2
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	str	w8, [x13]
	stur	w14, [x13, #-24]
	stp	x11, xzr, [x13, #-16]
	ldr	x15, [x12], #8
	stp	x10, x15, [x11], #16
	sub	x10, x10, #1
	add	x13, x13, #32
	subs	x9, x9, #1
	b.ne	LBB0_10
LBB0_11:
	mov	w9, w20
	add	x9, x21, x9, lsl #5
	str	w8, [x9, #24]
	mov	w10, #2
	str	w10, [x9]
	lsl	w10, w20, #1
	add	x10, x24, w10, uxtw #3
Lloh15:
	adrp	x11, _SDVO_I2C_OPCODE@GOTPAGE
Lloh16:
	ldr	x11, [x11, _SDVO_I2C_OPCODE@GOTPAGEOFF]
	stp	x10, xzr, [x9, #8]
Lloh17:
	ldr	x9, [x11]
	str	x9, [x10]
	mov	w9, #1
	mov	w10, #1
	bfi	w10, w20, #1, #31
	str	x22, [x24, w10, uxtw #3]
Lloh18:
	adrp	x10, _SDVO_I2C_CMD_STATUS@GOTPAGE
Lloh19:
	ldr	x10, [x10, _SDVO_I2C_CMD_STATUS@GOTPAGEOFF]
Lloh20:
	ldr	x10, [x10]
	stur	x10, [x29, #-64]
	add	w10, w20, #1
	add	x10, x21, x10, lsl #5
	str	w8, [x10, #24]
	str	w9, [x10]
	sub	x11, x29, #64
	stp	x11, xzr, [x10, #8]
	add	w10, w20, #2
	add	x10, x21, x10, lsl #5
	str	w8, [x10, #24]
Lloh21:
	adrp	x8, _I2C_M_RD@GOTPAGE
Lloh22:
	ldr	x8, [x8, _I2C_M_RD@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	str	w9, [x10]
	stp	x11, x8, [x10, #8]
	add	w20, w20, #3
	ldr	w0, [x19]
	mov	x1, x21
	mov	x2, x20
	bl	_i2c_transfer
	mov	x1, x0
	tbnz	w0, #31, LBB0_14
; %bb.12:
	cmp	w1, w20
	b.ne	LBB0_15
; %bb.13:
	mov	w0, #1
	b	LBB0_17
LBB0_14:
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_KMS
	b	LBB0_16
LBB0_15:
	str	x20, [sp, #-16]!
Lloh26:
	adrp	x0, l_.str.2@PAGE
Lloh27:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG_KMS
	add	sp, sp, #16
LBB0_16:
	mov	w0, #0
LBB0_17:
	ldur	x8, [x29, #-56]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.18:
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_ARG_LEN,4,2                ; @MAX_ARG_LEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Need to increase arg length\n"

	.comm	_SDVO_I2C_ARG_0,8,3             ; @SDVO_I2C_ARG_0
	.comm	_SDVO_I2C_OPCODE,8,3            ; @SDVO_I2C_OPCODE
	.comm	_SDVO_I2C_CMD_STATUS,8,3        ; @SDVO_I2C_CMD_STATUS
	.comm	_I2C_M_RD,8,3                   ; @I2C_M_RD
l_.str.1:                               ; @.str.1
	.asciz	"I2c transfer returned %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"I2c transfer returned %d/%d\n"

	.no_dead_strip	_psb_intel_sdvo_write_cmd
.subsections_via_symbols
