	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hid_submit_ctrl
_hid_submit_ctrl:                       ## @hid_submit_ctrl
	.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	(%rdi), %r14
	movq	(%r14), %rax
	movq	40(%r14), %rcx
	leaq	(%rax,%rax,2), %rax
	movq	16(%rcx,%rax,8), %r12
	movq	(%rcx,%rax,8), %rbx
	movb	8(%rcx,%rax,8), %r13b
	movq	_HID_REPORTED_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	52(%r14), %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_1
## %bb.12:
	movq	_resumption_waker@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$16, %r14
	movq	%r14, %rsi
	callq	_queue_work
LBB0_13:
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_1:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	(%r12), %ebx
	decl	%ebx
	sarl	$3, %ebx
	movb	%r13b, -41(%rbp)                ## 1-byte Spill
	xorl	%r13d, %r13d
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	cmpl	$0, 4(%r12)
	setg	%r13b
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rax
	movb	(%rax), %r12b
	movq	%r15, %rdi
	callq	_hid_to_usb_dev
	addl	%r13d, %ebx
	incl	%ebx
	movb	-41(%rbp), %r13b                ## 1-byte Reload
	cmpb	%r12b, %r13b
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	jne	LBB0_4
## %bb.2:
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	24(%r14), %rcx
	movl	%eax, 8(%rcx)
	movl	%ebx, (%rcx)
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	je	LBB0_7
## %bb.3:
	movl	48(%r14), %edi
	movq	%rbx, %rsi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_memcpy
	movq	%rbx, %rdi
	callq	_kfree
	movq	(%r14), %rax
	movq	40(%r14), %rcx
	leaq	(%rax,%rax,2), %rax
	movq	$0, (%rcx,%rax,8)
	jmp	LBB0_7
LBB0_4:
	xorl	%r12d, %r12d
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	movq	24(%r14), %rcx
	movl	%eax, 8(%rcx)
	movq	%r15, %rdi
	callq	_hid_to_usb_dev
	movq	24(%r14), %rcx
	movl	8(%rcx), %esi
	movl	%eax, %edi
	xorl	%edx, %edx
	callq	_usb_maxpacket
	testl	%eax, %eax
	jle	LBB0_6
## %bb.5:
	movl	%eax, %r13d
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movl	%eax, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %r12d
	imull	%r13d, %r12d
	movl	8(%r14), %eax
	cmpl	%eax, %r12d
	cmovgel	%eax, %r12d
LBB0_6:
	movq	24(%r14), %rax
	movl	%r12d, (%rax)
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movb	-41(%rbp), %r13b                ## 1-byte Reload
LBB0_7:
	movq	%r15, %rdi
	callq	_hid_to_usb_dev
	movq	24(%r14), %rcx
	movl	%eax, 4(%rcx)
	movq	_USB_TYPE_CLASS@GOTPCREL(%rip), %rax
	movq	_USB_RECIP_INTERFACE@GOTPCREL(%rip), %rcx
	movb	(%rax), %dl
	orb	%r13b, %dl
	orb	(%rcx), %dl
	movq	32(%r14), %rax
	movb	%dl, (%rax)
	movq	_HID_REQ_SET_REPORT@GOTPCREL(%rip), %r15
	movq	%r15, %rcx
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rdx
	cmpb	(%rdx), %r13b
	je	LBB0_9
## %bb.8:
	movq	_HID_REQ_GET_REPORT@GOTPCREL(%rip), %rcx
