	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __mt76u_vendor_request
___mt76u_vendor_request:                ## @__mt76u_vendor_request
	.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	%r9, -80(%rbp)                  ## 8-byte Spill
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movl	%edx, %ebx
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	movl	(%rdi), %edi
	callq	_to_usb_device
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rcx
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	testl	%ebx, (%rcx)
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	je	LBB0_2
## %bb.1:
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	jmp	LBB0_3
LBB0_2:
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
LBB0_3:
	movl	%eax, %r15d
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	leaq	4(%r14), %r12
	xorl	%ebx, %ebx
	movq	_ENODEV@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MT76_REMOVED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_MT_VEND_REQ_TOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subq	$8, %rsp
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	-56(%rbp), %r8d                 ## 4-byte Reload
	movl	-48(%rbp), %r9d                 ## 4-byte Reload
	pushq	%rax
	pushq	16(%rbp)
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %r13d
	movl	(%r14), %eax
	addl	%r13d, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_MT76_REMOVED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_set_bit
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	testl	%r13d, %r13d
	jns	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r14), %eax
	addl	%r13d, %eax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	$5000, %edi                     ## imm = 0x1388
	movl	$10000, %esi                    ## imm = 0x2710
	callq	_usleep_range
	incl	%ebx
	movq	_MT_VEND_REQ_MAX_RETRY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jl	LBB0_4
## %bb.11:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	%r13d, %r8d
	callq	_dev_err
	jmp	LBB0_12
LBB0_5:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_12:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_USB_DIR_IN,4,2                 ## @USB_DIR_IN
	.comm	_MT_VEND_REQ_MAX_RETRY,4,2      ## @MT_VEND_REQ_MAX_RETRY
	.comm	_MT76_REMOVED,4,2               ## @MT76_REMOVED
	.comm	_EIO,4,2                        ## @EIO
	.comm	_MT_VEND_REQ_TOUT_MS,4,2        ## @MT_VEND_REQ_TOUT_MS
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vendor request req:%02x off:%04x failed:%d\n"

	.no_dead_strip	___mt76u_vendor_request
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __mt76u_vendor_request
___mt76u_vendor_request:                ; @__mt76u_vendor_request
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	stp	x5, x6, [sp, #24]               ; 16-byte Folded Spill
	str	w4, [sp, #44]                   ; 4-byte Folded Spill
	mov	x23, x3
	mov	x24, x2
	mov	x20, x1
	mov	x21, x0
	ldr	w0, [x0]
	bl	_to_usb_device
	mov	x26, x0
Lloh0:
	adrp	x8, _USB_DIR_IN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _USB_DIR_IN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_2
; %bb.1:
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	b	LBB0_3
LBB0_2:
	mov	w1, #0
	bl	_usb_sndctrlpipe
LBB0_3:
	mov	x27, x0
	mov	w19, #0
	str	x21, [sp, #16]                  ; 8-byte Folded Spill
	add	x28, x21, #4
Lloh3:
	adrp	x21, _MT76_REMOVED@GOTPAGE
Lloh4:
	ldr	x21, [x21, _MT76_REMOVED@GOTPAGEOFF]
Lloh5:
	adrp	x22, _ENODEV@GOTPAGE
Lloh6:
	ldr	x22, [x22, _ENODEV@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	mov	x1, x28
	bl	_test_bit
	cbnz	x0, LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh7:
	adrp	x8, _MT_VEND_REQ_TOUT_MS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MT_VEND_REQ_TOUT_MS@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [sp]
	mov	x0, x26
	mov	x1, x27
	mov	x2, x20
	mov	x3, x24
	mov	x4, x23
	ldr	w5, [sp, #44]                   ; 4-byte Folded Reload
	ldp	x6, x7, [sp, #24]               ; 16-byte Folded Reload
	bl	_usb_control_msg
	mov	x25, x0
	ldr	w8, [x22]
	cmn	w0, w8
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x21]
	mov	x1, x28
	bl	_set_bit
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	tbz	w25, #31, LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22]
	cmn	w25, w8
	b.eq	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #5000
	mov	w1, #10000
	bl	_usleep_range
	add	w19, w19, #1
Lloh10:
	adrp	x8, _MT_VEND_REQ_MAX_RETRY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MT_VEND_REQ_MAX_RETRY@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w19, w8
	b.lt	LBB0_4
; %bb.10:
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldr	w0, [x8]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	ldr	w3, [sp, #44]                   ; 4-byte Folded Reload
	mov	x4, x25
	bl	_dev_err
	b	LBB0_12
LBB0_11:
Lloh15:
	adrp	x8, _EIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_12:
	mov	x0, x25
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_USB_DIR_IN,4,2                 ; @USB_DIR_IN
	.comm	_MT_VEND_REQ_MAX_RETRY,4,2      ; @MT_VEND_REQ_MAX_RETRY
	.comm	_MT76_REMOVED,4,2               ; @MT76_REMOVED
	.comm	_EIO,4,2                        ; @EIO
	.comm	_MT_VEND_REQ_TOUT_MS,4,2        ; @MT_VEND_REQ_TOUT_MS
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vendor request req:%02x off:%04x failed:%d\n"

	.no_dead_strip	___mt76u_vendor_request
.subsections_via_symbols
