	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uclogic_params_huion_init
_uclogic_params_huion_init:             ## @uclogic_params_huion_init
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_hid_to_usb_dev
	movq	%rax, %rbx
	movl	(%r12), %edi
	callq	_to_usb_interface
	movq	(%rax), %rax
	movq	(%rax), %rax
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	testq	%r15, %r15
	je	LBB0_5
## %bb.1:
	testq	%r12, %r12
	je	LBB0_5
## %bb.2:
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	leaq	-64(%rbp), %rdi
	callq	_uclogic_params_init_with_pen_unused
	xorl	%r14d, %r14d
LBB0_4:
	leaq	-64(%rbp), %r12
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$16, %edx
	callq	_memcpy
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	jmp	LBB0_7
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movq	%r14, %rdi
	callq	_kfree
	leaq	-64(%rbp), %rdi
	callq	_uclogic_params_cleanup
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$19, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	movq	%rax, %r14
	movl	$19, %ecx
	movq	%rbx, %rdi
	movl	$201, %esi
	movq	%rax, %rdx
	callq	_usb_string
	movl	%eax, %ebx
	movq	_EPIPE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_12
## %bb.10:
	movb	$0, (%r14)
	jmp	LBB0_13
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_12:
	testl	%ebx, %ebx
	js	LBB0_22
LBB0_13:
	leaq	_uclogic_params_huion_init.transition_ver(%rip), %rsi
	movq	%r14, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	leaq	-56(%rbp), %rdi
	leaq	-36(%rbp), %rsi
	movq	%r12, %rdx
	callq	_uclogic_params_pen_init_v2
	testl	%eax, %eax
	je	LBB0_19
## %bb.15:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_26
LBB0_16:
	leaq	L_.str.1(%rip), %rsi
LBB0_17:
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_hid_dbg
	leaq	-56(%rbp), %rdi
	leaq	-36(%rbp), %rsi
	movq	%r12, %rdx
	callq	_uclogic_params_pen_init_v1
	testl	%eax, %eax
	je	LBB0_23
## %bb.18:
	movl	%eax, %ebx
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_26
LBB0_19:
	cmpl	$0, -36(%rbp)
	je	LBB0_27
## %bb.20:
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_hid_dbg
	leaq	-60(%rbp), %rdi
	movq	_uclogic_rdesc_buttonpad_v2_arr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_uclogic_rdesc_buttonpad_v2_size@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_UCLOGIC_RDESC_BUTTONPAD_V2_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_uclogic_params_frame_init_with_desc
	testl	%eax, %eax
	je	LBB0_29
## %bb.21:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_26
LBB0_22:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_26
LBB0_23:
	cmpl	$0, -36(%rbp)
	je	LBB0_28
