	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_mobile_i2c_isr
_sh_mobile_i2c_isr:                     ## @sh_mobile_i2c_isr
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	_ICSR@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_iic_rd
	movl	%eax, %r14d
	movb	(%rbx), %al
	orb	%r14b, %al
	movb	%al, (%rbx)
	movl	32(%rbx), %edi
	movq	24(%rbx), %rcx
	movq	_I2C_M_RD@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	andl	(%rcx), %edx
	leaq	L_.str.2(%rip), %rdx
	leaq	L_.str.1(%rip), %r8
	cmoveq	%rdx, %r8
	movl	4(%rbx), %r9d
	movl	4(%rcx), %ecx
	movl	%ecx, (%rsp)
	movzbl	%r14b, %edx
	movzbl	%al, %ecx
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	8(%rbx), %rax
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	cmpl	$0, 4(%rbx)
	je	LBB0_2
LBB0_3:
	movq	_ICSR_AL@GOTPCREL(%rip), %rcx
	movq	_ICSR_TACK@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	orb	(%rcx), %al
	testb	%r14b, %al
	je	LBB0_5
## %bb.4:
	movl	(%r12), %esi
	notb	%al
	andb	%r14b, %al
	movzbl	%al, %edx
	movq	%rbx, %rdi
	callq	_iic_wr
	xorl	%r15d, %r15d
	jmp	LBB0_9
LBB0_5:
	movq	24(%rbx), %rax
	movl	(%r15), %ecx
	testl	%ecx, (%rax)
	je	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	callq	_sh_mobile_i2c_isr_rx
	jmp	LBB0_8
LBB0_2:
	movq	_ICIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ICIC_TDMAE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_iic_set_clr
	jmp	LBB0_9
LBB0_7:
	movq	%rbx, %rdi
	callq	_sh_mobile_i2c_isr_tx
LBB0_8:
	movl	%eax, %r15d
LBB0_9:
	movq	8(%rbx), %rax
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.10:
	cmpl	$1, 4(%rbx)
	jne	LBB0_12
## %bb.11:
	movq	_ICIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ICIC_RDMAE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_iic_set_clr
LBB0_12:
	movq	_ICSR_WAIT@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	testb	%r14b, %al
	je	LBB0_14
## %bb.13:
	movl	(%r12), %esi
	notb	%al
	andb	%al, %r14b
	movzbl	%r14b, %edx
	movq	%rbx, %rdi
	callq	_iic_wr
LBB0_14:
	testl	%r15d, %r15d
	je	LBB0_16
## %bb.15:
	movq	_SW_DONE@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	orb	%al, (%rbx)
	leaq	16(%rbx), %rdi
	callq	_wake_up
LBB0_16:
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_iic_rd
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ICSR,4,2                       ## @ICSR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i2c_isr 0x%02x 0x%02x %s %d %d!\n"

	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
L_.str.1:                               ## @.str.1
	.asciz	"read"

L_.str.2:                               ## @.str.2
	.asciz	"write"

	.comm	_DMA_TO_DEVICE,8,3              ## @DMA_TO_DEVICE
	.comm	_ICIC,4,2                       ## @ICIC
	.comm	_ICIC_TDMAE,4,2                 ## @ICIC_TDMAE
	.comm	_ICSR_AL,1,0                    ## @ICSR_AL
	.comm	_ICSR_TACK,1,0                  ## @ICSR_TACK
	.comm	_DMA_FROM_DEVICE,8,3            ## @DMA_FROM_DEVICE
	.comm	_ICIC_RDMAE,4,2                 ## @ICIC_RDMAE
	.comm	_ICSR_WAIT,1,0                  ## @ICSR_WAIT
	.comm	_SW_DONE,1,0                    ## @SW_DONE
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_sh_mobile_i2c_isr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh_mobile_i2c_isr
_sh_mobile_i2c_isr:                     ; @sh_mobile_i2c_isr
	.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
