	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pasemi_i2c_xfer_msg
_pasemi_i2c_xfer_msg:                   ## @pasemi_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	andl	(%rsi), %ebx
	movq	(%rdi), %r14
	setne	%al
	movq	_MTXFIFO_START@GOTPCREL(%rip), %rcx
	movl	4(%rsi), %esi
	addl	%esi, %esi
	orl	(%rcx), %esi
	orl	%eax, %esi
	movq	%r14, %rdi
	callq	_TXFIFO_WR
	movslq	8(%r12), %rsi
	testl	%ebx, %ebx
	je	LBB0_1
## %bb.3:
	movq	_MTXFIFO_READ@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.4:
	movq	_MTXFIFO_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_5:
	orl	%r15d, %esi
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_TXFIFO_WR
	movq	%r14, %rdi
	callq	_pasemi_smb_waitready
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_6
LBB0_10:
	movq	_REG_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CTL_MTR@GOTPCREL(%rip), %rax
	movq	_CTL_MRR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_CLK_100K_DIV@GOTPCREL(%rip), %rax
	movq	_CTL_CLK_M@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	(%rax), %edx
	orl	%ecx, %edx
	movq	%r14, %rdi
	callq	_reg_write
	jmp	LBB0_18
LBB0_1:
	cmpl	$1, %esi
	jle	LBB0_2
## %bb.12:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	movl	(%rax,%rbx,4), %esi
	movq	%r14, %rdi
	callq	_TXFIFO_WR
	incq	%rbx
	movslq	8(%r12), %rsi
	decq	%rsi
	cmpq	%rsi, %rbx
	jl	LBB0_13
	jmp	LBB0_14
LBB0_6:
	cmpl	$0, 8(%r12)
	jle	LBB0_17
