	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function attr_set_mode
_attr_set_mode:                         ## @attr_set_mode
	.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	%rcx, %rbx
	movq	%rdi, %r14
	movq	8(%rdi), %r12
	movl	(%r12), %r15d
	movq	%rdx, %rdi
	movq	%rcx, %rsi
	callq	_hgpk_mode_from_name
	movl	%eax, %r13d
	movq	_HGPK_MODE_INVALID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
	jmp	LBB0_10
LBB0_3:
	cmpl	%r13d, %r15d
	je	LBB0_10
## %bb.4:
	movq	(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_input_allocate_device
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	_PSMOUSE_INITIALIZING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_psmouse_set_state
	movl	%r13d, (%r12)
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_hgpk_reset_device
	testl	%eax, %eax
	jne	LBB0_9
## %bb.7:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r13d, %edx
	callq	_hgpk_setup_input_device
	movq	_PSMOUSE_CMD_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_psmouse_set_state
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_input_register_device
	testl	%eax, %eax
	je	LBB0_8
LBB0_9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %ebx
	callq	_input_free_device
	movl	%r15d, (%r12)
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_hgpk_reset_device
	movslq	%ebx, %rbx
LBB0_10:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_8:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r14)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_input_unregister_device
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_HGPK_MODE_INVALID,4,2          ## @HGPK_MODE_INVALID
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_ENOMEM,8,3                     ## @ENOMEM
	.comm	_PSMOUSE_INITIALIZING,4,2       ## @PSMOUSE_INITIALIZING
	.comm	_PSMOUSE_CMD_MODE,4,2           ## @PSMOUSE_CMD_MODE
	.no_dead_strip	_attr_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function attr_set_mode
_attr_set_mode:                         ; @attr_set_mode
	.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
	mov	x19, x3
	mov	x20, x0
	ldr	x25, [x0, #8]
	ldr	w26, [x25]
	mov	x0, x2
	mov	x1, x3
	bl	_hgpk_mode_from_name
Lloh0:
	adrp	x8, _HGPK_MODE_INVALID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HGPK_MODE_INVALID@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	x8, [x8]
	neg	x19, x8
	b	LBB0_8
LBB0_3:
	mov	x23, x0
	cmp	w26, w0
	b.eq	LBB0_8
; %bb.4:
	ldr	x21, [x20]
	bl	_input_allocate_device
	cbz	x0, LBB0_9
; %bb.5:
	mov	x22, x0
Lloh5:
	adrp	x8, _PSMOUSE_INITIALIZING@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PSMOUSE_INITIALIZING@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_psmouse_set_state
	str	w23, [x25]
	mov	x0, x20
	mov	w1, #0
	bl	_hgpk_reset_device
	mov	x24, x0
	cbnz	w0, LBB0_7
; %bb.6:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x23
	bl	_hgpk_setup_input_device
Lloh8:
	adrp	x8, _PSMOUSE_CMD_MODE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PSMOUSE_CMD_MODE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_psmouse_set_state
	mov	x0, x22
	bl	_input_register_device
	mov	x24, x0
	cbz	w0, LBB0_10
LBB0_7:
	mov	x0, x22
	bl	_input_free_device
	str	w26, [x25]
	mov	x0, x20
	mov	w1, #0
	bl	_hgpk_reset_device
	sxtw	x19, w24
LBB0_8:
	mov	x0, x19
	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_9:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
LBB0_10:
	str	x22, [x20]
	mov	x0, x21
	bl	_input_unregister_device
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_HGPK_MODE_INVALID,4,2          ; @HGPK_MODE_INVALID
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_ENOMEM,8,3                     ; @ENOMEM
	.comm	_PSMOUSE_INITIALIZING,4,2       ; @PSMOUSE_INITIALIZING
	.comm	_PSMOUSE_CMD_MODE,4,2           ; @PSMOUSE_CMD_MODE
	.no_dead_strip	_attr_set_mode
.subsections_via_symbols
