	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hidinput_apple_event
_hidinput_apple_event:                  ## @hidinput_apple_event
	.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, %r15
	movq	%rdx, %r14
	movq	%rsi, %r13
	movq	%rdi, %rbx
	callq	_hid_get_drvdata
	movq	%rax, %r12
	movq	(%r14), %rdx
	movq	_KEY_FN@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	testq	%r15, %r15
	setne	%al
	movl	%eax, (%r12)
	movl	8(%r14), %esi
LBB0_30:
	movq	%r13, %rdi
	jmp	LBB0_31
LBB0_2:
	movq	_fnmode@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	je	LBB0_27
## %bb.3:
	movl	$-768, %eax                     ## imm = 0xFD00
	addl	(%rbx), %eax
	cmpl	$-227, %eax
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%rcx, %rbx
	jae	LBB0_4
## %bb.5:
	movq	_powerbook_fn_keys@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_apple_fn_keys@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %edi
	movq	%rdx, %rsi
	callq	_apple_find_translation
	testq	%rax, %rax
	je	LBB0_12
## %bb.7:
	movq	%rax, %r13
	movq	(%r14), %rdi
	movl	12(%r12), %esi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_8
LBB0_21:
	movq	(%r14), %rdi
	movl	12(%r12), %esi
	testq	%r15, %r15
	je	LBB0_23
## %bb.22:
	callq	_set_bit
	jmp	LBB0_24
LBB0_8:
	movq	_APPLE_FLAG_FKEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r13)
	je	LBB0_19
## %bb.9:
	movl	(%rbx), %eax
	cmpl	$1, %eax
	je	LBB0_18
## %bb.10:
	cmpl	$2, %eax
	jne	LBB0_12
## %bb.11:
	cmpl	$0, (%r12)
	jne	LBB0_21
	jmp	LBB0_12
LBB0_23:
	callq	_clear_bit
LBB0_24:
	movl	8(%r14), %esi
	movq	8(%r13), %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_31:
	movq	%r15, %rcx
	callq	_input_event
	movl	$1, %ebx
LBB0_32:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movl	(%r12), %eax
	testl	%eax, %eax
	jne	LBB0_21
	jmp	LBB0_12
LBB0_18:
	xorl	%eax, %eax
	cmpl	$0, (%r12)
	sete	%al
	testl	%eax, %eax
	jne	LBB0_21
LBB0_12:
	movq	_APPLE_NUMLOCK_EMULATION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r12)
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_27
## %bb.13:
	movq	(%r14), %rdi
	movl	8(%r12), %esi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_15
## %bb.14:
	movq	_LED_NUML@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	(%r13), %esi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_27
LBB0_15:
	movq	_powerbook_numlock_keys@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rsi
	callq	_apple_find_translation
	movl	$1, %ebx
	testq	%rax, %rax
	je	LBB0_32
## %bb.16:
	movq	%rax, %r13
	movq	(%r14), %rdi
	movl	8(%r12), %esi
	testq	%r15, %r15
	je	LBB0_25
## %bb.17:
	callq	_set_bit
	jmp	LBB0_26
LBB0_27:
	movq	_APPLE_ISO_KEYBOARD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	testl	%eax, 4(%r12)
	je	LBB0_32
## %bb.28:
	movq	_apple_iso_keyboard@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rsi
	callq	_apple_find_translation
	testq	%rax, %rax
	je	LBB0_32
## %bb.29:
	movl	8(%r14), %esi
	movq	8(%rax), %rdx
	jmp	LBB0_30
LBB0_25:
	callq	_clear_bit
LBB0_26:
	movl	8(%r14), %esi
	movq	8(%r13), %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rcx
	callq	_input_event
	jmp	LBB0_32
	.cfi_endproc
                                        ## -- End function
	.comm	_KEY_FN,8,3                     ## @KEY_FN
	.comm	_fnmode,4,2                     ## @fnmode
	.comm	_powerbook_fn_keys,4,2          ## @powerbook_fn_keys
	.comm	_apple_fn_keys,4,2              ## @apple_fn_keys
	.comm	_APPLE_FLAG_FKEY,4,2            ## @APPLE_FLAG_FKEY
	.comm	_APPLE_NUMLOCK_EMULATION,4,2    ## @APPLE_NUMLOCK_EMULATION
	.comm	_LED_NUML,8,3                   ## @LED_NUML
	.comm	_powerbook_numlock_keys,4,2     ## @powerbook_numlock_keys
	.comm	_APPLE_ISO_KEYBOARD,4,2         ## @APPLE_ISO_KEYBOARD
	.comm	_apple_iso_keyboard,4,2         ## @apple_iso_keyboard
	.no_dead_strip	_hidinput_apple_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hidinput_apple_event
_hidinput_apple_event:                  ; @hidinput_apple_event
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x3
	mov	x21, x2
	mov	x20, x1
	mov	x23, x0
	bl	_hid_get_drvdata
	mov	x22, x0
	ldr	x2, [x21]
Lloh0:
	adrp	x8, _KEY_FN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KEY_FN@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x2, x8
	b.ne	LBB0_2
