	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function img_i2c_xfer
_img_i2c_xfer:                          ## @img_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	$72, %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
	movq	%rdi, %r15
	callq	_i2c_get_adapdata
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	_MODE_SUSPEND@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_WARN
	jmp	LBB0_3
LBB0_2:
	movq	_MODE_FATAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	testl	%r14d, %r14d
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_23
## %bb.6:
	movq	_I2C_M_IGNORE_NAK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%r14d, %r15d
	xorl	%edx, %edx
	xorl	%r13d, %r13d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_10 Depth=1
	testl	%esi, %ecx
	jne	LBB0_3
LBB0_8:                                 ##   in Loop: Header=BB0_10 Depth=1
	movl	$1, %r13d
LBB0_9:                                 ##   in Loop: Header=BB0_10 Depth=1
	incq	%rdx
	cmpq	%rdx, %r15
	je	LBB0_12
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$0, 4(%rbx,%rdx,8)
	movl	(%rbx,%rdx,8), %esi
	je	LBB0_7
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	testl	%esi, %eax
	jne	LBB0_8
	jmp	LBB0_9
LBB0_12:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_pm_runtime_get_sync
	testl	%eax, %eax
	js	LBB0_25
## %bb.13:
	leaq	24(%r12), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	leal	-1(%r14), %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	leaq	20(%r12), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, %rax
	addq	$16, %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	decq	%r15
	xorl	%r14d, %r14d
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_lock_irqsave
	movq	(%rbx,%r14,8), %rax
	movq	%rax, 28(%r12)
	movl	$0, 8(%r12)
	xorl	%eax, %eax
	cmpq	%r14, -104(%rbp)                ## 8-byte Folded Reload
	sete	%al
	movl	%eax, 12(%r12)
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_reinit_completion
	movq	_SCB_INT_CLEAR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$-1, %edx
	callq	_img_i2c_writel
	movq	_SCB_CLEAR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$-1, %edx
	callq	_img_i2c_writel
	testl	%r13d, %r13d
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%r12, %rdi
	callq	_img_i2c_atomic_start
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	xorl	%esi, %esi
	cmpl	$0, 12(%r12)
	sete	%sil
	movq	%r12, %rdi
	callq	_img_i2c_transaction_halt
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx,%r14,8)
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%r12, %rdi
	callq	_img_i2c_read
	jmp	LBB0_19
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	%r12, %rdi
	callq	_img_i2c_write
LBB0_19:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_img_i2c_transaction_halt
	xorl	%esi, %esi
	cmpl	$0, 12(%r12)
	sete	%sil
	movq	%r12, %rdi
	callq	_img_i2c_transaction_halt
LBB0_20:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	movq	_IMG_I2C_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_wait_for_completion_timeout
	movq	%rax, %r13
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_del_timer_sync
	testq	%r13, %r13
	je	LBB0_26
## %bb.21:                              ##   in Loop: Header=BB0_14 Depth=1
	cmpl	$0, 8(%r12)
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_27
## %bb.22:                              ##   in Loop: Header=BB0_14 Depth=1
	leaq	1(%r14), %rax
	cmpq	%r14, %r15
	movq	%rax, %r14
	jne	LBB0_14
	jmp	LBB0_27
LBB0_23:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movl	(%r15), %edi
	callq	_pm_runtime_get_sync
	testl	%eax, %eax
	jns	LBB0_27
LBB0_25:
                                        ## kill: def $eax killed $eax def $rax
	jmp	LBB0_4
LBB0_26:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 8(%r12)
LBB0_27:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %edi
	callq	_pm_runtime_mark_last_busy
	movl	(%r14), %edi
	callq	_pm_runtime_put_autosuspend
	movl	8(%r12), %ecx
	testl	%ecx, %ecx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmovnel	%ecx, %eax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_MODE_SUSPEND,8,3               ## @MODE_SUSPEND
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"refusing to service transaction in suspended state\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_MODE_FATAL,8,3                 ## @MODE_FATAL
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_I2C_M_IGNORE_NAK,4,2           ## @I2C_M_IGNORE_NAK
	.comm	_SCB_INT_CLEAR_REG,4,2          ## @SCB_INT_CLEAR_REG
	.comm	_SCB_CLEAR_REG,4,2              ## @SCB_CLEAR_REG
	.comm	_IMG_I2C_TIMEOUT,4,2            ## @IMG_I2C_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"i2c transfer timed out\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_img_i2c_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function img_i2c_xfer
_img_i2c_xfer:                          ; @img_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	x23, x2
	mov	x22, x1
	mov	x21, x0
	bl	_i2c_get_adapdata
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _MODE_SUSPEND@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MODE_SUSPEND@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_WARN
	b	LBB0_3
