	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_usb_hydra_get_single_capability
_kvaser_usb_hydra_get_single_capability: ## @kvaser_usb_hydra_get_single_capability
	.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, %r15
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %edi
	movl	$24, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	_CMD_GET_CAPABILITIES_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r12)
	movl	%ebx, %edi
	callq	_cpu_to_le16
	movl	%eax, 16(%r12)
	movl	24(%r14), %esi
	movq	%r12, %rdi
	callq	_kvaser_usb_hydra_set_cmd_dest_he
	movq	%r14, %rdi
	callq	_kvaser_usb_hydra_get_next_transid
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_kvaser_usb_hydra_set_cmd_transid
	movq	%r12, %rdi
	callq	_kvaser_usb_hydra_cmd_size
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_kvaser_usb_send_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.3:
	movq	_CMD_GET_CAPABILITIES_RESP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%r12, %rdx
	callq	_kvaser_usb_hydra_wait_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.4:
	movl	12(%r12), %edi
	callq	_le16_to_cpu
	movl	%eax, (%r15)
	movq	_KVASER_USB_HYDRA_CAP_STAT_OK@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpl	(%rcx), %eax
	jne	LBB0_19
## %bb.5:
	movl	8(%r12), %edi
	callq	_le16_to_cpu
	movl	%eax, %r15d
	leal	-128(%r15), %eax
	cmpl	$2, %eax
	ja	LBB0_7