; %bb.1:
	cmp	x19, #0
	cset	w8, ne
	str	w8, [x22]
	ldr	w1, [x21, #8]
	b	LBB0_22
LBB0_2:
Lloh3:
	adrp	x24, _fnmode@GOTPAGE
Lloh4:
	ldr	x24, [x24, _fnmode@GOTPAGEOFF]
	ldr	w8, [x24]
	cbz	w8, LBB0_19
; %bb.3:
	ldr	w8, [x23]
Lloh5:
	adrp	x9, _powerbook_fn_keys@GOTPAGE
Lloh6:
	ldr	x9, [x9, _powerbook_fn_keys@GOTPAGEOFF]
	sub	w8, w8, #768
Lloh7:
	adrp	x10, _apple_fn_keys@GOTPAGE
Lloh8:
	ldr	x10, [x10, _apple_fn_keys@GOTPAGEOFF]
	cmn	w8, #227
	csel	x8, x9, x10, lo
	ldr	w0, [x8]
	mov	x1, x2
	bl	_apple_find_translation
	cbz	x0, LBB0_12
; %bb.4:
	mov	x23, x0
	ldr	x0, [x21]
	ldr	w1, [x22, #12]
	bl	_test_bit
	cbz	x0, LBB0_7
LBB0_5:
	ldr	x0, [x21]
	ldr	w1, [x22, #12]
	cbz	x19, LBB0_17
LBB0_6:
	bl	_set_bit
	b	LBB0_18
LBB0_7:
	ldr	w8, [x23]
Lloh9:
	adrp	x9, _APPLE_FLAG_FKEY@GOTPAGE
Lloh10:
	ldr	x9, [x9, _APPLE_FLAG_FKEY@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.8:
	ldr	w8, [x24]
	cmp	w8, #1
	b.eq	LBB0_11
; %bb.9:
	cmp	w8, #2
	b.ne	LBB0_12
LBB0_10:
	ldr	w8, [x22]
	cbnz	w8, LBB0_5
	b	LBB0_12
LBB0_11:
	ldr	w8, [x22]
	cmp	w8, #0
	cset	w8, eq
	cbnz	w8, LBB0_5
LBB0_12:
	ldr	w8, [x22, #4]
Lloh12:
	adrp	x9, _APPLE_NUMLOCK_EMULATION@GOTPAGE
Lloh13:
	ldr	x9, [x9, _APPLE_NUMLOCK_EMULATION@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.13:
	ldr	x0, [x21]
	ldr	w1, [x22, #8]
	bl	_test_bit
	cbnz	x0, LBB0_15
; %bb.14:
Lloh15:
	adrp	x8, _LED_NUML@GOTPAGE
Lloh16:
	ldr	x8, [x8, _LED_NUML@GOTPAGEOFF]
Lloh17:
	ldr	x0, [x8]
	ldr	w1, [x20]
	bl	_test_bit
	cbz	x0, LBB0_19
LBB0_15:
Lloh18:
	adrp	x8, _powerbook_numlock_keys@GOTPAGE
Lloh19:
	ldr	x8, [x8, _powerbook_numlock_keys@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldr	x1, [x21]
	bl	_apple_find_translation
	cbz	x0, LBB0_23
; %bb.16:
	mov	x23, x0
	ldr	x0, [x21]
	ldr	w1, [x22, #8]
	cbnz	x19, LBB0_6
LBB0_17:
	bl	_clear_bit
LBB0_18:
	ldr	w1, [x21, #8]
	ldr	x2, [x23, #8]
	b	LBB0_22
LBB0_19:
	ldr	w8, [x22, #4]
Lloh21:
	adrp	x9, _APPLE_ISO_KEYBOARD@GOTPAGE
Lloh22:
	ldr	x9, [x9, _APPLE_ISO_KEYBOARD@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_25
; %bb.20:
Lloh24:
	adrp	x8, _apple_iso_keyboard@GOTPAGE
Lloh25:
	ldr	x8, [x8, _apple_iso_keyboard@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldr	x1, [x21]
	bl	_apple_find_translation
	cbz	x0, LBB0_24
; %bb.21:
	ldr	w1, [x21, #8]
	ldr	x2, [x0, #8]
LBB0_22:
	mov	x0, x20
	mov	x3, x19
	bl	_input_event
LBB0_23:
	mov	w0, #1
LBB0_24:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_25:
	mov	w0, #0
	b	LBB0_24
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_KEY_FN,8,3                     ; @KEY_FN
	.comm	_fnmode,4,2                     ; @fnmode
	.comm	_powerbook_fn_keys,4,2          ; @powerbook_fn_keys
	.comm	_apple_fn_keys,4,2              ; @apple_fn_keys
	.comm	_APPLE_FLAG_FKEY,4,2            ; @APPLE_FLAG_FKEY
	.comm	_APPLE_NUMLOCK_EMULATION,4,2    ; @APPLE_NUMLOCK_EMULATION
	.comm	_LED_NUML,8,3                   ; @LED_NUML
	.comm	_powerbook_numlock_keys,4,2     ; @powerbook_numlock_keys
	.comm	_APPLE_ISO_KEYBOARD,4,2         ; @APPLE_ISO_KEYBOARD
	.comm	_apple_iso_keyboard,4,2         ; @apple_iso_keyboard
	.no_dead_strip	_hidinput_apple_event
.subsections_via_symbols
