	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_zd_chip_unlock_phy_regs        ## -- Begin function zd_chip_unlock_phy_regs
	.p2align	4, 0x90
_zd_chip_unlock_phy_regs:               ## @zd_chip_unlock_phy_regs
	.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	%rdi, %r14
	callq	_mutex_is_locked
	movl	%eax, %edi
	callq	_ZD_ASSERT
	movq	_CR_REG1@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	leaq	-28(%rbp), %rsi
	movq	%r14, %rdi
	callq	_zd_ioread32_locked
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_zd_chip_dev
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_5
LBB0_2:
	movq	_UNLOCK_PHY_REGS@GOTPCREL(%rip), %rax
	movl	-28(%rbp), %esi
	orl	(%rax), %esi
	movl	%esi, -28(%rbp)
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_zd_iowrite32_locked
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_zd_chip_dev
	leaq	L_.str.1(%rip), %rsi
LBB0_5:
	movl	%eax, %edi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_CR_REG1,4,2                    ## @CR_REG1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error ioread32(CR_REG1): %d\n"

	.comm	_UNLOCK_PHY_REGS,4,2            ## @UNLOCK_PHY_REGS
L_.str.1:                               ## @.str.1
	.asciz	"error iowrite32(CR_REG1): %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_zd_chip_unlock_phy_regs        ; -- Begin function zd_chip_unlock_phy_regs
	.p2align	2
_zd_chip_unlock_phy_regs:               ; @zd_chip_unlock_phy_regs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	bl	_mutex_is_locked
	bl	_ZD_ASSERT
Lloh0:
	adrp	x21, _CR_REG1@GOTPAGE
Lloh1:
	ldr	x21, [x21, _CR_REG1@GOTPAGEOFF]
	ldr	w2, [x21]
	add	x1, sp, #12
	mov	x0, x19
	bl	_zd_ioread32_locked
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	bl	_zd_chip_dev
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
Lloh4:
	adrp	x8, _UNLOCK_PHY_REGS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _UNLOCK_PHY_REGS@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	orr	w1, w9, w8
	str	w1, [sp, #12]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_zd_iowrite32_locked
	mov	x20, x0
	cbz	w0, LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_zd_chip_dev
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_4:
	mov	x2, x20
	bl	_dev_err
LBB0_5:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_CR_REG1,4,2                    ; @CR_REG1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error ioread32(CR_REG1): %d\n"

	.comm	_UNLOCK_PHY_REGS,4,2            ; @UNLOCK_PHY_REGS
l_.str.1:                               ; @.str.1
	.asciz	"error iowrite32(CR_REG1): %d\n"

.subsections_via_symbols