## %bb.6:
	movl	4(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, %r13d
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_8
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_20
LBB0_7:
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_warn
	xorl	%eax, %eax
	xorl	%r13d, %r13d
LBB0_8:
	cmpl	$0, (%r14)
	jle	LBB0_19
## %bb.9:
	andl	%eax, %r13d
	leaq	16(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	20(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_15:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	_CAN_CTRLMODE_ONE_SHOT@GOTPCREL(%rip), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	(%rax), %eax
	orl	%eax, (%rcx)
LBB0_17:                                ##   in Loop: Header=BB0_10 Depth=1
	incl	%ebx
	cmpl	(%r14), %ebx
	jge	LBB0_18
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_BIT
	testl	%eax, %r13d
	je	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$128, %r15d
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_CAN_CTRLMODE_LISTENONLY@GOTPCREL(%rip), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$129, %r15d
	je	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$130, %r15d
	jne	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_KVASER_USB_CAP_BERR_CAP@GOTPCREL(%rip), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_18:
	xorl	%ebx, %ebx
LBB0_19:
	movq	%r12, %rdi
	callq	_kfree
LBB0_20:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CMD_GET_CAPABILITIES_REQ,4,2   ## @CMD_GET_CAPABILITIES_REQ
	.comm	_CMD_GET_CAPABILITIES_RESP,4,2  ## @CMD_GET_CAPABILITIES_RESP
	.comm	_KVASER_USB_HYDRA_CAP_STAT_OK,4,2 ## @KVASER_USB_HYDRA_CAP_STAT_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown capability command %u\n"

	.comm	_CAN_CTRLMODE_LISTENONLY,4,2    ## @CAN_CTRLMODE_LISTENONLY
	.comm	_KVASER_USB_CAP_BERR_CAP,4,2    ## @KVASER_USB_CAP_BERR_CAP
	.comm	_CAN_CTRLMODE_ONE_SHOT,4,2      ## @CAN_CTRLMODE_ONE_SHOT
	.no_dead_strip	_kvaser_usb_hydra_get_single_capability
.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_get_single_capability
_kvaser_usb_hydra_get_single_capability: ; @kvaser_usb_hydra_get_single_capability
	.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
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w0, #1
	mov	w1, #24
	bl	_kcalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _CMD_GET_CAPABILITIES_REQ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_GET_CAPABILITIES_REQ@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x0, #20]
	mov	x0, x22
	bl	_cpu_to_le16
	str	w0, [x19, #16]
	ldr	w1, [x20, #24]
	mov	x0, x19
	bl	_kvaser_usb_hydra_set_cmd_dest_he
	mov	x0, x20
	bl	_kvaser_usb_hydra_get_next_transid
	mov	x1, x0
	mov	x0, x19
	bl	_kvaser_usb_hydra_set_cmd_transid
	mov	x0, x19
	bl	_kvaser_usb_hydra_cmd_size
	mov	x2, x0
	mov	x0, x20
	mov	x1, x19
	bl	_kvaser_usb_send_cmd
	mov	x22, x0
	cbnz	w0, LBB0_21
; %bb.2:
Lloh6:
	adrp	x8, _CMD_GET_CAPABILITIES_RESP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CMD_GET_CAPABILITIES_RESP@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x19
	bl	_kvaser_usb_hydra_wait_cmd
	mov	x22, x0
	cbnz	w0, LBB0_21
; %bb.3:
	ldr	w0, [x19, #12]
	bl	_le16_to_cpu
	str	w0, [x21]
Lloh9:
	adrp	x8, _KVASER_USB_HYDRA_CAP_STAT_OK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KVASER_USB_HYDRA_CAP_STAT_OK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_20
; %bb.4:
	ldr	w0, [x19, #8]
	bl	_le16_to_cpu
	mov	x21, x0
	sub	w8, w0, #128
	cmp	w8, #2
	b.hi	LBB0_7
; %bb.5:
	ldr	w0, [x19, #4]
	bl	_le32_to_cpu
	mov	x23, x0
	ldr	w0, [x19]
	bl	_le32_to_cpu
	b	LBB0_8
LBB0_6:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_22
LBB0_7:
	ldr	x0, [x20, #8]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_warn
	mov	w23, #0
	mov	w0, #0
LBB0_8:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.9:
	mov	w22, #0
	and	w23, w0, w23
	add	x24, x20, #16
	add	x25, x20, #20
Lloh17:
	adrp	x26, _CAN_CTRLMODE_LISTENONLY@GOTPAGE
Lloh18:
	ldr	x26, [x26, _CAN_CTRLMODE_LISTENONLY@GOTPAGEOFF]
Lloh19:
	adrp	x27, _CAN_CTRLMODE_ONE_SHOT@GOTPAGE
Lloh20:
	ldr	x27, [x27, _CAN_CTRLMODE_ONE_SHOT@GOTPAGEOFF]
Lloh21:
	adrp	x28, _KVASER_USB_CAP_BERR_CAP@GOTPAGE
Lloh22:
	ldr	x28, [x28, _KVASER_USB_CAP_BERR_CAP@GOTPAGEOFF]
	b	LBB0_14
LBB0_10:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	x8, x26
LBB0_11:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	x9, x24
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x8]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	w22, w22, #1
	ldr	w8, [x20]
	cmp	w22, w8
	b.ge	LBB0_20
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_BIT
	tst	w23, w0
	b.eq	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	cmp	w21, #128
	b.eq	LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	cmp	w21, #129
	b.eq	LBB0_10
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	cmp	w21, #130
	b.ne	LBB0_13
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x8, x28
	mov	x9, x25
	b	LBB0_12
LBB0_19:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	x8, x27
	b	LBB0_11
LBB0_20:
	mov	w22, #0
LBB0_21:
	mov	x0, x19
	bl	_kfree
LBB0_22:
	mov	x0, x22
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CMD_GET_CAPABILITIES_REQ,4,2   ; @CMD_GET_CAPABILITIES_REQ
	.comm	_CMD_GET_CAPABILITIES_RESP,4,2  ; @CMD_GET_CAPABILITIES_RESP
	.comm	_KVASER_USB_HYDRA_CAP_STAT_OK,4,2 ; @KVASER_USB_HYDRA_CAP_STAT_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown capability command %u\n"

	.comm	_CAN_CTRLMODE_LISTENONLY,4,2    ; @CAN_CTRLMODE_LISTENONLY
	.comm	_KVASER_USB_CAP_BERR_CAP,4,2    ; @KVASER_USB_CAP_BERR_CAP
	.comm	_CAN_CTRLMODE_ONE_SHOT,4,2      ; @CAN_CTRLMODE_ONE_SHOT
	.no_dead_strip	_kvaser_usb_hydra_get_single_capability
.subsections_via_symbols
