	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function img_i2c_auto
_img_i2c_auto:                          ## @img_i2c_auto
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_INT_WRITE_ACK_ERR@GOTPCREL(%rip), %rax
	movq	_INT_ADDR_ACK_ERR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%esi, %ecx
	je	LBB0_2
## %bb.1:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
LBB0_14:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ISR_COMPLETE                   ## TAILCALL
LBB0_2:
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_LINESTAT_ABORT_DET@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_7
## %bb.3:
	movl	36(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r14)
	je	LBB0_6
## %bb.4:
	movq	_INT_FIFO_FULL_FILLING@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	callq	_img_i2c_read_fifo
LBB0_6:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 32(%r14)
	movq	%r14, %rdi
	callq	_img_i2c_stop_start
LBB0_26:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	cmpl	$0, (%r14)
	jne	LBB0_10
## %bb.8:
	movq	_LINESTAT_START_BIT_DET@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_img_i2c_transaction_halt
	movq	_INT_SLAVE_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 28(%r14)
LBB0_10:
	leaq	24(%r14), %r15
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	$1, %edi
	callq	_msecs_to_jiffies
	addq	%rax, %r12
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_mod_timer
	movq	_INT_STOP_DETECTED@GOTPCREL(%rip), %rcx
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	8(%r14), %eax
	testl	%ebx, (%rcx)
	je	LBB0_15
## %bb.11:
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	callq	_img_i2c_read_fifo
LBB0_13:
	xorl	%edi, %edi
	jmp	LBB0_14
LBB0_15:
	testl	%eax, %eax
	je	LBB0_19
## %bb.16:
	movq	_INT_FIFO_FULL_FILLING@GOTPCREL(%rip), %rax
	movq	_INT_MASTER_HALTED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%ebx, %ecx
	je	LBB0_23
## %bb.17:
	movq	%r14, %rdi
	callq	_img_i2c_read_fifo
	cmpq	$0, 16(%r14)
	jne	LBB0_23
	jmp	LBB0_18
LBB0_19:
	movq	_INT_FIFO_EMPTY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_INT_MASTER_HALTED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%eax, %ecx
	testl	%ebx, %ecx
	je	LBB0_23
## %bb.20:
	testl	%ebx, %eax
	je	LBB0_22
## %bb.21:
	cmpq	$0, 16(%r14)
	je	LBB0_18
LBB0_22:
	movq	%r14, %rdi
	callq	_img_i2c_write_fifo
LBB0_23:
	movq	_INT_MASTER_HALTED@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_24
## %bb.25:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_img_i2c_transaction_halt
	xorl	%esi, %esi
	cmpl	$0, (%r14)
	sete	%sil
	movq	%r14, %rdi
	callq	_img_i2c_transaction_halt
	jmp	LBB0_26
LBB0_24:
	xorl	%ebx, %ebx
	jmp	LBB0_26
LBB0_18:
	movq	_ISR_WAITSTOP@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_WRITE_ACK_ERR,4,2          ## @INT_WRITE_ACK_ERR
	.comm	_INT_ADDR_ACK_ERR,4,2           ## @INT_ADDR_ACK_ERR
	.comm	_EIO,4,2                        ## @EIO
	.comm	_LINESTAT_ABORT_DET,4,2         ## @LINESTAT_ABORT_DET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"abort condition detected\n"

	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_INT_FIFO_FULL_FILLING,4,2      ## @INT_FIFO_FULL_FILLING
	.comm	_LINESTAT_START_BIT_DET,4,2     ## @LINESTAT_START_BIT_DET
	.comm	_INT_SLAVE_EVENT,4,2            ## @INT_SLAVE_EVENT
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_INT_STOP_DETECTED,4,2          ## @INT_STOP_DETECTED
	.comm	_INT_MASTER_HALTED,4,2          ## @INT_MASTER_HALTED
	.comm	_ISR_WAITSTOP,4,2               ## @ISR_WAITSTOP
	.comm	_INT_FIFO_EMPTY,4,2             ## @INT_FIFO_EMPTY
	.no_dead_strip	_img_i2c_auto
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function img_i2c_auto
_img_i2c_auto:                          ; @img_i2c_auto
	.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
Lloh0:
	adrp	x8, _INT_WRITE_ACK_ERR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INT_WRITE_ACK_ERR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _INT_ADDR_ACK_ERR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _INT_ADDR_ACK_ERR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w1
	b.eq	LBB0_3
; %bb.1:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
LBB0_2:
	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
	b	_ISR_COMPLETE
LBB0_3:
	mov	x20, x1
	mov	x19, x0
Lloh9:
	adrp	x8, _LINESTAT_ABORT_DET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LINESTAT_ABORT_DET@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_10
