	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmcmsptwi_do_xfer
_pmcmsptwi_do_xfer:                     ## @pmcmsptwi_do_xfer
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movl	%edi, %ebx
	movq	_pmcmsptwi_adapter@GOTPCREL(%rip), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_MSP_TWI_CMD_REG_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	movl	%ebx, %edi
	callq	_pmcmsptwi_writel
	cmpq	$0, 8(%r15)
	je	LBB0_3
## %bb.1:
	leaq	4(%r15), %r14
	movq	_MSP_IRQ_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	movq	_pmcmsptwi_adapter@GOTPCREL(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	%r14, %rdi
	callq	_complete
	movq	_MSP_TWI_XFER_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	jmp	LBB0_4
LBB0_3:
	movq	%r15, %rdi
	callq	_pmcmsptwi_poll_complete
LBB0_4:
	movl	(%r15), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pmcmsptwi_adapter,4,2          ## @pmcmsptwi_adapter
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Writing cmd reg 0x%08x\n"

	.comm	_MSP_TWI_CMD_REG_OFFSET,8,3     ## @MSP_TWI_CMD_REG_OFFSET
	.comm	_MSP_IRQ_TIMEOUT,4,2            ## @MSP_IRQ_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"Result: IRQ timeout\n"

	.comm	_MSP_TWI_XFER_TIMEOUT,4,2       ## @MSP_TWI_XFER_TIMEOUT
	.no_dead_strip	_pmcmsptwi_do_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pmcmsptwi_do_xfer
_pmcmsptwi_do_xfer:                     ; @pmcmsptwi_do_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	str	x20, [sp]
Lloh0:
	adrp	x0, _pmcmsptwi_adapter@GOTPAGE
Lloh1:
	ldr	x0, [x0, _pmcmsptwi_adapter@GOTPAGEOFF]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	x8, [x19, #16]
Lloh4:
	adrp	x9, _MSP_TWI_CMD_REG_OFFSET@GOTPAGE
Lloh5:
	ldr	x9, [x9, _MSP_TWI_CMD_REG_OFFSET@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x20
	bl	_pmcmsptwi_writel
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_3
; %bb.1:
	add	x20, x19, #4
Lloh7:
	adrp	x8, _MSP_IRQ_TIMEOUT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MSP_IRQ_TIMEOUT@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wait_for_completion_timeout
	cbnz	x0, LBB0_4
; %bb.2:
Lloh10:
	adrp	x0, _pmcmsptwi_adapter@GOTPAGE
Lloh11:
	ldr	x0, [x0, _pmcmsptwi_adapter@GOTPAGEOFF]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	x0, x20
	bl	_complete
Lloh14:
	adrp	x8, _MSP_TWI_XFER_TIMEOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MSP_TWI_XFER_TIMEOUT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_4
LBB0_3:
	mov	x0, x19
	bl	_pmcmsptwi_poll_complete
LBB0_4:
	ldr	w0, [x19]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_pmcmsptwi_adapter,4,2          ; @pmcmsptwi_adapter
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Writing cmd reg 0x%08x\n"

	.comm	_MSP_TWI_CMD_REG_OFFSET,8,3     ; @MSP_TWI_CMD_REG_OFFSET
	.comm	_MSP_IRQ_TIMEOUT,4,2            ; @MSP_IRQ_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"Result: IRQ timeout\n"

	.comm	_MSP_TWI_XFER_TIMEOUT,4,2       ; @MSP_TWI_XFER_TIMEOUT
	.no_dead_strip	_pmcmsptwi_do_xfer
.subsections_via_symbols
