	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adbhid_input_keycode
_adbhid_input_keycode:                  ## @adbhid_input_keycode
	.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	_adbhid@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movslq	%edi, %r12
	movq	(%rax,%r12,8), %r15
	movl	%esi, %ebx
	andl	$127, %ebx
	movl	%esi, %r13d
	andl	$128, %r13d
	cmpl	$255, %esi
	jne	LBB0_8
## %bb.1:
	movq	_restore_capslock_events@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.2:
	movl	(%r15), %ecx
	movq	_FLAG_POWER_KEY_PRESSED@GOTPCREL(%rip), %rdx
	movl	$128, %r13d
	movl	$127, %ebx
	testl	%ecx, (%rdx)
	je	LBB0_3
LBB0_8:
	movq	8(%r15), %rax
	movl	%ebx, %ecx
	movl	(%rax,%rcx,4), %esi
	testl	%esi, %esi
	je	LBB0_11
## %bb.9:
	movl	16(%r15), %edi
	xorl	%edx, %edx
	testl	%r13d, %r13d
	sete	%dl
	callq	_input_report_key
	movq	(%r14), %rax
	movq	(%rax,%r12,8), %rax
	movl	16(%rax), %edi
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_input_sync                     ## TAILCALL
LBB0_11:
	testl	%r13d, %r13d
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_info                        ## TAILCALL
LBB0_3:
	movq	_FLAG_CAPSLOCK_TRANSLATE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%ecx, %edx
	je	LBB0_7
## %bb.4:
	movq	_FLAG_CAPSLOCK_DOWN@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	xorl	%r13d, %r13d
	testl	%ecx, %esi
	setne	%bl
	cmovnel	%esi, %edx
	notl	%edx
	andl	%ecx, %edx
	movl	%edx, (%r15)
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	movb	%bl, %r13b
	movl	$135, %ebx
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
	movq	(%r14), %rax
	movq	(%rax,%r12,8), %r15
	jmp	LBB0_8
LBB0_6:
	movl	16(%r15), %edi
	movq	_KEY_CAPSLOCK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$1, %edx
	callq	_input_report_key
	movl	16(%r15), %edi
	callq	_input_sync
	movl	16(%r15), %edi
	movl	(%rbx), %esi
	xorl	%edx, %edx
	callq	_input_report_key
	movl	16(%r15), %edi
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_adbhid,8,3                     ## @adbhid
	.comm	_restore_capslock_events,8,3    ## @restore_capslock_events
	.comm	_FLAG_CAPSLOCK_IGNORE_NEXT,4,2  ## @FLAG_CAPSLOCK_IGNORE_NEXT
	.comm	_FLAG_CAPSLOCK_TRANSLATE,4,2    ## @FLAG_CAPSLOCK_TRANSLATE
	.comm	_FLAG_CAPSLOCK_DOWN,4,2         ## @FLAG_CAPSLOCK_DOWN
	.comm	_FLAG_POWER_KEY_PRESSED,4,2     ## @FLAG_POWER_KEY_PRESSED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Spurious caps lock event (scancode 0xff).\n"

	.comm	_KEY_CAPSLOCK,4,2               ## @KEY_CAPSLOCK
L_.str.1:                               ## @.str.1
	.asciz	"Unhandled ADB key (scancode %#02x) %s.\n"

L_.str.2:                               ## @.str.2
	.asciz	"released"

L_.str.3:                               ## @.str.3
	.asciz	"pressed"

	.comm	_ADB_KEY_CMD,4,2                ## @ADB_KEY_CMD
	.comm	_ADB_KEY_FWDEL,4,2              ## @ADB_KEY_FWDEL
	.comm	_FLAG_EMU_FWDEL_DOWN,4,2        ## @FLAG_EMU_FWDEL_DOWN
	.comm	_FLAG_FN_KEY_PRESSED,4,2        ## @FLAG_FN_KEY_PRESSED
	.comm	_FLAG_POWER_FROM_FN,4,2         ## @FLAG_POWER_FROM_FN
	.comm	_PMAC_FTR_GET_MB_INFO,4,2       ## @PMAC_FTR_GET_MB_INFO
	.comm	_PMAC_MB_INFO_MODEL,4,2         ## @PMAC_MB_INFO_MODEL
	.no_dead_strip	_adbhid_input_keycode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adbhid_input_keycode
_adbhid_input_keycode:                  ; @adbhid_input_keycode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
                                        ; kill: def $w0 killed $w0 def $x0
Lloh0:
	adrp	x20, _adbhid@GOTPAGE
