	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tg3_ape_unlock
_tg3_ape_unlock:                        ## @tg3_ape_unlock
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_ENABLE_APE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_tg3_flag
	testl	%eax, %eax
	je	LBB0_12
## %bb.1:
	leal	-128(%rbx), %eax
	cmpl	$4, %eax
	jae	LBB0_2
LBB0_7:
	movq	_APE_LOCK_GRANT_DRIVER@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_8
LBB0_2:
	leal	-132(%rbx), %eax
	cmpl	$2, %eax
	jb	LBB0_5
## %bb.3:
	cmpl	$134, %ebx
	jne	LBB0_12
## %bb.4:
	movq	%r14, %rdi
	callq	_tg3_asic_rev
	movq	_ASIC_REV_5761@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	(%r14), %ecx
	testl	%ecx, %ecx
	je	LBB0_7
## %bb.6:
	movl	$1, %r15d
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r15d
LBB0_8:
	movq	%r14, %rdi
	callq	_tg3_asic_rev
	movq	_ASIC_REV_5761@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.10:
	movq	_TG3_APE_LOCK_GRANT@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_9:
	movq	_TG3_APE_PER_LOCK_GRANT@GOTPCREL(%rip), %rax
LBB0_11:
	shll	$2, %ebx
	addl	(%rax), %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tg3_ape_write32                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ENABLE_APE,4,2                 ## @ENABLE_APE
	.comm	_ASIC_REV_5761,8,3              ## @ASIC_REV_5761
	.comm	_APE_LOCK_GRANT_DRIVER,4,2      ## @APE_LOCK_GRANT_DRIVER
	.comm	_TG3_APE_LOCK_GRANT,4,2         ## @TG3_APE_LOCK_GRANT
	.comm	_TG3_APE_PER_LOCK_GRANT,4,2     ## @TG3_APE_PER_LOCK_GRANT
	.no_dead_strip	_tg3_ape_unlock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tg3_ape_unlock
_tg3_ape_unlock:                        ; @tg3_ape_unlock
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _ENABLE_APE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENABLE_APE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_tg3_flag
	cbz	w0, LBB0_6
; %bb.1:
	sub	w8, w20, #128
	cmp	w8, #4
	b.hs	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _APE_LOCK_GRANT_DRIVER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _APE_LOCK_GRANT_DRIVER@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	b	LBB0_9
LBB0_3:
	sub	w8, w20, #132
	cmp	w8, #2
	b.lo	LBB0_7
; %bb.4:
	cmp	w20, #134
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_tg3_asic_rev
Lloh6:
	adrp	x8, _ASIC_REV_5761@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ASIC_REV_5761@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_7
LBB0_6:
	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_7:
	ldr	w8, [x19]
	cbz	w8, LBB0_2
; %bb.8:
	mov	w9, #1
	lsl	w21, w9, w8
LBB0_9:
	mov	x0, x19
	bl	_tg3_asic_rev
Lloh9:
	adrp	x8, _ASIC_REV_5761@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ASIC_REV_5761@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
Lloh12:
	adrp	x9, _TG3_APE_LOCK_GRANT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _TG3_APE_LOCK_GRANT@GOTPAGEOFF]
Lloh14:
	adrp	x10, _TG3_APE_PER_LOCK_GRANT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _TG3_APE_PER_LOCK_GRANT@GOTPAGEOFF]
	cmp	x0, x8
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	add	w1, w8, w20, lsl #2
	mov	x0, x19
	mov	x2, x21
	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	_tg3_ape_write32
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ENABLE_APE,4,2                 ; @ENABLE_APE
	.comm	_ASIC_REV_5761,8,3              ; @ASIC_REV_5761
	.comm	_APE_LOCK_GRANT_DRIVER,4,2      ; @APE_LOCK_GRANT_DRIVER
	.comm	_TG3_APE_LOCK_GRANT,4,2         ; @TG3_APE_LOCK_GRANT
	.comm	_TG3_APE_PER_LOCK_GRANT,4,2     ; @TG3_APE_PER_LOCK_GRANT
	.no_dead_strip	_tg3_ape_unlock
.subsections_via_symbols
