	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uclogic_params_pen_init_v1
_uclogic_params_pen_init_v1:            ## @uclogic_params_pen_init_v1
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	$0, -56(%rbp)
	movq	_UCLOGIC_RDESC_PEN_PH_ID_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	testq	%r12, %r12
	je	LBB0_3
## %bb.1:
	testq	%r14, %r14
	je	LBB0_3
## %bb.2:
	testq	%r13, %r13
	je	LBB0_3
## %bb.5:
	leaq	-56(%rbp), %rdi
	movq	%r13, %rsi
	movl	$100, %edx
	movl	$12, %ecx
	callq	_uclogic_params_get_str_desc
	movl	%eax, %ebx
	movq	_EPIPE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_hid_dbg
	jmp	LBB0_17
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_7:
	testl	%ebx, %ebx
	js	LBB0_8
## %bb.9:
	cmpl	$12, %ebx
	jne	LBB0_10
## %bb.11:
	movq	-56(%rbp), %rdi
	addq	$8, %rdi
	callq	_get_unaligned_le16
	movq	_UCLOGIC_RDESC_PEN_PH_ID_X_LM@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	movl	%eax, (%r15,%rcx,4)
	movq	-56(%rbp), %rdi
	addq	$16, %rdi
	callq	_get_unaligned_le16
	movq	_UCLOGIC_RDESC_PEN_PH_ID_Y_LM@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	movl	%eax, (%r15,%rcx,4)
	movq	-56(%rbp), %rdi
	addq	$32, %rdi
	callq	_get_unaligned_le16
	movq	_UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, (%r15,%rcx,4)
	movq	-56(%rbp), %rdi
	addq	$40, %rdi
	callq	_get_unaligned_le16
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movl	%eax, %ecx
	movq	(%r13), %rax
	imull	$1000, (%r15,%rax,4), %eax      ## imm = 0x3E8
	cltd
	idivl	%ecx
	movq	_UCLOGIC_RDESC_PEN_PH_ID_X_PM@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%eax, (%r15,%rdx,4)
	movq	(%rbx), %rax
	imull	$1000, (%r15,%rax,4), %eax      ## imm = 0x3E8
	cltd
	idivl	%ecx
	jmp	LBB0_14
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_hid_err
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_10:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	movl	%ebx, %edx
	movl	$12, %ecx
	xorl	%eax, %eax
	callq	_hid_dbg
	jmp	LBB0_17
LBB0_12:
	movq	_UCLOGIC_RDESC_PEN_PH_ID_X_PM@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$0, (%r15,%rax,4)
	xorl	%eax, %eax
LBB0_14:
	movq	_UCLOGIC_RDESC_PEN_PH_ID_Y_PM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, (%r15,%rcx,4)
	movq	-56(%rbp), %rdi
	callq	_kfree
	movq	$0, -56(%rbp)
	movq	_uclogic_rdesc_pen_v1_template_arr@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_uclogic_rdesc_pen_v1_template_size@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_ARRAY_SIZE
	movl	%r13d, %edi
	movl	%ebx, %esi
	movq	%r15, %rdx
	movl	%eax, %ecx
	callq	_uclogic_rdesc_template_apply
	testq	%rax, %rax
	je	LBB0_15
## %bb.16:
	movq	%rax, %rbx
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	%rbx, 16(%r12)
	movq	_uclogic_rdesc_pen_v1_template_size@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r12)
	movq	_UCLOGIC_RDESC_PEN_V1_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r12)
	movq	_UCLOGIC_PARAMS_PEN_INRANGE_INVERTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
	movl	$1, %r15d
LBB0_17:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movl	%r15d, (%r14)
	xorl	%ebx, %ebx
LBB0_18:
	xorl	%edi, %edi
	callq	_kfree
	movq	-56(%rbp), %rdi
	callq	_kfree
	movq	%r12, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_20