## %bb.24:
	leaq	L_.str.7(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_hid_dbg
	leaq	-60(%rbp), %rdi
	leaq	-36(%rbp), %rsi
	movq	%r12, %rdx
	callq	_uclogic_params_frame_init_v1_buttonpad
	testl	%eax, %eax
	je	LBB0_30
## %bb.25:
	movl	%eax, %ebx
	leaq	L_.str.8(%rip), %rsi
LBB0_26:
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_hid_err
	jmp	LBB0_7
LBB0_27:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_17
LBB0_28:
	leaq	L_.str.12(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_hid_dbg
	leaq	-64(%rbp), %rdi
	callq	_uclogic_params_init_invalid
	jmp	LBB0_4
LBB0_30:
	cmpl	$0, -36(%rbp)
	leaq	L_.str.11(%rip), %rax
	leaq	L_.str.10(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.9(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_hid_dbg
	cmpl	$0, -36(%rbp)
	je	LBB0_4
LBB0_29:
	movl	$32, -64(%rbp)
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @uclogic_params_huion_init.transition_ver
_uclogic_params_huion_init.transition_ver:
	.asciz	"HUION_T153_160607"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EPIPE,4,2                      ## @EPIPE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed retrieving Huion firmware version: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"transition firmware detected, not probing pen v2 parameters\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed probing pen v2 parameters: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"pen v2 parameters found\n"

	.comm	_uclogic_rdesc_buttonpad_v2_arr,4,2 ## @uclogic_rdesc_buttonpad_v2_arr
	.comm	_uclogic_rdesc_buttonpad_v2_size,4,2 ## @uclogic_rdesc_buttonpad_v2_size
	.comm	_UCLOGIC_RDESC_BUTTONPAD_V2_ID,4,2 ## @UCLOGIC_RDESC_BUTTONPAD_V2_ID
L_.str.4:                               ## @.str.4
	.asciz	"failed creating v2 buttonpad parameters: %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"pen v2 parameters not found\n"

L_.str.6:                               ## @.str.6
	.asciz	"failed probing pen v1 parameters: %d\n"

L_.str.7:                               ## @.str.7
	.asciz	"pen v1 parameters found\n"

L_.str.8:                               ## @.str.8
	.asciz	"v1 buttonpad probing failed: %d\n"

L_.str.9:                               ## @.str.9
	.asciz	"buttonpad v1 parameters%s found\n"

L_.str.10:                              ## @.str.10
	.space	1

L_.str.11:                              ## @.str.11
	.asciz	" not"

L_.str.12:                              ## @.str.12
	.asciz	"pen v1 parameters not found\n"

	.no_dead_strip	_uclogic_params_huion_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uclogic_params_huion_init
_uclogic_params_huion_init:             ; @uclogic_params_huion_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x21, x1
	mov	x20, x0
	mov	x0, x1
	bl	_hid_to_usb_dev
	mov	x22, x0
	ldr	w0, [x21]
	bl	_to_usb_interface
	ldr	x8, [x0]
	ldr	x8, [x8]
	stp	xzr, xzr, [sp, #8]
	cbz	x20, LBB0_5
; %bb.1:
	cbz	x21, LBB0_5
; %bb.2:
	cbz	x8, LBB0_8
; %bb.3:
	add	x0, sp, #8
	bl	_uclogic_params_init_with_pen_unused
	mov	x19, #0
LBB0_4:
	add	x1, sp, #8
	mov	x0, x20
	mov	w2, #16
	bl	_memcpy
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	mov	w22, #0
	b	LBB0_7
LBB0_5:
	mov	x19, #0
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_7:
	mov	x0, x19
	bl	_kfree
	add	x0, sp, #8
	bl	_uclogic_params_cleanup
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
LBB0_8:
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #19
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_11
; %bb.9:
	mov	x0, x22
	mov	w1, #201
	mov	x2, x19
	mov	w3, #19
	bl	_usb_string
Lloh5:
	adrp	x8, _EPIPE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EPIPE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_12
; %bb.10:
	strb	wzr, [x19]
	b	LBB0_13
LBB0_11:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
LBB0_12:
	mov	x22, x0
	tbnz	w0, #31, LBB0_22
LBB0_13:
Lloh10:
	adrp	x1, _uclogic_params_huion_init.transition_ver@PAGE
Lloh11:
	add	x1, x1, _uclogic_params_huion_init.transition_ver@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_16
; %bb.14:
	add	x8, sp, #8
	add	x0, x8, #8
	add	x1, sp, #28
	mov	x2, x21
	bl	_uclogic_params_pen_init_v2
	cbz	w0, LBB0_19
; %bb.15:
	mov	x22, x0
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_26
LBB0_16:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_17:
	mov	x0, x21
	bl	_hid_dbg
	add	x8, sp, #8
	add	x0, x8, #8
	add	x1, sp, #28
	mov	x2, x21
	bl	_uclogic_params_pen_init_v1
	cbz	w0, LBB0_23
; %bb.18:
	mov	x22, x0
Lloh16:
	adrp	x1, l_.str.6@PAGE
Lloh17:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_26
LBB0_19:
	ldr	w8, [sp, #28]
	cbz	w8, LBB0_27
; %bb.20:
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_hid_dbg
	add	x8, sp, #8
	orr	x0, x8, #0x4
Lloh20:
	adrp	x8, _uclogic_rdesc_buttonpad_v2_arr@GOTPAGE
Lloh21:
	ldr	x8, [x8, _uclogic_rdesc_buttonpad_v2_arr@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x8, _uclogic_rdesc_buttonpad_v2_size@GOTPAGE
Lloh24:
	ldr	x8, [x8, _uclogic_rdesc_buttonpad_v2_size@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
Lloh26:
	adrp	x8, _UCLOGIC_RDESC_BUTTONPAD_V2_ID@GOTPAGE
Lloh27:
	ldr	x8, [x8, _UCLOGIC_RDESC_BUTTONPAD_V2_ID@GOTPAGEOFF]
Lloh28:
	ldr	w3, [x8]
	bl	_uclogic_params_frame_init_with_desc
	cbz	w0, LBB0_30
; %bb.21:
	mov	x22, x0
Lloh29:
	adrp	x1, l_.str.4@PAGE
Lloh30:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_26
LBB0_22:
Lloh31:
	adrp	x1, l_.str@PAGE
Lloh32:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_26
LBB0_23:
	ldr	w8, [sp, #28]
	cbz	w8, LBB0_28
; %bb.24:
Lloh33:
	adrp	x1, l_.str.7@PAGE
Lloh34:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x21
	bl	_hid_dbg
	add	x8, sp, #8
	orr	x0, x8, #0x4
	add	x1, sp, #28
	mov	x2, x21
	bl	_uclogic_params_frame_init_v1_buttonpad
	cbz	w0, LBB0_29
; %bb.25:
	mov	x22, x0
Lloh35:
	adrp	x1, l_.str.8@PAGE
Lloh36:
	add	x1, x1, l_.str.8@PAGEOFF
LBB0_26:
	mov	x0, x21
	mov	x2, x22
	bl	_hid_err
	b	LBB0_7
LBB0_27:
Lloh37:
	adrp	x1, l_.str.5@PAGE
Lloh38:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_17
LBB0_28:
Lloh39:
	adrp	x1, l_.str.12@PAGE
Lloh40:
	add	x1, x1, l_.str.12@PAGEOFF
	mov	x0, x21
	bl	_hid_dbg
	add	x0, sp, #8
	bl	_uclogic_params_init_invalid
	b	LBB0_4
LBB0_29:
	ldr	w8, [sp, #28]
Lloh41:
	adrp	x9, l_.str.10@PAGE
Lloh42:
	add	x9, x9, l_.str.10@PAGEOFF
Lloh43:
	adrp	x10, l_.str.11@PAGE
Lloh44:
	add	x10, x10, l_.str.11@PAGEOFF
	cmp	w8, #0
	csel	x8, x10, x9, eq
	str	x8, [sp]
Lloh45:
	adrp	x1, l_.str.9@PAGE
Lloh46:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x0, x21
	bl	_hid_dbg
	ldr	w8, [sp, #28]
	cbz	w8, LBB0_4
LBB0_30:
	mov	w8, #32
	str	w8, [sp, #8]
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_uclogic_params_huion_init.transition_ver: ; @uclogic_params_huion_init.transition_ver
	.asciz	"HUION_T153_160607"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EPIPE,4,2                      ; @EPIPE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed retrieving Huion firmware version: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"transition firmware detected, not probing pen v2 parameters\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed probing pen v2 parameters: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"pen v2 parameters found\n"

	.comm	_uclogic_rdesc_buttonpad_v2_arr,4,2 ; @uclogic_rdesc_buttonpad_v2_arr
	.comm	_uclogic_rdesc_buttonpad_v2_size,4,2 ; @uclogic_rdesc_buttonpad_v2_size
	.comm	_UCLOGIC_RDESC_BUTTONPAD_V2_ID,4,2 ; @UCLOGIC_RDESC_BUTTONPAD_V2_ID
l_.str.4:                               ; @.str.4
	.asciz	"failed creating v2 buttonpad parameters: %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"pen v2 parameters not found\n"

l_.str.6:                               ; @.str.6
	.asciz	"failed probing pen v1 parameters: %d\n"

l_.str.7:                               ; @.str.7
	.asciz	"pen v1 parameters found\n"

l_.str.8:                               ; @.str.8
	.asciz	"v1 buttonpad probing failed: %d\n"

l_.str.9:                               ; @.str.9
	.asciz	"buttonpad v1 parameters%s found\n"

l_.str.10:                              ; @.str.10
	.space	1

l_.str.11:                              ; @.str.11
	.asciz	" not"

l_.str.12:                              ; @.str.12
	.asciz	"pen v1 parameters not found\n"

	.no_dead_strip	_uclogic_params_huion_init
.subsections_via_symbols
