	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_sirfsoc_irq
_i2c_sirfsoc_irq:                       ## @i2c_sirfsoc_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	_SIRFSOC_I2C_STATUS@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	16(%rsi), %rdi
	callq	_readl
	movl	%eax, %r14d
	movq	_SIRFSOC_I2C_STAT_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	testl	%r14d, %edi
	je	LBB0_8
## %bb.1:
	movq	_SIRFSOC_I2C_ERR_NOACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%rbx)
	movq	(%r15), %rsi
	addq	16(%rbx), %rsi
	callq	_writel
	movq	_SIRFSOC_I2C_STAT_NACK@GOTPCREL(%rip), %rax
	leaq	40(%rbx), %rdi
	testl	%r14d, (%rax)
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	jmp	LBB0_4
LBB0_8:
	movq	_SIRFSOC_I2C_STAT_CMD_DONE@GOTPCREL(%rip), %r12
	testl	%r14d, (%r12)
	je	LBB0_15
## %bb.9:
	cmpq	$0, 32(%rbx)
	je	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	callq	_i2c_sirfsoc_read_data
LBB0_11:
	movq	(%rbx), %rax
	cmpq	8(%rbx), %rax
	jne	LBB0_13
## %bb.12:
	leaq	24(%rbx), %rdi
	callq	_complete
	jmp	LBB0_14
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
LBB0_4:
	movq	_SIRFSOC_I2C_CTRL@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	16(%rbx), %rdi
	callq	_readl
	movq	_SIRFSOC_I2C_RESET@GOTPCREL(%rip), %r15
	orl	(%r15), %eax
	movq	(%r14), %rsi
	addq	16(%rbx), %rsi
	movl	%eax, %edi
	callq	_writel
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	addq	16(%rbx), %rdi
	callq	_readl
	testl	%eax, (%r15)
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	xorl	%eax, %eax
	callq	_cpu_relax
	jmp	LBB0_6
LBB0_7:
	addq	$24, %rbx
	movq	%rbx, %rdi
	callq	_complete
	jmp	LBB0_15
LBB0_13:
	movq	%rbx, %rdi
	callq	_i2c_sirfsoc_queue_cmd
LBB0_14:
	movl	(%r12), %edi
	movq	(%r15), %rsi
	addq	16(%rbx), %rsi
	callq	_writel
LBB0_15:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIRFSOC_I2C_STATUS,8,3         ## @SIRFSOC_I2C_STATUS
	.comm	_SIRFSOC_I2C_STAT_ERR,4,2       ## @SIRFSOC_I2C_STAT_ERR
	.comm	_SIRFSOC_I2C_ERR_NOACK,4,2      ## @SIRFSOC_I2C_ERR_NOACK
	.comm	_SIRFSOC_I2C_STAT_NACK,4,2      ## @SIRFSOC_I2C_STAT_NACK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ACK not received\n"

L_.str.1:                               ## @.str.1
	.asciz	"I2C error\n"

	.comm	_SIRFSOC_I2C_CTRL,8,3           ## @SIRFSOC_I2C_CTRL
	.comm	_SIRFSOC_I2C_RESET,4,2          ## @SIRFSOC_I2C_RESET
	.comm	_SIRFSOC_I2C_STAT_CMD_DONE,4,2  ## @SIRFSOC_I2C_STAT_CMD_DONE
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_i2c_sirfsoc_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_sirfsoc_irq
_i2c_sirfsoc_irq:                       ; @i2c_sirfsoc_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	x19, x1
	ldr	x8, [x1, #16]
Lloh0:
	adrp	x21, _SIRFSOC_I2C_STATUS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SIRFSOC_I2C_STATUS@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	mov	x20, x0
Lloh2:
	adrp	x8, _SIRFSOC_I2C_STAT_ERR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SIRFSOC_I2C_STAT_ERR@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	tst	w0, w20
	b.eq	LBB0_3
; %bb.1:
Lloh5:
	adrp	x8, _SIRFSOC_I2C_ERR_NOACK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SIRFSOC_I2C_ERR_NOACK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19, #44]
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel
Lloh8:
	adrp	x8, _SIRFSOC_I2C_STAT_NACK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SIRFSOC_I2C_STAT_NACK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	add	x0, x19, #40
	tst	w8, w20
	b.eq	LBB0_8
; %bb.2:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	b	LBB0_9
LBB0_3:
Lloh13:
	adrp	x22, _SIRFSOC_I2C_STAT_CMD_DONE@GOTPAGE
Lloh14:
	ldr	x22, [x22, _SIRFSOC_I2C_STAT_CMD_DONE@GOTPAGEOFF]
	ldr	w8, [x22]
	tst	w8, w20
	b.eq	LBB0_15
; %bb.4:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_i2c_sirfsoc_read_data
LBB0_6:
	ldp	x8, x9, [x19]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.7:
	add	x0, x19, #24
	bl	_complete
	b	LBB0_14
LBB0_8:
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_9:
	ldr	x8, [x19, #16]
Lloh17:
	adrp	x20, _SIRFSOC_I2C_CTRL@GOTPAGE
Lloh18:
	ldr	x20, [x20, _SIRFSOC_I2C_CTRL@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh19:
	adrp	x21, _SIRFSOC_I2C_RESET@GOTPAGE
Lloh20:
	ldr	x21, [x21, _SIRFSOC_I2C_RESET@GOTPAGEOFF]
	ldr	w8, [x21]
	orr	w0, w8, w0
	ldr	x8, [x19, #16]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writel
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x21]
	tst	w8, w0
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	bl	_cpu_relax
	b	LBB0_10
LBB0_12:
	add	x0, x19, #24
	bl	_complete
	b	LBB0_15
LBB0_13:
	mov	x0, x19
	bl	_i2c_sirfsoc_queue_cmd
LBB0_14:
	ldr	w0, [x22]
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel
LBB0_15:
Lloh21:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh22:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh23:
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_SIRFSOC_I2C_STATUS,8,3         ; @SIRFSOC_I2C_STATUS
	.comm	_SIRFSOC_I2C_STAT_ERR,4,2       ; @SIRFSOC_I2C_STAT_ERR
	.comm	_SIRFSOC_I2C_ERR_NOACK,4,2      ; @SIRFSOC_I2C_ERR_NOACK
	.comm	_SIRFSOC_I2C_STAT_NACK,4,2      ; @SIRFSOC_I2C_STAT_NACK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ACK not received\n"

l_.str.1:                               ; @.str.1
	.asciz	"I2C error\n"

	.comm	_SIRFSOC_I2C_CTRL,8,3           ; @SIRFSOC_I2C_CTRL
	.comm	_SIRFSOC_I2C_RESET,4,2          ; @SIRFSOC_I2C_RESET
	.comm	_SIRFSOC_I2C_STAT_CMD_DONE,4,2  ; @SIRFSOC_I2C_STAT_CMD_DONE
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_i2c_sirfsoc_irq
.subsections_via_symbols