## %bb.19:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_20:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_UCLOGIC_RDESC_PEN_PH_ID_NUM,4,2 ## @UCLOGIC_RDESC_PEN_PH_ID_NUM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EPIPE,4,2                      ## @EPIPE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"string descriptor with pen parameters not found, assuming not compatible\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed retrieving pen parameters: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"string descriptor with pen parameters has invalid length (got %d, expected %d), assuming not compatible\n"

	.comm	_UCLOGIC_RDESC_PEN_PH_ID_X_LM,8,3 ## @UCLOGIC_RDESC_PEN_PH_ID_X_LM
	.comm	_UCLOGIC_RDESC_PEN_PH_ID_Y_LM,8,3 ## @UCLOGIC_RDESC_PEN_PH_ID_Y_LM
	.comm	_UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM,8,3 ## @UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM
	.comm	_UCLOGIC_RDESC_PEN_PH_ID_X_PM,8,3 ## @UCLOGIC_RDESC_PEN_PH_ID_X_PM
	.comm	_UCLOGIC_RDESC_PEN_PH_ID_Y_PM,8,3 ## @UCLOGIC_RDESC_PEN_PH_ID_Y_PM
	.comm	_uclogic_rdesc_pen_v1_template_arr,4,2 ## @uclogic_rdesc_pen_v1_template_arr
	.comm	_uclogic_rdesc_pen_v1_template_size,4,2 ## @uclogic_rdesc_pen_v1_template_size
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_UCLOGIC_RDESC_PEN_V1_ID,4,2    ## @UCLOGIC_RDESC_PEN_V1_ID
	.comm	_UCLOGIC_PARAMS_PEN_INRANGE_INVERTED,4,2 ## @UCLOGIC_PARAMS_PEN_INRANGE_INVERTED
	.no_dead_strip	_uclogic_params_pen_init_v1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uclogic_params_pen_init_v1
