	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rcsi2_phtw_write
_rcsi2_phtw_write:                      ## @rcsi2_phtw_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	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movq	_PHTW_REG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_PHTW_DWEN@GOTPCREL(%rip), %r15
	movl	(%r15), %r12d
	movl	%esi, %edi
	callq	_PHTW_TESTDIN_DATA
	orl	%eax, %r12d
	movq	_PHTW_CWEN@GOTPCREL(%rip), %r14
	orl	(%r14), %r12d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_PHTW_TESTDIN_CODE
	orl	%eax, %r12d
	movq	%r13, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	movq	%rbx, %r12
	callq	_rcsi2_write
	movl	$21, %ebx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_rcsi2_read
	movl	(%r14), %ecx
	orl	(%r15), %ecx
	testl	%eax, %ecx
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	decl	%ebx
	jne	LBB0_1
## %bb.4:
	movl	(%r13), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_5
LBB0_2:
	xorl	%eax, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PHTW_REG,4,2                   ## @PHTW_REG
	.comm	_PHTW_DWEN,4,2                  ## @PHTW_DWEN
	.comm	_PHTW_CWEN,4,2                  ## @PHTW_CWEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout waiting for PHTW_DWEN and/or PHTW_CWEN\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_rcsi2_phtw_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rcsi2_phtw_write
_rcsi2_phtw_write:                      ; @rcsi2_phtw_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x19, x0
Lloh0:
	adrp	x22, _PHTW_REG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PHTW_REG@GOTPAGEOFF]
	ldr	w21, [x22]
Lloh2:
	adrp	x23, _PHTW_DWEN@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PHTW_DWEN@GOTPAGEOFF]
	ldr	w24, [x23]
	mov	x0, x1
	bl	_PHTW_TESTDIN_DATA
	orr	w8, w0, w24
Lloh4:
	adrp	x24, _PHTW_CWEN@GOTPAGE
Lloh5:
	ldr	x24, [x24, _PHTW_CWEN@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w25, w8, w9
	mov	x0, x20
	bl	_PHTW_TESTDIN_CODE
	orr	w2, w25, w0
	mov	x0, x19
	mov	x1, x21
	bl	_rcsi2_write
	mov	w20, #21
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rcsi2_read
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	subs	w20, w20, #1
	b.ne	LBB0_1
; %bb.3:
	ldr	w0, [x19]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh8:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_4:
	mov	w0, #0
LBB0_5:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_PHTW_REG,4,2                   ; @PHTW_REG
	.comm	_PHTW_DWEN,4,2                  ; @PHTW_DWEN
	.comm	_PHTW_CWEN,4,2                  ; @PHTW_CWEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout waiting for PHTW_DWEN and/or PHTW_CWEN\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_rcsi2_phtw_write
.subsections_via_symbols