LBB0_9:
	movq	(%rcx), %rcx
	movq	%rcx, 8(%rax)
	movl	8(%r12), %edi
	shll	$8, %edi
	addl	$256, %edi                      ## imm = 0x100
	orl	4(%r12), %edi
	callq	_cpu_to_le16
	movq	32(%r14), %rcx
	movq	%rax, 32(%rcx)
	movl	12(%r14), %edi
	callq	_cpu_to_le16
	movq	32(%r14), %rcx
	movq	%rax, 24(%rcx)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_le16
	movq	32(%r14), %rdx
	movq	%rax, 16(%rdx)
	movq	8(%rdx), %rsi
	movq	24(%rdx), %rcx
	cmpq	(%r15), %rsi
	leaq	L_.str.1(%rip), %rdi
	leaq	L_.str.2(%rip), %rsi
	cmoveq	%rdi, %rsi
	movq	32(%rdx), %rdx
	leaq	L_.str(%rip), %rdi
	movq	%rax, %r8
	callq	_dbg_hid
	movq	24(%r14), %rdi
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_usb_submit_urb
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.3(%rip), %rdi
	callq	_err_hid
	movl	$-1, %eax
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r14)
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_HID_REPORTED_IDLE,4,2          ## @HID_REPORTED_IDLE
	.comm	_USB_DIR_OUT,1,0                ## @USB_DIR_OUT
	.comm	_USB_TYPE_CLASS,1,0             ## @USB_TYPE_CLASS
	.comm	_USB_RECIP_INTERFACE,1,0        ## @USB_RECIP_INTERFACE
	.comm	_HID_REQ_SET_REPORT,8,3         ## @HID_REQ_SET_REPORT
	.comm	_HID_REQ_GET_REPORT,8,3         ## @HID_REQ_GET_REPORT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"submitting ctrl urb: %s wValue=0x%04x wIndex=0x%04x wLength=%u\n"

L_.str.1:                               ## @.str.1
	.asciz	"Set_Report"

L_.str.2:                               ## @.str.2
	.asciz	"Get_Report"

	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
L_.str.3:                               ## @.str.3
	.asciz	"usb_submit_urb(ctrl) failed"

	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_resumption_waker,4,2           ## @resumption_waker
	.no_dead_strip	_hid_submit_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hid_submit_ctrl