_uclogic_params_pen_init_v1:            ; @uclogic_params_pen_init_v1
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	mov	x24, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	stur	xzr, [x29, #-80]
Lloh3:
	adrp	x8, _UCLOGIC_RDESC_PEN_PH_ID_NUM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UCLOGIC_RDESC_PEN_PH_ID_NUM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	cbz	x0, LBB0_5
; %bb.1:
	cbz	x19, LBB0_5
; %bb.2:
	cbz	x22, LBB0_5
; %bb.3:
	sub	x0, x29, #80
	mov	x1, x22
	mov	w2, #100
	mov	w3, #12
	bl	_uclogic_params_get_str_desc
Lloh8:
	adrp	x8, _EPIPE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EPIPE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_7
; %bb.4:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_hid_dbg
	mov	w8, #0
	b	LBB0_16
LBB0_5:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_17
LBB0_7:
	mov	x23, x0
	tbnz	w0, #31, LBB0_11
; %bb.8:
	cmp	w23, #12
	b.ne	LBB0_12
; %bb.9:
	ldur	x8, [x29, #-80]
	add	x0, x8, #8
	bl	_get_unaligned_le16
Lloh15:
	adrp	x22, _UCLOGIC_RDESC_PEN_PH_ID_X_LM@GOTPAGE
Lloh16:
	ldr	x22, [x22, _UCLOGIC_RDESC_PEN_PH_ID_X_LM@GOTPAGEOFF]
	ldr	x8, [x22]
	str	w0, [x21, x8, lsl #2]
	ldur	x8, [x29, #-80]
	add	x0, x8, #16
	bl	_get_unaligned_le16
Lloh17:
	adrp	x23, _UCLOGIC_RDESC_PEN_PH_ID_Y_LM@GOTPAGE
Lloh18:
	ldr	x23, [x23, _UCLOGIC_RDESC_PEN_PH_ID_Y_LM@GOTPAGEOFF]
	ldr	x8, [x23]
	str	w0, [x21, x8, lsl #2]
	ldur	x8, [x29, #-80]
	add	x0, x8, #32
	bl	_get_unaligned_le16
Lloh19:
	adrp	x8, _UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	str	w0, [x21, x8, lsl #2]
	ldur	x8, [x29, #-80]
	add	x0, x8, #40
	bl	_get_unaligned_le16
	cbz	w0, LBB0_13
; %bb.10:
	ldr	x8, [x22]
	ldr	w8, [x21, x8, lsl #2]
	mov	w9, #1000
	mul	w8, w8, w9
	sdiv	w8, w8, w0
Lloh22:
	adrp	x10, _UCLOGIC_RDESC_PEN_PH_ID_X_PM@GOTPAGE
Lloh23:
	ldr	x10, [x10, _UCLOGIC_RDESC_PEN_PH_ID_X_PM@GOTPAGEOFF]
Lloh24:
	ldr	x10, [x10]
	str	w8, [x21, x10, lsl #2]
	ldr	x8, [x23]
	ldr	w8, [x21, x8, lsl #2]
	mul	w8, w8, w9
	sdiv	w8, w8, w0
	b	LBB0_14
LBB0_11:
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x23
	bl	_hid_err
	b	LBB0_17
LBB0_12:
	mov	w8, #12
	stp	x23, x8, [sp, #-16]!
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	bl	_hid_dbg
	add	sp, sp, #16
	mov	w8, #0
	b	LBB0_16
LBB0_13:
	mov	w8, #0
Lloh29:
	adrp	x9, _UCLOGIC_RDESC_PEN_PH_ID_X_PM@GOTPAGE
Lloh30:
	ldr	x9, [x9, _UCLOGIC_RDESC_PEN_PH_ID_X_PM@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	str	wzr, [x21, x9, lsl #2]
LBB0_14:
Lloh32:
	adrp	x9, _UCLOGIC_RDESC_PEN_PH_ID_Y_PM@GOTPAGE
Lloh33:
	ldr	x9, [x9, _UCLOGIC_RDESC_PEN_PH_ID_Y_PM@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	str	w8, [x21, x9, lsl #2]
	ldur	x0, [x29, #-80]
	bl	_kfree
	stur	xzr, [x29, #-80]
Lloh35:
	adrp	x8, _uclogic_rdesc_pen_v1_template_arr@GOTPAGE
Lloh36:
	ldr	x8, [x8, _uclogic_rdesc_pen_v1_template_arr@GOTPAGEOFF]
Lloh37:
	ldr	w22, [x8]
Lloh38:
	adrp	x25, _uclogic_rdesc_pen_v1_template_size@GOTPAGE
Lloh39:
	ldr	x25, [x25, _uclogic_rdesc_pen_v1_template_size@GOTPAGEOFF]
	ldr	w23, [x25]
	mov	x0, x21
	bl	_ARRAY_SIZE
	mov	x3, x0
	mov	x0, x22
	mov	x1, x23
	mov	x2, x21
	bl	_uclogic_rdesc_template_apply
	cbz	x0, LBB0_19
; %bb.15:
	mov	x21, x0
	mov	x0, x20
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	str	x21, [x20, #16]
	ldr	w8, [x25]
	str	w8, [x20, #8]
Lloh40:
	adrp	x8, _UCLOGIC_RDESC_PEN_V1_ID@GOTPAGE
Lloh41:
	ldr	x8, [x8, _UCLOGIC_RDESC_PEN_V1_ID@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
Lloh43:
	adrp	x9, _UCLOGIC_PARAMS_PEN_INRANGE_INVERTED@GOTPAGE
Lloh44:
	ldr	x9, [x9, _UCLOGIC_PARAMS_PEN_INRANGE_INVERTED@GOTPAGEOFF]
Lloh45:
	ldr	w9, [x9]
	stp	w9, w8, [x20]
	mov	w8, #1
LBB0_16:
	mov	w23, #0
	str	w8, [x19]
LBB0_17:
	mov	x0, #0
	bl	_kfree
	ldur	x0, [x29, #-80]
	bl	_kfree
	mov	sp, x24
	ldur	x8, [x29, #-72]
Lloh46:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh47:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh48:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_20
; %bb.18:
	mov	x0, x23
	sub	sp, x29, #64
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_19:
Lloh49:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh50:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
LBB0_20:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_UCLOGIC_RDESC_PEN_PH_ID_NUM,4,2 ; @UCLOGIC_RDESC_PEN_PH_ID_NUM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EPIPE,4,2                      ; @EPIPE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"string descriptor with pen parameters not found, assuming not compatible\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed retrieving pen parameters: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"string descriptor with pen parameters has invalid length (got %d, expected %d), assuming not compatible\n"

	.comm	_UCLOGIC_RDESC_PEN_PH_ID_X_LM,8,3 ; @UCLOGIC_RDESC_PEN_PH_ID_X_LM
	.comm	_UCLOGIC_RDESC_PEN_PH_ID_Y_LM,8,3 ; @UCLOGIC_RDESC_PEN_PH_ID_Y_LM
	.comm	_UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM,8,3 ; @UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM
	.comm	_UCLOGIC_RDESC_PEN_PH_ID_X_PM,8,3 ; @UCLOGIC_RDESC_PEN_PH_ID_X_PM
	.comm	_UCLOGIC_RDESC_PEN_PH_ID_Y_PM,8,3 ; @UCLOGIC_RDESC_PEN_PH_ID_Y_PM
	.comm	_uclogic_rdesc_pen_v1_template_arr,4,2 ; @uclogic_rdesc_pen_v1_template_arr
	.comm	_uclogic_rdesc_pen_v1_template_size,4,2 ; @uclogic_rdesc_pen_v1_template_size
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_UCLOGIC_RDESC_PEN_V1_ID,4,2    ; @UCLOGIC_RDESC_PEN_V1_ID
	.comm	_UCLOGIC_PARAMS_PEN_INRANGE_INVERTED,4,2 ; @UCLOGIC_PARAMS_PEN_INRANGE_INVERTED
	.no_dead_strip	_uclogic_params_pen_init_v1
.subsections_via_symbols
