	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_usb_hydra_get_software_details
_kvaser_usb_hydra_get_software_details: ## @kvaser_usb_hydra_get_software_details
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %edi
	movl	$16, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	_CMD_GET_SOFTWARE_DETAILS_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r12)
	movl	$1, 8(%r12)
	movq	_KVASER_USB_HYDRA_HE_ADDRESS_ILLEGAL@GOTPCREL(%rip), %rax
	movl	(%rax), %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_20
## %bb.3:
	movq	_CMD_GET_SOFTWARE_DETAILS_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_20
## %bb.4:
	movl	4(%r12), %edi
	callq	_le32_to_cpu
	movq	%rax, 16(%r14)
	movl	(%r12), %edi
	callq	_le32_to_cpu
	movq	%rax, %r15
	movq	_KVASER_USB_HYDRA_SW_FLAG_FW_BAD@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_6
## %bb.5:
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_20
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_6:
	movq	_KVASER_USB_HYDRA_SW_FLAG_FW_BETA@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_8
## %bb.7:
	movq	8(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_info
LBB0_8:
	movq	_KVASER_USB_HYDRA_SW_FLAG_EXT_CAP@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_10
## %bb.9:
	movq	_KVASER_USB_CAP_EXT_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 28(%r14)
LBB0_10:
	movq	_KVASER_USB_HYDRA_SW_FLAG_EXT_CMD@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_12
## %bb.11:
	movq	_KVASER_USB_HYDRA_CAP_EXT_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 28(%r14)
LBB0_12:
	movq	_KVASER_USB_HYDRA_SW_FLAG_CANFD@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_14
## %bb.13:
	movq	_CAN_CTRLMODE_FD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%r14)
LBB0_14:
	movq	_KVASER_USB_HYDRA_SW_FLAG_NONISO@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_16
## %bb.15:
	movq	_CAN_CTRLMODE_FD_NON_ISO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%r14)
LBB0_16:
	movq	_KVASER_USB_HYDRA_SW_FLAG_FREQ_80M@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_18
## %bb.17:
	movq	_kvaser_usb_hydra_dev_cfg_kcan@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_18:
	movq	_kvaser_usb_hydra_dev_cfg_flexc@GOTPCREL(%rip), %rax
LBB0_19:
	movq	%rax, (%r14)
	xorl	%ebx, %ebx
LBB0_20:
	movq	%r12, %rdi
	callq	_kfree
LBB0_21:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	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_SOFTWARE_DETAILS_REQ,4,2 ## @CMD_GET_SOFTWARE_DETAILS_REQ
	.comm	_KVASER_USB_HYDRA_HE_ADDRESS_ILLEGAL,4,2 ## @KVASER_USB_HYDRA_HE_ADDRESS_ILLEGAL
	.comm	_CMD_GET_SOFTWARE_DETAILS_RESP,4,2 ## @CMD_GET_SOFTWARE_DETAILS_RESP
	.comm	_KVASER_USB_HYDRA_SW_FLAG_FW_BAD,4,2 ## @KVASER_USB_HYDRA_SW_FLAG_FW_BAD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bad firmware, device refuse to run!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_KVASER_USB_HYDRA_SW_FLAG_FW_BETA,4,2 ## @KVASER_USB_HYDRA_SW_FLAG_FW_BETA
L_.str.1:                               ## @.str.1
	.asciz	"Beta firmware in use\n"

	.comm	_KVASER_USB_HYDRA_SW_FLAG_EXT_CAP,4,2 ## @KVASER_USB_HYDRA_SW_FLAG_EXT_CAP
	.comm	_KVASER_USB_CAP_EXT_CAP,4,2     ## @KVASER_USB_CAP_EXT_CAP
	.comm	_KVASER_USB_HYDRA_SW_FLAG_EXT_CMD,4,2 ## @KVASER_USB_HYDRA_SW_FLAG_EXT_CMD
	.comm	_KVASER_USB_HYDRA_CAP_EXT_CMD,4,2 ## @KVASER_USB_HYDRA_CAP_EXT_CMD
	.comm	_KVASER_USB_HYDRA_SW_FLAG_CANFD,4,2 ## @KVASER_USB_HYDRA_SW_FLAG_CANFD
	.comm	_CAN_CTRLMODE_FD,4,2            ## @CAN_CTRLMODE_FD
	.comm	_KVASER_USB_HYDRA_SW_FLAG_NONISO,4,2 ## @KVASER_USB_HYDRA_SW_FLAG_NONISO
	.comm	_CAN_CTRLMODE_FD_NON_ISO,4,2    ## @CAN_CTRLMODE_FD_NON_ISO
	.comm	_KVASER_USB_HYDRA_SW_FLAG_FREQ_80M,4,2 ## @KVASER_USB_HYDRA_SW_FLAG_FREQ_80M
	.comm	_kvaser_usb_hydra_dev_cfg_kcan,4,2 ## @kvaser_usb_hydra_dev_cfg_kcan
	.comm	_kvaser_usb_hydra_dev_cfg_flexc,4,2 ## @kvaser_usb_hydra_dev_cfg_flexc
	.no_dead_strip	_kvaser_usb_hydra_get_software_details
