	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aspeed_i2c_master_xfer
_aspeed_i2c_master_xfer:                ## @aspeed_i2c_master_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r12
	callq	_i2c_get_adapdata
	movq	%rax, %r13
	leaq	20(%rax), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	$0, 64(%r13)
	cmpq	$0, 32(%r13)
	je	LBB0_1
LBB0_4:
	movq	$0, 64(%r13)
	movq	%r12, 56(%r13)
	movq	$0, 48(%r13)
	movl	%r15d, (%r13)
	movq	%r13, %rbx
	addq	$44, %rbx
	movq	%rbx, %rdi
	callq	_reinit_completion
	movq	%r13, %rdi
	callq	_aspeed_i2c_do_start
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	40(%r13), %esi
	movq	%rbx, %rdi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_5
## %bb.11:
	movl	16(%r13), %eax
	jmp	LBB0_12
LBB0_1:
	movq	_ASPEED_I2C_CMD_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	24(%r13), %rdi
	callq	_readl
	movq	_ASPEED_I2CD_BUS_BUSY_STS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.2:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r13, %rdi
	callq	_aspeed_i2c_recover_bus
	testl	%eax, %eax
	jne	LBB0_12
## %bb.3:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	jmp	LBB0_4
LBB0_5:
	cmpq	$0, 32(%r13)
	je	LBB0_8
## %bb.6:
	movq	_ASPEED_I2C_CMD_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	24(%r13), %rdi
	callq	_readl
	movq	_ASPEED_I2CD_BUS_BUSY_STS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movq	%r13, %rdi
	callq	_aspeed_i2c_recover_bus
LBB0_8:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r13), %rax
	movq	_ASPEED_I2C_MASTER_PENDING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	_ASPEED_I2C_MASTER_INACTIVE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r13)
LBB0_10:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ASPEED_I2C_CMD_REG,8,3         ## @ASPEED_I2C_CMD_REG
	.comm	_ASPEED_I2CD_BUS_BUSY_STS,4,2   ## @ASPEED_I2CD_BUS_BUSY_STS
	.comm	_ASPEED_I2C_MASTER_PENDING,8,3  ## @ASPEED_I2C_MASTER_PENDING
	.comm	_ASPEED_I2C_MASTER_INACTIVE,8,3 ## @ASPEED_I2C_MASTER_INACTIVE
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_aspeed_i2c_master_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aspeed_i2c_master_xfer
_aspeed_i2c_master_xfer:                ; @aspeed_i2c_master_xfer
	.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	x21, x2
	mov	x22, x1
	bl	_i2c_get_adapdata
	mov	x19, x0
	add	x20, x0, #20
	mov	x0, x20
	bl	_spin_lock_irqsave
	str	xzr, [x19, #64]
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_3
LBB0_1:
	stp	x22, xzr, [x19, #56]
	str	xzr, [x19, #48]
	add	x22, x19, #44
	str	w21, [x19]
	mov	x0, x22
	bl	_reinit_completion
	mov	x0, x19
	bl	_aspeed_i2c_do_start
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	w1, [x19, #40]
	mov	x0, x22
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w0, [x19, #16]
	b	LBB0_12
LBB0_3:
	ldr	x8, [x19, #24]
Lloh0:
	adrp	x9, _ASPEED_I2C_CMD_REG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ASPEED_I2C_CMD_REG@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh3:
	adrp	x8, _ASPEED_I2CD_BUS_BUSY_STS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ASPEED_I2CD_BUS_BUSY_STS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_1
; %bb.4:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_aspeed_i2c_recover_bus
	cbnz	w0, LBB0_12
; %bb.5:
	mov	x0, x20
	bl	_spin_lock_irqsave
	b	LBB0_1
LBB0_6:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_9
; %bb.7:
	ldr	x8, [x19, #24]
Lloh6:
	adrp	x9, _ASPEED_I2C_CMD_REG@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ASPEED_I2C_CMD_REG@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh9:
	adrp	x8, _ASPEED_I2CD_BUS_BUSY_STS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ASPEED_I2CD_BUS_BUSY_STS@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_aspeed_i2c_recover_bus
LBB0_9:
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
Lloh12:
	adrp	x9, _ASPEED_I2C_MASTER_PENDING@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ASPEED_I2C_MASTER_PENDING@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:
Lloh15:
	adrp	x8, _ASPEED_I2C_MASTER_INACTIVE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ASPEED_I2C_MASTER_INACTIVE@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	str	x8, [x19, #8]
LBB0_11:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh18:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_ASPEED_I2C_CMD_REG,8,3         ; @ASPEED_I2C_CMD_REG
	.comm	_ASPEED_I2CD_BUS_BUSY_STS,4,2   ; @ASPEED_I2CD_BUS_BUSY_STS
	.comm	_ASPEED_I2C_MASTER_PENDING,8,3  ; @ASPEED_I2C_MASTER_PENDING
	.comm	_ASPEED_I2C_MASTER_INACTIVE,8,3 ; @ASPEED_I2C_MASTER_INACTIVE
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_aspeed_i2c_master_xfer
.subsections_via_symbols
