	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_atombios_i2c_xfer       ## -- Begin function amdgpu_atombios_i2c_xfer
	.p2align	4, 0x90
_amdgpu_atombios_i2c_xfer:              ## @amdgpu_atombios_i2c_xfer
	.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	%edx, %r14d
	movq	%rsi, %rbx
	callq	_i2c_get_adapdata
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	cmpl	$1, %r14d
	jne	LBB0_3
## %bb.1:
	cmpl	$0, (%rbx)
	jne	LBB0_4
## %bb.2:
	movl	16(%rbx), %esi
	movq	_HW_I2C_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_amdgpu_atombios_i2c_process_i2c_ch
	testl	%eax, %eax
	movl	$1, %r14d
	cmovnel	%eax, %r14d
	jmp	LBB0_12
LBB0_3:
	jl	LBB0_12
LBB0_4:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	incq	%rax
	cmpq	-72(%rbp), %rax                 ## 8-byte Folded Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_11
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	(%rax,%rax,2), %rax
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%rbx,%rax,8)
	movq	_HW_I2C_READ@GOTPCREL(%rip), %rcx
	cmoveq	_HW_I2C_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rbx,%rax,8), %r15d
	movq	_ATOM_MAX_HW_I2C_READ@GOTPCREL(%rip), %rdx
	cmoveq	_ATOM_MAX_HW_I2C_WRITE@GOTPCREL(%rip), %rdx
	testl	%r15d, %r15d
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%rcx), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	(%rdx), %r14d
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,8), %r12
	addq	$16, %r12
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	%r14d, %r15d
	movl	%r14d, %ebx
	cmovll	%r15d, %ebx
	movl	(%r12), %esi
	movslq	%r13d, %rcx
	shlq	$2, %rcx
	addq	-8(%r12), %rcx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%ebx, %r8d
	callq	_amdgpu_atombios_i2c_process_i2c_ch
	testl	%eax, %eax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=2
	addl	%ebx, %r13d
	subl	%ebx, %r15d
	jne	LBB0_7
	jmp	LBB0_10
LBB0_8:
	movl	%eax, %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_HW_I2C_WRITE,4,2               ## @HW_I2C_WRITE
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_ATOM_MAX_HW_I2C_READ,4,2       ## @ATOM_MAX_HW_I2C_READ
	.comm	_HW_I2C_READ,4,2                ## @HW_I2C_READ
	.comm	_ATOM_MAX_HW_I2C_WRITE,4,2      ## @ATOM_MAX_HW_I2C_WRITE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_atombios_i2c_xfer       ; -- Begin function amdgpu_atombios_i2c_xfer
	.p2align	2
_amdgpu_atombios_i2c_xfer:              ; @amdgpu_atombios_i2c_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x2
	mov	x21, x1
	bl	_i2c_get_adapdata
	mov	x20, x0
	cmp	w19, #1
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x21]
	cbnz	w8, LBB0_4
; %bb.2:
	ldr	w1, [x21, #16]
Lloh0:
	adrp	x8, _HW_I2C_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HW_I2C_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x3, #0
	mov	w4, #0
	bl	_amdgpu_atombios_i2c_process_i2c_ch
	cmp	w0, #0
	csinc	w19, w0, wzr, ne
	b	LBB0_11
LBB0_3:
	b.lt	LBB0_11
LBB0_4:
	mov	x24, #0
	str	w19, [sp, #4]                   ; 4-byte Folded Spill
	mov	w8, w19
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x24, x24, #1
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	cmp	x24, x8
	b.eq	LBB0_12
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	mov	w8, #24
	madd	x8, x24, x8, x21
	ldp	w25, w8, [x8]
Lloh3:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
Lloh6:
	adrp	x8, _HW_I2C_WRITE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HW_I2C_WRITE@GOTPAGEOFF]
Lloh8:
	adrp	x9, _HW_I2C_READ@GOTPAGE
Lloh9:
	ldr	x9, [x9, _HW_I2C_READ@GOTPAGEOFF]
	csel	x9, x8, x9, eq
Lloh10:
	adrp	x8, _ATOM_MAX_HW_I2C_WRITE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ATOM_MAX_HW_I2C_WRITE@GOTPAGEOFF]
Lloh12:
	adrp	x10, _ATOM_MAX_HW_I2C_READ@GOTPAGE
Lloh13:
	ldr	x10, [x10, _ATOM_MAX_HW_I2C_READ@GOTPAGEOFF]
	csel	x8, x8, x10, eq
	cbz	w25, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w27, #0
	ldr	w22, [x9]
	ldr	w28, [x8]
	mov	w8, #24
	madd	x8, x24, x8, x21
	add	x26, x8, #16
	add	x19, x8, #8
LBB0_8:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	w25, w28
	csel	w23, w25, w28, lt
	ldr	w1, [x26]
	ldr	x8, [x19]
	add	x3, x8, w27, sxtw #2
	mov	x0, x20
	mov	x2, x22
	mov	x4, x23
	bl	_amdgpu_atombios_i2c_process_i2c_ch
	cbnz	w0, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	add	w27, w27, w23
	subs	w25, w25, w23
	b.ne	LBB0_8
	b	LBB0_5
LBB0_10:
	mov	x19, x0
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_12:
	ldr	w19, [sp, #4]                   ; 4-byte Folded Reload
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_HW_I2C_WRITE,4,2               ; @HW_I2C_WRITE
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_ATOM_MAX_HW_I2C_READ,4,2       ; @ATOM_MAX_HW_I2C_READ
	.comm	_HW_I2C_READ,4,2                ; @HW_I2C_READ
	.comm	_ATOM_MAX_HW_I2C_WRITE,4,2      ; @ATOM_MAX_HW_I2C_WRITE
.subsections_via_symbols
