	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcan_usb_pro_encode_msg
_pcan_usb_pro_encode_msg:               ## @pcan_usb_pro_encode_msg
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdi, %r15
	movq	(%rsi), %rbx
	movq	(%rcx), %rax
	leaq	-32(%rbp), %rdi
	movq	%rdx, %rsi
	movq	%rax, %rdx
	callq	_pcan_msg_init_empty
	movl	(%rbx), %r9d
	movl	4(%rbx), %r8d
	movq	_CAN_RTR_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_PCAN_USBPRO_TXMSG0@GOTPCREL(%rip), %rcx
	testl	%r9d, %eax
	je	LBB0_1
LBB0_6:
	xorl	%edx, %edx
	testl	%r9d, %eax
	setne	%dl
	movl	(%rcx), %esi
	movl	(%r15), %eax
	movq	_CAN_EFF_FLAG@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	movl	(%rcx), %ecx
	andl	%r9d, %ecx
	setne	%dil
	leal	(%rdx,%rdi,2), %ecx
	shll	$4, %eax
	andl	$15, %r8d
	orl	%eax, %r8d
	movl	8(%rbx), %eax
	movl	%eax, (%rsp)
	leaq	-32(%rbp), %rdi
	xorl	%edx, %edx
	callq	_pcan_msg_add_rec
	movq	-32(%rbp), %rax
	movq	%rax, (%r14)
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	testl	%r8d, %r8d
	je	LBB0_2
## %bb.3:
	cmpl	$5, %r8d
	jge	LBB0_4
## %bb.5:
	movq	_PCAN_USBPRO_TXMSG4@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_2:
	xorl	%r8d, %r8d
	jmp	LBB0_6
LBB0_4:
	movq	_PCAN_USBPRO_TXMSG8@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_CAN_RTR_FLAG,4,2               ## @CAN_RTR_FLAG
	.comm	_PCAN_USBPRO_TXMSG0,4,2         ## @PCAN_USBPRO_TXMSG0
	.comm	_PCAN_USBPRO_TXMSG4,4,2         ## @PCAN_USBPRO_TXMSG4
	.comm	_PCAN_USBPRO_TXMSG8,4,2         ## @PCAN_USBPRO_TXMSG8
	.comm	_CAN_EFF_FLAG,4,2               ## @CAN_EFF_FLAG
	.no_dead_strip	_pcan_usb_pro_encode_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcan_usb_pro_encode_msg
_pcan_usb_pro_encode_msg:               ; @pcan_usb_pro_encode_msg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x3
	mov	x8, x2
	mov	x20, x0
	ldr	x21, [x1]
	ldr	x2, [x3]
	add	x0, sp, #8
	mov	x1, x8
	bl	_pcan_msg_init_empty
Lloh0:
	adrp	x8, _CAN_RTR_FLAG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CAN_RTR_FLAG@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldp	w5, w4, [x21]
Lloh3:
	adrp	x9, _PCAN_USBPRO_TXMSG0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PCAN_USBPRO_TXMSG0@GOTPAGEOFF]
	ands	w8, w8, w5
	b.ne	LBB0_2
; %bb.1:
Lloh5:
	adrp	x10, _PCAN_USBPRO_TXMSG8@GOTPAGE
Lloh6:
	ldr	x10, [x10, _PCAN_USBPRO_TXMSG8@GOTPAGEOFF]
Lloh7:
	adrp	x11, _PCAN_USBPRO_TXMSG4@GOTPAGE
Lloh8:
	ldr	x11, [x11, _PCAN_USBPRO_TXMSG4@GOTPAGEOFF]
	cmp	w4, #5
	csel	x10, x11, x10, lt
	cmp	w4, #0
	csel	w4, wzr, w4, eq
	csel	x9, x9, x10, eq
LBB0_2:
	cmp	w8, #0
	cset	w3, ne
	ldr	w1, [x9]
	ldr	w8, [x20]
Lloh9:
	adrp	x9, _CAN_EFF_FLAG@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CAN_EFF_FLAG@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w5
	cset	w9, ne
	bfi	w3, w9, #1, #1
	bfi	w4, w8, #4, #28
	ldr	w6, [x21, #8]
	add	x0, sp, #8
	mov	w2, #0
	bl	_pcan_msg_add_rec
	ldr	x8, [sp, #8]
	str	x8, [x19]
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_CAN_RTR_FLAG,4,2               ; @CAN_RTR_FLAG
	.comm	_PCAN_USBPRO_TXMSG0,4,2         ; @PCAN_USBPRO_TXMSG0
	.comm	_PCAN_USBPRO_TXMSG4,4,2         ; @PCAN_USBPRO_TXMSG4
	.comm	_PCAN_USBPRO_TXMSG8,4,2         ; @PCAN_USBPRO_TXMSG8
	.comm	_CAN_EFF_FLAG,4,2               ; @CAN_EFF_FLAG
	.no_dead_strip	_pcan_usb_pro_encode_msg
.subsections_via_symbols
