	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_usb_hydra_set_opt_mode
_kvaser_usb_hydra_set_opt_mode:         ## @kvaser_usb_hydra_set_opt_mode
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_CAN_CTRLMODE_FD@GOTPCREL(%rip), %rax
	movq	_CAN_CTRLMODE_FD_NON_ISO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	(%rax), %eax
	orl	%ecx, %eax
	andl	8(%rdi), %eax
	cmpl	%ecx, %eax
	jne	LBB0_2
## %bb.1:
	movl	12(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_netdev_warn
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_2:
	movq	16(%rbx), %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %edi
	movl	$8, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r15
	movq	_CMD_SET_DRIVERMODE_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movq	(%r14), %rax
	movq	(%rbx), %rcx
	movl	(%rax,%rcx,4), %esi
	movq	%r15, %rdi
	callq	_kvaser_usb_hydra_set_cmd_dest_he
	movq	%r14, %rdi
	callq	_kvaser_usb_hydra_get_next_transid
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_kvaser_usb_hydra_set_cmd_transid
	movq	_CAN_CTRLMODE_LISTENONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	8(%rbx), %eax
	jne	LBB0_6
## %bb.7:
	movq	_KVASER_USB_HYDRA_CTRLMODE_NORMAL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_4:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_6:
	movq	_KVASER_USB_HYDRA_CTRLMODE_LISTEN@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movq	%r15, %rdi
	callq	_kvaser_usb_hydra_cmd_size
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_kvaser_usb_send_cmd
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_kfree
	movl	%ebx, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CAN_CTRLMODE_FD,4,2            ## @CAN_CTRLMODE_FD
	.comm	_CAN_CTRLMODE_FD_NON_ISO,4,2    ## @CAN_CTRLMODE_FD_NON_ISO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CTRLMODE_FD shall be on if CTRLMODE_FD_NON_ISO is on\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CMD_SET_DRIVERMODE_REQ,4,2     ## @CMD_SET_DRIVERMODE_REQ
	.comm	_CAN_CTRLMODE_LISTENONLY,4,2    ## @CAN_CTRLMODE_LISTENONLY
	.comm	_KVASER_USB_HYDRA_CTRLMODE_LISTEN,4,2 ## @KVASER_USB_HYDRA_CTRLMODE_LISTEN
	.comm	_KVASER_USB_HYDRA_CTRLMODE_NORMAL,4,2 ## @KVASER_USB_HYDRA_CTRLMODE_NORMAL
	.no_dead_strip	_kvaser_usb_hydra_set_opt_mode
.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_set_opt_mode
_kvaser_usb_hydra_set_opt_mode:         ; @kvaser_usb_hydra_set_opt_mode
	.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
	ldr	w8, [x0, #8]
Lloh0:
	adrp	x9, _CAN_CTRLMODE_FD@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CAN_CTRLMODE_FD@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _CAN_CTRLMODE_FD_NON_ISO@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CAN_CTRLMODE_FD_NON_ISO@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	orr	w9, w10, w9
	and	w8, w9, w8
	cmp	w8, w10
	b.ne	LBB0_2
; %bb.1:
	ldr	w0, [x20, #12]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_warn
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:
	ldr	x19, [x20, #16]
Lloh10:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	w0, #1
	mov	w1, #8
	bl	_kcalloc
	cbz	x0, LBB0_4
; %bb.3:
	mov	x21, x0
Lloh13:
	adrp	x8, _CMD_SET_DRIVERMODE_REQ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CMD_SET_DRIVERMODE_REQ@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [x0, #4]
	ldr	x8, [x19]
	ldr	x9, [x20]
	ldr	w1, [x8, x9, lsl #2]
	bl	_kvaser_usb_hydra_set_cmd_dest_he
	mov	x0, x19
	bl	_kvaser_usb_hydra_get_next_transid
	mov	x1, x0
	mov	x0, x21
	bl	_kvaser_usb_hydra_set_cmd_transid
	ldr	w8, [x20, #8]
Lloh16:
	adrp	x9, _CAN_CTRLMODE_LISTENONLY@GOTPAGE
Lloh17:
	ldr	x9, [x9, _CAN_CTRLMODE_LISTENONLY@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x10, _KVASER_USB_HYDRA_CTRLMODE_NORMAL@GOTPAGE
Lloh20:
	ldr	x10, [x10, _KVASER_USB_HYDRA_CTRLMODE_NORMAL@GOTPAGEOFF]
Lloh21:
	adrp	x11, _KVASER_USB_HYDRA_CTRLMODE_LISTEN@GOTPAGE
Lloh22:
	ldr	x11, [x11, _KVASER_USB_HYDRA_CTRLMODE_LISTEN@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	str	w8, [x21]
	mov	x0, x21
	bl	_kvaser_usb_hydra_cmd_size
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_kvaser_usb_send_cmd
	mov	x19, x0
	mov	x0, x21
	bl	_kfree
	mov	x0, x19
	b	LBB0_6
LBB0_4:
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_5:
	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
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_CAN_CTRLMODE_FD,4,2            ; @CAN_CTRLMODE_FD
	.comm	_CAN_CTRLMODE_FD_NON_ISO,4,2    ; @CAN_CTRLMODE_FD_NON_ISO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CTRLMODE_FD shall be on if CTRLMODE_FD_NON_ISO is on\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CMD_SET_DRIVERMODE_REQ,4,2     ; @CMD_SET_DRIVERMODE_REQ
	.comm	_CAN_CTRLMODE_LISTENONLY,4,2    ; @CAN_CTRLMODE_LISTENONLY
	.comm	_KVASER_USB_HYDRA_CTRLMODE_LISTEN,4,2 ; @KVASER_USB_HYDRA_CTRLMODE_LISTEN
	.comm	_KVASER_USB_HYDRA_CTRLMODE_NORMAL,4,2 ; @KVASER_USB_HYDRA_CTRLMODE_NORMAL
	.no_dead_strip	_kvaser_usb_hydra_set_opt_mode
.subsections_via_symbols
