	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dib0700_rc_setup               ## -- Begin function dib0700_rc_setup
	.p2align	4, 0x90
_dib0700_rc_setup:                      ## @dib0700_rc_setup
	.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
	xorl	%r12d, %r12d
	testq	%rsi, %rsi
	je	LBB0_20
## %bb.1:
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	cmpl	$66048, (%rax)                  ## imm = 0x10200
	jl	LBB0_20
## %bb.2:
	movq	%rsi, %rbx
	movq	(%rsi), %rax
	cmpl	$1, 8(%rax)
	jg	LBB0_5
## %bb.3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_20
LBB0_5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	xorl	%r12d, %r12d
	xorl	%edi, %edi
	callq	_usb_alloc_urb
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r14
	movq	_RC_MSG_SIZE_V1_20@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movl	(%r13), %esi
	callq	_kzalloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%r12, %r13
	movq	_EINPROGRESS@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 8(%r14)
	movq	(%rbx), %rax
	movq	(%rax), %rbx
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_usb_endpoint_dir_in
	testq	%rax, %rax
	je	LBB0_15
## %bb.10:
	movq	%rbx, %rdi
	callq	_usb_endpoint_xfer_bulk
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movl	(%r15), %edi
	movl	$1, %esi
	callq	_usb_rcvbulkpipe
	movl	%eax, %ebx
	movl	(%r15), %esi
	movq	(%r14), %rcx
	movl	(%r13), %r8d
	movq	_dib0700_rc_urb_completion@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	subq	$8, %rsp
	movq	%r14, %rdi
	movl	%ebx, %edx
	pushq	%r15
	callq	_usb_fill_bulk_urb
	jmp	LBB0_14
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_20
LBB0_8:
	leaq	L_.str(%rip), %rdi
	callq	_err
	movq	%r14, %rdi
	callq	_usb_free_urb
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_12:
	movq	%rbx, %rdi
	callq	_usb_endpoint_xfer_int
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movl	(%r15), %edi
	movl	$1, %esi
	callq	_usb_rcvintpipe
	movl	%eax, %ebx
	movl	(%r15), %esi
	movq	(%r14), %rcx
	movl	(%r13), %r8d
	movq	_dib0700_rc_urb_completion@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r14, %rdi
	movl	%ebx, %edx
	pushq	$1
	pushq	%r15
	callq	_usb_fill_int_urb
LBB0_14:
	addq	$16, %rsp
	testl	%ebx, %ebx
	je	LBB0_15
## %bb.16:
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_usb_submit_urb
	testl	%eax, %eax
	je	LBB0_17
## %bb.18:
	movl	%eax, %r12d
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_19
LBB0_15:
	leaq	L_.str.1(%rip), %rdi
LBB0_19:
	callq	_err
	movq	(%r14), %rdi
	callq	_kfree
	movq	%r14, %rdi
	callq	_usb_free_urb
LBB0_20:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	xorl	%r12d, %r12d
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_RC_MSG_SIZE_V1_20,4,2          ## @RC_MSG_SIZE_V1_20
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rc kzalloc failed"

	.comm	_EINPROGRESS,4,2                ## @EINPROGRESS
	.comm	_dib0700_rc_urb_completion,4,2  ## @dib0700_rc_urb_completion
L_.str.1:                               ## @.str.1
	.asciz	"There's no endpoint for remote controller"

	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
L_.str.2:                               ## @.str.2
	.asciz	"rc submit urb failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dib0700_rc_setup               ; -- Begin function dib0700_rc_setup
	.p2align	2
_dib0700_rc_setup:                      ; @dib0700_rc_setup
	.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	w22, #0
	cbz	x1, LBB0_12
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
	mov	w9, #512
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.lt	LBB0_12
; %bb.2:
	mov	x21, x1
	ldr	x8, [x1]
	ldr	w8, [x8, #8]
	cmp	w8, #1
	b.gt	LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_11
LBB0_4:
Lloh2:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #0
	bl	_usb_alloc_urb
	cbz	x0, LBB0_10
; %bb.5:
	mov	x19, x0
Lloh4:
	adrp	x22, _RC_MSG_SIZE_V1_20@GOTPAGE
Lloh5:
	ldr	x22, [x22, _RC_MSG_SIZE_V1_20@GOTPAGEOFF]
	ldr	w0, [x22]
	ldr	w1, [x23]
	bl	_kzalloc
	str	x0, [x19]
	cbz	x0, LBB0_9
; %bb.6:
Lloh6:
	adrp	x8, _EINPROGRESS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINPROGRESS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x19, #8]
	ldr	x8, [x21]
	ldr	x8, [x8]
	add	x21, x8, #4
	mov	x0, x21
	bl	_usb_endpoint_dir_in
	cbz	x0, LBB0_17
; %bb.7:
	mov	x0, x21
	bl	_usb_endpoint_xfer_bulk
	cbz	x0, LBB0_13
; %bb.8:
	ldr	w0, [x20]
	mov	w1, #1
	bl	_usb_rcvbulkpipe
	mov	x21, x0
	ldr	w1, [x20]
	ldr	x3, [x19]
	ldr	w4, [x22]
Lloh9:
	adrp	x8, _dib0700_rc_urb_completion@GOTPAGE
Lloh10:
	ldr	x8, [x8, _dib0700_rc_urb_completion@GOTPAGEOFF]
Lloh11:
	ldr	w5, [x8]
	mov	x0, x19
	mov	x2, x21
	mov	x6, x20
	bl	_usb_fill_bulk_urb
	cbnz	w21, LBB0_15
	b	LBB0_17
LBB0_9:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
	mov	x0, x19
	bl	_usb_free_urb
LBB0_10:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_12:
	mov	x0, x22
	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
LBB0_13:
	mov	x0, x21
	bl	_usb_endpoint_xfer_int
	cbz	x0, LBB0_17
; %bb.14:
	ldr	w0, [x20]
	mov	w1, #1
	bl	_usb_rcvintpipe
	mov	x21, x0
	ldr	w1, [x20]
	ldr	x3, [x19]
	ldr	w4, [x22]
Lloh16:
	adrp	x8, _dib0700_rc_urb_completion@GOTPAGE
Lloh17:
	ldr	x8, [x8, _dib0700_rc_urb_completion@GOTPAGEOFF]
Lloh18:
	ldr	w5, [x8]
	mov	x0, x19
	mov	x2, x21
	mov	x6, x20
	mov	w7, #1
	bl	_usb_fill_int_urb
	cbz	w21, LBB0_17
LBB0_15:
Lloh19:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh20:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_usb_submit_urb
	mov	x22, x0
	cbz	w0, LBB0_12
; %bb.16:
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_err
	ldr	x0, [x19]
	bl	_kfree
	mov	x0, x19
	bl	_usb_free_urb
	b	LBB0_12
LBB0_17:
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_err
	ldr	x0, [x19]
	bl	_kfree
	mov	x0, x19
	bl	_usb_free_urb
	mov	w22, #0
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_RC_MSG_SIZE_V1_20,4,2          ; @RC_MSG_SIZE_V1_20
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rc kzalloc failed"

	.comm	_EINPROGRESS,4,2                ; @EINPROGRESS
	.comm	_dib0700_rc_urb_completion,4,2  ; @dib0700_rc_urb_completion
l_.str.1:                               ; @.str.1
	.asciz	"There's no endpoint for remote controller"

	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
l_.str.2:                               ; @.str.2
	.asciz	"rc submit urb failed"

.subsections_via_symbols
