	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function altr_i2c_xfer_msg
_altr_i2c_xfer_msg:                     ## @altr_i2c_xfer_msg
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	_ALTR_I2C_ISR_RXOF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_ALTR_I2C_ISR_ARB@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_ALTR_I2C_ISR_NACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %rdi
	callq	_i2c_8bit_addr_from_msg
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r12, 32(%rbx)
	movl	8(%r12), %eax
	movl	%eax, 24(%rbx)
	movl	4(%r12), %eax
	movl	%eax, 20(%rbx)
	movl	$0, (%rbx)
	leaq	16(%rbx), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_reinit_completion
	movq	%rbx, %rdi
	callq	_altr_i2c_core_enable
	movq	_ALTR_I2C_RX_DATA@GOTPCREL(%rip), %r15
	movq	_ALTR_I2C_RX_FIFO_LVL@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movq	(%r13), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	testl	%eax, %eax
	jne	LBB0_1
## %bb.2:
	orl	-48(%rbp), %r14d                ## 4-byte Folded Reload
	orl	-44(%rbp), %r14d                ## 4-byte Folded Reload
	movq	_ALTR_I2C_TFR_CMD_STA@GOTPCREL(%rip), %rax
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	orl	(%rax), %edi
	movq	_ALTR_I2C_TFR_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_writel
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_4
## %bb.3:
	movq	_ALTR_I2C_ISER_RXOF_EN@GOTPCREL(%rip), %rax
	movq	_ALTR_I2C_ISER_RXRDY_EN@GOTPCREL(%rip), %rcx
	orl	(%rax), %r14d
	orl	(%rcx), %r14d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	$1, %edx
	callq	_altr_i2c_int_enable
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_altr_i2c_transfer
	jmp	LBB0_5
LBB0_4:
	movq	_ALTR_I2C_ISR_TXRDY@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	$1, %edx
	callq	_altr_i2c_int_enable
	movq	%rbx, %rdi
	callq	_altr_i2c_fill_tx_fifo
