	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_usb_leaf_wait_cmd
_kvaser_usb_leaf_wait_cmd:              ## @kvaser_usb_leaf_wait_cmd
	.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	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	_KVASER_USB_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, %r13
	movq	_KVASER_USB_RX_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_16
## %bb.1:
	movq	%rax, %rbx
	addq	%r14, %r13
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err_ratelimited
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_time_before
	testq	%rax, %rax
	je	LBB0_11
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movq	_KVASER_USB_RX_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	leaq	-44(%rbp), %rcx
	callq	_kvaser_usb_recv_cmd
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_14
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %eax
	movq	_CMD_HEADER_LEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	jl	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r13d, %r13d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=2
	movq	8(%r12), %rax
	movl	(%rax), %edi
	callq	_le16_to_cpu
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_round_up
	movl	%eax, %r13d
	movl	-44(%rbp), %eax
	movq	_CMD_HEADER_LEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=2
	movl	%eax, %edx
	subl	%ecx, %edx
	cmpl	%edx, %r13d
	jg	LBB0_10
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movslq	%r13d, %rsi
	movl	(%rbx,%rsi), %edx
	testl	%edx, %edx
	je	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=2
	addl	%edx, %r13d
	cmpl	%eax, %r13d
	jg	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=2
	addq	%rbx, %rsi
	cmpq	%r15, 8(%rsi)
	jne	LBB0_7
## %bb.13:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_memcpy
LBB0_14:
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_15
LBB0_16:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_15:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_KVASER_USB_TIMEOUT,4,2         ## @KVASER_USB_TIMEOUT
	.comm	_KVASER_USB_RX_BUFFER_SIZE,4,2  ## @KVASER_USB_RX_BUFFER_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CMD_HEADER_LEN,4,2             ## @CMD_HEADER_LEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Format error\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_kvaser_usb_leaf_wait_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvaser_usb_leaf_wait_cmd
_kvaser_usb_leaf_wait_cmd:              ; @kvaser_usb_leaf_wait_cmd
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x27, _jiffies@GOTPAGE
Lloh1:
	ldr	x27, [x27, _jiffies@GOTPAGEOFF]
	ldr	x24, [x27]
Lloh2:
	adrp	x8, _KVASER_USB_TIMEOUT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _KVASER_USB_TIMEOUT@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x23, x0
Lloh5:
	adrp	x28, _KVASER_USB_RX_BUFFER_SIZE@GOTPAGE
Lloh6:
	ldr	x28, [x28, _KVASER_USB_RX_BUFFER_SIZE@GOTPAGEOFF]
	ldr	w0, [x28]
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_14
; %bb.1:
	mov	x20, x0
	add	x23, x23, x24
Lloh10:
	adrp	x24, _CMD_HEADER_LEN@GOTPAGE
Lloh11:
	ldr	x24, [x24, _CMD_HEADER_LEN@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x22]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err_ratelimited
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x27]
	mov	x1, x23
	bl	_time_before
	cbz	x0, LBB0_16
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	w2, [x28]
	add	x3, sp, #12
	mov	x0, x22
	mov	x1, x20
	bl	_kvaser_usb_recv_cmd
	mov	x25, x0
	tbnz	w0, #31, LBB0_13
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x24]
	cmp	w8, w9
	b.lt	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w26, #0
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=2
	ldr	x8, [x22, #8]
	ldr	w0, [x8]
	bl	_le16_to_cpu
	mov	x1, x0
	mov	x0, x26
	bl	_round_up
	mov	x26, x0
	ldr	w8, [sp, #12]
	ldr	w9, [x24]
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	sub	w10, w8, w9
	cmp	w26, w10
	b.gt	LBB0_3
LBB0_9:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x1, x20, w26, sxtw
	ldr	w2, [x1]
	cbz	w2, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	add	w26, w2, w26
	cmp	w26, w8
	b.gt	LBB0_2
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	x10, [x1, #8]
	cmp	x10, x21
	b.ne	LBB0_8
; %bb.12:
	mov	x0, x19
	bl	_memcpy
LBB0_13:
	mov	x0, x20
	bl	_kfree
	b	LBB0_15
LBB0_14:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_15:
	mov	x0, x25
	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
LBB0_16:
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_KVASER_USB_TIMEOUT,4,2         ; @KVASER_USB_TIMEOUT
	.comm	_KVASER_USB_RX_BUFFER_SIZE,4,2  ; @KVASER_USB_RX_BUFFER_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CMD_HEADER_LEN,4,2             ; @CMD_HEADER_LEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Format error\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_kvaser_usb_leaf_wait_cmd
.subsections_via_symbols
