	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bnx2x_acquire_hw_lock          ## -- Begin function bnx2x_acquire_hw_lock
	.p2align	4, 0x90
_bnx2x_acquire_hw_lock:                 ## @bnx2x_acquire_hw_lock
	.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, %r12d
	movq	%rdi, %r14
	movl	$1, %r13d
	movl	%r12d, %ecx
	shll	%cl, %r13d
	callq	_BP_FUNC
	movl	%eax, %r15d
	movq	_HW_LOCK_MAX_RESOURCE_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmpl	%r12d, %edx
	jge	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_BNX2X_ERR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_2:
	cmpl	$5, %r15d
	jg	LBB0_4
## %bb.3:
	movq	_MISC_REG_DRIVER_CONTROL_1@GOTPCREL(%rip), %rax
	shll	$3, %r15d
	addl	(%rax), %r15d
	jmp	LBB0_5
LBB0_4:
	movq	_MISC_REG_DRIVER_CONTROL_7@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%r15,8), %r15d
	addl	$-48, %r15d
LBB0_5:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_REG_RD
	testl	%r13d, %eax
	je	LBB0_6
## %bb.13:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%eax, %esi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_BNX2X_ERR
	movq	_EEXIST@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_6:
	leal	4(%r15), %r12d
	movl	$1000, %ebx                     ## imm = 0x3E8
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	%r13d, %edx
	callq	_REG_WR
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_REG_RD
	testl	%r13d, %eax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	$5000, %edi                     ## imm = 0x1388
	movl	$10000, %esi                    ## imm = 0x2710
	callq	_usleep_range
	decl	%ebx
	jne	LBB0_7
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_BNX2X_ERR
	movq	_EAGAIN@GOTPCREL(%rip), %rax
LBB0_11:
	subl	(%rax), %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%r14d, %r14d
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_HW_LOCK_MAX_RESOURCE_VALUE,4,2 ## @HW_LOCK_MAX_RESOURCE_VALUE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"resource(0x%x) > HW_LOCK_MAX_RESOURCE_VALUE(0x%x)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MISC_REG_DRIVER_CONTROL_1,4,2  ## @MISC_REG_DRIVER_CONTROL_1
	.comm	_MISC_REG_DRIVER_CONTROL_7,4,2  ## @MISC_REG_DRIVER_CONTROL_7
L_.str.1:                               ## @.str.1
	.asciz	"lock_status 0x%x  resource_bit 0x%x\n"

	.comm	_EEXIST,4,2                     ## @EEXIST
L_.str.2:                               ## @.str.2
	.asciz	"Timeout\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bnx2x_acquire_hw_lock          ; -- Begin function bnx2x_acquire_hw_lock
	.p2align	2
_bnx2x_acquire_hw_lock:                 ; @bnx2x_acquire_hw_lock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_BP_FUNC
Lloh0:
	adrp	x8, _HW_LOCK_MAX_RESOURCE_VALUE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HW_LOCK_MAX_RESOURCE_VALUE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ge	LBB0_2
; %bb.1:
	stp	x20, x8, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BNX2X_ERR
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_2:
	mov	w8, #1
	lsl	w20, w8, w20
	cmp	w0, #5
	b.gt	LBB0_4
; %bb.3:
Lloh7:
	adrp	x8, _MISC_REG_DRIVER_CONTROL_1@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MISC_REG_DRIVER_CONTROL_1@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	add	w21, w8, w0, lsl #3
	b	LBB0_5
LBB0_4:
Lloh10:
	adrp	x8, _MISC_REG_DRIVER_CONTROL_7@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MISC_REG_DRIVER_CONTROL_7@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	add	w8, w8, w0, lsl #3
	sub	w21, w8, #48
LBB0_5:
	mov	x0, x19
	mov	x1, x21
	bl	_REG_RD
                                        ; kill: def $w0 killed $w0 def $x0
	tst	w0, w20
	b.eq	LBB0_7
; %bb.6:
	stp	x0, x20, [sp]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_BNX2X_ERR
Lloh15:
	adrp	x8, _EEXIST@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
	b	LBB0_11
LBB0_7:
	add	w22, w21, #4
	mov	w23, #1000
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_REG_WR
	mov	x0, x19
	mov	x1, x21
	bl	_REG_RD
	tst	w0, w20
	b.ne	LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w0, #5000
	mov	w1, #10000
	bl	_usleep_range
	subs	w23, w23, #1
	b.ne	LBB0_8
; %bb.10:
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_BNX2X_ERR
Lloh19:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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
	add	sp, sp, #80
	ret
LBB0_13:
	mov	w0, #0
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_HW_LOCK_MAX_RESOURCE_VALUE,4,2 ; @HW_LOCK_MAX_RESOURCE_VALUE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"resource(0x%x) > HW_LOCK_MAX_RESOURCE_VALUE(0x%x)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MISC_REG_DRIVER_CONTROL_1,4,2  ; @MISC_REG_DRIVER_CONTROL_1
	.comm	_MISC_REG_DRIVER_CONTROL_7,4,2  ; @MISC_REG_DRIVER_CONTROL_7
l_.str.1:                               ; @.str.1
	.asciz	"lock_status 0x%x  resource_bit 0x%x\n"

	.comm	_EEXIST,4,2                     ; @EEXIST
l_.str.2:                               ; @.str.2
	.asciz	"Timeout\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
.subsections_via_symbols