Lloh0:
	adrp	x22, _ICSR@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ICSR@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_iic_rd
	mov	x20, x0
	ldrb	w8, [x19]
	orr	w8, w8, w0
	strb	w8, [x19]
	ldr	w0, [x19, #32]
Lloh2:
	adrp	x21, _I2C_M_RD@GOTPAGE
Lloh3:
	ldr	x21, [x21, _I2C_M_RD@GOTPAGEOFF]
	ldr	x9, [x19, #24]
	ldr	w10, [x21]
Lloh4:
	adrp	x11, l_.str.1@PAGE
Lloh5:
	add	x11, x11, l_.str.1@PAGEOFF
Lloh6:
	adrp	x12, l_.str.2@PAGE
Lloh7:
	add	x12, x12, l_.str.2@PAGEOFF
	ldp	w13, w6, [x9]
	tst	w10, w13
	csel	x4, x12, x11, eq
	ldr	w5, [x19, #4]
	and	w3, w8, #0xff
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
	ldr	x8, [x19, #8]
Lloh10:
	adrp	x9, _DMA_TO_DEVICE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_6
LBB0_2:
Lloh13:
	adrp	x8, _ICSR_AL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ICSR_AL@GOTPAGEOFF]
	ldrb	w8, [x8]
Lloh15:
	adrp	x9, _ICSR_TACK@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ICSR_TACK@GOTPAGEOFF]
	ldrb	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w20
	b.eq	LBB0_4
; %bb.3:
	ldr	w1, [x22]
	bic	w2, w20, w8
	mov	x0, x19
	bl	_iic_wr
	mov	w21, #0
	b	LBB0_9
LBB0_4:
	ldr	x8, [x19, #24]
	ldr	w8, [x8]
	ldr	w9, [x21]
	mov	x0, x19
	tst	w9, w8
	b.eq	LBB0_7
; %bb.5:
	bl	_sh_mobile_i2c_isr_rx
	b	LBB0_8
LBB0_6:
Lloh17:
	adrp	x8, _ICIC@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ICIC@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _ICIC_TDMAE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ICIC_TDMAE@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	bl	_iic_set_clr
	mov	w21, #0
	b	LBB0_9
LBB0_7:
	bl	_sh_mobile_i2c_isr_tx
LBB0_8:
	mov	x21, x0
LBB0_9:
	ldr	x8, [x19, #8]
Lloh23:
	adrp	x9, _DMA_FROM_DEVICE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.10:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.ne	LBB0_12
; %bb.11:
Lloh26:
	adrp	x8, _ICIC@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ICIC@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x8, _ICIC_RDMAE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ICIC_RDMAE@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	bl	_iic_set_clr
LBB0_12:
Lloh32:
	adrp	x8, _ICSR_WAIT@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ICSR_WAIT@GOTPAGEOFF]
	ldrb	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_14
; %bb.13:
	ldr	w1, [x22]
	bic	w2, w20, w8
	mov	x0, x19
	bl	_iic_wr
LBB0_14:
	cbz	w21, LBB0_16
; %bb.15:
Lloh34:
	adrp	x8, _SW_DONE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _SW_DONE@GOTPAGEOFF]
	ldrb	w8, [x8]
	ldrb	w9, [x19]
	orr	w8, w9, w8
	mov	x0, x19
	strb	w8, [x0], #16
	bl	_wake_up
LBB0_16:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_iic_rd
Lloh36:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh37:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh38:
	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	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_ICSR,4,2                       ; @ICSR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c_isr 0x%02x 0x%02x %s %d %d!\n"

	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
l_.str.1:                               ; @.str.1
	.asciz	"read"

l_.str.2:                               ; @.str.2
	.asciz	"write"

	.comm	_DMA_TO_DEVICE,8,3              ; @DMA_TO_DEVICE
	.comm	_ICIC,4,2                       ; @ICIC
	.comm	_ICIC_TDMAE,4,2                 ; @ICIC_TDMAE
	.comm	_ICSR_AL,1,0                    ; @ICSR_AL
	.comm	_ICSR_TACK,1,0                  ; @ICSR_TACK
	.comm	_DMA_FROM_DEVICE,8,3            ; @DMA_FROM_DEVICE
	.comm	_ICIC_RDMAE,4,2                 ; @ICIC_RDMAE
	.comm	_ICSR_WAIT,1,0                  ; @ICSR_WAIT
	.comm	_SW_DONE,1,0                    ; @SW_DONE
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_sh_mobile_i2c_isr
.subsections_via_symbols
