	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcan_usb_fd_build_restart_cmd
_pcan_usb_fd_build_restart_cmd:         ## @pcan_usb_fd_build_restart_cmd
	.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	%rsi, %r15
	movq	%rdi, %r14
	movl	8(%rdi), %edi
	movq	_PUCAN_CMD_WR_ERR_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pucan_cmd_opcode_channel
	movq	%rax, 24(%r15)
	movq	_PUCAN_WRERRCNT_TE@GOTPCREL(%rip), %rax
	movq	_PUCAN_WRERRCNT_RE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, 16(%r15)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r15)
	movq	_CAN_CTRLMODE_FD_NON_ISO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_1
## %bb.2:
	movl	8(%r14), %edi
	andl	4(%r14), %eax
	jne	LBB0_3
## %bb.4:
	movq	_PUCAN_CMD_SET_EN_OPTION@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_1:
	leaq	128(%r15), %rbx
	jmp	LBB0_6
LBB0_3:
	movq	_PUCAN_CMD_CLR_DIS_OPTION@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %esi
	callq	_pucan_cmd_opcode_channel
	movq	%rax, 144(%r15)
	movq	_PUCAN_OPTION_CANDFDISO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, 136(%r15)
	movq	$0, 128(%r15)
	leaq	224(%r15), %rbx
LBB0_6:
	movl	8(%r14), %edi
	movq	_CAN_CTRLMODE_LISTENONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	4(%r14), %eax
	jne	LBB0_7
## %bb.8:
	movq	_PUCAN_CMD_NORMAL_MODE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_PUCAN_CMD_LISTEN_ONLY_MODE@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %esi
	callq	_pucan_cmd_opcode_channel
	movq	%rax, (%rbx)
	subq	%r15, %rbx
	addq	$32, %rbx
	shrq	$2, %rbx
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PUCAN_CMD_WR_ERR_CNT,4,2       ## @PUCAN_CMD_WR_ERR_CNT
	.comm	_PUCAN_WRERRCNT_TE,4,2          ## @PUCAN_WRERRCNT_TE
	.comm	_PUCAN_WRERRCNT_RE,4,2          ## @PUCAN_WRERRCNT_RE
	.comm	_CAN_CTRLMODE_FD_NON_ISO,4,2    ## @CAN_CTRLMODE_FD_NON_ISO
	.comm	_PUCAN_CMD_CLR_DIS_OPTION,4,2   ## @PUCAN_CMD_CLR_DIS_OPTION
	.comm	_PUCAN_CMD_SET_EN_OPTION,4,2    ## @PUCAN_CMD_SET_EN_OPTION
	.comm	_PUCAN_OPTION_CANDFDISO,4,2     ## @PUCAN_OPTION_CANDFDISO
	.comm	_CAN_CTRLMODE_LISTENONLY,4,2    ## @CAN_CTRLMODE_LISTENONLY
	.comm	_PUCAN_CMD_LISTEN_ONLY_MODE,4,2 ## @PUCAN_CMD_LISTEN_ONLY_MODE
	.comm	_PUCAN_CMD_NORMAL_MODE,4,2      ## @PUCAN_CMD_NORMAL_MODE
	.no_dead_strip	_pcan_usb_fd_build_restart_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcan_usb_fd_build_restart_cmd
_pcan_usb_fd_build_restart_cmd:         ; @pcan_usb_fd_build_restart_cmd
	.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	x19, x1
	mov	x20, x0
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x8, _PUCAN_CMD_WR_ERR_CNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PUCAN_CMD_WR_ERR_CNT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_pucan_cmd_opcode_channel
Lloh3:
	adrp	x8, _PUCAN_WRERRCNT_TE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PUCAN_WRERRCNT_TE@GOTPAGEOFF]
	str	x0, [x19, #24]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _PUCAN_WRERRCNT_RE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PUCAN_WRERRCNT_RE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w0, w9, w8
	bl	_cpu_to_le16
	stp	xzr, x0, [x19, #8]
	str	xzr, [x19]
	ldr	w9, [x20]
Lloh9:
	adrp	x8, _CAN_CTRLMODE_FD_NON_ISO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CAN_CTRLMODE_FD_NON_ISO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_2
; %bb.1:
Lloh12:
	adrp	x9, _PUCAN_CMD_SET_EN_OPTION@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PUCAN_CMD_SET_EN_OPTION@GOTPAGEOFF]
	ldp	w10, w0, [x20, #4]
Lloh14:
	adrp	x11, _PUCAN_CMD_CLR_DIS_OPTION@GOTPAGE
Lloh15:
	ldr	x11, [x11, _PUCAN_CMD_CLR_DIS_OPTION@GOTPAGEOFF]
	tst	w10, w8
	csel	x8, x9, x11, eq
	ldr	w1, [x8]
	bl	_pucan_cmd_opcode_channel
	str	x0, [x19, #144]
Lloh16:
	adrp	x8, _PUCAN_OPTION_CANDFDISO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PUCAN_OPTION_CANDFDISO@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_cpu_to_le16
	stp	xzr, x0, [x19, #128]
	add	x21, x19, #224
	b	LBB0_3
LBB0_2:
	add	x21, x19, #128
LBB0_3:
	ldp	w8, w0, [x20, #4]
Lloh19:
	adrp	x9, _CAN_CTRLMODE_LISTENONLY@GOTPAGE
Lloh20:
	ldr	x9, [x9, _CAN_CTRLMODE_LISTENONLY@GOTPAGEOFF]
Lloh21:
	adrp	x10, _PUCAN_CMD_LISTEN_ONLY_MODE@GOTPAGE
Lloh22:
	ldr	x10, [x10, _PUCAN_CMD_LISTEN_ONLY_MODE@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
Lloh24:
	adrp	x11, _PUCAN_CMD_NORMAL_MODE@GOTPAGE
Lloh25:
	ldr	x11, [x11, _PUCAN_CMD_NORMAL_MODE@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	w1, [x8]
	bl	_pucan_cmd_opcode_channel
	str	x0, [x21]
	sub	x8, x21, x19
	add	x8, x8, #32
	lsr	x0, x8, #2
                                        ; kill: def $w0 killed $w0 killed $x0
	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	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_PUCAN_CMD_WR_ERR_CNT,4,2       ; @PUCAN_CMD_WR_ERR_CNT
	.comm	_PUCAN_WRERRCNT_TE,4,2          ; @PUCAN_WRERRCNT_TE
	.comm	_PUCAN_WRERRCNT_RE,4,2          ; @PUCAN_WRERRCNT_RE
	.comm	_CAN_CTRLMODE_FD_NON_ISO,4,2    ; @CAN_CTRLMODE_FD_NON_ISO
	.comm	_PUCAN_CMD_CLR_DIS_OPTION,4,2   ; @PUCAN_CMD_CLR_DIS_OPTION
	.comm	_PUCAN_CMD_SET_EN_OPTION,4,2    ; @PUCAN_CMD_SET_EN_OPTION
	.comm	_PUCAN_OPTION_CANDFDISO,4,2     ; @PUCAN_OPTION_CANDFDISO
	.comm	_CAN_CTRLMODE_LISTENONLY,4,2    ; @CAN_CTRLMODE_LISTENONLY
	.comm	_PUCAN_CMD_LISTEN_ONLY_MODE,4,2 ; @PUCAN_CMD_LISTEN_ONLY_MODE
	.comm	_PUCAN_CMD_NORMAL_MODE,4,2      ; @PUCAN_CMD_NORMAL_MODE
	.no_dead_strip	_pcan_usb_fd_build_restart_cmd
.subsections_via_symbols
