	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_usb_leaf_set_opt_mode
_kvaser_usb_leaf_set_opt_mode:          ## @kvaser_usb_leaf_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	_CMD_SET_CTRL_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_CMD_HEADER_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	addq	$4, %rdx
	movq	%rdx, (%rbx)
	movl	$255, 8(%rbx)
	movl	8(%r14), %eax
	movl	%eax, 16(%rbx)
	movq	_CAN_CTRLMODE_LISTENONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	4(%r14), %eax
	jne	LBB0_4
## %bb.5:
	movq	_KVASER_CTRL_MODE_NORMAL@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_2
LBB0_4:
	movq	_KVASER_CTRL_MODE_SILENT@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movl	(%r14), %edi
	movq	%rbx, %rsi
	callq	_kvaser_usb_send_cmd
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r14d, %eax
LBB0_2:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CMD_SET_CTRL_MODE,4,2          ## @CMD_SET_CTRL_MODE
	.comm	_CMD_HEADER_LEN,8,3             ## @CMD_HEADER_LEN
	.comm	_CAN_CTRLMODE_LISTENONLY,4,2    ## @CAN_CTRLMODE_LISTENONLY
	.comm	_KVASER_CTRL_MODE_SILENT,4,2    ## @KVASER_CTRL_MODE_SILENT
	.comm	_KVASER_CTRL_MODE_NORMAL,4,2    ## @KVASER_CTRL_MODE_NORMAL
	.no_dead_strip	_kvaser_usb_leaf_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_leaf_set_opt_mode
_kvaser_usb_leaf_set_opt_mode:          ; @kvaser_usb_leaf_set_opt_mode
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.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, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kmalloc
	cbz	x0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x8, _CMD_SET_CTRL_MODE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_SET_CTRL_MODE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _CMD_HEADER_LEN@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CMD_HEADER_LEN@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x2, x9, #4
	str	x2, [x0]
	mov	w9, #255
	str	w9, [x0, #8]
	ldp	w10, w9, [x19, #4]
	stp	w9, w8, [x0, #16]
Lloh9:
	adrp	x8, _CAN_CTRLMODE_LISTENONLY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CAN_CTRLMODE_LISTENONLY@GOTPAGEOFF]
Lloh11:
	adrp	x9, _KVASER_CTRL_MODE_NORMAL@GOTPAGE
Lloh12:
	ldr	x9, [x9, _KVASER_CTRL_MODE_NORMAL@GOTPAGEOFF]
Lloh13:
	adrp	x11, _KVASER_CTRL_MODE_SILENT@GOTPAGE
Lloh14:
	ldr	x11, [x11, _KVASER_CTRL_MODE_SILENT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w10
	csel	x8, x9, x11, eq
	ldr	w8, [x8]
	str	w8, [x0, #12]
	ldr	w0, [x19]
	mov	x1, x20
	bl	_kvaser_usb_send_cmd
	mov	x19, x0
	mov	x0, x20
	bl	_kfree
	mov	x0, x19
	b	LBB0_3
LBB0_2:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh15
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CMD_SET_CTRL_MODE,4,2          ; @CMD_SET_CTRL_MODE
	.comm	_CMD_HEADER_LEN,8,3             ; @CMD_HEADER_LEN
	.comm	_CAN_CTRLMODE_LISTENONLY,4,2    ; @CAN_CTRLMODE_LISTENONLY
	.comm	_KVASER_CTRL_MODE_SILENT,4,2    ; @KVASER_CTRL_MODE_SILENT
	.comm	_KVASER_CTRL_MODE_NORMAL,4,2    ; @KVASER_CTRL_MODE_NORMAL
	.no_dead_strip	_kvaser_usb_leaf_set_opt_mode
.subsections_via_symbols