.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_software_details
_kvaser_usb_hydra_get_software_details: ; @kvaser_usb_hydra_get_software_details
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w21, #1
	mov	w0, #1
	mov	w1, #16
	bl	_kcalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _CMD_GET_SOFTWARE_DETAILS_REQ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_GET_SOFTWARE_DETAILS_REQ@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	stp	w21, w8, [x0, #8]
Lloh6:
	adrp	x8, _KVASER_USB_HYDRA_HE_ADDRESS_ILLEGAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _KVASER_USB_HYDRA_HE_ADDRESS_ILLEGAL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	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	x21, x0
	cbnz	w0, LBB0_20
; %bb.2:
Lloh9:
	adrp	x8, _CMD_GET_SOFTWARE_DETAILS_RESP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CMD_GET_SOFTWARE_DETAILS_RESP@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x19
	bl	_kvaser_usb_hydra_wait_cmd
	mov	x21, x0
	cbnz	w0, LBB0_20
; %bb.3:
	ldr	w0, [x19, #4]
	bl	_le32_to_cpu
	str	x0, [x20, #16]
	ldr	w0, [x19]
	bl	_le32_to_cpu
	mov	x21, x0
Lloh12:
	adrp	x8, _KVASER_USB_HYDRA_SW_FLAG_FW_BAD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _KVASER_USB_HYDRA_SW_FLAG_FW_BAD@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_6
; %bb.4:
	ldr	x0, [x20, #8]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_20
LBB0_5:
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_21
LBB0_6:
Lloh23:
	adrp	x8, _KVASER_USB_HYDRA_SW_FLAG_FW_BETA@GOTPAGE
Lloh24:
	ldr	x8, [x8, _KVASER_USB_HYDRA_SW_FLAG_FW_BETA@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_8
; %bb.7:
	ldr	x0, [x20, #8]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
LBB0_8:
Lloh28:
	adrp	x8, _KVASER_USB_HYDRA_SW_FLAG_EXT_CAP@GOTPAGE
Lloh29:
	ldr	x8, [x8, _KVASER_USB_HYDRA_SW_FLAG_EXT_CAP@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_10
; %bb.9:
Lloh31:
	adrp	x8, _KVASER_USB_CAP_EXT_CAP@GOTPAGE
Lloh32:
	ldr	x8, [x8, _KVASER_USB_CAP_EXT_CAP@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	ldr	w9, [x20, #28]
	orr	w8, w9, w8
	str	w8, [x20, #28]
LBB0_10:
Lloh34:
	adrp	x8, _KVASER_USB_HYDRA_SW_FLAG_EXT_CMD@GOTPAGE
Lloh35:
	ldr	x8, [x8, _KVASER_USB_HYDRA_SW_FLAG_EXT_CMD@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_12
; %bb.11:
Lloh37:
	adrp	x8, _KVASER_USB_HYDRA_CAP_EXT_CMD@GOTPAGE
Lloh38:
	ldr	x8, [x8, _KVASER_USB_HYDRA_CAP_EXT_CMD@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	ldr	w9, [x20, #28]
	orr	w8, w9, w8
	str	w8, [x20, #28]
LBB0_12:
Lloh40:
	adrp	x8, _KVASER_USB_HYDRA_SW_FLAG_CANFD@GOTPAGE
Lloh41:
	ldr	x8, [x8, _KVASER_USB_HYDRA_SW_FLAG_CANFD@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_14
; %bb.13:
Lloh43:
	adrp	x8, _CAN_CTRLMODE_FD@GOTPAGE
Lloh44:
	ldr	x8, [x8, _CAN_CTRLMODE_FD@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	ldr	w9, [x20, #24]
	orr	w8, w9, w8
	str	w8, [x20, #24]
LBB0_14:
Lloh46:
	adrp	x8, _KVASER_USB_HYDRA_SW_FLAG_NONISO@GOTPAGE
Lloh47:
	ldr	x8, [x8, _KVASER_USB_HYDRA_SW_FLAG_NONISO@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_16
; %bb.15:
Lloh49:
	adrp	x8, _CAN_CTRLMODE_FD_NON_ISO@GOTPAGE
Lloh50:
	ldr	x8, [x8, _CAN_CTRLMODE_FD_NON_ISO@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
	ldr	w9, [x20, #24]
	orr	w8, w9, w8
	str	w8, [x20, #24]
LBB0_16:
Lloh52:
	adrp	x8, _KVASER_USB_HYDRA_SW_FLAG_FREQ_80M@GOTPAGE
Lloh53:
	ldr	x8, [x8, _KVASER_USB_HYDRA_SW_FLAG_FREQ_80M@GOTPAGEOFF]
Lloh54:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_18
; %bb.17:
	mov	w21, #0
Lloh55:
	adrp	x8, _kvaser_usb_hydra_dev_cfg_kcan@GOTPAGE
Lloh56:
	ldr	x8, [x8, _kvaser_usb_hydra_dev_cfg_kcan@GOTPAGEOFF]
	b	LBB0_19
LBB0_18:
	mov	w21, #0
Lloh57:
	adrp	x8, _kvaser_usb_hydra_dev_cfg_flexc@GOTPAGE
Lloh58:
	ldr	x8, [x8, _kvaser_usb_hydra_dev_cfg_flexc@GOTPAGEOFF]
LBB0_19:
	str	x8, [x20]
LBB0_20:
	mov	x0, x19
	bl	_kfree
LBB0_21:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGot	Lloh55, Lloh56
	.loh AdrpLdrGot	Lloh57, Lloh58
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CMD_GET_SOFTWARE_DETAILS_REQ,4,2 ; @CMD_GET_SOFTWARE_DETAILS_REQ
	.comm	_KVASER_USB_HYDRA_HE_ADDRESS_ILLEGAL,4,2 ; @KVASER_USB_HYDRA_HE_ADDRESS_ILLEGAL
	.comm	_CMD_GET_SOFTWARE_DETAILS_RESP,4,2 ; @CMD_GET_SOFTWARE_DETAILS_RESP
	.comm	_KVASER_USB_HYDRA_SW_FLAG_FW_BAD,4,2 ; @KVASER_USB_HYDRA_SW_FLAG_FW_BAD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bad firmware, device refuse to run!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_KVASER_USB_HYDRA_SW_FLAG_FW_BETA,4,2 ; @KVASER_USB_HYDRA_SW_FLAG_FW_BETA
l_.str.1:                               ; @.str.1
	.asciz	"Beta firmware in use\n"

	.comm	_KVASER_USB_HYDRA_SW_FLAG_EXT_CAP,4,2 ; @KVASER_USB_HYDRA_SW_FLAG_EXT_CAP
	.comm	_KVASER_USB_CAP_EXT_CAP,4,2     ; @KVASER_USB_CAP_EXT_CAP
	.comm	_KVASER_USB_HYDRA_SW_FLAG_EXT_CMD,4,2 ; @KVASER_USB_HYDRA_SW_FLAG_EXT_CMD
	.comm	_KVASER_USB_HYDRA_CAP_EXT_CMD,4,2 ; @KVASER_USB_HYDRA_CAP_EXT_CMD
	.comm	_KVASER_USB_HYDRA_SW_FLAG_CANFD,4,2 ; @KVASER_USB_HYDRA_SW_FLAG_CANFD
	.comm	_CAN_CTRLMODE_FD,4,2            ; @CAN_CTRLMODE_FD
	.comm	_KVASER_USB_HYDRA_SW_FLAG_NONISO,4,2 ; @KVASER_USB_HYDRA_SW_FLAG_NONISO
	.comm	_CAN_CTRLMODE_FD_NON_ISO,4,2    ; @CAN_CTRLMODE_FD_NON_ISO
	.comm	_KVASER_USB_HYDRA_SW_FLAG_FREQ_80M,4,2 ; @KVASER_USB_HYDRA_SW_FLAG_FREQ_80M
	.comm	_kvaser_usb_hydra_dev_cfg_kcan,4,2 ; @kvaser_usb_hydra_dev_cfg_kcan
	.comm	_kvaser_usb_hydra_dev_cfg_flexc,4,2 ; @kvaser_usb_hydra_dev_cfg_flexc
	.no_dead_strip	_kvaser_usb_hydra_get_software_details
.subsections_via_symbols
