	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flexcop_usb_v8_memory_req
_flexcop_usb_v8_memory_req:             ## @flexcop_usb_v8_memory_req
	.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
	cmpl	$9, %r9d
	jb	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_err
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	movl	%r9d, %r13d
	movl	%edx, %r14d
	movl	%esi, %r12d
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	shll	$8, %r14d
	cmpl	$130, %esi
	je	LBB0_9
## %bb.4:
	cmpl	$129, %r12d
	je	LBB0_5
## %bb.6:
	cmpl	$128, %r12d
	jne	LBB0_8
## %bb.7:
	movq	%rdi, %r15
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	orl	(%r8), %r14d
	movq	_B2C2_USB_CTRL_PIPE_OUT@GOTPCREL(%rip), %rax
	movq	_B2C2_WAIT_FOR_OPERATION_V8WRITE@GOTPCREL(%rip), %rsi
	jmp	LBB0_10
LBB0_9:
	movq	%rdi, %r15
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	_B2C2_USB_CTRL_PIPE_OUT@GOTPCREL(%rip), %rax
	movq	_B2C2_WAIT_FOR_OPERATION_V8FLASH@GOTPCREL(%rip), %rsi
LBB0_10:
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rdx
	jmp	LBB0_11
LBB0_5:
	movq	%rdi, %r15
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	_B2C2_USB_CTRL_PIPE_IN@GOTPCREL(%rip), %rax
	movq	_B2C2_WAIT_FOR_OPERATION_V8READ@GOTPCREL(%rip), %rsi
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rdx
LBB0_11:
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	(%rsi), %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	orl	(%rdx), %ebx
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	movl	%r14d, %r8d
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%r13d, %r9d
	callq	_deb_v8
	leaq	8(%r15), %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	_USB_ENDPOINT_DIR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	movl	%ebx, %ecx
	jne	LBB0_13
## %bb.12:
	movq	(%r15), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%r13d, %edx
	movl	%ecx, %ebx
	callq	_memcpy
	movl	%ebx, %ecx
LBB0_13:
	movl	12(%r15), %edi
	movq	_HZ@GOTPCREL(%rip), %rax
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	imull	(%rax), %ebx
	subq	$8, %rsp
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	movl	%ecx, %r12d
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	movl	%r14d, %r9d
	pushq	%rbx
	pushq	%r13
	pushq	(%r15)
	callq	_usb_control_msg
	addq	$32, %rsp
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	subl	(%rcx), %ebx
	cmpl	%r13d, %eax
	cmovel	%eax, %ebx
	testl	%ebx, %ebx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	js	LBB0_17
## %bb.14:
	movq	_USB_ENDPOINT_DIR_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_16
## %bb.15:
	movq	(%r15), %rsi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_memcpy
LBB0_16:
	xorl	%ebx, %ebx
LBB0_17:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	_deb_v8@GOTPCREL(%rip), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_debug_dump
	jmp	LBB0_18
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	callq	_deb_info
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Buffer size bigger than max URB control message\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_B2C2_WAIT_FOR_OPERATION_V8READ,4,2 ## @B2C2_WAIT_FOR_OPERATION_V8READ
	.comm	_USB_DIR_IN,4,2                 ## @USB_DIR_IN
	.comm	_B2C2_USB_CTRL_PIPE_IN,4,2      ## @B2C2_USB_CTRL_PIPE_IN
	.comm	_USB_DIR_OUT,4,2                ## @USB_DIR_OUT
	.comm	_B2C2_WAIT_FOR_OPERATION_V8WRITE,4,2 ## @B2C2_WAIT_FOR_OPERATION_V8WRITE
	.comm	_B2C2_USB_CTRL_PIPE_OUT,4,2     ## @B2C2_USB_CTRL_PIPE_OUT
	.comm	_B2C2_WAIT_FOR_OPERATION_V8FLASH,4,2 ## @B2C2_WAIT_FOR_OPERATION_V8FLASH
L_.str.1:                               ## @.str.1
	.asciz	"unsupported request for v8_mem_req %x.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"v8mem: %02x %02x %04x %04x, len: %d\n"

	.comm	_USB_ENDPOINT_DIR_MASK,4,2      ## @USB_ENDPOINT_DIR_MASK
	.comm	_HZ,4,2                         ## @HZ
	.no_dead_strip	_flexcop_usb_v8_memory_req
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flexcop_usb_v8_memory_req
_flexcop_usb_v8_memory_req:             ; @flexcop_usb_v8_memory_req
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cmp	w5, #9
	b.lo	LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_17
LBB0_2:
	mov	x20, x5
	mov	x19, x4
	mov	x23, x3
	mov	x22, x1
	mov	x21, x0
Lloh4:
	adrp	x8, _USB_TYPE_VENDOR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _USB_TYPE_VENDOR@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	lsl	w24, w2, #8
Lloh7:
	adrp	x11, _USB_DIR_IN@GOTPAGE
Lloh8:
	ldr	x11, [x11, _USB_DIR_IN@GOTPAGEOFF]
	cmp	w1, #130
	b.eq	LBB0_6
; %bb.3:
	cmp	w22, #129
	b.eq	LBB0_8
; %bb.4:
	cmp	w22, #128
	b.ne	LBB0_16
; %bb.5:
	ldr	w9, [x19]
	orr	w24, w9, w24
Lloh9:
	adrp	x9, _B2C2_USB_CTRL_PIPE_OUT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _B2C2_USB_CTRL_PIPE_OUT@GOTPAGEOFF]
Lloh11:
	adrp	x10, _B2C2_WAIT_FOR_OPERATION_V8WRITE@GOTPAGE
