	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qlcnic_read_rom
_qlcnic_read_rom:                       ## @qlcnic_read_rom
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movl	(%rsi), %r13d
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movl	4(%rsi), %ecx
	leal	3(%rcx), %eax
	testl	%ecx, %ecx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	cmovnsl	%ecx, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_QLCNIC_FLASH_LOCK@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_QLC_SHARED_REG_RD32
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movq	_MAX_CTL_CHECK@GOTPCREL(%rip), %rbx
	cmpl	$0, (%rbx)
	jle	LBB0_5
## %bb.2:
	movl	$1, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$10000, %edi                    ## imm = 0x2710
	movl	$11000, %esi                    ## imm = 0x2AF8
	callq	_usleep_range
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_QLC_SHARED_REG_RD32
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leal	1(%r14), %eax
	cmpl	(%rbx), %r14d
	movl	%eax, %r14d
	jl	LBB0_3
LBB0_5:
	movq	_QLCNIC_FLASH_LOCK_OWNER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r12), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_QLC_SHARED_REG_WR32
	cmpl	$4, -56(%rbp)                   ## 4-byte Folded Reload
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jl	LBB0_8
## %bb.6:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	sarl	$2, %eax
	movl	%eax, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edx
	andl	$-65536, %edx                   ## imm = 0xFFFF0000
	movq	_FLASH_ROM_WINDOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_qlcnic_ind_wr
	movl	%r13d, %edi
	callq	_LSW
	movq	_FLASH_ROM_DATA@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_qlcnic_ind_rd
	addl	$4, %r13d
	movl	%eax, %edi
	callq	_cpu_to_le32
	movl	%eax, (%r15,%rbx,4)
	incq	%rbx
	cmpl	%ebx, %r14d
	jne	LBB0_7
LBB0_8:
	movq	_QLCNIC_FLASH_UNLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_QLC_SHARED_REG_RD32
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_QLCNIC_FLASH_LOCK,4,2          ## @QLCNIC_FLASH_LOCK
	.comm	_MAX_CTL_CHECK,4,2              ## @MAX_CTL_CHECK
	.comm	_QLCNIC_FLASH_LOCK_OWNER,4,2    ## @QLCNIC_FLASH_LOCK_OWNER
	.comm	_FLASH_ROM_WINDOW,4,2           ## @FLASH_ROM_WINDOW
	.comm	_FLASH_ROM_DATA,4,2             ## @FLASH_ROM_DATA
	.comm	_QLCNIC_FLASH_UNLOCK,4,2        ## @QLCNIC_FLASH_UNLOCK
	.no_dead_strip	_qlcnic_read_rom
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qlcnic_read_rom
_qlcnic_read_rom:                       ; @qlcnic_read_rom
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldp	w22, w24, [x1]
	add	w8, w24, #3
	cmp	w24, #0
	csel	w23, w8, w24, lt
Lloh0:
	adrp	x25, _QLCNIC_FLASH_LOCK@GOTPAGE
Lloh1:
	ldr	x25, [x25, _QLCNIC_FLASH_LOCK@GOTPAGEOFF]
	ldr	w1, [x25]
	bl	_QLC_SHARED_REG_RD32
Lloh2:
	adrp	x26, _MAX_CTL_CHECK@GOTPAGE
Lloh3:
	ldr	x26, [x26, _MAX_CTL_CHECK@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w0, #0
	ccmp	w8, #1, #8, eq
	b.lt	LBB0_3
; %bb.1:
	mov	w27, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #10000
	mov	w1, #11000
	bl	_usleep_range
	ldr	w1, [x25]
	mov	x0, x20
	bl	_QLC_SHARED_REG_RD32
	ldr	w8, [x26]
	cmp	w0, #0
	ccmp	w27, w8, #0, eq
	add	w27, w27, #1
	b.lt	LBB0_2
LBB0_3:
Lloh4:
	adrp	x8, _QLCNIC_FLASH_LOCK_OWNER@GOTPAGE
Lloh5:
	ldr	x8, [x8, _QLCNIC_FLASH_LOCK_OWNER@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	x8, [x20]
	ldr	w2, [x8]
	mov	x0, x20
	bl	_QLC_SHARED_REG_WR32
	cmp	w24, #4
	b.lt	LBB0_6
; %bb.4:
	asr	w23, w23, #2
Lloh7:
	adrp	x24, _FLASH_ROM_WINDOW@GOTPAGE
Lloh8:
	ldr	x24, [x24, _FLASH_ROM_WINDOW@GOTPAGEOFF]
Lloh9:
	adrp	x25, _FLASH_ROM_DATA@GOTPAGE
Lloh10:
	ldr	x25, [x25, _FLASH_ROM_DATA@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	and	w2, w22, #0xffff0000
	ldr	w1, [x24]
	mov	x0, x20
	bl	_qlcnic_ind_wr
	mov	x0, x22
	bl	_LSW
	ldr	w8, [x25]
	add	w1, w8, w0
	mov	x0, x20
	bl	_qlcnic_ind_rd
	add	w22, w22, #4
	bl	_cpu_to_le32
	str	w0, [x21], #4
	subs	w23, w23, #1
	b.ne	LBB0_5
LBB0_6:
Lloh11:
	adrp	x8, _QLCNIC_FLASH_UNLOCK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _QLCNIC_FLASH_UNLOCK@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_QLC_SHARED_REG_RD32
	ldr	w0, [x19, #4]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_QLCNIC_FLASH_LOCK,4,2          ; @QLCNIC_FLASH_LOCK
	.comm	_MAX_CTL_CHECK,4,2              ; @MAX_CTL_CHECK
	.comm	_QLCNIC_FLASH_LOCK_OWNER,4,2    ; @QLCNIC_FLASH_LOCK_OWNER
	.comm	_FLASH_ROM_WINDOW,4,2           ; @FLASH_ROM_WINDOW
	.comm	_FLASH_ROM_DATA,4,2             ; @FLASH_ROM_DATA
	.comm	_QLCNIC_FLASH_UNLOCK,4,2        ; @QLCNIC_FLASH_UNLOCK
	.no_dead_strip	_qlcnic_read_rom
.subsections_via_symbols
