	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_usb_leaf_get_card_info
_kvaser_usb_leaf_get_card_info:         ## @kvaser_usb_leaf_get_card_info
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_CMD_GET_CARD_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_kvaser_usb_leaf_send_simple_cmd
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	_CMD_GET_CARD_INFO_REPLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-16(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_kvaser_usb_leaf_wait_cmd
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movl	-16(%rbp), %ecx
	movl	%ecx, (%rbx)
	movq	_KVASER_USB_MAX_NET_DEVICES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jg	LBB0_5
## %bb.3:
	movq	8(%rbx), %rdx
	movq	_KVASER_USBCAN@GOTPCREL(%rip), %rsi
	xorl	%eax, %eax
	cmpq	(%rsi), %rdx
	jne	LBB0_6
## %bb.4:
	movq	_MAX_USBCAN_NET_DEVICES@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jle	LBB0_6
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_GET_CARD_INFO,4,2          ## @CMD_GET_CARD_INFO
	.comm	_CMD_GET_CARD_INFO_REPLY,4,2    ## @CMD_GET_CARD_INFO_REPLY
	.comm	_KVASER_USB_MAX_NET_DEVICES,4,2 ## @KVASER_USB_MAX_NET_DEVICES
	.comm	_KVASER_USBCAN,8,3              ## @KVASER_USBCAN
	.comm	_MAX_USBCAN_NET_DEVICES,4,2     ## @MAX_USBCAN_NET_DEVICES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_kvaser_usb_leaf_get_card_info
.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_get_card_info
_kvaser_usb_leaf_get_card_info:         ; @kvaser_usb_leaf_get_card_info
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _CMD_GET_CARD_INFO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CMD_GET_CARD_INFO@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_kvaser_usb_leaf_send_simple_cmd
	cbnz	w0, LBB0_6
; %bb.1:
Lloh3:
	adrp	x8, _CMD_GET_CARD_INFO_REPLY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_GET_CARD_INFO_REPLY@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_kvaser_usb_leaf_wait_cmd
	cbnz	w0, LBB0_6
; %bb.2:
	ldr	w8, [sp, #8]
	str	w8, [x19]
Lloh6:
	adrp	x9, _KVASER_USB_MAX_NET_DEVICES@GOTPAGE
Lloh7:
	ldr	x9, [x9, _KVASER_USB_MAX_NET_DEVICES@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.gt	LBB0_5
; %bb.3:
	ldr	x9, [x19, #8]
Lloh9:
	adrp	x10, _KVASER_USBCAN@GOTPAGE
Lloh10:
	ldr	x10, [x10, _KVASER_USBCAN@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
Lloh12:
	adrp	x11, _MAX_USBCAN_NET_DEVICES@GOTPAGE
Lloh13:
	ldr	x11, [x11, _MAX_USBCAN_NET_DEVICES@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	cmp	x9, x10
	ccmp	w8, w11, #4, eq
	b.gt	LBB0_5
; %bb.4:
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_GET_CARD_INFO,4,2          ; @CMD_GET_CARD_INFO
	.comm	_CMD_GET_CARD_INFO_REPLY,4,2    ; @CMD_GET_CARD_INFO_REPLY
	.comm	_KVASER_USB_MAX_NET_DEVICES,4,2 ; @KVASER_USB_MAX_NET_DEVICES
	.comm	_KVASER_USBCAN,8,3              ; @KVASER_USBCAN
	.comm	_MAX_USBCAN_NET_DEVICES,4,2     ; @MAX_USBCAN_NET_DEVICES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_kvaser_usb_leaf_get_card_info
.subsections_via_symbols
