	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_process_i2c_ch
_radeon_process_i2c_ch:                 ## @radeon_process_i2c_ch
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r12d
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movl	%edx, %ebx
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	(%rax), %r13
	movq	_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ProcessI2cChannelTransaction@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_GetIndexIntoMasterTable
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%edi, %edi
	callq	_cpu_to_le16
	movq	%rax, %r15
	movq	%rax, -80(%rbp)
	leaq	-120(%rbp), %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%r13), %rdi
	callq	_mutex_lock
	movq	(%r13), %rdi
	movq	8(%rdi), %rsi
	movq	_HW_I2C_WRITE@GOTPCREL(%rip), %rax
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	testl	%ebx, (%rax)
	je	LBB0_10
## %bb.1:
	movq	_ATOM_MAX_HW_I2C_WRITE@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jge	LBB0_5
## %bb.2:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_3
LBB0_10:
	movq	_ATOM_MAX_HW_I2C_READ@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jge	LBB0_12
## %bb.11:
	leaq	L_.str.1(%rip), %rdi
LBB0_3:
	movl	%r12d, %esi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_5:
	xorl	%eax, %eax
	movl	$0, %ecx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.6:
	movl	(%rdx), %ecx
LBB0_7:
	movl	%ecx, -120(%rbp)
	subl	$1, %r12d
	cmovbl	%eax, %r12d
	testl	%r12d, %r12d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_9
## %bb.8:
	leaq	4(%rdx), %rsi
	leaq	-80(%rbp), %rdi
	movl	%r12d, %edx
	callq	_memcpy
	movq	-80(%rbp), %r15
LBB0_9:
	movq	%r15, %rdi
	callq	_cpu_to_le16
	movq	%rax, -88(%rbp)
	movq	(%r13), %rdi
	jmp	LBB0_13
LBB0_12:
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	$0, -120(%rbp)
	movq	$0, -88(%rbp)
LBB0_13:
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, -116(%rbp)
	movq	_TARGET_HW_I2C_CLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -92(%rbp)
	movl	%r12d, -112(%rbp)
	addl	%ecx, %ecx
	movl	%ecx, -108(%rbp)
	movl	4(%r14), %eax
	movl	%eax, -96(%rbp)
	leaq	-120(%rbp), %rdx
	callq	_atom_execute_table_scratch_unlocked
	movq	-104(%rbp), %rax
	movq	_HW_ASSISTED_I2C_STATUS_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.15:
	xorl	%ebx, %ebx
	movq	_HW_I2C_WRITE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	jne	LBB0_17
## %bb.16:
	xorl	%ebx, %ebx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	callq	_radeon_atom_copy_swap
	jmp	LBB0_17
LBB0_14:
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_17:
	movq	(%r13), %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_COMMAND,4,2                    ## @COMMAND
	.comm	_ProcessI2cChannelTransaction,4,2 ## @ProcessI2cChannelTransaction
	.comm	_HW_I2C_WRITE,4,2               ## @HW_I2C_WRITE
	.comm	_ATOM_MAX_HW_I2C_WRITE,4,2      ## @ATOM_MAX_HW_I2C_WRITE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hw i2c: tried to write too many bytes (%d vs 3)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ATOM_MAX_HW_I2C_READ,4,2       ## @ATOM_MAX_HW_I2C_READ
L_.str.1:                               ## @.str.1
	.asciz	"hw i2c: tried to read too many bytes (%d vs 255)\n"

	.comm	_TARGET_HW_I2C_CLOCK,4,2        ## @TARGET_HW_I2C_CLOCK
	.comm	_HW_ASSISTED_I2C_STATUS_SUCCESS,8,3 ## @HW_ASSISTED_I2C_STATUS_SUCCESS
L_.str.2:                               ## @.str.2
	.asciz	"hw_i2c error\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_radeon_process_i2c_ch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_process_i2c_ch
