	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uclogic_params_frame_init_v1_buttonpad
_uclogic_params_frame_init_v1_buttonpad: ## @uclogic_params_frame_init_v1_buttonpad
	.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	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	%rdx, %rdi
	callq	_hid_to_usb_dev
	testq	%r12, %r12
	je	LBB0_3
## %bb.1:
	testq	%r14, %r14
	je	LBB0_3
## %bb.2:
	testq	%r13, %r13
	je	LBB0_3
## %bb.5:
	movq	%rax, %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r15
	movl	$16, %ecx
	movq	%rbx, %rdi
	movl	$123, %esi
	movq	%rax, %rdx
	callq	_usb_string
	movl	%eax, %ebx
	movq	_EPIPE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_9
## %bb.8:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_hid_dbg
	jmp	LBB0_15
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_9:
	testl	%ebx, %ebx
	js	LBB0_16
## %bb.10:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_hid_dbg
LBB0_15:
	movl	%ebx, (%r14)
	xorl	%ebx, %ebx
LBB0_16:
	movq	%r15, %rdi
	callq	_kfree
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_hid_dbg
	movq	_uclogic_rdesc_buttonpad_v1_arr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_uclogic_rdesc_buttonpad_v1_size@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_UCLOGIC_RDESC_BUTTONPAD_V1_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	callq	_uclogic_params_frame_init_with_desc
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %ebx
	jmp	LBB0_16
LBB0_14:
	movl	$1, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.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	"generic button -enabling string descriptor not found\n"

L_.str.1:                               ## @.str.1
	.asciz	"HK On"

L_.str.2:                               ## @.str.2
	.asciz	"invalid response to enabling generic buttons: \"%s\"\n"

L_.str.3:                               ## @.str.3
	.asciz	"generic buttons enabled\n"

	.comm	_uclogic_rdesc_buttonpad_v1_arr,4,2 ## @uclogic_rdesc_buttonpad_v1_arr
	.comm	_uclogic_rdesc_buttonpad_v1_size,4,2 ## @uclogic_rdesc_buttonpad_v1_size
	.comm	_UCLOGIC_RDESC_BUTTONPAD_V1_ID,4,2 ## @UCLOGIC_RDESC_BUTTONPAD_V1_ID
	.no_dead_strip	_uclogic_params_frame_init_v1_buttonpad
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uclogic_params_frame_init_v1_buttonpad
_uclogic_params_frame_init_v1_buttonpad: ; @uclogic_params_frame_init_v1_buttonpad
	.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	x22, x2
	mov	x20, x1
	mov	x21, x0
	mov	x0, x2
	bl	_hid_to_usb_dev
	cbz	x21, LBB0_6
; %bb.1:
	cbz	x20, LBB0_6
; %bb.2:
	cbz	x22, LBB0_6
; %bb.3:
	mov	x23, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.4:
	mov	x0, x23
	mov	w1, #123
	mov	x2, x19
	mov	w3, #16
	bl	_usb_string
Lloh3:
	adrp	x8, _EPIPE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EPIPE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_9
; %bb.5:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_12
LBB0_6:
	mov	x19, #0
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_14
LBB0_9:
	mov	x23, x0
	tbnz	w0, #31, LBB0_14
; %bb.10:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x23
	bl	_strncmp
	cbz	x0, LBB0_15
; %bb.11:
	str	x19, [sp]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_12:
	mov	x0, x22
	bl	_hid_dbg
	mov	w8, #0
LBB0_13:
	mov	w23, #0
	str	w8, [x20]
LBB0_14:
	mov	x0, x19
	bl	_kfree
	mov	x0, x23
	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
LBB0_15:
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x22
	bl	_hid_dbg
Lloh18:
	adrp	x8, _uclogic_rdesc_buttonpad_v1_arr@GOTPAGE
Lloh19:
	ldr	x8, [x8, _uclogic_rdesc_buttonpad_v1_arr@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _uclogic_rdesc_buttonpad_v1_size@GOTPAGE
Lloh22:
	ldr	x8, [x8, _uclogic_rdesc_buttonpad_v1_size@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
Lloh24:
	adrp	x8, _UCLOGIC_RDESC_BUTTONPAD_V1_ID@GOTPAGE
Lloh25:
	ldr	x8, [x8, _UCLOGIC_RDESC_BUTTONPAD_V1_ID@GOTPAGEOFF]
Lloh26:
	ldr	w3, [x8]
	mov	x0, x21
	bl	_uclogic_params_frame_init_with_desc
	cbz	w0, LBB0_17
; %bb.16:
	mov	x23, x0
	b	LBB0_14
LBB0_17:
	mov	w8, #1
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.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	"generic button -enabling string descriptor not found\n"

l_.str.1:                               ; @.str.1
	.asciz	"HK On"

l_.str.2:                               ; @.str.2
	.asciz	"invalid response to enabling generic buttons: \"%s\"\n"

l_.str.3:                               ; @.str.3
	.asciz	"generic buttons enabled\n"

	.comm	_uclogic_rdesc_buttonpad_v1_arr,4,2 ; @uclogic_rdesc_buttonpad_v1_arr
	.comm	_uclogic_rdesc_buttonpad_v1_size,4,2 ; @uclogic_rdesc_buttonpad_v1_size
	.comm	_UCLOGIC_RDESC_BUTTONPAD_V1_ID,4,2 ; @UCLOGIC_RDESC_BUTTONPAD_V1_ID
	.no_dead_strip	_uclogic_params_frame_init_v1_buttonpad
.subsections_via_symbols
