	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function altr_i2c_isr
_altr_i2c_isr:                          ## @altr_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	40(%rsi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	andl	(%rax), %ebx
	movl	(%r15), %r14d
	movq	_ALTR_I2C_ISR_ARB@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	andl	%r14d, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_altr_i2c_int_clear
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 32(%r15)
	jmp	LBB0_5
LBB0_1:
	movl	16(%r15), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_2:
	movq	_ALTR_I2C_ALL_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_altr_i2c_int_clear
	jmp	LBB0_15
LBB0_8:
	movq	_ALTR_I2C_ISR_NACK@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	andl	%r14d, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movl	16(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 32(%r15)
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_altr_i2c_int_clear
	movq	%r15, %rdi
	callq	_altr_i2c_stop
LBB0_5:
	movq	_ALTR_I2C_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	24(%r15), %rdi
	movq	_ALTR_I2C_STAT_CORE@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	movl	(%rax), %eax
	andl	%r14d, %eax
	sete	%dl
	movq	_ALTR_I2C_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%r14d, %esi
	movl	$1, %ecx
	callq	_readl_poll_timeout_atomic
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	16(%r15), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_err
LBB0_7:
	movq	_ALTR_I2C_ALL_IRQ@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_altr_i2c_int_enable
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_altr_i2c_int_clear
	leaq	20(%r15), %rdi
	callq	_complete
	movl	16(%r15), %edi
	leaq	L_.str.5(%rip), %rsi
	callq	_dev_dbg
LBB0_15:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	testl	%ebx, %ebx
	je	LBB0_16
## %bb.11:
	movq	_ALTR_I2C_ISR_RXOF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	%r14d, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%r15, %rdi
	callq	_altr_i2c_empty_rx_fifo
	movq	_ALTR_I2C_ISR_RXRDY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_altr_i2c_int_clear
	movq	%r15, %rdi
	callq	_altr_i2c_stop
	movl	16(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_5
LBB0_16:
	movq	_ALTR_I2C_ISR_TXRDY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%r14d, %esi
	je	LBB0_19
## %bb.17:
	movq	%r15, %rdi
	callq	_altr_i2c_int_clear
	cmpq	$0, 8(%r15)
	jle	LBB0_5
## %bb.18:
	movq	%r15, %rdi
	callq	_altr_i2c_fill_tx_fifo
	jmp	LBB0_15
LBB0_13:
	movq	_ALTR_I2C_ISR_RXRDY@GOTPCREL(%rip), %rbx
	testl	%r14d, (%rbx)
	je	LBB0_19
## %bb.14:
	movq	%r15, %rdi
	callq	_altr_i2c_empty_rx_fifo
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_altr_i2c_int_clear
	cmpq	$0, 8(%r15)
	jne	LBB0_15
	jmp	LBB0_5
LBB0_19:
	movl	16(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_warn
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unexpected interrupt\n"

	.comm	_ALTR_I2C_ALL_IRQ,4,2           ## @ALTR_I2C_ALL_IRQ
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_ALTR_I2C_ISR_ARB,4,2           ## @ALTR_I2C_ISR_ARB
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_ALTR_I2C_ISR_NACK,4,2          ## @ALTR_I2C_ISR_NACK
L_.str.1:                               ## @.str.1
	.asciz	"Could not get ACK\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_ALTR_I2C_ISR_RXOF,4,2          ## @ALTR_I2C_ISR_RXOF
	.comm	_ALTR_I2C_ISR_RXRDY,4,2         ## @ALTR_I2C_ISR_RXRDY
L_.str.2:                               ## @.str.2
	.asciz	"RX FIFO Overflow\n"

	.comm	_ALTR_I2C_ISR_TXRDY,4,2         ## @ALTR_I2C_ISR_TXRDY
L_.str.3:                               ## @.str.3
	.asciz	"Unexpected interrupt: 0x%x\n"

	.comm	_ALTR_I2C_STATUS,8,3            ## @ALTR_I2C_STATUS
	.comm	_ALTR_I2C_STAT_CORE,4,2         ## @ALTR_I2C_STAT_CORE
	.comm	_ALTR_I2C_TIMEOUT,4,2           ## @ALTR_I2C_TIMEOUT
L_.str.4:                               ## @.str.4
	.asciz	"message timeout\n"

L_.str.5:                               ## @.str.5
	.asciz	"Message Complete\n"

	.no_dead_strip	_altr_i2c_isr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function altr_i2c_isr
_altr_i2c_isr:                          ; @altr_i2c_isr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x1
	ldr	x8, [x1, #40]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	w20, [x19]
Lloh0:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
	ldr	w21, [x8]
Lloh2:
	ldr	w22, [x9]
Lloh3:
	adrp	x23, _ALTR_I2C_ISR_ARB@GOTPAGE
Lloh4:
	ldr	x23, [x23, _ALTR_I2C_ISR_ARB@GOTPAGEOFF]
	ldr	w8, [x23]
	and	w0, w8, w20
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.2:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_altr_i2c_int_clear
Lloh5:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x19, #32]
	b	LBB0_7
LBB0_3:
	ldr	w0, [x19, #16]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	bl	_dev_warn
Lloh10:
	adrp	x8, _ALTR_I2C_ALL_IRQ@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ALTR_I2C_ALL_IRQ@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_altr_i2c_int_clear
	b	LBB0_10
LBB0_5:
Lloh13:
	adrp	x23, _ALTR_I2C_ISR_NACK@GOTPAGE
Lloh14:
	ldr	x23, [x23, _ALTR_I2C_ISR_NACK@GOTPAGEOFF]
	ldr	w8, [x23]
	and	w0, w8, w20
	bl	_unlikely
	cbz	x0, LBB0_11
; %bb.6:
	ldr	w0, [x19, #16]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
Lloh17:
	adrp	x8, _ENXIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x19, #32]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_altr_i2c_int_clear
	mov	x0, x19
	bl	_altr_i2c_stop
LBB0_7:
	ldr	x8, [x19, #24]
Lloh20:
	adrp	x9, _ALTR_I2C_STATUS@GOTPAGE
Lloh21:
	ldr	x9, [x9, _ALTR_I2C_STATUS@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	add	x0, x9, x8
Lloh23:
	adrp	x8, _ALTR_I2C_STAT_CORE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ALTR_I2C_STAT_CORE@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	tst	w8, w20
	cset	w2, eq
Lloh26:
	adrp	x8, _ALTR_I2C_TIMEOUT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ALTR_I2C_TIMEOUT@GOTPAGEOFF]
Lloh28:
	ldr	w4, [x8]
	mov	x1, x20
	mov	w3, #1
	bl	_readl_poll_timeout_atomic
	cbz	w0, LBB0_9
; %bb.8:
	ldr	w0, [x19, #16]
Lloh29:
	adrp	x1, l_.str.4@PAGE
Lloh30:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
LBB0_9:
Lloh31:
	adrp	x20, _ALTR_I2C_ALL_IRQ@GOTPAGE
Lloh32:
	ldr	x20, [x20, _ALTR_I2C_ALL_IRQ@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_altr_i2c_int_enable
	ldr	w1, [x20]
	mov	x0, x19
	bl	_altr_i2c_int_clear
	add	x0, x19, #20
	bl	_complete
	ldr	w0, [x19, #16]
Lloh33:
	adrp	x1, l_.str.5@PAGE
Lloh34:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_dbg
LBB0_10:
Lloh35:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh36:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
	and	w8, w22, w21
	cbz	w8, LBB0_14
; %bb.12:
Lloh38:
	adrp	x8, _ALTR_I2C_ISR_RXOF@GOTPAGE
Lloh39:
	ldr	x8, [x8, _ALTR_I2C_ISR_RXOF@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	and	w0, w8, w20
	bl	_unlikely
	cbz	x0, LBB0_17
; %bb.13:
	mov	x0, x19
	bl	_altr_i2c_empty_rx_fifo
Lloh41:
	adrp	x8, _ALTR_I2C_ISR_RXRDY@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ALTR_I2C_ISR_RXRDY@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_altr_i2c_int_clear
	mov	x0, x19
	bl	_altr_i2c_stop
	ldr	w0, [x19, #16]
Lloh44:
	adrp	x1, l_.str.2@PAGE
Lloh45:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_7
LBB0_14:
Lloh46:
	adrp	x8, _ALTR_I2C_ISR_TXRDY@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ALTR_I2C_ISR_TXRDY@GOTPAGEOFF]
Lloh48:
	ldr	w1, [x8]
	tst	w1, w20
	b.eq	LBB0_19
; %bb.15:
	mov	x0, x19
	bl	_altr_i2c_int_clear
	ldr	x8, [x19, #8]
	cmp	x8, #1
	b.lt	LBB0_7
; %bb.16:
	mov	x0, x19
	bl	_altr_i2c_fill_tx_fifo
	b	LBB0_10
LBB0_17:
Lloh49:
	adrp	x21, _ALTR_I2C_ISR_RXRDY@GOTPAGE
Lloh50:
	ldr	x21, [x21, _ALTR_I2C_ISR_RXRDY@GOTPAGEOFF]
	ldr	w8, [x21]
	tst	w8, w20
	b.eq	LBB0_19
; %bb.18:
	mov	x0, x19
	bl	_altr_i2c_empty_rx_fifo
	ldr	w1, [x21]
	mov	x0, x19
	bl	_altr_i2c_int_clear
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_10
	b	LBB0_7
LBB0_19:
	ldr	w0, [x19, #16]
	str	x20, [sp]
Lloh51:
	adrp	x1, l_.str.3@PAGE
Lloh52:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_4
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpAdd	Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unexpected interrupt\n"

	.comm	_ALTR_I2C_ALL_IRQ,4,2           ; @ALTR_I2C_ALL_IRQ
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_ALTR_I2C_ISR_ARB,4,2           ; @ALTR_I2C_ISR_ARB
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_ALTR_I2C_ISR_NACK,4,2          ; @ALTR_I2C_ISR_NACK
l_.str.1:                               ; @.str.1
	.asciz	"Could not get ACK\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_ALTR_I2C_ISR_RXOF,4,2          ; @ALTR_I2C_ISR_RXOF
	.comm	_ALTR_I2C_ISR_RXRDY,4,2         ; @ALTR_I2C_ISR_RXRDY
l_.str.2:                               ; @.str.2
	.asciz	"RX FIFO Overflow\n"

	.comm	_ALTR_I2C_ISR_TXRDY,4,2         ; @ALTR_I2C_ISR_TXRDY
l_.str.3:                               ; @.str.3
	.asciz	"Unexpected interrupt: 0x%x\n"

	.comm	_ALTR_I2C_STATUS,8,3            ; @ALTR_I2C_STATUS
	.comm	_ALTR_I2C_STAT_CORE,4,2         ; @ALTR_I2C_STAT_CORE
	.comm	_ALTR_I2C_TIMEOUT,4,2           ; @ALTR_I2C_TIMEOUT
l_.str.4:                               ; @.str.4
	.asciz	"message timeout\n"

l_.str.5:                               ; @.str.5
	.asciz	"Message Complete\n"

	.no_dead_strip	_altr_i2c_isr
.subsections_via_symbols