## %bb.7:
	xorl	%ebx, %ebx
	movq	_MRXFIFO_EMPTY@GOTPCREL(%rip), %r15
	movq	_MRXFIFO_DATA_M@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_RXFIFO_RD
	testl	%eax, (%r15)
	jne	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	andl	(%r13), %eax
	movq	16(%r12), %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	movslq	8(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_8
	jmp	LBB0_17
LBB0_2:
	decq	%rsi
LBB0_14:
	movq	16(%r12), %rax
	testl	%r15d, %r15d
	je	LBB0_16
## %bb.15:
	movq	_MTXFIFO_STOP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
LBB0_16:
	orl	(%rax,%rsi,4), %r15d
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_TXFIFO_WR
LBB0_17:
	xorl	%r15d, %r15d
LBB0_18:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_ENODATA@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_MTXFIFO_START,4,2              ## @MTXFIFO_START
	.comm	_MTXFIFO_READ,4,2               ## @MTXFIFO_READ
	.comm	_MTXFIFO_STOP,4,2               ## @MTXFIFO_STOP
	.comm	_MRXFIFO_EMPTY,4,2              ## @MRXFIFO_EMPTY
	.comm	_ENODATA,4,2                    ## @ENODATA
	.comm	_MRXFIFO_DATA_M,4,2             ## @MRXFIFO_DATA_M
	.comm	_REG_CTL,4,2                    ## @REG_CTL
	.comm	_CTL_MTR,4,2                    ## @CTL_MTR
	.comm	_CTL_MRR,4,2                    ## @CTL_MRR
	.comm	_CLK_100K_DIV,4,2               ## @CLK_100K_DIV
	.comm	_CTL_CLK_M,4,2                  ## @CTL_CLK_M
	.no_dead_strip	_pasemi_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 pasemi_i2c_xfer_msg
_pasemi_i2c_xfer_msg:                   ; @pasemi_i2c_xfer_msg
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x2
	mov	x20, x1
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _I2C_M_RD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I2C_M_RD@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldp	w9, w10, [x1]
	ands	w22, w8, w9
	cset	w8, ne
Lloh3:
	adrp	x9, _MTXFIFO_START@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MTXFIFO_START@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w9, w9, w10, lsl #1
	orr	w1, w9, w8
	mov	x0, x19
	bl	_TXFIFO_WR
	ldrsw	x8, [x20, #8]
	cbz	w22, LBB0_3
; %bb.1:
Lloh6:
	adrp	x9, _MTXFIFO_READ@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MTXFIFO_READ@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _MTXFIFO_STOP@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MTXFIFO_STOP@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w21, #0
	csel	w9, wzr, w9, eq
	orr	w1, w8, w9
	mov	x0, x19
	bl	_TXFIFO_WR
	mov	x0, x19
	bl	_pasemi_smb_waitready
	mov	x21, x0
	cbz	w0, LBB0_6
LBB0_2:
Lloh12:
	adrp	x8, _REG_CTL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _REG_CTL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _CTL_MTR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CTL_MTR@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _CTL_MRR@GOTPAGE
Lloh19:
	ldr	x9, [x9, _CTL_MRR@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh21:
	adrp	x9, _CLK_100K_DIV@GOTPAGE
Lloh22:
	ldr	x9, [x9, _CLK_100K_DIV@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
Lloh24:
	adrp	x10, _CTL_CLK_M@GOTPAGE
Lloh25:
	ldr	x10, [x10, _CTL_CLK_M@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	and	w9, w10, w9
	orr	w2, w8, w9
	mov	x0, x19
	bl	_reg_write
	b	LBB0_13
LBB0_3:
	cmp	w8, #1
	b.le	LBB0_10
; %bb.4:
	mov	x22, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	ldr	w1, [x8, x22, lsl #2]
	mov	x0, x19
	bl	_TXFIFO_WR
	add	x22, x22, #1
	ldrsw	x8, [x20, #8]
	sub	x8, x8, #1
	cmp	x22, x8
	b.lt	LBB0_5
	b	LBB0_11
LBB0_6:
	ldr	w8, [x20, #8]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.7:
	mov	x21, #0
Lloh27:
	adrp	x22, _MRXFIFO_EMPTY@GOTPAGE
Lloh28:
	ldr	x22, [x22, _MRXFIFO_EMPTY@GOTPAGEOFF]
Lloh29:
	adrp	x23, _MRXFIFO_DATA_M@GOTPAGE
Lloh30:
	ldr	x23, [x23, _MRXFIFO_DATA_M@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_RXFIFO_RD
	ldr	w8, [x22]
	tst	w8, w0
	b.ne	LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x23]
	and	w8, w8, w0
	ldr	x9, [x20, #16]
	str	w8, [x9, x21, lsl #2]
	add	x21, x21, #1
	ldrsw	x8, [x20, #8]
	cmp	x21, x8
	b.lt	LBB0_8
	b	LBB0_12
LBB0_10:
	sub	x8, x8, #1
LBB0_11:
	ldr	x9, [x20, #16]
	ldr	w8, [x9, x8, lsl #2]
Lloh31:
	adrp	x9, _MTXFIFO_STOP@GOTPAGE
Lloh32:
	ldr	x9, [x9, _MTXFIFO_STOP@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	cmp	w21, #0
	csel	w9, wzr, w9, eq
	orr	w1, w9, w8
	mov	x0, x19
	bl	_TXFIFO_WR
LBB0_12:
	mov	w21, #0
LBB0_13:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_14:
Lloh34:
	adrp	x8, _ENODATA@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENODATA@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_MTXFIFO_START,4,2              ; @MTXFIFO_START
	.comm	_MTXFIFO_READ,4,2               ; @MTXFIFO_READ
	.comm	_MTXFIFO_STOP,4,2               ; @MTXFIFO_STOP
	.comm	_MRXFIFO_EMPTY,4,2              ; @MRXFIFO_EMPTY
	.comm	_ENODATA,4,2                    ; @ENODATA
	.comm	_MRXFIFO_DATA_M,4,2             ; @MRXFIFO_DATA_M
	.comm	_REG_CTL,4,2                    ; @REG_CTL
	.comm	_CTL_MTR,4,2                    ; @CTL_MTR
	.comm	_CTL_MRR,4,2                    ; @CTL_MRR
	.comm	_CLK_100K_DIV,4,2               ; @CLK_100K_DIV
	.comm	_CTL_CLK_M,4,2                  ; @CTL_CLK_M
	.no_dead_strip	_pasemi_i2c_xfer_msg
.subsections_via_symbols
