	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psif_write
_psif_write:                            ## @psif_write
	.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	%esi, %r14d
	movq	(%rdi), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	_SR@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_psif_readl
	movl	%eax, %ebx
	movq	_TXEMPTY@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_PSIF_BIT
	testl	%ebx, %eax
	jne	LBB0_11
## %bb.1:
	movl	$10, %edi
	callq	_msleep
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_psif_readl
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_PSIF_BIT
	testl	%ebx, %eax
	jne	LBB0_11
## %bb.2:
	movl	$10, %edi
	callq	_msleep
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_psif_readl
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_PSIF_BIT
	testl	%ebx, %eax
	jne	LBB0_11
## %bb.3:
	movl	$10, %edi
	callq	_msleep
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_psif_readl
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_PSIF_BIT
	testl	%ebx, %eax
	jne	LBB0_11
## %bb.4:
	movl	$10, %edi
	callq	_msleep
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_psif_readl
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_PSIF_BIT
	testl	%ebx, %eax
	jne	LBB0_11
## %bb.5:
	movl	$10, %edi
	callq	_msleep
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_psif_readl
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_PSIF_BIT
	testl	%ebx, %eax
	jne	LBB0_11
## %bb.6:
	movl	$10, %edi
	callq	_msleep
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_psif_readl
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_PSIF_BIT
	testl	%ebx, %eax
	jne	LBB0_11
## %bb.7:
	movl	$10, %edi
	callq	_msleep
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_psif_readl
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_PSIF_BIT
	testl	%ebx, %eax
	jne	LBB0_11
## %bb.8:
	movl	$10, %edi
	callq	_msleep
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_psif_readl
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_PSIF_BIT
	testl	%ebx, %eax
	jne	LBB0_11
## %bb.9:
	movl	$10, %edi
	callq	_msleep
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_psif_readl
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_PSIF_BIT
	testl	%ebx, %eax
	jne	LBB0_11
## %bb.10:
	movl	$10, %edi
	callq	_msleep
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_psif_readl
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_PSIF_BIT
	testl	%ebx, %eax
	je	LBB0_12
LBB0_11:
	movq	_THR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%r14b, %edx
	movq	%r15, %rdi
	callq	_psif_writel
	xorl	%ebx, %ebx
LBB0_13:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	8(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_SR,4,2                         ## @SR
	.comm	_TXEMPTY,4,2                    ## @TXEMPTY
	.comm	_THR,4,2                        ## @THR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout writing to THR\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_psif_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psif_write
_psif_write:                            ; @psif_write
	.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	x20, x1
	ldr	x19, [x0]
	mov	x0, x19
	bl	_spin_lock_irqsave
Lloh0:
	adrp	x22, _SR@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SR@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_psif_readl
	mov	x21, x0
Lloh2:
	adrp	x23, _TXEMPTY@GOTPAGE
Lloh3:
	ldr	x23, [x23, _TXEMPTY@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_PSIF_BIT
	tst	w0, w21
	b.ne	LBB0_11
; %bb.1:
	mov	w0, #10
	bl	_msleep
	ldr	w1, [x22]
	mov	x0, x19
	bl	_psif_readl
	mov	x21, x0
	ldr	w0, [x23]
	bl	_PSIF_BIT
	tst	w0, w21
	b.ne	LBB0_11
; %bb.2:
	mov	w0, #10
	bl	_msleep
	ldr	w1, [x22]
	mov	x0, x19
	bl	_psif_readl
	mov	x21, x0
	ldr	w0, [x23]
	bl	_PSIF_BIT
	tst	w0, w21
	b.ne	LBB0_11
; %bb.3:
	mov	w0, #10
	bl	_msleep
	ldr	w1, [x22]
	mov	x0, x19
	bl	_psif_readl
	mov	x21, x0
	ldr	w0, [x23]
	bl	_PSIF_BIT
	tst	w0, w21
	b.ne	LBB0_11
; %bb.4:
	mov	w0, #10
	bl	_msleep
	ldr	w1, [x22]
	mov	x0, x19
	bl	_psif_readl
	mov	x21, x0
	ldr	w0, [x23]
	bl	_PSIF_BIT
	tst	w0, w21
	b.ne	LBB0_11
; %bb.5:
	mov	w0, #10
	bl	_msleep
	ldr	w1, [x22]
	mov	x0, x19
	bl	_psif_readl
	mov	x21, x0
	ldr	w0, [x23]
	bl	_PSIF_BIT
	tst	w0, w21
	b.ne	LBB0_11
; %bb.6:
	mov	w0, #10
	bl	_msleep
	ldr	w1, [x22]
	mov	x0, x19
	bl	_psif_readl
	mov	x21, x0
	ldr	w0, [x23]
	bl	_PSIF_BIT
	tst	w0, w21
	b.ne	LBB0_11
; %bb.7:
	mov	w0, #10
	bl	_msleep
	ldr	w1, [x22]
	mov	x0, x19
	bl	_psif_readl
	mov	x21, x0
	ldr	w0, [x23]
	bl	_PSIF_BIT
	tst	w0, w21
	b.ne	LBB0_11
; %bb.8:
	mov	w0, #10
	bl	_msleep
	ldr	w1, [x22]
	mov	x0, x19
	bl	_psif_readl
	mov	x21, x0
	ldr	w0, [x23]
	bl	_PSIF_BIT
	tst	w0, w21
	b.ne	LBB0_11
; %bb.9:
	mov	w0, #10
	bl	_msleep
	ldr	w1, [x22]
	mov	x0, x19
	bl	_psif_readl
	mov	x21, x0
	ldr	w0, [x23]
	bl	_PSIF_BIT
	tst	w0, w21
	b.ne	LBB0_11
; %bb.10:
	mov	w0, #10
	bl	_msleep
	ldr	w1, [x22]
	mov	x0, x19
	bl	_psif_readl
	mov	x21, x0
	ldr	w0, [x23]
	bl	_PSIF_BIT
	tst	w0, w21
	b.eq	LBB0_13
LBB0_11:
Lloh4:
	adrp	x8, _THR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _THR@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_psif_writel
	mov	w20, #0
LBB0_12:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	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_13:
	ldr	x0, [x19, #8]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh9:
	adrp	x8, _EBUSY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_12
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SR,4,2                         ; @SR
	.comm	_TXEMPTY,4,2                    ; @TXEMPTY
	.comm	_THR,4,2                        ; @THR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout writing to THR\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_psif_write
.subsections_via_symbols
