	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function esd_usb2_setup_rx_urbs
_esd_usb2_setup_rx_urbs:                ## @esd_usb2_setup_rx_urbs
	.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
	xorl	%r13d, %r13d
	cmpl	$0, (%rdi)
	jne	LBB0_19
## %bb.1:
	movq	_MAX_RX_URBS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_2
## %bb.3:
	leaq	16(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movq	_RX_BUFFER_SIZE@GOTPCREL(%rip), %r14
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r13), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r12, %rdi
	callq	_usb_free_urb
	testl	%r13d, %r13d
	jne	LBB0_15
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	incl	%r15d
	movq	_MAX_RX_URBS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	movq	_RX_BUFFER_SIZE@GOTPCREL(%rip), %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	jge	LBB0_12
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %esi
	xorl	%edi, %edi
	callq	_usb_alloc_urb
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r12
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r15), %rdi
	movl	(%r14), %esi
	movl	(%rbx), %edx
	movq	%rax, %rcx
	callq	_usb_alloc_coherent
	movq	8(%r15), %r13
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_usb_rcvbulkpipe
	movl	(%r14), %r8d
	movq	_esd_usb2_read_bulk_callback@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	movq	%r15, (%rsp)
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	%eax, %edx
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rcx
	callq	_usb_fill_bulk_urb
	movq	_URB_NO_TRANSFER_DMA_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%r12)
	movq	%r12, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_usb_anchor_urb
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_usb_submit_urb
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	callq	_usb_free_urb
	jmp	LBB0_11
LBB0_2:
	xorl	%r13d, %r13d
	jmp	LBB0_18
LBB0_5:
	xorl	%r13d, %r13d
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	testl	%r15d, %r15d
	jne	LBB0_12
LBB0_18:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_19
LBB0_9:
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_usb_unanchor_urb
	movq	8(%r15), %rdi
	movq	_RX_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %ecx
	movq	%rbx, %rdx
	callq	_usb_free_coherent
	movq	%r12, %rdi
	callq	_usb_free_urb
	jmp	LBB0_16
LBB0_15:
	negl	%r13d
LBB0_16:
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	testl	%r15d, %r15d
	je	LBB0_18
LBB0_12:
	movq	_MAX_RX_URBS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jge	LBB0_14
## %bb.13:
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_warn
LBB0_14:
	movl	$1, (%rbx)
	xorl	%r13d, %r13d
LBB0_19:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_RX_URBS,4,2                ## @MAX_RX_URBS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_RX_BUFFER_SIZE,4,2             ## @RX_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No memory left for USB buffer\n"

	.comm	_esd_usb2_read_bulk_callback,4,2 ## @esd_usb2_read_bulk_callback
	.comm	_URB_NO_TRANSFER_DMA_MAP,4,2    ## @URB_NO_TRANSFER_DMA_MAP
L_.str.1:                               ## @.str.1
	.asciz	"couldn't setup read URBs\n"

L_.str.2:                               ## @.str.2
	.asciz	"rx performance may be slow\n"

	.no_dead_strip	_esd_usb2_setup_rx_urbs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function esd_usb2_setup_rx_urbs
_esd_usb2_setup_rx_urbs:                ; @esd_usb2_setup_rx_urbs
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	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
	.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
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	mov	w23, #0
	b	LBB0_18
LBB0_2:
	mov	x19, x0
Lloh0:
	adrp	x25, _MAX_RX_URBS@GOTPAGE
Lloh1:
	ldr	x25, [x25, _MAX_RX_URBS@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.3:
	mov	w26, #0
	add	x20, x19, #16
Lloh2:
	adrp	x28, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x28, [x28, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	adrp	x27, _RX_BUFFER_SIZE@GOTPAGE
Lloh5:
	ldr	x27, [x27, _RX_BUFFER_SIZE@GOTPAGEOFF]
Lloh6:
	adrp	x21, _URB_NO_TRANSFER_DMA_MAP@GOTPAGE
Lloh7:
	ldr	x21, [x21, _URB_NO_TRANSFER_DMA_MAP@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x23]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w23, [x8]
	mov	x0, x22
	bl	_usb_free_urb
	cbnz	w23, LBB0_16
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	w26, w26, #1
	ldr	w8, [x25]
	cmp	w26, w8
	b.ge	LBB0_13
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x28]
	mov	w0, #0
	bl	_usb_alloc_urb
	cbz	x0, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x22, x0
	ldr	x0, [x19, #8]
	ldr	w1, [x27]
	ldr	w2, [x28]
	mov	x3, x22
	bl	_usb_alloc_coherent
	ldr	x23, [x19, #8]
	cbz	x0, LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x24, x0
	mov	x0, x23
	mov	w1, #1
	bl	_usb_rcvbulkpipe
	mov	x2, x0
	ldr	w4, [x27]
Lloh13:
	adrp	x8, _esd_usb2_read_bulk_callback@GOTPAGE
Lloh14:
	ldr	x8, [x8, _esd_usb2_read_bulk_callback@GOTPAGEOFF]
Lloh15:
	ldr	w5, [x8]
	mov	x0, x22
	mov	x1, x23
	mov	x3, x24
	mov	x6, x19
	bl	_usb_fill_bulk_urb
	ldr	w8, [x21]
	ldr	w9, [x22, #4]
	orr	w8, w9, w8
	str	w8, [x22, #4]
	mov	x0, x22
	mov	x1, x20
	bl	_usb_anchor_urb
	ldr	w1, [x28]
	mov	x0, x22
	bl	_usb_submit_urb
	cbnz	w0, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x22
	bl	_usb_free_urb
	b	LBB0_5
LBB0_10:
	mov	w23, #0
	b	LBB0_17
LBB0_11:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w23, w8
	cbnz	w26, LBB0_13
	b	LBB0_17
LBB0_12:
	mov	x23, x0
	mov	x0, x22
	bl	_usb_unanchor_urb
	ldr	x0, [x19, #8]
	ldr	w1, [x27]
	ldr	w3, [x22]
	mov	x2, x24
	bl	_usb_free_coherent
	mov	x0, x22
	bl	_usb_free_urb
	cbz	w26, LBB0_17
LBB0_13:
	ldr	w8, [x25]
	cmp	w26, w8
	b.ge	LBB0_15
; %bb.14:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
LBB0_15:
	mov	w23, #0
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_18
LBB0_16:
	neg	w23, w23
	cbnz	w26, LBB0_13
LBB0_17:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_18:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_RX_URBS,4,2                ; @MAX_RX_URBS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_RX_BUFFER_SIZE,4,2             ; @RX_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No memory left for USB buffer\n"

	.comm	_esd_usb2_read_bulk_callback,4,2 ; @esd_usb2_read_bulk_callback
	.comm	_URB_NO_TRANSFER_DMA_MAP,4,2    ; @URB_NO_TRANSFER_DMA_MAP
l_.str.1:                               ; @.str.1
	.asciz	"couldn't setup read URBs\n"

l_.str.2:                               ; @.str.2
	.asciz	"rx performance may be slow\n"

	.no_dead_strip	_esd_usb2_setup_rx_urbs
.subsections_via_symbols
