	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcan_usb_encode_msg
_pcan_usb_encode_msg:                   ## @pcan_usb_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	(%rdi), %r12
	movq	(%rsi), %r13
	movabsq	$4294967298, %rax               ## imm = 0x100000002
	movq	%rax, (%rdx)
	movq	_PCAN_USB_MSG_HEADER_LEN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	leaq	(%rdx,%rcx,4), %rbx
	movl	(%r13), %eax
	movl	%eax, (%rdx,%rcx,4)
	movl	4(%r13), %edi
	movq	_CAN_RTR_FLAG@GOTPCREL(%rip), %rcx
	testl	%edi, (%rcx)
	je	LBB0_2
## %bb.1:
	movq	_PCAN_USB_STATUSLEN_RTR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	movl	4(%r13), %edi
LBB0_2:
	movq	_CAN_EFF_FLAG@GOTPCREL(%rip), %rax
	testl	%edi, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_CAN_ERR_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %edi
	shll	$3, %edi
	callq	_cpu_to_le32
	movl	%eax, -48(%rbp)
	movq	_PCAN_USB_STATUSLEN_EXT_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
	leaq	4(%rbx), %rdi
	leaq	-48(%rbp), %rsi
	movl	$4, %edx
	callq	_memcpy
	addq	$20, %rbx
	jmp	LBB0_5
LBB0_4:
	movq	_CAN_ERR_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %edi
	shll	$5, %edi
	callq	_cpu_to_le16
	movl	%eax, -44(%rbp)
	leaq	4(%rbx), %rdi
	leaq	-44(%rbp), %rsi
	movl	$2, %edx
	callq	_memcpy
	addq	$12, %rbx
LBB0_5:
	movq	_CAN_RTR_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r13)
	jne	LBB0_7
## %bb.6:
	movq	8(%r13), %rsi
	movl	(%r13), %edx
	movq	%rbx, %rdi
	callq	_memcpy
LBB0_7:
	movzbl	(%r12), %eax
	movq	(%r14), %rcx
	movl	%eax, -4(%r15,%rcx,4)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCAN_USB_MSG_HEADER_LEN,4,2    ## @PCAN_USB_MSG_HEADER_LEN
	.comm	_CAN_RTR_FLAG,4,2               ## @CAN_RTR_FLAG
	.comm	_PCAN_USB_STATUSLEN_RTR,4,2     ## @PCAN_USB_STATUSLEN_RTR
	.comm	_CAN_EFF_FLAG,4,2               ## @CAN_EFF_FLAG
	.comm	_CAN_ERR_MASK,4,2               ## @CAN_ERR_MASK
	.comm	_PCAN_USB_STATUSLEN_EXT_ID,4,2  ## @PCAN_USB_STATUSLEN_EXT_ID
	.no_dead_strip	_pcan_usb_encode_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function pcan_usb_encode_msg
lCPI0_0:
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_pcan_usb_encode_msg:                   ; @pcan_usb_encode_msg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x3
	mov	x19, x2
	ldr	x22, [x0]
	ldr	x23, [x1]
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x2]
Lloh2:
	adrp	x8, _PCAN_USB_MSG_HEADER_LEN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCAN_USB_MSG_HEADER_LEN@GOTPAGEOFF]
Lloh4:
	ldrsw	x8, [x8]
	add	x21, x2, x8, lsl #2
	ldr	w9, [x23]
	str	w9, [x21]
	ldr	w8, [x23, #4]
Lloh5:
	adrp	x24, _CAN_RTR_FLAG@GOTPAGE
Lloh6:
	ldr	x24, [x24, _CAN_RTR_FLAG@GOTPAGEOFF]
	ldr	w10, [x24]
	tst	w10, w8
	b.eq	LBB0_2
; %bb.1:
Lloh7:
	adrp	x8, _PCAN_USB_STATUSLEN_RTR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PCAN_USB_STATUSLEN_RTR@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	orr	w8, w8, w9
	str	w8, [x21]
	ldr	w8, [x23, #4]
LBB0_2:
Lloh10:
	adrp	x9, _CAN_EFF_FLAG@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CAN_EFF_FLAG@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh13:
	adrp	x9, _CAN_ERR_MASK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _CAN_ERR_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	and	w8, w9, w8
	lsl	w0, w8, #3
	bl	_cpu_to_le32
	str	w0, [sp, #12]
Lloh16:
	adrp	x8, _PCAN_USB_STATUSLEN_EXT_ID@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PCAN_USB_STATUSLEN_EXT_ID@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	mov	x0, x21
	ldr	w9, [x0], #4
	orr	w8, w9, w8
	str	w8, [x21], #20
	add	x1, sp, #12
	mov	w2, #4
	bl	_memcpy
	b	LBB0_5
LBB0_4:
Lloh19:
	adrp	x9, _CAN_ERR_MASK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _CAN_ERR_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	and	w8, w9, w8
	lsl	w0, w8, #5
	bl	_cpu_to_le16
	str	w0, [sp, #8]
	add	x0, x21, #4
	add	x1, sp, #8
	mov	w2, #2
	bl	_memcpy
	add	x21, x21, #12
LBB0_5:
	ldr	w8, [x23, #4]
	ldr	w9, [x24]
	tst	w9, w8
	b.ne	LBB0_7
; %bb.6:
	ldr	x1, [x23, #8]
	ldr	w2, [x23]
	mov	x0, x21
	bl	_memcpy
LBB0_7:
	ldrb	w8, [x22]
	ldr	x9, [x20]
	add	x9, x19, x9, lsl #2
	stur	w8, [x9, #-4]
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdrp	Lloh0, Lloh2
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_PCAN_USB_MSG_HEADER_LEN,4,2    ; @PCAN_USB_MSG_HEADER_LEN
	.comm	_CAN_RTR_FLAG,4,2               ; @CAN_RTR_FLAG
	.comm	_PCAN_USB_STATUSLEN_RTR,4,2     ; @PCAN_USB_STATUSLEN_RTR
	.comm	_CAN_EFF_FLAG,4,2               ; @CAN_EFF_FLAG
	.comm	_CAN_ERR_MASK,4,2               ; @CAN_ERR_MASK
	.comm	_PCAN_USB_STATUSLEN_EXT_ID,4,2  ; @PCAN_USB_STATUSLEN_EXT_ID
	.no_dead_strip	_pcan_usb_encode_msg
.subsections_via_symbols