Lloh12:
	ldr	x10, [x10, _B2C2_WAIT_FOR_OPERATION_V8WRITE@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh13:
	adrp	x9, _B2C2_USB_CTRL_PIPE_OUT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _B2C2_USB_CTRL_PIPE_OUT@GOTPAGEOFF]
Lloh15:
	adrp	x10, _B2C2_WAIT_FOR_OPERATION_V8FLASH@GOTPAGE
Lloh16:
	ldr	x10, [x10, _B2C2_WAIT_FOR_OPERATION_V8FLASH@GOTPAGEOFF]
LBB0_7:
Lloh17:
	adrp	x11, _USB_DIR_OUT@GOTPAGE
Lloh18:
	ldr	x11, [x11, _USB_DIR_OUT@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh19:
	adrp	x9, _B2C2_USB_CTRL_PIPE_IN@GOTPAGE
Lloh20:
	ldr	x9, [x9, _B2C2_USB_CTRL_PIPE_IN@GOTPAGEOFF]
Lloh21:
	adrp	x10, _B2C2_WAIT_FOR_OPERATION_V8READ@GOTPAGE
Lloh22:
	ldr	x10, [x10, _B2C2_WAIT_FOR_OPERATION_V8READ@GOTPAGEOFF]
LBB0_9:
	ldr	w27, [x9]
	ldr	w28, [x10]
	ldr	w9, [x11]
	orr	w26, w9, w8
Lloh23:
	adrp	x0, l_.str.2@PAGE
Lloh24:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x26
	mov	x2, x22
	mov	x3, x23
	mov	x4, x24
	mov	x5, x20
	bl	_deb_v8
	add	x25, x21, #8
	mov	x0, x25
	bl	_mutex_lock
Lloh25:
	adrp	x8, _USB_ENDPOINT_DIR_MASK@GOTPAGE
Lloh26:
	ldr	x8, [x8, _USB_ENDPOINT_DIR_MASK@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	and	w8, w8, w26
Lloh28:
	adrp	x9, _USB_DIR_OUT@GOTPAGE
Lloh29:
	ldr	x9, [x9, _USB_DIR_OUT@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_11
; %bb.10:
	ldr	x0, [x21]
	mov	x1, x19
	mov	x2, x20
	bl	_memcpy
LBB0_11:
	ldr	w0, [x21, #12]
	ldr	x6, [x21]
Lloh31:
	adrp	x8, _HZ@GOTPAGE
Lloh32:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	mul	w8, w8, w28
	str	w8, [sp]
	mov	x1, x27
	mov	x2, x22
	mov	x3, x26
	mov	x4, x23
	mov	x5, x24
	mov	x7, x20
	bl	_usb_control_msg
Lloh34:
	adrp	x8, _EIO@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	cmp	w0, w20
	csneg	w22, w0, w8, eq
	tbnz	w22, #31, LBB0_15
; %bb.12:
Lloh37:
	adrp	x8, _USB_ENDPOINT_DIR_MASK@GOTPAGE
Lloh38:
	ldr	x8, [x8, _USB_ENDPOINT_DIR_MASK@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	and	w8, w8, w26
Lloh40:
	adrp	x9, _USB_DIR_IN@GOTPAGE
Lloh41:
	ldr	x9, [x9, _USB_DIR_IN@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_14
; %bb.13:
	ldr	x1, [x21]
	mov	x0, x19
	mov	x2, x20
	bl	_memcpy
LBB0_14:
	mov	w22, #0
LBB0_15:
	mov	x0, x25
	bl	_mutex_unlock
Lloh43:
	adrp	x2, _deb_v8@GOTPAGE
Lloh44:
	ldr	x2, [x2, _deb_v8@GOTPAGEOFF]
	mov	x0, x19
	mov	x1, x22
	bl	_debug_dump
	b	LBB0_18
LBB0_16:
Lloh45:
	adrp	x0, l_.str.1@PAGE
Lloh46:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x22
	bl	_deb_info
Lloh47:
	adrp	x8, _EINVAL@GOTPAGE
Lloh48:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_18:
	mov	x0, x22
	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
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpAdd	Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Buffer size bigger than max URB control message\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_B2C2_WAIT_FOR_OPERATION_V8READ,4,2 ; @B2C2_WAIT_FOR_OPERATION_V8READ
	.comm	_USB_DIR_IN,4,2                 ; @USB_DIR_IN
	.comm	_B2C2_USB_CTRL_PIPE_IN,4,2      ; @B2C2_USB_CTRL_PIPE_IN
	.comm	_USB_DIR_OUT,4,2                ; @USB_DIR_OUT
	.comm	_B2C2_WAIT_FOR_OPERATION_V8WRITE,4,2 ; @B2C2_WAIT_FOR_OPERATION_V8WRITE
	.comm	_B2C2_USB_CTRL_PIPE_OUT,4,2     ; @B2C2_USB_CTRL_PIPE_OUT
	.comm	_B2C2_WAIT_FOR_OPERATION_V8FLASH,4,2 ; @B2C2_WAIT_FOR_OPERATION_V8FLASH
l_.str.1:                               ; @.str.1
	.asciz	"unsupported request for v8_mem_req %x.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"v8mem: %02x %02x %04x %04x, len: %d\n"

	.comm	_USB_ENDPOINT_DIR_MASK,4,2      ; @USB_ENDPOINT_DIR_MASK
	.comm	_HZ,4,2                         ; @HZ
	.no_dead_strip	_flexcop_usb_v8_memory_req
.subsections_via_symbols
