	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_usb_hydra_wait_cmd
_kvaser_usb_hydra_wait_cmd:             ## @kvaser_usb_hydra_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	_KVASER_USB_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, %rbx
	movq	(%r12), %rax
	movq	_CMD_EXTENDED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	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_7
## %bb.3:
	movq	%rax, %r12
	addq	%r14, %rbx
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err_ratelimited
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rbx, %rsi
	callq	_time_before
	testq	%rax, %rax
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_13
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movl	$0, -44(%rbp)
	movq	_KVASER_USB_RX_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	leaq	-44(%rbp), %rcx
	callq	_kvaser_usb_recv_cmd
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_16
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$0, -44(%rbp)
	jle	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movslq	%r15d, %r15
	leaq	(%r12,%r15), %r13
	movq	%r13, %rdi
	callq	_kvaser_usb_hydra_cmd_size
	addq	%rax, %r15
	movslq	-44(%rbp), %rcx
	cmpq	%rcx, %r15
	ja	LBB0_11
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rdx, (%r13)
	je	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_10 Depth=2
	cmpl	%r15d, %ecx
	jg	LBB0_10
	jmp	LBB0_12
LBB0_15:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%rax, %rdx
	callq	_memcpy
LBB0_16:
	movq	%r12, %rdi
	callq	_kfree
	jmp	LBB0_17
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_8:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_17:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_KVASER_USB_TIMEOUT,4,2         ## @KVASER_USB_TIMEOUT
	.comm	_CMD_EXTENDED,8,3               ## @CMD_EXTENDED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wait for CMD_EXTENDED not allowed\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.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
L_.str.1:                               ## @.str.1
	.asciz	"Format error\n"

	.no_dead_strip	_kvaser_usb_hydra_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_hydra_wait_cmd
_kvaser_usb_hydra_wait_cmd:             ; @kvaser_usb_hydra_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	x20, 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
	ldr	x8, [x19]
Lloh5:
	adrp	x9, _CMD_EXTENDED@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CMD_EXTENDED@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	x0, [x20]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_15
LBB0_2:
	mov	x23, x0
Lloh12:
	adrp	x28, _KVASER_USB_RX_BUFFER_SIZE@GOTPAGE
Lloh13:
	ldr	x28, [x28, _KVASER_USB_RX_BUFFER_SIZE@GOTPAGEOFF]
	ldr	w0, [x28]
Lloh14:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_14
; %bb.3:
	mov	x22, x0
	add	x23, x23, x24
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [x20]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err_ratelimited
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [x27]
	mov	x1, x23
	bl	_time_before
	cbz	x0, LBB0_17
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	str	wzr, [sp, #12]
	ldr	w2, [x28]
	add	x3, sp, #12
	mov	x0, x20
	mov	x1, x22
	bl	_kvaser_usb_recv_cmd
	mov	x24, x0
	tbnz	w0, #31, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [sp, #12]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x8, #0
LBB0_9:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sxtw	x25, w8
	add	x26, x22, x25
	mov	x0, x26
	bl	_kvaser_usb_hydra_cmd_size
	ldrsw	x9, [sp, #12]
	add	x8, x0, x25
	cmp	x8, x9
	b.hi	LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	x10, [x26]
	cmp	x10, x21
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	cmp	w9, w8
	b.gt	LBB0_9
	b	LBB0_5
LBB0_12:
	mov	x2, x0
	mov	x0, x19
	mov	x1, x26
	bl	_memcpy
LBB0_13:
	mov	x0, x22
	bl	_kfree
	b	LBB0_16
LBB0_14:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_16:
	mov	x0, x24
	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_17:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_KVASER_USB_TIMEOUT,4,2         ; @KVASER_USB_TIMEOUT
	.comm	_CMD_EXTENDED,8,3               ; @CMD_EXTENDED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wait for CMD_EXTENDED not allowed\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.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
l_.str.1:                               ; @.str.1
	.asciz	"Format error\n"

	.no_dead_strip	_kvaser_usb_hydra_wait_cmd
.subsections_via_symbols
