	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdns_i2c_master_xfer
_cdns_i2c_master_xfer:                  ## @cdns_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, %r14d
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movl	12(%r12), %edi
	callq	_pm_runtime_get_sync
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	_CDNS_I2C_SR_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cdns_i2c_readreg
	movq	_CDNS_I2C_SR_BA@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.3:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_24:
	movl	12(%r12), %edi
	callq	_pm_runtime_mark_last_busy
	movl	12(%r12), %edi
	callq	_pm_runtime_put_autosuspend
	jmp	LBB0_25
LBB0_1:
	movl	%eax, %r14d
LBB0_25:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	cmpl	$2, %r14d
	jl	LBB0_12
## %bb.6:
	movq	_CDNS_I2C_BROKEN_HOLD_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_11
## %bb.7:
	leal	-1(%r14), %eax
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	testl	%ecx, (%r13,%rdx,4)
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_9 Depth=1
	incq	%rdx
	cmpq	%rax, %rdx
	jb	LBB0_9
LBB0_11:
	movl	$1, 4(%r12)
	movq	_CDNS_I2C_CR_OFFSET@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_cdns_i2c_readreg
	movq	_CDNS_I2C_CR_HOLD@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%rbx), %esi
	movl	%eax, %edi
	callq	_cdns_i2c_writereg
	testl	%r14d, %r14d
	jg	LBB0_14
	jmp	LBB0_24
LBB0_12:
	movl	$0, 4(%r12)
	testl	%r14d, %r14d
	jle	LBB0_24
LBB0_14:
	movl	%r14d, %ebx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$1, %ebx
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	$0, 4(%r12)
LBB0_17:                                ##   in Loop: Header=BB0_15 Depth=1
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_cdns_i2c_process_msg
	testl	%eax, %eax
	jne	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_15 Depth=1
	cmpl	$0, 8(%r12)
	jne	LBB0_20
## %bb.23:                              ##   in Loop: Header=BB0_15 Depth=1
	addq	$4, %r13
	decl	%ebx
	jne	LBB0_15
	jmp	LBB0_24
LBB0_18:
	movl	%eax, %r14d
	jmp	LBB0_24
LBB0_20:
	movq	%r15, %rdi
	callq	_cdns_i2c_master_reset
	movq	_CDNS_I2C_IXR_NACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r12)
	je	LBB0_22
## %bb.21:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_10:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_22:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_CDNS_I2C_SR_OFFSET,4,2         ## @CDNS_I2C_SR_OFFSET
	.comm	_CDNS_I2C_SR_BA,4,2             ## @CDNS_I2C_SR_BA
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_CDNS_I2C_BROKEN_HOLD_BIT,4,2   ## @CDNS_I2C_BROKEN_HOLD_BIT
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't do repeated start after a receive message\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_CDNS_I2C_CR_OFFSET,4,2         ## @CDNS_I2C_CR_OFFSET
	.comm	_CDNS_I2C_CR_HOLD,4,2           ## @CDNS_I2C_CR_HOLD
	.comm	_CDNS_I2C_IXR_NACK,4,2          ## @CDNS_I2C_IXR_NACK
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_cdns_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 cdns_i2c_master_xfer
_cdns_i2c_master_xfer:                  ; @cdns_i2c_master_xfer
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	mov	x22, x1
	mov	x21, x0
	ldr	x19, [x0, #8]
	ldr	w0, [x19, #12]
	bl	_pm_runtime_get_sync
	tbnz	w0, #31, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _CDNS_I2C_SR_OFFSET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CDNS_I2C_SR_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_cdns_i2c_readreg
Lloh3:
	adrp	x8, _CDNS_I2C_SR_BA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CDNS_I2C_SR_BA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.2:
Lloh6:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	ldr	w0, [x19, #12]
	bl	_pm_runtime_mark_last_busy
	ldr	w0, [x19, #12]
	bl	_pm_runtime_put_autosuspend
	b	LBB0_6
LBB0_5:
	mov	x20, x0
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_7:
	cmp	w20, #2
	b.lt	LBB0_13
; %bb.8:
Lloh8:
	adrp	x8, _CDNS_I2C_BROKEN_HOLD_BIT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CDNS_I2C_BROKEN_HOLD_BIT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x19]
	tst	w8, w9
	b.eq	LBB0_12
; %bb.9:
	mov	x8, #0
	sub	w9, w20, #1
Lloh11:
	adrp	x10, _I2C_M_RD@GOTPAGE
Lloh12:
	ldr	x10, [x10, _I2C_M_RD@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x22, x8, lsl #2]
	tst	w10, w11
	b.ne	LBB0_23
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x8, x8, #1
	cmp	x8, x9
	b.lo	LBB0_10
LBB0_12:
	mov	w8, #1
	str	w8, [x19, #4]
Lloh14:
	adrp	x23, _CDNS_I2C_CR_OFFSET@GOTPAGE
Lloh15:
	ldr	x23, [x23, _CDNS_I2C_CR_OFFSET@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_cdns_i2c_readreg
Lloh16:
	adrp	x8, _CDNS_I2C_CR_HOLD@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CDNS_I2C_CR_HOLD@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	w1, [x23]
	bl	_cdns_i2c_writereg
	cmp	w20, #1
	b.ge	LBB0_14
	b	LBB0_4
LBB0_13:
	str	wzr, [x19, #4]
	cmp	w20, #1
	b.lt	LBB0_4
LBB0_14:
	mov	x23, x20
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	cmp	w23, #1
	b.ne	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	str	wzr, [x19, #4]
LBB0_17:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_cdns_i2c_process_msg
	cbnz	w0, LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_15 Depth=1
	add	x22, x22, #4
	subs	w23, w23, #1
	b.ne	LBB0_15
	b	LBB0_4
LBB0_20:
	mov	x20, x0
	b	LBB0_4
LBB0_21:
	mov	x0, x21
	bl	_cdns_i2c_master_reset
	ldr	w8, [x19, #8]
Lloh19:
	adrp	x9, _CDNS_I2C_IXR_NACK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _CDNS_I2C_IXR_NACK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_24
; %bb.22:
Lloh22:
	adrp	x8, _ENXIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_3
LBB0_23:
	ldr	w0, [x21]
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh26:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_3
LBB0_24:
Lloh28:
	adrp	x8, _EIO@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_CDNS_I2C_SR_OFFSET,4,2         ; @CDNS_I2C_SR_OFFSET
	.comm	_CDNS_I2C_SR_BA,4,2             ; @CDNS_I2C_SR_BA
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_CDNS_I2C_BROKEN_HOLD_BIT,4,2   ; @CDNS_I2C_BROKEN_HOLD_BIT
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't do repeated start after a receive message\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_CDNS_I2C_CR_OFFSET,4,2         ; @CDNS_I2C_CR_OFFSET
	.comm	_CDNS_I2C_CR_HOLD,4,2           ; @CDNS_I2C_CR_HOLD
	.comm	_CDNS_I2C_IXR_NACK,4,2          ; @CDNS_I2C_IXR_NACK
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_cdns_i2c_master_xfer
.subsections_via_symbols