Lloh1:
	ldr	x20, [x20, _adbhid@GOTPAGEOFF]
	ldr	x8, [x20]
	sxtw	x21, w0
	ldr	x19, [x8, w0, sxtw #3]
	and	w9, w1, #0x7f
	and	w8, w1, #0x80
	cmp	w1, #255
	b.ne	LBB0_4
; %bb.1:
Lloh2:
	adrp	x10, _restore_capslock_events@GOTPAGE
Lloh3:
	ldr	x10, [x10, _restore_capslock_events@GOTPAGEOFF]
	ldr	x11, [x10]
	cbz	x11, LBB0_4
; %bb.2:
	ldr	w9, [x19]
Lloh4:
	adrp	x8, _FLAG_POWER_KEY_PRESSED@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FLAG_POWER_KEY_PRESSED@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_8
LBB0_3:
	mov	w8, #128
	mov	w9, #127
LBB0_4:
	ldr	x10, [x19, #8]
	ldr	w1, [x10, w9, uxtw #2]
	cbz	w1, LBB0_7
; %bb.5:
	ldr	w0, [x19, #16]
	cmp	w8, #0
	cset	w2, eq
	bl	_input_report_key
	ldr	x8, [x20]
	ldr	x8, [x8, x21, lsl #3]
	ldr	w0, [x8, #16]
LBB0_6:
	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
	add	sp, sp, #64
	b	_input_sync
LBB0_7:
Lloh7:
	adrp	x10, l_.str.2@PAGE
Lloh8:
	add	x10, x10, l_.str.2@PAGEOFF
Lloh9:
	adrp	x11, l_.str.3@PAGE
Lloh10:
	add	x11, x11, l_.str.3@PAGEOFF
	cmp	w8, #0
	csel	x8, x11, x10, eq
	stp	x9, x8, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
	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
	add	sp, sp, #64
	ret
LBB0_8:
Lloh13:
	adrp	x8, _FLAG_CAPSLOCK_TRANSLATE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FLAG_CAPSLOCK_TRANSLATE@GOTPAGEOFF]
Lloh15:
	ldr	w11, [x8]
	tst	w11, w9
	b.eq	LBB0_11
; %bb.9:
Lloh16:
	adrp	x8, _FLAG_CAPSLOCK_DOWN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _FLAG_CAPSLOCK_DOWN@GOTPAGEOFF]
Lloh18:
	ldr	w12, [x8]
	tst	w12, w9
	cset	w8, ne
	csel	w11, w11, w12, eq
	bic	w9, w9, w11
	str	w9, [x19]
	ldr	x9, [x10]
	cbz	x9, LBB0_12
; %bb.10:
	mov	w9, #135
	b	LBB0_4
LBB0_11:
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
	ldr	x8, [x20]
	ldr	x19, [x8, x21, lsl #3]
	b	LBB0_3
LBB0_12:
	ldr	w0, [x19, #16]
Lloh21:
	adrp	x20, _KEY_CAPSLOCK@GOTPAGE
Lloh22:
	ldr	x20, [x20, _KEY_CAPSLOCK@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	w2, #1
	bl	_input_report_key
	ldr	w0, [x19, #16]
	bl	_input_sync
	ldr	w0, [x19, #16]
	ldr	w1, [x20]
	mov	w2, #0
	bl	_input_report_key
	ldr	w0, [x19, #16]
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_adbhid,8,3                     ; @adbhid
	.comm	_restore_capslock_events,8,3    ; @restore_capslock_events
	.comm	_FLAG_CAPSLOCK_IGNORE_NEXT,4,2  ; @FLAG_CAPSLOCK_IGNORE_NEXT
	.comm	_FLAG_CAPSLOCK_TRANSLATE,4,2    ; @FLAG_CAPSLOCK_TRANSLATE
	.comm	_FLAG_CAPSLOCK_DOWN,4,2         ; @FLAG_CAPSLOCK_DOWN
	.comm	_FLAG_POWER_KEY_PRESSED,4,2     ; @FLAG_POWER_KEY_PRESSED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Spurious caps lock event (scancode 0xff).\n"

	.comm	_KEY_CAPSLOCK,4,2               ; @KEY_CAPSLOCK
l_.str.1:                               ; @.str.1
	.asciz	"Unhandled ADB key (scancode %#02x) %s.\n"

l_.str.2:                               ; @.str.2
	.asciz	"released"

l_.str.3:                               ; @.str.3
	.asciz	"pressed"

	.comm	_ADB_KEY_CMD,4,2                ; @ADB_KEY_CMD
	.comm	_ADB_KEY_FWDEL,4,2              ; @ADB_KEY_FWDEL
	.comm	_FLAG_EMU_FWDEL_DOWN,4,2        ; @FLAG_EMU_FWDEL_DOWN
	.comm	_FLAG_FN_KEY_PRESSED,4,2        ; @FLAG_FN_KEY_PRESSED
	.comm	_FLAG_POWER_FROM_FN,4,2         ; @FLAG_POWER_FROM_FN
	.comm	_PMAC_FTR_GET_MB_INFO,4,2       ; @PMAC_FTR_GET_MB_INFO
	.comm	_PMAC_MB_INFO_MODEL,4,2         ; @PMAC_MB_INFO_MODEL
	.no_dead_strip	_adbhid_input_keycode
.subsections_via_symbols
