	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bdx_fw_load
_bdx_fw_load:                           ## @bdx_fw_load
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	$0, -48(%rbp)
	movq	_regINIT_SEMAPHORE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_READ_REG
	movl	%eax, %r12d
	movq	_regINIT_STATUS@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_READ_REG
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	testl	%r12d, %r12d
	je	LBB0_5
## %bb.2:
	movq	8(%r15), %rdx
	leaq	L_.str(%rip), %rsi
	leaq	-48(%rbp), %rdi
	callq	_request_firmware
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r14d
                                        ## implicit-def: $ebx
	jmp	LBB0_9
LBB0_4:
	movq	-48(%rbp), %rax
	movq	8(%rax), %rsi
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_bdx_tx_push_desc_safe
	movl	$100, %edi
	callq	_mdelay
LBB0_5:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_READ_REG
	testl	%eax, %eax
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	$2, %edi
	callq	_mdelay
	incl	%ebx
	cmpl	$200, %ebx
	jne	LBB0_6
## %bb.8:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movl	$200, %ebx
LBB0_9:
	testl	%r12d, %r12d
	je	LBB0_11
## %bb.10:
	movq	_regINIT_SEMAPHORE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_WRITE_REG
LBB0_11:
	movq	-48(%rbp), %rdi
	callq	_release_firmware
	movq	(%r15), %rdi
	testl	%r14d, %r14d
	je	LBB0_14
## %bb.12:
	leaq	L_.str.1(%rip), %rsi
	callq	_netdev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %eax
	jne	LBB0_15
## %bb.13:
	movq	_regVPC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_READ_REG
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_regVIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_READ_REG
	movl	%eax, %r12d
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_READ_REG
	leaq	L_.str.2(%rip), %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	movl	%eax, %ecx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_DBG
	jmp	LBB0_15
LBB0_14:
	movl	(%rdi), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DBG
LBB0_15:
	movl	%r14d, %edi
	callq	_RET
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENTER,4,2                      ## @ENTER
	.comm	_regINIT_SEMAPHORE,4,2          ## @regINIT_SEMAPHORE
	.comm	_regINIT_STATUS,4,2             ## @regINIT_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tehuti/bdx.bin"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"firmware loading failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"VPC = 0x%x VIC = 0x%x INIT_STATUS = 0x%x i=%d\n"

	.comm	_regVPC,4,2                     ## @regVPC
	.comm	_regVIC,4,2                     ## @regVIC
L_.str.3:                               ## @.str.3
	.asciz	"%s: firmware loading success\n"

	.no_dead_strip	_bdx_fw_load
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bdx_fw_load
_bdx_fw_load:                           ; @bdx_fw_load
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
	str	xzr, [sp, #24]
Lloh0:
	adrp	x22, _regINIT_SEMAPHORE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _regINIT_SEMAPHORE@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_READ_REG
	mov	x21, x0
Lloh2:
	adrp	x23, _regINIT_STATUS@GOTPAGE
Lloh3:
	ldr	x23, [x23, _regINIT_STATUS@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_READ_REG
	cmp	w0, #0
	ccmp	w21, #0, #4, eq
	b.eq	LBB0_4
; %bb.1:
	ldr	x2, [x19, #8]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #24
	bl	_request_firmware
	cbz	w0, LBB0_3
; %bb.2:
	mov	x20, x0
                                        ; implicit-def: $w24
	cbnz	w21, LBB0_9
	b	LBB0_10
LBB0_3:
	ldr	x8, [sp, #24]
	ldr	x1, [x8, #8]
	ldr	w2, [x8]
	mov	x0, x19
	bl	_bdx_tx_push_desc_safe
	mov	w0, #100
	bl	_mdelay
LBB0_4:
	mov	w24, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x19
	bl	_READ_REG
	cbnz	w0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #2
	bl	_mdelay
	add	w24, w24, #1
	cmp	w24, #200
	b.ne	LBB0_5
; %bb.7:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w20, w8
	mov	w24, #200
	cbnz	w21, LBB0_9
	b	LBB0_10
LBB0_8:
	mov	w20, #0
	cbz	w21, LBB0_10
LBB0_9:
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #1
	bl	_WRITE_REG
LBB0_10:
	ldr	x0, [sp, #24]
	bl	_release_firmware
	ldr	x0, [x19]
	cbz	w20, LBB0_13
; %bb.11:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_netdev_err
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmn	w20, w8
	b.ne	LBB0_15
; %bb.12:
Lloh14:
	adrp	x8, _regVPC@GOTPAGE
Lloh15:
	ldr	x8, [x8, _regVPC@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_READ_REG
	mov	x21, x0
Lloh17:
	adrp	x8, _regVIC@GOTPAGE
Lloh18:
	ldr	x8, [x8, _regVIC@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_READ_REG
	mov	x22, x0
	ldr	w1, [x23]
	mov	x0, x19
	bl	_READ_REG
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x0, x24, [sp, #8]
	str	x22, [sp]
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	b	LBB0_14
LBB0_13:
	ldr	w1, [x0]
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_14:
	bl	_DBG
LBB0_15:
	mov	x0, x20
	bl	_RET
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ENTER,4,2                      ; @ENTER
	.comm	_regINIT_SEMAPHORE,4,2          ; @regINIT_SEMAPHORE
	.comm	_regINIT_STATUS,4,2             ; @regINIT_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tehuti/bdx.bin"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"firmware loading failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"VPC = 0x%x VIC = 0x%x INIT_STATUS = 0x%x i=%d\n"

	.comm	_regVPC,4,2                     ; @regVPC
	.comm	_regVIC,4,2                     ; @regVIC
l_.str.3:                               ; @.str.3
	.asciz	"%s: firmware loading success\n"

	.no_dead_strip	_bdx_fw_load
.subsections_via_symbols