_radeon_process_i2c_ch:                 ; @radeon_process_i2c_ch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x27, [x8]
Lloh0:
	adrp	x8, _COMMAND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _COMMAND@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _ProcessI2cChannelTransaction@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ProcessI2cChannelTransaction@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_GetIndexIntoMasterTable
	mov	x24, x0
	mov	x0, #0
	bl	_cpu_to_le16
	mov	x26, x0
	str	x0, [sp]
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	mov	x0, x19
	bl	_mutex_lock
	ldr	x0, [x27]
	bl	_mutex_lock
	ldr	x0, [x27]
	ldr	x25, [x0, #8]
Lloh6:
	adrp	x28, _HW_I2C_WRITE@GOTPAGE
Lloh7:
	ldr	x28, [x28, _HW_I2C_WRITE@GOTPAGEOFF]
	ldr	w8, [x28]
	tst	w8, w22
	b.eq	LBB0_3
; %bb.1:
Lloh8:
	adrp	x8, _ATOM_MAX_HW_I2C_WRITE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ATOM_MAX_HW_I2C_WRITE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ge	LBB0_6
; %bb.2:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_5
LBB0_3:
Lloh13:
	adrp	x8, _ATOM_MAX_HW_I2C_READ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ATOM_MAX_HW_I2C_READ@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ge	LBB0_8
; %bb.4:
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_5:
	mov	x1, x20
	bl	_DRM_ERROR
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_18
LBB0_6:
	cbz	x21, LBB0_9
; %bb.7:
	ldr	w8, [x21]
	b	LBB0_10
LBB0_8:
	str	wzr, [sp, #8]
	str	xzr, [sp, #40]
	b	LBB0_13
LBB0_9:
	mov	w8, #0
LBB0_10:
	str	w8, [sp, #8]
	sub	w8, w20, #1
	cmp	w20, #0
	csel	w20, wzr, w8, eq
	cbz	w20, LBB0_12
; %bb.11:
	add	x1, x21, #4
	mov	x0, sp
	mov	x2, x20
	bl	_memcpy
	ldr	x26, [sp]
LBB0_12:
	mov	x0, x26
	bl	_cpu_to_le16
	str	x0, [sp, #40]
	ldr	x0, [x27]
LBB0_13:
Lloh20:
	adrp	x8, _TARGET_HW_I2C_CLOCK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _TARGET_HW_I2C_CLOCK@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x8]
	stp	w22, w20, [sp, #12]
	lsl	w8, w23, #1
	ldr	w9, [x19, #4]
	str	w8, [sp, #20]
	stp	w9, w10, [sp, #32]
	add	x2, sp, #8
	mov	x1, x24
	bl	_atom_execute_table_scratch_unlocked
	ldr	x8, [sp, #24]
Lloh23:
	adrp	x9, _HW_ASSISTED_I2C_STATUS_SUCCESS@GOTPAGE
Lloh24:
	ldr	x9, [x9, _HW_ASSISTED_I2C_STATUS_SUCCESS@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.14:
	ldr	w8, [x28]
	tst	w8, w22
	b.ne	LBB0_16
; %bb.15:
	mov	x0, x21
	mov	x1, x25
	mov	x2, x20
	mov	w3, #0
	bl	_radeon_atom_copy_swap
LBB0_16:
	mov	w20, #0
	b	LBB0_19
LBB0_17:
Lloh26:
	adrp	x0, l_.str.2@PAGE
Lloh27:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG_KMS
Lloh28:
	adrp	x8, _EIO@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_19:
	ldr	x0, [x27]
	bl	_mutex_unlock
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_COMMAND,4,2                    ; @COMMAND
	.comm	_ProcessI2cChannelTransaction,4,2 ; @ProcessI2cChannelTransaction
	.comm	_HW_I2C_WRITE,4,2               ; @HW_I2C_WRITE
	.comm	_ATOM_MAX_HW_I2C_WRITE,4,2      ; @ATOM_MAX_HW_I2C_WRITE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hw i2c: tried to write too many bytes (%d vs 3)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ATOM_MAX_HW_I2C_READ,4,2       ; @ATOM_MAX_HW_I2C_READ
l_.str.1:                               ; @.str.1
	.asciz	"hw i2c: tried to read too many bytes (%d vs 255)\n"

	.comm	_TARGET_HW_I2C_CLOCK,4,2        ; @TARGET_HW_I2C_CLOCK
	.comm	_HW_ASSISTED_I2C_STATUS_SUCCESS,8,3 ; @HW_ASSISTED_I2C_STATUS_SUCCESS
l_.str.2:                               ; @.str.2
	.asciz	"hw_i2c error\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_radeon_process_i2c_ch
.subsections_via_symbols