LBB0_2:
Lloh5:
	adrp	x9, _MODE_FATAL@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MODE_FATAL@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
LBB0_3:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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_5:
	mov	x20, x0
	subs	w27, w23, #1
	b.lt	LBB0_23
; %bb.6:
	mov	w28, #0
Lloh11:
	adrp	x8, _I2C_M_IGNORE_NAK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _I2C_M_IGNORE_NAK@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh15:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	mov	w19, w23
	add	x10, x22, #4
	mov	x11, x19
	b	LBB0_10
LBB0_7:                                 ;   in Loop: Header=BB0_10 Depth=1
	tst	w9, w12
	b.ne	LBB0_3
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	mov	w28, #1
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x10, x10, #8
	subs	x11, x11, #1
	b.eq	LBB0_12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldp	w12, w13, [x10, #-4]
	cbz	w13, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	tst	w8, w12
	b.ne	LBB0_8
	b	LBB0_9
LBB0_12:
	ldr	w0, [x21]
	bl	_pm_runtime_get_sync
	tbnz	w0, #31, LBB0_4
; %bb.13:
	str	w23, [sp, #12]                  ; 4-byte Folded Spill
	add	x23, x20, #24
	add	x24, x20, #20
	add	x25, x20, #16
	sub	x8, x19, #1
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	mov	x19, x8
	mov	x0, x23
	bl	_spin_lock_irqsave
	ldr	x8, [x22]
	stur	x8, [x20, #28]
	cmp	x27, #0
	cset	w8, eq
	stp	wzr, w8, [x20, #8]
	mov	x0, x24
	bl	_reinit_completion
Lloh17:
	adrp	x8, _SCB_INT_CLEAR_REG@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SCB_INT_CLEAR_REG@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #-1
	bl	_img_i2c_writel
Lloh20:
	adrp	x8, _SCB_CLEAR_REG@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SCB_CLEAR_REG@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #-1
	bl	_img_i2c_writel
	cbz	w28, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x20
	bl	_img_i2c_atomic_start
	b	LBB0_20
LBB0_16:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x20, #12]
	cmp	w8, #0
	cset	w1, eq
	mov	x0, x20
	bl	_img_i2c_transaction_halt
	ldr	w8, [x22]
Lloh23:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh24:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	mov	x0, x20
	tst	w9, w8
	b.eq	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	bl	_img_i2c_read
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_14 Depth=1
	bl	_img_i2c_write
LBB0_19:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x20
	mov	w1, #0
	bl	_img_i2c_transaction_halt
	ldr	w8, [x20, #12]
	cmp	w8, #0
	cset	w1, eq
	mov	x0, x20
	bl	_img_i2c_transaction_halt
LBB0_20:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x23
	bl	_spin_unlock_irqrestore
Lloh26:
	adrp	x8, _IMG_I2C_TIMEOUT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _IMG_I2C_TIMEOUT@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_wait_for_completion_timeout
	mov	x26, x0
	mov	x0, x25
	bl	_del_timer_sync
	cbz	x26, LBB0_24
; %bb.21:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x20, #8]
	cbnz	w8, LBB0_25
; %bb.22:                               ;   in Loop: Header=BB0_14 Depth=1
	sub	x8, x19, #1
	sub	x27, x27, #1
	add	x22, x22, #8
	cbnz	x19, LBB0_14
	b	LBB0_25
LBB0_23:
	str	w23, [sp, #12]                  ; 4-byte Folded Spill
	ldr	w0, [x21]
	bl	_pm_runtime_get_sync
	tbz	w0, #31, LBB0_25
	b	LBB0_4
LBB0_24:
	ldr	w0, [x21]
Lloh29:
	adrp	x1, l_.str.1@PAGE
Lloh30:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh31:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x20, #8]
LBB0_25:
	ldr	w0, [x21]
	bl	_pm_runtime_mark_last_busy
	ldr	w0, [x21]
	bl	_pm_runtime_put_autosuspend
	ldr	w8, [x20, #8]
	cmp	w8, #0
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	csel	w0, w9, w8, eq
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_MODE_SUSPEND,8,3               ; @MODE_SUSPEND
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"refusing to service transaction in suspended state\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_MODE_FATAL,8,3                 ; @MODE_FATAL
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_I2C_M_IGNORE_NAK,4,2           ; @I2C_M_IGNORE_NAK
	.comm	_SCB_INT_CLEAR_REG,4,2          ; @SCB_INT_CLEAR_REG
	.comm	_SCB_CLEAR_REG,4,2              ; @SCB_CLEAR_REG
	.comm	_IMG_I2C_TIMEOUT,4,2            ; @IMG_I2C_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"i2c transfer timed out\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_img_i2c_xfer
.subsections_via_symbols
