	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hix5hd2_i2c_irq
_hix5hd2_i2c_irq:                       ## @hix5hd2_i2c_irq
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	leaq	32(%rsi), %r14
	movq	%r14, %rdi
	callq	_spin_lock
	movq	%rbx, %rdi
	callq	_hix5hd2_i2c_clr_pend_irq
	movq	_I2C_ARBITRATE_INTR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.1:
	movl	48(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	movq	_I2C_ACK_INTR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	movl	48(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, (%rbx)
LBB0_9:
	movq	_HIX5I2C_STAT_RW_ERR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
LBB0_14:
	movq	8(%rbx), %rax
	movq	_HIX5I2C_STAT_RW_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.15:
	movq	40(%rbx), %rcx
	movq	8(%rcx), %rcx
	cmpq	24(%rbx), %rcx
	je	LBB0_17
LBB0_16:
	movq	_HIX5I2C_STAT_RW_ERR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
LBB0_17:
	movq	%rbx, %rdi
	callq	_hix5hd2_i2c_disable_irq
	movq	%rbx, %rdi
	callq	_hix5hd2_i2c_clr_pend_irq
	addq	$36, %rbx
	movq	%rbx, %rdi
	callq	_complete
LBB0_18:
	movq	%r14, %rdi
	callq	_spin_unlock
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	movq	_I2C_OVER_INTR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_14
## %bb.6:
	cmpq	$0, 16(%rbx)
	jle	LBB0_13
## %bb.7:
	movq	%rbx, %rdi
	callq	_hix5hd2_rw_preprocess
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	movl	%eax, (%rbx)
	jmp	LBB0_9
LBB0_13:
	movq	%rbx, %rdi
	callq	_hix5hd2_rw_over
	jmp	LBB0_14
LBB0_10:
	movq	40(%rbx), %rax
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_12
## %bb.11:
	movq	%rbx, %rdi
	callq	_hix5hd2_read_handle
	jmp	LBB0_14
LBB0_12:
	movq	%rbx, %rdi
	callq	_hix5hd2_write_handle
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_ARBITRATE_INTR,4,2         ## @I2C_ARBITRATE_INTR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ARB bus loss\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_HIX5I2C_STAT_RW_ERR,8,3        ## @HIX5I2C_STAT_RW_ERR
	.comm	_I2C_ACK_INTR,4,2               ## @I2C_ACK_INTR
L_.str.1:                               ## @.str.1
	.asciz	"No ACK from device\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_I2C_OVER_INTR,4,2              ## @I2C_OVER_INTR
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_HIX5I2C_STAT_RW_SUCCESS,8,3    ## @HIX5I2C_STAT_RW_SUCCESS
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_hix5hd2_i2c_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hix5hd2_i2c_irq
_hix5hd2_i2c_irq:                       ; @hix5hd2_i2c_irq
	.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
	mov	x20, x1
	add	x19, x1, #32
	mov	x0, x19
	bl	_spin_lock
	mov	x0, x20
	bl	_hix5hd2_i2c_clr_pend_irq
Lloh0:
	adrp	x8, _I2C_ARBITRATE_INTR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I2C_ARBITRATE_INTR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x21, _HIX5I2C_STAT_RW_ERR@GOTPAGE
Lloh4:
	ldr	x21, [x21, _HIX5I2C_STAT_RW_ERR@GOTPAGEOFF]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x20, #48]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh7:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
Lloh9:
	adrp	x8, _I2C_ACK_INTR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _I2C_ACK_INTR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.3:
	ldr	w0, [x20, #48]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
Lloh14:
	adrp	x8, _ENXIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x20]
LBB0_5:
	ldr	x8, [x21]
	str	x8, [x20, #8]
LBB0_6:
	ldr	x8, [x20, #8]
Lloh16:
	adrp	x9, _HIX5I2C_STAT_RW_SUCCESS@GOTPAGE
Lloh17:
	ldr	x9, [x9, _HIX5I2C_STAT_RW_SUCCESS@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	ldr	x9, [x20, #40]
	ldr	x9, [x9, #8]
	ldr	x10, [x20, #24]
	ldr	x11, [x21]
	cmp	x9, x10
	ccmp	x8, x11, #4, ne
	b.eq	LBB0_9
	b	LBB0_10
LBB0_8:
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_10
LBB0_9:
	mov	x0, x20
	bl	_hix5hd2_i2c_disable_irq
	mov	x0, x20
	bl	_hix5hd2_i2c_clr_pend_irq
	add	x0, x20, #36
	bl	_complete
LBB0_10:
	mov	x0, x19
	bl	_spin_unlock
Lloh19:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	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_11:
Lloh22:
	adrp	x8, _I2C_OVER_INTR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _I2C_OVER_INTR@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.12:
	ldr	x8, [x20, #16]
	mov	x0, x20
	cmp	x8, #1
	b.lt	LBB0_15
; %bb.13:
	bl	_hix5hd2_rw_preprocess
	cbz	w0, LBB0_16
; %bb.14:
	str	w0, [x20]
	b	LBB0_5
LBB0_15:
	bl	_hix5hd2_rw_over
	b	LBB0_6
LBB0_16:
	ldr	x8, [x20, #40]
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh26:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	mov	x0, x20
	tst	w9, w8
	b.eq	LBB0_18
; %bb.17:
	bl	_hix5hd2_read_handle
	b	LBB0_6
LBB0_18:
	bl	_hix5hd2_write_handle
	b	LBB0_6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_ARBITRATE_INTR,4,2         ; @I2C_ARBITRATE_INTR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ARB bus loss\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_HIX5I2C_STAT_RW_ERR,8,3        ; @HIX5I2C_STAT_RW_ERR
	.comm	_I2C_ACK_INTR,4,2               ; @I2C_ACK_INTR
l_.str.1:                               ; @.str.1
	.asciz	"No ACK from device\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_I2C_OVER_INTR,4,2              ; @I2C_OVER_INTR
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_HIX5I2C_STAT_RW_SUCCESS,8,3    ; @HIX5I2C_STAT_RW_SUCCESS
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_hix5hd2_i2c_irq
.subsections_via_symbols
