	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_usb_setup_rx_urbs
_kvaser_usb_setup_rx_urbs:              ## @kvaser_usb_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	%r14d, %r14d
	cmpl	$0, (%rdi)
	jne	LBB0_17
## %bb.1:
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_KVASER_USB_MAX_RX_URBS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_8
## %bb.2:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	leaq	36(%r15), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movq	_KVASER_USB_RX_BUFFER_SIZE@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	xorl	%edi, %edi
	callq	_usb_alloc_urb
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %r12
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	32(%r15), %edi
	movl	(%r14), %esi
	movl	(%r13), %edx
	leaq	-64(%rbp), %rcx
	callq	_usb_alloc_coherent
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %rbx
	movl	32(%r15), %r13d
	movq	40(%r15), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_usb_rcvbulkpipe
	movl	(%r14), %r8d
	movq	_kvaser_usb_read_bulk_callback@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	movq	%r15, (%rsp)
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	movq	%rbx, %rcx
	callq	_usb_fill_bulk_urb
	movq	-64(%rbp), %rax
	movq	%rax, 8(%r12)
	movq	_URB_NO_TRANSFER_DMA_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r12)
	movq	%r12, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_usb_anchor_urb
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movq	%rax, %r13
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_usb_submit_urb
	testl	%eax, %eax
	jne	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	24(%r15), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rbx, (%rax,%rcx,8)
	movq	%rcx, %rbx
	movq	-64(%rbp), %rax
	movq	16(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	%r12, %rdi
	callq	_usb_free_urb
	incq	%rbx
	movq	_KVASER_USB_MAX_RX_URBS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	movq	_KVASER_USB_RX_BUFFER_SIZE@GOTPCREL(%rip), %r14
	jl	LBB0_3
## %bb.7:
	xorl	%r14d, %r14d
	testl	%ebx, %ebx
	jne	LBB0_12
	jmp	LBB0_16
LBB0_8:
	xorl	%r14d, %r14d
	jmp	LBB0_16
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	testl	%ebx, %ebx
	jne	LBB0_12
LBB0_16:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_warn
	jmp	LBB0_17
LBB0_10:
	movq	8(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_dev_warn
	movq	%r12, %rdi
	callq	_usb_free_urb
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_11
LBB0_15:
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_usb_unanchor_urb
	movl	32(%r15), %edi
	movq	_KVASER_USB_RX_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-64(%rbp), %rcx
	movq	%rbx, %rdx
	callq	_usb_free_coherent
	movq	%r12, %rdi
	callq	_usb_free_urb
LBB0_11:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	testl	%ebx, %ebx
	je	LBB0_16
LBB0_12:
	movq	_KVASER_USB_MAX_RX_URBS@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jle	LBB0_14
## %bb.13:
	movq	8(%rbx), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_14:
	movl	$1, (%rbx)
	xorl	%r14d, %r14d
LBB0_17:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KVASER_USB_MAX_RX_URBS,4,2     ## @KVASER_USB_MAX_RX_URBS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_KVASER_USB_RX_BUFFER_SIZE,4,2  ## @KVASER_USB_RX_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No memory left for USB buffer\n"

	.comm	_kvaser_usb_read_bulk_callback,4,2 ## @kvaser_usb_read_bulk_callback
	.comm	_URB_NO_TRANSFER_DMA_MAP,4,2    ## @URB_NO_TRANSFER_DMA_MAP
L_.str.1:                               ## @.str.1
	.asciz	"Cannot setup read URBs, error %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"RX performances may be slow\n"

	.no_dead_strip	_kvaser_usb_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 kvaser_usb_setup_rx_urbs
_kvaser_usb_setup_rx_urbs:              ; @kvaser_usb_setup_rx_urbs
	.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
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	mov	w22, #0
	b	LBB0_17
LBB0_2:
	mov	x19, x0
Lloh0:
	adrp	x8, _KVASER_USB_MAX_RX_URBS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KVASER_USB_MAX_RX_URBS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.3:
	mov	x25, #0
	add	x20, x19, #36
Lloh3:
	adrp	x27, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x27, [x27, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	adrp	x26, _KVASER_USB_RX_BUFFER_SIZE@GOTPAGE
Lloh6:
	ldr	x26, [x26, _KVASER_USB_RX_BUFFER_SIZE@GOTPAGEOFF]
Lloh7:
	adrp	x28, _kvaser_usb_read_bulk_callback@GOTPAGE
Lloh8:
	ldr	x28, [x28, _kvaser_usb_read_bulk_callback@GOTPAGEOFF]
Lloh9:
	adrp	x24, _URB_NO_TRANSFER_DMA_MAP@GOTPAGE
Lloh10:
	ldr	x24, [x24, _URB_NO_TRANSFER_DMA_MAP@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x27]
	mov	w0, #0
	bl	_usb_alloc_urb
	cbz	x0, LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x21, x0
	ldr	w0, [x19, #32]
	ldr	w1, [x26]
	ldr	w2, [x27]
	add	x3, sp, #8
	bl	_usb_alloc_coherent
	cbz	x0, LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x0
	ldr	w22, [x19, #32]
	ldr	x8, [x19, #40]
	ldr	w1, [x8]
	mov	x0, x22
	bl	_usb_rcvbulkpipe
	mov	x2, x0
	ldr	w4, [x26]
	ldr	w5, [x28]
	mov	x0, x21
	mov	x1, x22
	mov	x3, x23
	mov	x6, x19
	bl	_usb_fill_bulk_urb
	ldr	x8, [sp, #8]
	str	x8, [x21, #8]
	ldr	w8, [x24]
	ldr	w9, [x21]
	orr	w8, w9, w8
	str	w8, [x21]
	mov	x0, x21
	mov	x1, x20
	bl	_usb_anchor_urb
	ldr	w1, [x27]
	mov	x0, x21
	bl	_usb_submit_urb
	cbnz	w0, LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #24]
	lsl	x9, x25, #3
	str	x23, [x8, x9]
	ldr	x8, [sp, #8]
	ldr	x10, [x19, #16]
	str	x8, [x10, x9]
	mov	x0, x21
	bl	_usb_free_urb
	add	x25, x25, #1
Lloh11:
	adrp	x8, _KVASER_USB_MAX_RX_URBS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _KVASER_USB_MAX_RX_URBS@GOTPAGEOFF]
Lloh13:
	ldrsw	x8, [x8]
	cmp	x25, x8
	b.lt	LBB0_4
; %bb.8:
	mov	w22, #0
	cbnz	w25, LBB0_12
	b	LBB0_16
LBB0_9:
	mov	w22, #0
	b	LBB0_16
LBB0_10:
	ldr	x0, [x19, #8]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
	mov	x0, x21
	bl	_usb_free_urb
LBB0_11:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w22, w8
	cbz	w25, LBB0_16
LBB0_12:
Lloh19:
	adrp	x8, _KVASER_USB_MAX_RX_URBS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _KVASER_USB_MAX_RX_URBS@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w8, w25
	b.le	LBB0_14
; %bb.13:
	ldr	x0, [x19, #8]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
LBB0_14:
	mov	w22, #0
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_17
LBB0_15:
	mov	x22, x0
	mov	x0, x21
	bl	_usb_unanchor_urb
	ldr	w0, [x19, #32]
	ldr	w1, [x26]
	ldr	x3, [sp, #8]
	mov	x2, x23
	bl	_usb_free_coherent
	mov	x0, x21
	bl	_usb_free_urb
	cbnz	w25, LBB0_12
LBB0_16:
	ldr	x0, [x19, #8]
	str	x22, [sp]
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
LBB0_17:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	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	_KVASER_USB_MAX_RX_URBS,4,2     ; @KVASER_USB_MAX_RX_URBS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_KVASER_USB_RX_BUFFER_SIZE,4,2  ; @KVASER_USB_RX_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No memory left for USB buffer\n"

	.comm	_kvaser_usb_read_bulk_callback,4,2 ; @kvaser_usb_read_bulk_callback
	.comm	_URB_NO_TRANSFER_DMA_MAP,4,2    ; @URB_NO_TRANSFER_DMA_MAP
l_.str.1:                               ; @.str.1
	.asciz	"Cannot setup read URBs, error %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"RX performances may be slow\n"

	.no_dead_strip	_kvaser_usb_setup_rx_urbs
.subsections_via_symbols
