	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function if_usb_setup_firmware
_if_usb_setup_firmware:                 ## @if_usb_setup_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	%r14
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	movl	$32, %edi
	callq	_cpu_to_le16
	movq	%rax, -64(%rbp)
	movq	$0, -72(%rbp)
	movl	(%r14), %eax
	movl	%eax, -56(%rbp)
	movq	_CMD_SET_BOOT2_VER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_lbs_cmd_with_response
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_lbs_deb_usb
LBB0_2:
	movabsq	$85899345922, %rax              ## imm = 0x1400000002
	movq	%rax, (%rbx)
	movq	_EHS_WAKE_ON_UNICAST_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_lbs_host_sleep_cfg
	movl	$32, %edi
	callq	_cpu_to_le16
	movq	%rax, -32(%rbp)
	movq	_CMD_ACT_GET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, -40(%rbp)
	movq	_CMD_802_11_FW_WAKE_METHOD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_lbs_cmd_with_response
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	8(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_netdev_info
	movq	_FW_CAPINFO_PS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 12(%rbx)
	jmp	LBB0_7
LBB0_4:
	movl	-48(%rbp), %edi
	callq	_le16_to_cpu
	movq	_CMD_WAKE_METHOD_COMMAND_INT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	callq	_lbs_deb_usb
	jmp	LBB0_7
LBB0_6:
	movq	_FW_CAPINFO_PS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 12(%rbx)
	movl	8(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_netdev_info
LBB0_7:
	addq	$64, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_SET_BOOT2_VER,4,2          ## @CMD_SET_BOOT2_VER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setting boot2 version failed\n"

	.comm	_EHS_WAKE_ON_UNICAST_DATA,4,2   ## @EHS_WAKE_ON_UNICAST_DATA
	.comm	_CMD_ACT_GET,4,2                ## @CMD_ACT_GET
	.comm	_CMD_802_11_FW_WAKE_METHOD,4,2  ## @CMD_802_11_FW_WAKE_METHOD
L_.str.1:                               ## @.str.1
	.asciz	"Firmware does not seem to support PS mode\n"

	.comm	_FW_CAPINFO_PS,4,2              ## @FW_CAPINFO_PS
	.comm	_CMD_WAKE_METHOD_COMMAND_INT,8,3 ## @CMD_WAKE_METHOD_COMMAND_INT
L_.str.2:                               ## @.str.2
	.asciz	"Firmware seems to support PS with wake-via-command\n"

L_.str.3:                               ## @.str.3
	.asciz	"Firmware doesn't wake via command interrupt; disabling PS mode\n"

	.no_dead_strip	_if_usb_setup_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function if_usb_setup_firmware
lCPI0_0:
	.long	2                               ; 0x2
	.long	20                              ; 0x14
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_if_usb_setup_firmware:                 ; @if_usb_setup_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
	ldr	x20, [x0, #16]
	mov	w0, #32
	bl	_cpu_to_le16
	stp	xzr, x0, [sp, #40]
	ldr	w8, [x20]
	str	w8, [sp, #56]
Lloh0:
	adrp	x8, _CMD_SET_BOOT2_VER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CMD_SET_BOOT2_VER@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #32
	mov	x0, x19
	bl	_lbs_cmd_with_response
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_lbs_deb_usb
LBB0_2:
Lloh5:
	adrp	x8, lCPI0_0@PAGE
Lloh6:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19]
Lloh7:
	adrp	x8, _EHS_WAKE_ON_UNICAST_DATA@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EHS_WAKE_ON_UNICAST_DATA@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	bl	_lbs_host_sleep_cfg
	mov	w0, #32
	bl	_cpu_to_le16
	str	x0, [sp, #16]
Lloh10:
	adrp	x8, _CMD_ACT_GET@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CMD_ACT_GET@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_cpu_to_le16
	str	x0, [sp, #8]
Lloh13:
	adrp	x8, _CMD_802_11_FW_WAKE_METHOD@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CMD_802_11_FW_WAKE_METHOD@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	bl	_lbs_cmd_with_response
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w0, [x19, #8]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_netdev_info
Lloh18:
	adrp	x8, _FW_CAPINFO_PS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _FW_CAPINFO_PS@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	w9, [x19, #12]
	bic	w8, w9, w8
	str	w8, [x19, #12]
	b	LBB0_7
LBB0_4:
	ldr	w0, [sp]
	bl	_le16_to_cpu
Lloh21:
	adrp	x8, _CMD_WAKE_METHOD_COMMAND_INT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CMD_WAKE_METHOD_COMMAND_INT@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.5:
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_lbs_deb_usb
	b	LBB0_7
LBB0_6:
Lloh26:
	adrp	x8, _FW_CAPINFO_PS@GOTPAGE
Lloh27:
	ldr	x8, [x8, _FW_CAPINFO_PS@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	ldp	w0, w9, [x19, #8]
	bic	w8, w9, w8
	str	w8, [x19, #12]
Lloh29:
	adrp	x1, l_.str.3@PAGE
Lloh30:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_netdev_info
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdrp	Lloh5, Lloh7
	.loh AdrpLdr	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_SET_BOOT2_VER,4,2          ; @CMD_SET_BOOT2_VER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setting boot2 version failed\n"

	.comm	_EHS_WAKE_ON_UNICAST_DATA,4,2   ; @EHS_WAKE_ON_UNICAST_DATA
	.comm	_CMD_ACT_GET,4,2                ; @CMD_ACT_GET
	.comm	_CMD_802_11_FW_WAKE_METHOD,4,2  ; @CMD_802_11_FW_WAKE_METHOD
l_.str.1:                               ; @.str.1
	.asciz	"Firmware does not seem to support PS mode\n"

	.comm	_FW_CAPINFO_PS,4,2              ; @FW_CAPINFO_PS
	.comm	_CMD_WAKE_METHOD_COMMAND_INT,8,3 ; @CMD_WAKE_METHOD_COMMAND_INT
l_.str.2:                               ; @.str.2
	.asciz	"Firmware seems to support PS with wake-via-command\n"

l_.str.3:                               ; @.str.3
	.asciz	"Firmware doesn't wake via command interrupt; disabling PS mode\n"

	.no_dead_strip	_if_usb_setup_firmware
.subsections_via_symbols
