	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgmac_chip_reset_idm_config
_bgmac_chip_reset_idm_config:           ## @bgmac_chip_reset_idm_config
	.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, %r15
	movq	_BCMA_IOST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bgmac_idm_read
	movl	(%r15), %r8d
	movq	_BGMAC_FEAT_IOST_ATTACHED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	andl	%r8d, %edi
	movq	_BGMAC_BCMA_IOST_ATTACHED@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movl	%edx, %ecx
	notl	%ecx
	xorl	%esi, %esi
	cmpl	$1, %edi
	movl	$0, %ebx
	sbbl	%ebx, %ebx
	orl	%ecx, %ebx
	andl	%eax, %ebx
	movq	_BGMAC_FEAT_NO_RESET@GOTPCREL(%rip), %rax
	testl	%r8d, (%rax)
	je	LBB0_1
## %bb.5:
	testl	%ebx, %edx
	jne	LBB0_6
	jmp	LBB0_7
LBB0_1:
	testl	%edx, %ebx
	je	LBB0_4
## %bb.2:
	movq	_BGMAC_BCMA_IOCTL_SW_CLKEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	$0, 4(%r15)
	jne	LBB0_4
## %bb.3:
	movq	_BGMAC_BCMA_IOCTL_SW_RESET@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
LBB0_4:
	movq	%r15, %rdi
	callq	_bgmac_clk_enable
	movl	(%r14), %edx
	testl	%ebx, %edx
	je	LBB0_7
LBB0_6:
	cmpl	$0, 4(%r15)
	je	LBB0_8
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_BCMA_IOCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_bgmac_idm_read
	movq	_BGMAC_BCMA_IOCTL_SW_RESET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	%r15, %rdi
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bgmac_idm_write                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BCMA_IOST,4,2                  ## @BCMA_IOST
	.comm	_BGMAC_FEAT_IOST_ATTACHED,4,2   ## @BGMAC_FEAT_IOST_ATTACHED
	.comm	_BGMAC_BCMA_IOST_ATTACHED,4,2   ## @BGMAC_BCMA_IOST_ATTACHED
	.comm	_BGMAC_FEAT_NO_RESET,4,2        ## @BGMAC_FEAT_NO_RESET
	.comm	_BGMAC_BCMA_IOCTL_SW_CLKEN,4,2  ## @BGMAC_BCMA_IOCTL_SW_CLKEN
	.comm	_BGMAC_BCMA_IOCTL_SW_RESET,4,2  ## @BGMAC_BCMA_IOCTL_SW_RESET
	.comm	_BCMA_IOCTL,4,2                 ## @BCMA_IOCTL
	.no_dead_strip	_bgmac_chip_reset_idm_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bgmac_chip_reset_idm_config
_bgmac_chip_reset_idm_config:           ; @bgmac_chip_reset_idm_config
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
Lloh0:
	adrp	x8, _BCMA_IOST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BCMA_IOST@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_bgmac_idm_read
	ldr	w9, [x19]
Lloh3:
	adrp	x8, _BGMAC_FEAT_IOST_ATTACHED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BGMAC_FEAT_IOST_ATTACHED@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x8]
Lloh6:
	adrp	x20, _BGMAC_BCMA_IOST_ATTACHED@GOTPAGE
Lloh7:
	ldr	x20, [x20, _BGMAC_BCMA_IOST_ATTACHED@GOTPAGEOFF]
	ldr	w8, [x20]
	tst	w10, w9
	mov	w10, #-1
	csinv	w10, w10, w8, eq
	and	w21, w10, w0
Lloh8:
	adrp	x10, _BGMAC_FEAT_NO_RESET@GOTPAGE
Lloh9:
	ldr	x10, [x10, _BGMAC_FEAT_NO_RESET@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_2
; %bb.1:
	tst	w8, w21
	b.ne	LBB0_7
	b	LBB0_8
LBB0_2:
	tst	w21, w8
	b.eq	LBB0_5
; %bb.3:
Lloh11:
	adrp	x8, _BGMAC_BCMA_IOCTL_SW_CLKEN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BGMAC_BCMA_IOCTL_SW_CLKEN@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	w8, [x19, #4]
	cbnz	w8, LBB0_6
; %bb.4:
Lloh14:
	adrp	x8, _BGMAC_BCMA_IOCTL_SW_RESET@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BGMAC_BCMA_IOCTL_SW_RESET@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	orr	w1, w8, w1
	b	LBB0_6
LBB0_5:
	mov	w1, #0
LBB0_6:
	mov	x0, x19
	bl	_bgmac_clk_enable
	ldr	w8, [x20]
	tst	w8, w21
	b.eq	LBB0_8
LBB0_7:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_9
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh17:
	adrp	x8, _BCMA_IOCTL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BCMA_IOCTL@GOTPAGEOFF]
Lloh19:
	ldr	w20, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_bgmac_idm_read
Lloh20:
	adrp	x8, _BGMAC_BCMA_IOCTL_SW_RESET@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BGMAC_BCMA_IOCTL_SW_RESET@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	bic	w2, w0, w8
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_bgmac_idm_write
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_BCMA_IOST,4,2                  ; @BCMA_IOST
	.comm	_BGMAC_FEAT_IOST_ATTACHED,4,2   ; @BGMAC_FEAT_IOST_ATTACHED
	.comm	_BGMAC_BCMA_IOST_ATTACHED,4,2   ; @BGMAC_BCMA_IOST_ATTACHED
	.comm	_BGMAC_FEAT_NO_RESET,4,2        ; @BGMAC_FEAT_NO_RESET
	.comm	_BGMAC_BCMA_IOCTL_SW_CLKEN,4,2  ; @BGMAC_BCMA_IOCTL_SW_CLKEN
	.comm	_BGMAC_BCMA_IOCTL_SW_RESET,4,2  ; @BGMAC_BCMA_IOCTL_SW_RESET
	.comm	_BCMA_IOCTL,4,2                 ; @BCMA_IOCTL
	.no_dead_strip	_bgmac_chip_reset_idm_config
.subsections_via_symbols
