	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt73usb_load_firmware
_rt73usb_load_firmware:                 ## @rt73usb_load_firmware
	.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
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movl	$100, %ebx
	movq	_MAC_CSR0@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_rt2x00usb_register_read
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$1, %edi
	callq	_msleep
	decl	%ebx
	jne	LBB0_1
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_rt2x00_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_6
LBB0_4:
	movq	_FIRMWARE_IMAGE_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movq	%r15, %rdx
	movq	%r14, %rcx
	callq	_rt2x00usb_register_multiwrite
	movq	_USB_DEVICE_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_USB_MODE_FIRMWARE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_REGISTER_TIMEOUT_FIRMWARE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_rt2x00usb_vendor_request_sw
	testl	%eax, %eax
	jns	LBB0_6
## %bb.5:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	callq	_rt2x00_err
	movl	%r15d, %r14d
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAC_CSR0,4,2                   ## @MAC_CSR0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unstable hardware\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_FIRMWARE_IMAGE_BASE,4,2        ## @FIRMWARE_IMAGE_BASE
	.comm	_USB_DEVICE_MODE,4,2            ## @USB_DEVICE_MODE
	.comm	_USB_MODE_FIRMWARE,4,2          ## @USB_MODE_FIRMWARE
	.comm	_REGISTER_TIMEOUT_FIRMWARE,4,2  ## @REGISTER_TIMEOUT_FIRMWARE
L_.str.1:                               ## @.str.1
	.asciz	"Failed to write Firmware to device\n"

	.no_dead_strip	_rt73usb_load_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt73usb_load_firmware
_rt73usb_load_firmware:                 ; @rt73usb_load_firmware
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x2
	mov	x21, x1
	mov	x19, x0
	mov	w22, #100
Lloh0:
	adrp	x23, _MAC_CSR0@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MAC_CSR0@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x19
	bl	_rt2x00usb_register_read
	cbnz	x0, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #1
	bl	_msleep
	subs	w22, w22, #1
	b.ne	LBB0_1
; %bb.3:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_rt2x00_err
Lloh4:
	adrp	x8, _EBUSY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_4:
Lloh7:
	adrp	x8, _FIRMWARE_IMAGE_BASE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _FIRMWARE_IMAGE_BASE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	mov	x3, x20
	bl	_rt2x00usb_register_multiwrite
Lloh10:
	adrp	x8, _USB_DEVICE_MODE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _USB_DEVICE_MODE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x8, _USB_MODE_FIRMWARE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _USB_MODE_FIRMWARE@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
Lloh16:
	adrp	x8, _REGISTER_TIMEOUT_FIRMWARE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _REGISTER_TIMEOUT_FIRMWARE@GOTPAGEOFF]
Lloh18:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_rt2x00usb_vendor_request_sw
	mov	x20, x0
	mov	w0, #0
	tbz	w20, #31, LBB0_6
; %bb.5:
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_rt2x00_err
	mov	x0, x20
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MAC_CSR0,4,2                   ; @MAC_CSR0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unstable hardware\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_FIRMWARE_IMAGE_BASE,4,2        ; @FIRMWARE_IMAGE_BASE
	.comm	_USB_DEVICE_MODE,4,2            ; @USB_DEVICE_MODE
	.comm	_USB_MODE_FIRMWARE,4,2          ; @USB_MODE_FIRMWARE
	.comm	_REGISTER_TIMEOUT_FIRMWARE,4,2  ; @REGISTER_TIMEOUT_FIRMWARE
l_.str.1:                               ; @.str.1
	.asciz	"Failed to write Firmware to device\n"

	.no_dead_strip	_rt73usb_load_firmware
.subsections_via_symbols
