	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh7760_i2c_master_xfer
_sh7760_i2c_master_xfer:                ## @sh7760_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
	subq	$24, %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, %r12
	movq	%rdi, %r15
	movq	16(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_sh7760_i2c_busy_check
	testq	%rax, %rax
	je	LBB0_1
## %bb.21:
	movl	4(%r15), %edx
	addq	$8, %r15
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_20
LBB0_1:
	testl	%r14d, %r14d
	jle	LBB0_19
## %bb.2:
	leal	-1(%r14), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	leaq	16(%rbx), %r13
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	(%r15), %r14d
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	xorl	%eax, %eax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	-48(%rbp), %ecx                 ## 4-byte Folded Reload
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	_IDF_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	movl	%eax, 4(%rbx)
	movl	$0, (%rbx)
	movq	%r12, 8(%rbx)
	movq	%r13, %rdi
	callq	_init_completion
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	%rbx, %rdi
	callq	_sh7760_i2c_mrecv
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	%rbx, %rdi
	callq	_sh7760_i2c_msend
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	%r13, %rdi
	callq	_wait_for_completion
	movl	(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_10
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=2
	movq	_IDS_NACK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_13
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=2
	movq	_IDS_ARBLOST@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_4 Depth=2
	subl	$1, %r14d
	jb	LBB0_14
## %bb.17:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	$2, %edi
	callq	_mdelay
	jmp	LBB0_4
LBB0_18:                                ##   in Loop: Header=BB0_3 Depth=1
	addq	$4, %r12
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cmpl	%r14d, %eax
	jne	LBB0_3
	jmp	LBB0_19
LBB0_10:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_13:
	movl	$1, %edi
	callq	_mdelay
LBB0_14:
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
LBB0_11:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_19:
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
	movq	_I2CMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_OUT32
	movq	_I2CMSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_OUT32
	movq	_I2CMIER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_OUT32
	movq	_I2CFIER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_OUT32
	movq	_I2CSCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_OUT32
	movq	_I2CSAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_OUT32
	movq	_I2CSSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_OUT32
LBB0_20:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sh7760-i2c%d: bus busy!\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_IDF_STOP,4,2                   ## @IDF_STOP
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_EIO,4,2                        ## @EIO
	.comm	_IDS_NACK,4,2                   ## @IDS_NACK
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.comm	_IDS_ARBLOST,4,2                ## @IDS_ARBLOST
	.comm	_I2CMCR,4,2                     ## @I2CMCR
	.comm	_I2CMSR,4,2                     ## @I2CMSR
	.comm	_I2CMIER,4,2                    ## @I2CMIER
	.comm	_I2CFIER,4,2                    ## @I2CFIER
	.comm	_I2CSCR,4,2                     ## @I2CSCR
	.comm	_I2CSAR,4,2                     ## @I2CSAR
	.comm	_I2CSSR,4,2                     ## @I2CSSR
	.no_dead_strip	_sh7760_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 sh7760_i2c_master_xfer
_sh7760_i2c_master_xfer:                ; @sh7760_i2c_master_xfer
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x2
	mov	x22, x1
	mov	x21, x0
	ldr	x19, [x0, #16]
	mov	x0, x19
	bl	_sh7760_i2c_busy_check
	cbz	x0, LBB0_2
; %bb.1:
	add	x0, x21, #8
	ldr	w2, [x21, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_19
LBB0_2:
	subs	w24, w20, #1
	b.lt	LBB0_18
; %bb.3:
	mov	w25, #0
	add	x23, x19, #16
Lloh5:
	adrp	x26, _IDF_STOP@GOTPAGE
Lloh6:
	ldr	x26, [x26, _IDF_STOP@GOTPAGEOFF]
Lloh7:
	adrp	x27, _I2C_M_RD@GOTPAGE
Lloh8:
	ldr	x27, [x27, _I2C_M_RD@GOTPAGEOFF]
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldr	w28, [x21]
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x26]
	cmp	w25, w24
	csel	w8, w8, wzr, eq
	stp	wzr, w8, [x19]
	str	x22, [x19, #8]
	mov	x0, x23
	bl	_init_completion
	ldr	w8, [x22]
	ldr	w9, [x27]
	mov	x0, x19
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	bl	_sh7760_i2c_mrecv
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=2
	bl	_sh7760_i2c_msend
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x23
	bl	_wait_for_completion
	ldr	w8, [x19]
	cbz	w8, LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=2
Lloh9:
	adrp	x9, _IDS_NACK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IDS_NACK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=2
Lloh12:
	adrp	x9, _IDS_ARBLOST@GOTPAGE
Lloh13:
	ldr	x9, [x9, _IDS_ARBLOST@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=2
	cbz	w28, LBB0_16
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=2
	sub	w28, w28, #1
	mov	w0, #2
	bl	_mdelay
	b	LBB0_5
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, #4
	add	w25, w25, #1
	cmp	w25, w20
	b.ne	LBB0_4
	b	LBB0_18
LBB0_14:
Lloh15:
	adrp	x8, _EIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_17
LBB0_15:
	mov	w0, #1
	bl	_mdelay
LBB0_16:
Lloh17:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_18:
	stp	xzr, xzr, [x19]
Lloh19:
	adrp	x8, _I2CMCR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _I2CMCR@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_OUT32
Lloh22:
	adrp	x8, _I2CMSR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _I2CMSR@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_OUT32
Lloh25:
	adrp	x8, _I2CMIER@GOTPAGE
Lloh26:
	ldr	x8, [x8, _I2CMIER@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_OUT32
Lloh28:
	adrp	x8, _I2CFIER@GOTPAGE
Lloh29:
	ldr	x8, [x8, _I2CFIER@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_OUT32
Lloh31:
	adrp	x8, _I2CSCR@GOTPAGE
Lloh32:
	ldr	x8, [x8, _I2CSCR@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_OUT32
Lloh34:
	adrp	x8, _I2CSAR@GOTPAGE
Lloh35:
	ldr	x8, [x8, _I2CSAR@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_OUT32
Lloh37:
	adrp	x8, _I2CSSR@GOTPAGE
Lloh38:
	ldr	x8, [x8, _I2CSSR@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_OUT32
LBB0_19:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sh7760-i2c%d: bus busy!\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_IDF_STOP,4,2                   ; @IDF_STOP
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_EIO,4,2                        ; @EIO
	.comm	_IDS_NACK,4,2                   ; @IDS_NACK
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.comm	_IDS_ARBLOST,4,2                ; @IDS_ARBLOST
	.comm	_I2CMCR,4,2                     ; @I2CMCR
	.comm	_I2CMSR,4,2                     ; @I2CMSR
	.comm	_I2CMIER,4,2                    ; @I2CMIER
	.comm	_I2CFIER,4,2                    ; @I2CFIER
	.comm	_I2CSCR,4,2                     ; @I2CSCR
	.comm	_I2CSAR,4,2                     ; @I2CSAR
	.comm	_I2CSSR,4,2                     ; @I2CSSR
	.no_dead_strip	_sh7760_i2c_master_xfer
.subsections_via_symbols
