	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_mobile_i2c_xfer
_sh_mobile_i2c_xfer:                    ## @sh_mobile_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, %ebx
	movq	%rsi, %r15
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_i2c_get_adapdata
	movq	%rax, %r14
	movl	24(%rax), %edi
	callq	_pm_runtime_get_sync
	testl	%ebx, %ebx
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_1
## %bb.2:
	leal	-1(%rbx), %ecx
	movl	%ebx, %eax
	leaq	-4(,%rax,4), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	shlq	$2, %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%r14)
	setne	%cl
	testq	%r12, %r12
	sete	%al
	orb	%cl, %al
	leaq	(%r15,%r12), %rsi
	movb	$1, %cl
	cmpq	%r12, -64(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_I2C_M_STOP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%r15,%r12)
	setne	%cl
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movzbl	%al, %ebx
	movzbl	%cl, %eax
	movl	%eax, (%r14)
	movl	$0, 4(%r14)
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_start_ch
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_OP_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_i2c_op
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_SW_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ICSR_TACK@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	36(%r14), %edi
	andl	8(%r14), %esi
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	callq	_wait_event_timeout
	movq	%rax, %rbx
	movl	32(%r14), %edi
	movl	4(%r14), %edx
	movl	28(%r14), %esi
	callq	_i2c_put_dma_safe_msg_buf
	testq	%rbx, %rbx
	je	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, (%r14)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_poll_busy
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_poll_dte
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	leaq	4(%r12), %rax
	cmpq	%r12, -56(%rbp)                 ## 8-byte Folded Reload
	movq	%rax, %r12
	jne	LBB0_3
	jmp	LBB0_16
LBB0_1:
	xorl	%r13d, %r13d
	jmp	LBB0_16
LBB0_8:
	movl	24(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	16(%r14), %rax
	movq	_DMA_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	_sh_mobile_i2c_cleanup_dma
LBB0_10:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_16:
	movq	_ICCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ICCR_SCP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_iic_wr
	movl	24(%r14), %edi
	callq	_pm_runtime_put_sync
	testl	%r13d, %r13d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmovnel	%r13d, %eax
                                        ## kill: def $eax killed $eax killed $rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_STOP,4,2                 ## @I2C_M_STOP
	.comm	_OP_START,4,2                   ## @OP_START
	.comm	_ICSR_TACK,4,2                  ## @ICSR_TACK
	.comm	_SW_DONE,4,2                    ## @SW_DONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Transfer request timed out\n"

	.comm	_DMA_NONE,8,3                   ## @DMA_NONE
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_ICCR,4,2                       ## @ICCR
	.comm	_ICCR_SCP,4,2                   ## @ICCR_SCP
	.no_dead_strip	_sh_mobile_i2c_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh_mobile_i2c_xfer
_sh_mobile_i2c_xfer:                    ; @sh_mobile_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
	mov	x22, x0
	bl	_i2c_get_adapdata
	mov	x20, x0
	ldr	w0, [x0, #24]
	bl	_pm_runtime_get_sync
	subs	w8, w19, #1
	str	w19, [sp, #12]                  ; 4-byte Folded Spill
	b.lt	LBB0_12
; %bb.1:
	mov	x24, #0
	mov	w9, w19
	lsl	x9, x9, #2
	sub	x25, x9, #4
	lsl	x26, x8, #2
Lloh0:
	adrp	x28, _ICSR_TACK@GOTPAGE
Lloh1:
	ldr	x28, [x28, _ICSR_TACK@GOTPAGEOFF]
Lloh2:
	adrp	x19, _SW_DONE@GOTPAGE
Lloh3:
	ldr	x19, [x19, _SW_DONE@GOTPAGEOFF]
Lloh4:
	adrp	x27, _I2C_M_STOP@GOTPAGE
Lloh5:
	ldr	x27, [x27, _I2C_M_STOP@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	cmp	w8, #0
	ccmp	x24, #0, #4, eq
	cset	w23, eq
	cmp	x26, x24
	b.ne	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w8, #1
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x21, x24]
	ldr	w9, [x27]
	tst	w9, w8
	cset	w8, ne
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x1, x21, x24
	stp	w8, wzr, [x20]
	mov	x0, x20
	mov	x2, x23
	bl	_start_ch
	cbz	w23, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh6:
	adrp	x8, _OP_START@GOTPAGE
Lloh7:
	ldr	x8, [x8, _OP_START@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_i2c_op
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x20, #36]
	ldr	w8, [x20, #8]
	ldr	w9, [x28]
	ldr	w10, [x19]
	orr	w9, w10, w9
	and	w1, w9, w8
	ldr	w2, [x22]
	bl	_wait_event_timeout
	mov	x23, x0
	ldp	w1, w0, [x20, #28]
	ldr	w2, [x20, #4]
	bl	_i2c_put_dma_safe_msg_buf
	cbz	x23, LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x20]
	cbz	w8, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	bl	_poll_busy
	mov	x23, x0
	tbz	w0, #31, LBB0_11
	b	LBB0_16
LBB0_10:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	bl	_poll_dte
	mov	x23, x0
	tbnz	w0, #31, LBB0_16
LBB0_11:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x8, x24, #4
	cmp	x25, x24
	mov	x24, x8
	b.ne	LBB0_2
	b	LBB0_16
LBB0_12:
	mov	w23, #0
	b	LBB0_16
LBB0_13:
	ldr	w0, [x20, #24]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	x8, [x20, #16]
Lloh11:
	adrp	x9, _DMA_NONE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DMA_NONE@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_15
; %bb.14:
	mov	x0, x20
	bl	_sh_mobile_i2c_cleanup_dma
LBB0_15:
Lloh14:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_16:
Lloh17:
	adrp	x8, _ICCR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ICCR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _ICCR_SCP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ICCR_SCP@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_iic_wr
	ldr	w0, [x20, #24]
	bl	_pm_runtime_put_sync
	cmp	w23, #0
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	csel	w0, w8, w23, eq
	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
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_STOP,4,2                 ; @I2C_M_STOP
	.comm	_OP_START,4,2                   ; @OP_START
	.comm	_ICSR_TACK,4,2                  ; @ICSR_TACK
	.comm	_SW_DONE,4,2                    ; @SW_DONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Transfer request timed out\n"

	.comm	_DMA_NONE,8,3                   ; @DMA_NONE
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_ICCR,4,2                       ; @ICCR
	.comm	_ICCR_SCP,4,2                   ; @ICCR_SCP
	.no_dead_strip	_sh_mobile_i2c_xfer
.subsections_via_symbols