LBB0_5:
	movq	_ALTR_I2C_XFER_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_wait_for_completion_timeout
	movq	%rax, %r15
	movq	%rbx, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	callq	_altr_i2c_int_enable
	movq	_ALTR_I2C_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movq	_ALTR_I2C_STAT_CORE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	movl	4(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_7:
	testq	%r15, %r15
	jne	LBB0_9
## %bb.8:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, (%rbx)
	movl	4(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
LBB0_9:
	movq	%rbx, %rdi
	callq	_altr_i2c_core_disable
	movl	(%rbx), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ALTR_I2C_ISR_RXOF,4,2          ## @ALTR_I2C_ISR_RXOF
	.comm	_ALTR_I2C_ISR_ARB,4,2           ## @ALTR_I2C_ISR_ARB
	.comm	_ALTR_I2C_ISR_NACK,4,2          ## @ALTR_I2C_ISR_NACK
	.comm	_ALTR_I2C_RX_DATA,8,3           ## @ALTR_I2C_RX_DATA
	.comm	_ALTR_I2C_RX_FIFO_LVL,8,3       ## @ALTR_I2C_RX_FIFO_LVL
	.comm	_ALTR_I2C_TFR_CMD_STA,4,2       ## @ALTR_I2C_TFR_CMD_STA
	.comm	_ALTR_I2C_TFR_CMD,8,3           ## @ALTR_I2C_TFR_CMD
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_ALTR_I2C_ISER_RXOF_EN,4,2      ## @ALTR_I2C_ISER_RXOF_EN
	.comm	_ALTR_I2C_ISER_RXRDY_EN,4,2     ## @ALTR_I2C_ISER_RXRDY_EN
	.comm	_ALTR_I2C_ISR_TXRDY,4,2         ## @ALTR_I2C_ISR_TXRDY
	.comm	_ALTR_I2C_XFER_TIMEOUT,4,2      ## @ALTR_I2C_XFER_TIMEOUT
	.comm	_ALTR_I2C_STATUS,8,3            ## @ALTR_I2C_STATUS
	.comm	_ALTR_I2C_STAT_CORE,4,2         ## @ALTR_I2C_STAT_CORE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Core Status not IDLE...\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.1:                               ## @.str.1
	.asciz	"Transaction timed out.\n"

	.no_dead_strip	_altr_i2c_xfer_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function altr_i2c_xfer_msg
_altr_i2c_xfer_msg:                     ; @altr_i2c_xfer_msg
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _ALTR_I2C_ISR_RXOF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ALTR_I2C_ISR_RXOF@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
Lloh3:
	adrp	x8, _ALTR_I2C_ISR_ARB@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ALTR_I2C_ISR_ARB@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
Lloh6:
	adrp	x8, _ALTR_I2C_ISR_NACK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ALTR_I2C_ISR_NACK@GOTPAGEOFF]
Lloh8:
	ldr	w25, [x8]
	mov	x0, x1
	bl	_i2c_8bit_addr_from_msg
	mov	x22, x0
	str	x21, [x19, #32]
	ldur	d0, [x21, #4]
	stur	d0, [x19, #20]
	str	wzr, [x19]
	add	x20, x19, #16
	mov	x0, x20
	bl	_reinit_completion
	mov	x0, x19
	bl	_altr_i2c_core_enable
Lloh9:
	adrp	x26, _ALTR_I2C_RX_DATA@GOTPAGE
Lloh10:
	ldr	x26, [x26, _ALTR_I2C_RX_DATA@GOTPAGEOFF]
Lloh11:
	adrp	x27, _ALTR_I2C_RX_FIFO_LVL@GOTPAGE
Lloh12:
	ldr	x27, [x27, _ALTR_I2C_RX_FIFO_LVL@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x9, [x26]
	add	x0, x9, x8
	bl	_readl
	ldr	x8, [x19, #8]
	ldr	x9, [x27]
	add	x0, x9, x8
	bl	_readl
	cbnz	w0, LBB0_1
; %bb.2:
	orr	w8, w24, w23
	orr	w23, w8, w25
Lloh13:
	adrp	x8, _ALTR_I2C_TFR_CMD_STA@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ALTR_I2C_TFR_CMD_STA@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	orr	w0, w8, w22
	ldr	x8, [x19, #8]
Lloh16:
	adrp	x9, _ALTR_I2C_TFR_CMD@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ALTR_I2C_TFR_CMD@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	w8, [x21]
Lloh19:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh20:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh22:
	adrp	x8, _ALTR_I2C_ISER_RXOF_EN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ALTR_I2C_ISER_RXOF_EN@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _ALTR_I2C_ISER_RXRDY_EN@GOTPAGE
Lloh26:
	ldr	x9, [x9, _ALTR_I2C_ISER_RXRDY_EN@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w8, w23
	orr	w21, w8, w9
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1
	bl	_altr_i2c_int_enable
	mov	x0, x19
	mov	w1, #0
	bl	_altr_i2c_transfer
	b	LBB0_5
LBB0_4:
Lloh28:
	adrp	x8, _ALTR_I2C_ISR_TXRDY@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ALTR_I2C_ISR_TXRDY@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	orr	w21, w8, w23
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1
	bl	_altr_i2c_int_enable
	mov	x0, x19
	bl	_altr_i2c_fill_tx_fifo
LBB0_5:
Lloh31:
	adrp	x8, _ALTR_I2C_XFER_TIMEOUT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ALTR_I2C_XFER_TIMEOUT@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wait_for_completion_timeout
	mov	x20, x0
	mov	x0, x19
	mov	x1, x21
	mov	w2, #0
	bl	_altr_i2c_int_enable
	ldr	x8, [x19, #8]
Lloh34:
	adrp	x9, _ALTR_I2C_STATUS@GOTPAGE
Lloh35:
	ldr	x9, [x9, _ALTR_I2C_STATUS@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh37:
	adrp	x8, _ALTR_I2C_STAT_CORE@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ALTR_I2C_STAT_CORE@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.6:
	ldr	w0, [x19, #4]
Lloh40:
	adrp	x1, l_.str@PAGE
Lloh41:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_7:
	cbnz	x20, LBB0_9
; %bb.8:
Lloh42:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh43:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x19]
	ldr	w0, [x19, #4]
Lloh45:
	adrp	x1, l_.str.1@PAGE
Lloh46:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
LBB0_9:
	mov	x0, x19
	bl	_altr_i2c_core_disable
	ldr	w0, [x19]
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_ALTR_I2C_ISR_RXOF,4,2          ; @ALTR_I2C_ISR_RXOF
	.comm	_ALTR_I2C_ISR_ARB,4,2           ; @ALTR_I2C_ISR_ARB
	.comm	_ALTR_I2C_ISR_NACK,4,2          ; @ALTR_I2C_ISR_NACK
	.comm	_ALTR_I2C_RX_DATA,8,3           ; @ALTR_I2C_RX_DATA
	.comm	_ALTR_I2C_RX_FIFO_LVL,8,3       ; @ALTR_I2C_RX_FIFO_LVL
	.comm	_ALTR_I2C_TFR_CMD_STA,4,2       ; @ALTR_I2C_TFR_CMD_STA
	.comm	_ALTR_I2C_TFR_CMD,8,3           ; @ALTR_I2C_TFR_CMD
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_ALTR_I2C_ISER_RXOF_EN,4,2      ; @ALTR_I2C_ISER_RXOF_EN
	.comm	_ALTR_I2C_ISER_RXRDY_EN,4,2     ; @ALTR_I2C_ISER_RXRDY_EN
	.comm	_ALTR_I2C_ISR_TXRDY,4,2         ; @ALTR_I2C_ISR_TXRDY
	.comm	_ALTR_I2C_XFER_TIMEOUT,4,2      ; @ALTR_I2C_XFER_TIMEOUT
	.comm	_ALTR_I2C_STATUS,8,3            ; @ALTR_I2C_STATUS
	.comm	_ALTR_I2C_STAT_CORE,4,2         ; @ALTR_I2C_STAT_CORE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Core Status not IDLE...\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.1:                               ; @.str.1
	.asciz	"Transaction timed out.\n"

	.no_dead_strip	_altr_i2c_xfer_msg
.subsections_via_symbols