; %bb.4:
	ldr	w0, [x19, #36]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [x19, #8]
Lloh14:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh15:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.5:
Lloh17:
	adrp	x8, _INT_FIFO_FULL_FILLING@GOTPAGE
Lloh18:
	ldr	x8, [x8, _INT_FIFO_FULL_FILLING@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_img_i2c_read_fifo
LBB0_7:
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x19, #32]
	mov	x0, x19
	bl	_img_i2c_stop_start
LBB0_8:
	mov	w0, #0
LBB0_9:
	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
LBB0_10:
	ldr	w8, [x19]
	cbnz	w8, LBB0_13
; %bb.11:
Lloh23:
	adrp	x8, _LINESTAT_START_BIT_DET@GOTPAGE
Lloh24:
	ldr	x8, [x8, _LINESTAT_START_BIT_DET@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_13
; %bb.12:
	mov	x0, x19
	mov	w1, #1
	bl	_img_i2c_transaction_halt
Lloh26:
	adrp	x8, _INT_SLAVE_EVENT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _INT_SLAVE_EVENT@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	ldr	w9, [x19, #28]
	bic	w8, w9, w8
	str	w8, [x19, #28]
LBB0_13:
	add	x21, x19, #24
Lloh29:
	adrp	x8, _jiffies@GOTPAGE
Lloh30:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh31:
	ldr	x22, [x8]
	mov	w0, #1
	bl	_msecs_to_jiffies
	add	x1, x0, x22
	mov	x0, x21
	bl	_mod_timer
Lloh32:
	adrp	x8, _INT_STOP_DETECTED@GOTPAGE
Lloh33:
	ldr	x8, [x8, _INT_STOP_DETECTED@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x8]
	ldr	w8, [x19, #8]
Lloh35:
	adrp	x10, _I2C_M_RD@GOTPAGE
Lloh36:
	ldr	x10, [x10, _I2C_M_RD@GOTPAGEOFF]
Lloh37:
	ldr	w10, [x10]
	and	w8, w10, w8
	tst	w9, w20
	b.eq	LBB0_17
; %bb.14:
	cbz	w8, LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_img_i2c_read_fifo
LBB0_16:
	mov	w0, #0
	b	LBB0_2
LBB0_17:
Lloh38:
	adrp	x21, _INT_MASTER_HALTED@GOTPAGE
Lloh39:
	ldr	x21, [x21, _INT_MASTER_HALTED@GOTPAGEOFF]
	cbz	w8, LBB0_20
; %bb.18:
Lloh40:
	adrp	x8, _INT_FIFO_FULL_FILLING@GOTPAGE
Lloh41:
	ldr	x8, [x8, _INT_FIFO_FULL_FILLING@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	ldr	w9, [x21]
	orr	w8, w9, w8
	tst	w8, w20
	b.eq	LBB0_24
; %bb.19:
	mov	x0, x19
	bl	_img_i2c_read_fifo
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_24
	b	LBB0_26
LBB0_20:
Lloh43:
	adrp	x8, _INT_FIFO_EMPTY@GOTPAGE
Lloh44:
	ldr	x8, [x8, _INT_FIFO_EMPTY@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	ldr	w9, [x21]
	orr	w9, w9, w8
	tst	w9, w20
	b.eq	LBB0_24
; %bb.21:
	tst	w8, w20
	b.eq	LBB0_23
; %bb.22:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_26
LBB0_23:
	mov	x0, x19
	bl	_img_i2c_write_fifo
LBB0_24:
	ldr	w8, [x21]
	tst	w8, w20
	b.eq	LBB0_8
; %bb.25:
	mov	x0, x19
	mov	w1, #0
	bl	_img_i2c_transaction_halt
	ldr	w8, [x19]
	cmp	w8, #0
	cset	w1, eq
	mov	x0, x19
	bl	_img_i2c_transaction_halt
	b	LBB0_8
LBB0_26:
Lloh46:
	adrp	x8, _ISR_WAITSTOP@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ISR_WAITSTOP@GOTPAGEOFF]
Lloh48:
	ldr	w0, [x8]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_WRITE_ACK_ERR,4,2          ; @INT_WRITE_ACK_ERR
	.comm	_INT_ADDR_ACK_ERR,4,2           ; @INT_ADDR_ACK_ERR
	.comm	_EIO,4,2                        ; @EIO
	.comm	_LINESTAT_ABORT_DET,4,2         ; @LINESTAT_ABORT_DET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"abort condition detected\n"

	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_INT_FIFO_FULL_FILLING,4,2      ; @INT_FIFO_FULL_FILLING
	.comm	_LINESTAT_START_BIT_DET,4,2     ; @LINESTAT_START_BIT_DET
	.comm	_INT_SLAVE_EVENT,4,2            ; @INT_SLAVE_EVENT
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_INT_STOP_DETECTED,4,2          ; @INT_STOP_DETECTED
	.comm	_INT_MASTER_HALTED,4,2          ; @INT_MASTER_HALTED
	.comm	_ISR_WAITSTOP,4,2               ; @ISR_WAITSTOP
	.comm	_INT_FIFO_EMPTY,4,2             ; @INT_FIFO_EMPTY
	.no_dead_strip	_img_i2c_auto
.subsections_via_symbols
