	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function meson_i2c_irq
_meson_i2c_irq:                         ## @meson_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	%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
	movq	%rsi, %rbx
	leaq	24(%rsi), %r14
	movq	%r14, %rdi
	callq	_spin_lock
	movq	%rbx, %rdi
	callq	_meson_i2c_reset_tokens
	movq	_REG_CTRL@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	movq	_REG_CTRL_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_meson_i2c_set_mask
	movq	(%r12), %rdi
	addq	48(%rbx), %rdi
	callq	_readl
	movl	%eax, %r15d
	movl	44(%rbx), %edi
	movq	(%rbx), %rdx
	movq	8(%rbx), %rcx
	movq	16(%rbx), %r8
	leaq	L_.str(%rip), %rsi
	movl	%eax, %r9d
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	(%rbx), %rax
	movq	_STATE_IDLE@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	jne	LBB0_2
## %bb.1:
	movq	_IRQ_NONE@GOTPCREL(%rip), %rbx
	jmp	LBB0_11
LBB0_2:
	movq	_REG_CTRL_ERROR@GOTPCREL(%rip), %rcx
	testl	%r15d, (%rcx)
	je	LBB0_4
## %bb.3:
	movl	44(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_ENXIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	movl	%r15d, 40(%rbx)
	jmp	LBB0_8
LBB0_4:
	movq	_STATE_READ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.5:
	movq	16(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.6:
	movq	8(%rbx), %rsi
	movq	32(%rbx), %rax
	addq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_meson_i2c_get_data
LBB0_7:
	movq	8(%rbx), %rax
	addq	16(%rbx), %rax
	movq	32(%rbx), %rcx
	movq	%rax, 8(%rbx)
	cmpq	8(%rcx), %rax
	jge	LBB0_8
## %bb.9:
	movq	%rbx, %rdi
	callq	_meson_i2c_prepare_xfer
	movq	(%r12), %rsi
	movq	_REG_CTRL_START@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	%ecx, %edx
	callq	_meson_i2c_set_mask
	jmp	LBB0_10
LBB0_8:
	movq	(%r13), %rax
	movq	%rax, (%rbx)
	addq	$28, %rbx
	movq	%rbx, %rdi
	callq	_complete
LBB0_10:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rbx
LBB0_11:
	movq	%r14, %rdi
	callq	_spin_unlock
	movl	(%rbx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_CTRL,8,3                   ## @REG_CTRL
	.comm	_REG_CTRL_START,4,2             ## @REG_CTRL_START
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"irq: state %d, pos %d, count %d, ctrl %08x\n"

	.comm	_STATE_IDLE,8,3                 ## @STATE_IDLE
	.comm	_IRQ_NONE,4,2                   ## @IRQ_NONE
	.comm	_REG_CTRL_ERROR,4,2             ## @REG_CTRL_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"error bit set\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_STATE_READ,8,3                 ## @STATE_READ
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_meson_i2c_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function meson_i2c_irq
_meson_i2c_irq:                         ; @meson_i2c_irq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x1
	add	x19, x1, #24
	mov	x0, x19
	bl	_spin_lock
	mov	x0, x20
	bl	_meson_i2c_reset_tokens
Lloh0:
	adrp	x22, _REG_CTRL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _REG_CTRL@GOTPAGEOFF]
	ldr	x1, [x22]
Lloh2:
	adrp	x23, _REG_CTRL_START@GOTPAGE
Lloh3:
	ldr	x23, [x23, _REG_CTRL_START@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x20
	mov	w3, #0
	bl	_meson_i2c_set_mask
	ldr	x8, [x20, #48]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
	mov	x21, x0
	ldr	w0, [x20, #44]
	ldr	q0, [x20]
	ldr	x8, [x20, #16]
	stp	x8, x21, [sp, #16]
	str	q0, [sp]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	x8, [x20]
Lloh6:
	adrp	x24, _STATE_IDLE@GOTPAGE
Lloh7:
	ldr	x24, [x24, _STATE_IDLE@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh8:
	adrp	x20, _IRQ_NONE@GOTPAGE
Lloh9:
	ldr	x20, [x20, _IRQ_NONE@GOTPAGEOFF]
	b	LBB0_12
LBB0_2:
Lloh10:
	adrp	x9, _REG_CTRL_ERROR@GOTPAGE
Lloh11:
	ldr	x9, [x9, _REG_CTRL_ERROR@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w21
	b.eq	LBB0_4
; %bb.3:
	ldr	w0, [x20, #44]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
Lloh15:
	adrp	x8, _ENXIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x20, #40]
	ldr	x8, [x24]
	str	x8, [x20]
	add	x0, x20, #28
	b	LBB0_10
LBB0_4:
Lloh18:
	adrp	x9, _STATE_READ@GOTPAGE
Lloh19:
	ldr	x9, [x9, _STATE_READ@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	ldr	x2, [x20, #16]
	cbz	x2, LBB0_7
; %bb.6:
	ldr	x8, [x20, #32]
	ldr	x8, [x8]
	ldr	x9, [x20, #8]
	add	x1, x9, x8
	mov	x0, x20
	bl	_meson_i2c_get_data
LBB0_7:
	ldp	x9, x8, [x20, #8]
	ldr	x10, [x20, #32]
	ldr	x10, [x10, #8]
	add	x8, x9, x8
	cmp	x8, x10
	str	x8, [x20, #8]
	b.ge	LBB0_9
; %bb.8:
	mov	x0, x20
	bl	_meson_i2c_prepare_xfer
	ldr	x1, [x22]
	ldr	w2, [x23]
	mov	x0, x20
	mov	x3, x2
	bl	_meson_i2c_set_mask
	b	LBB0_11
LBB0_9:
	ldr	x8, [x24]
	str	x8, [x20], #28
	mov	x0, x20
LBB0_10:
	bl	_complete
LBB0_11:
Lloh21:
	adrp	x20, _IRQ_HANDLED@GOTPAGE
Lloh22:
	ldr	x20, [x20, _IRQ_HANDLED@GOTPAGEOFF]
LBB0_12:
	mov	x0, x19
	bl	_spin_unlock
	ldr	w0, [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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_CTRL,8,3                   ; @REG_CTRL
	.comm	_REG_CTRL_START,4,2             ; @REG_CTRL_START
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"irq: state %d, pos %d, count %d, ctrl %08x\n"

	.comm	_STATE_IDLE,8,3                 ; @STATE_IDLE
	.comm	_IRQ_NONE,4,2                   ; @IRQ_NONE
	.comm	_REG_CTRL_ERROR,4,2             ; @REG_CTRL_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"error bit set\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_STATE_READ,8,3                 ; @STATE_READ
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_meson_i2c_irq
.subsections_via_symbols
