	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function if_spi_init_card
_if_spi_init_card:                      ## @if_spi_init_card
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	32(%rdi), %r15
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	24(%rdi), %rax
	movl	(%rax), %esi
	callq	_spu_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.1:
	leaq	16(%r14), %rdx
	movq	%r14, %rdi
	movq	%r14, %rsi
	callq	_spu_get_chip_revision
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.2:
	movq	_IF_SPI_SCRATCH_4_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r14, %rdi
	callq	_spu_read_u32
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.3:
	movq	-56(%rbp), %rax
	movq	_SUCCESSFUL_FW_DOWNLOAD_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
LBB0_15:
	xorl	%eax, %eax
	callq	_lbs_deb_spi
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_spu_set_interrupt_mode
	movl	%eax, %ebx
	jmp	LBB0_16
LBB0_5:
	movq	_fw_table@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movq	(%r12), %rdi
	cmpq	(%rdi,%rbx,8), %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_6
LBB0_8:
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %ebx
	jne	LBB0_10
## %bb.9:
	movl	(%r15), %edi
	movl	(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_netdev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_10:
	movq	8(%r14), %rdi
	addq	$16, %rdi
	movl	(%r14), %esi
	movq	(%r12), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-40(%rbp), %r8
	callq	_lbs_get_firmware
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	callq	_netdev_err
	jmp	LBB0_16
LBB0_12:
	movl	16(%r14), %edx
	movq	(%r14), %rsi
	movq	8(%r14), %rax
	movq	8(%rax), %rcx
	movl	(%rcx), %ecx
	movl	(%rax), %r9d
	movl	4(%rax), %r8d
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_lbs_deb_spi
	movq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_if_spi_prog_helper_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.13:
	movq	-40(%rbp), %rsi
	movq	%r14, %rdi
	callq	_if_spi_prog_main_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_14
LBB0_16:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_IF_SPI_SCRATCH_4_REG,4,2       ## @IF_SPI_SCRATCH_4_REG
	.comm	_SUCCESSFUL_FW_DOWNLOAD_MAGIC,8,3 ## @SUCCESSFUL_FW_DOWNLOAD_MAGIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Firmware is already loaded for Marvell WLAN 802.11 adapter\n"

	.comm	_fw_table,8,3                   ## @fw_table
L_.str.1:                               ## @.str.1
	.asciz	"Unsupported chip_id: 0x%02x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.2:                               ## @.str.2
	.asciz	"failed to find firmware (%d)\n"

L_.str.3:                               ## @.str.3
	.asciz	"Initializing FW for Marvell WLAN 802.11 adapter (chip_id = 0x%04x, chip_rev = 0x%02x) attached to SPI bus_num %d, chip_select %d. spi->max_speed_hz=%d\n"

L_.str.4:                               ## @.str.4
	.asciz	"loaded FW for Marvell WLAN 802.11 adapter\n"

	.no_dead_strip	_if_spi_init_card
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function if_spi_init_card
_if_spi_init_card:                      ; @if_spi_init_card
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	stp	xzr, xzr, [sp, #40]
	ldp	x8, x21, [x0, #24]
	ldr	w1, [x8]
	bl	_spu_init
	mov	x20, x0
	cbnz	w0, LBB0_17
; %bb.1:
	add	x2, x19, #16
	mov	x0, x19
	mov	x1, x19
	bl	_spu_get_chip_revision
	mov	x20, x0
	cbnz	w0, LBB0_17
; %bb.2:
Lloh0:
	adrp	x8, _IF_SPI_SCRATCH_4_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IF_SPI_SCRATCH_4_REG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	sub	x2, x29, #40
	mov	x0, x19
	bl	_spu_read_u32
	mov	x20, x0
	cbnz	w0, LBB0_17
; %bb.3:
	ldur	x8, [x29, #-40]
Lloh3:
	adrp	x9, _SUCCESSFUL_FW_DOWNLOAD_MAGIC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SUCCESSFUL_FW_DOWNLOAD_MAGIC@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
LBB0_5:
	bl	_lbs_deb_spi
	mov	x0, x19
	mov	w1, #0
	mov	w2, #1
	bl	_spu_set_interrupt_mode
	mov	x20, x0
	b	LBB0_17
LBB0_6:
Lloh8:
	adrp	x20, _fw_table@GOTPAGE
Lloh9:
	ldr	x20, [x20, _fw_table@GOTPAGEOFF]
	ldr	x0, [x20]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_10
; %bb.7:
	mov	x22, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x0, [x20]
	ldr	x9, [x0, x22, lsl #3]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x22, x22, #1
	bl	_ARRAY_SIZE
	cmp	x22, w0, sxtw
	b.lt	LBB0_8
	b	LBB0_11
LBB0_10:
	mov	w22, #0
LBB0_11:
	ldr	x0, [x20]
	bl	_ARRAY_SIZE
	cmp	w22, w0
	b.ne	LBB0_13
; %bb.12:
	ldr	w0, [x21]
	ldr	w2, [x19]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_netdev_err
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_17
LBB0_13:
	ldr	x8, [x19, #8]
	add	x0, x8, #16
	ldr	w1, [x19]
	ldr	x2, [x20]
	add	x3, sp, #48
	add	x4, sp, #40
	bl	_lbs_get_firmware
	cbz	w0, LBB0_15
; %bb.14:
	mov	x20, x0
	ldr	w0, [x21]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_netdev_err
	b	LBB0_17
LBB0_15:
	ldp	x8, x9, [x19]
	ldr	x10, [x9, #8]
	ldr	w11, [x19, #16]
	ldr	w10, [x10]
	ldp	w9, w12, [x9]
	stp	x12, x9, [sp, #24]
	stp	x11, x10, [sp, #8]
	str	x8, [sp]
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_lbs_deb_spi
	ldr	x1, [sp, #48]
	mov	x0, x19
	bl	_if_spi_prog_helper_firmware
	mov	x20, x0
	cbnz	w0, LBB0_17
; %bb.16:
	ldr	x1, [sp, #40]
	mov	x0, x19
	bl	_if_spi_prog_main_firmware
	mov	x20, x0
	cbz	w0, LBB0_18
LBB0_17:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_18:
Lloh19:
	adrp	x0, l_.str.4@PAGE
Lloh20:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_IF_SPI_SCRATCH_4_REG,4,2       ; @IF_SPI_SCRATCH_4_REG
	.comm	_SUCCESSFUL_FW_DOWNLOAD_MAGIC,8,3 ; @SUCCESSFUL_FW_DOWNLOAD_MAGIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Firmware is already loaded for Marvell WLAN 802.11 adapter\n"

	.comm	_fw_table,8,3                   ; @fw_table
l_.str.1:                               ; @.str.1
	.asciz	"Unsupported chip_id: 0x%02x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.2:                               ; @.str.2
	.asciz	"failed to find firmware (%d)\n"

l_.str.3:                               ; @.str.3
	.asciz	"Initializing FW for Marvell WLAN 802.11 adapter (chip_id = 0x%04x, chip_rev = 0x%02x) attached to SPI bus_num %d, chip_select %d. spi->max_speed_hz=%d\n"

l_.str.4:                               ; @.str.4
	.asciz	"loaded FW for Marvell WLAN 802.11 adapter\n"

	.no_dead_strip	_if_spi_init_card
.subsections_via_symbols