_hid_submit_ctrl:                       ; @hid_submit_ctrl
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	ldr	x22, [x0]
	ldr	x8, [x22, #40]
	ldr	x9, [x22]
	mov	w10, #24
	madd	x8, x9, x10, x8
	ldr	x23, [x8, #16]
	ldr	x21, [x8]
	ldrb	w24, [x8, #8]
Lloh0:
	adrp	x8, _HID_REPORTED_IDLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HID_REPORTED_IDLE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x1, x22, #52
	bl	_test_bit
	cbz	w0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _resumption_waker@GOTPAGE
Lloh4:
	ldr	x8, [x8, _resumption_waker@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x1, x22, #16
	bl	_queue_work
	mov	w0, #0
	b	LBB0_12
LBB0_2:
	ldp	w8, w9, [x23]
	sub	w8, w8, #1
	asr	w8, w8, #3
	cmp	w9, #0
	cinc	w8, w8, gt
	add	w19, w8, #1
Lloh6:
	adrp	x25, _USB_DIR_OUT@GOTPAGE
Lloh7:
	ldr	x25, [x25, _USB_DIR_OUT@GOTPAGEOFF]
	ldrb	w26, [x25]
	mov	x0, x20
	bl	_hid_to_usb_dev
	cmp	w24, w26
	b.ne	LBB0_5
; %bb.3:
	mov	w1, #0
	bl	_usb_sndctrlpipe
	ldr	x8, [x22, #24]
	str	w0, [x8, #8]
	str	w19, [x8]
	cbz	x21, LBB0_9
; %bb.4:
	ldr	w0, [x22, #48]
	mov	x1, x21
	mov	x2, x19
	bl	_memcpy
	mov	x0, x21
	bl	_kfree
	ldr	x8, [x22, #40]
	ldr	x9, [x22]
	mov	w10, #24
	mul	x9, x9, x10
	str	xzr, [x8, x9]
	b	LBB0_9
LBB0_5:
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	ldr	x8, [x22, #24]
	str	w0, [x8, #8]
	mov	x0, x20
	bl	_hid_to_usb_dev
	ldr	x8, [x22, #24]
	ldr	w1, [x8, #8]
	mov	w2, #0
	bl	_usb_maxpacket
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.6:
	mov	x21, x0
	mov	x0, x19
	mov	x1, x21
	bl	_DIV_ROUND_UP
	mul	w8, w0, w21
	ldr	w9, [x22, #8]
	cmp	w8, w9
	csel	w8, w8, w9, lt
	b	LBB0_8
LBB0_7:
	mov	w8, #0
LBB0_8:
	ldr	x9, [x22, #24]
	str	w8, [x9]
LBB0_9:
	mov	x0, x20
	bl	_hid_to_usb_dev
	ldp	x8, x9, [x22, #24]
	str	w0, [x8, #4]
Lloh8:
	adrp	x8, _USB_TYPE_CLASS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _USB_TYPE_CLASS@GOTPAGEOFF]
	ldrb	w8, [x8]
Lloh10:
	adrp	x10, _USB_RECIP_INTERFACE@GOTPAGE
Lloh11:
	ldr	x10, [x10, _USB_RECIP_INTERFACE@GOTPAGEOFF]
	ldrb	w10, [x10]
	orr	w8, w8, w24
	orr	w8, w8, w10
	strb	w8, [x9]
Lloh12:
	adrp	x20, _HID_REQ_SET_REPORT@GOTPAGE
Lloh13:
	ldr	x20, [x20, _HID_REQ_SET_REPORT@GOTPAGEOFF]
	ldrb	w8, [x25]
Lloh14:
	adrp	x10, _HID_REQ_GET_REPORT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _HID_REQ_GET_REPORT@GOTPAGEOFF]
	cmp	w24, w8
	csel	x8, x20, x10, eq
	ldr	x8, [x8]
	str	x8, [x9, #8]
	ldp	w9, w8, [x23, #4]
	lsl	w8, w8, #8
	add	w8, w8, #256
	orr	w0, w8, w9
	bl	_cpu_to_le16
	ldr	x8, [x22, #32]
	str	x0, [x8, #32]
	ldr	w0, [x22, #12]
	bl	_cpu_to_le16
	ldr	x8, [x22, #32]
	str	x0, [x8, #24]
	mov	x0, x19
	bl	_cpu_to_le16
	mov	x4, x0
	ldr	x8, [x22, #32]
	str	x0, [x8, #16]
	ldr	x9, [x8, #8]
	ldr	x10, [x20]
Lloh16:
	adrp	x11, l_.str.2@PAGE
Lloh17:
	add	x11, x11, l_.str.2@PAGEOFF
Lloh18:
	adrp	x12, l_.str.1@PAGE
Lloh19:
	add	x12, x12, l_.str.1@PAGEOFF
	cmp	x9, x10
	csel	x1, x12, x11, eq
	ldp	x3, x2, [x8, #24]
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg_hid
	ldr	x0, [x22, #24]
Lloh22:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh23:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	bl	_usb_submit_urb
	cbz	x0, LBB0_11
; %bb.10:
Lloh25:
	adrp	x0, l_.str.3@PAGE
Lloh26:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_err_hid
	mov	w0, #-1
	b	LBB0_12
LBB0_11:
Lloh27:
	adrp	x8, _jiffies@GOTPAGE
Lloh28:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	str	w8, [x22, #20]
LBB0_12:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_HID_REPORTED_IDLE,4,2          ; @HID_REPORTED_IDLE
	.comm	_USB_DIR_OUT,1,0                ; @USB_DIR_OUT
	.comm	_USB_TYPE_CLASS,1,0             ; @USB_TYPE_CLASS
	.comm	_USB_RECIP_INTERFACE,1,0        ; @USB_RECIP_INTERFACE
	.comm	_HID_REQ_SET_REPORT,8,3         ; @HID_REQ_SET_REPORT
	.comm	_HID_REQ_GET_REPORT,8,3         ; @HID_REQ_GET_REPORT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"submitting ctrl urb: %s wValue=0x%04x wIndex=0x%04x wLength=%u\n"

l_.str.1:                               ; @.str.1
	.asciz	"Set_Report"

l_.str.2:                               ; @.str.2
	.asciz	"Get_Report"

	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
l_.str.3:                               ; @.str.3
	.asciz	"usb_submit_urb(ctrl) failed"

	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_resumption_waker,4,2           ; @resumption_waker
	.no_dead_strip	_hid_submit_ctrl
.subsections_via_symbols
