	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lkkbd_connect
_lkkbd_connect:                         ## @lkkbd_connect
	.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	%rsi, %r12
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	movq	%rax, %r15
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_input_allocate_device
	movq	%rax, %rbx
	testq	%r15, %r15
	je	LBB0_2
## %bb.1:
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.3:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, (%r15)
	movq	%rbx, 8(%r15)
	movq	%r15, %rdi
	addq	$44, %rdi
	movq	_lkkbd_reinit@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_WORK
	movq	_bell_volume@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r15)
	movq	_keyclick_volume@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r15)
	movq	_ctrlclick_volume@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r15)
	movq	16(%r15), %rdi
	movq	_lkkbd_keycode@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_LK_NUM_KEYCODES@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	shll	$2, %edx
	callq	_memcpy
	movl	28(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	$4, %edx
	callq	_strlcpy
	movl	24(%r15), %edi
	movq	(%r14), %rcx
	leaq	L_.str.1(%rip), %rdx
	movl	$4, %esi
	callq	_snprintf
	movl	28(%r15), %eax
	movl	%eax, 76(%rbx)
	movl	24(%r15), %eax
	movl	%eax, 72(%rbx)
	movq	_BUS_RS232@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 68(%rbx)
	movq	_SERIO_LKKBD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%rbx)
	movq	$0, 56(%rbx)
	movl	$256, 48(%rbx)                  ## imm = 0x100
	leaq	8(%r14), %rax
	movq	%rax, 40(%rbx)
	movq	_lkkbd_event@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%rbx)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_input_set_drvdata
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	32(%rbx), %esi
	callq	_set_bit
	movq	_EV_LED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	32(%rbx), %esi
	callq	_set_bit
	movq	_EV_SND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	32(%rbx), %esi
	callq	_set_bit
	movq	_EV_REP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	32(%rbx), %esi
	callq	_set_bit
	movq	_LED_CAPSL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	28(%rbx), %esi
	callq	_set_bit
	movq	_LED_SLEEP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	28(%rbx), %esi
	callq	_set_bit
	movq	_LED_COMPOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	28(%rbx), %esi
	callq	_set_bit
	movq	_LED_SCROLLL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	28(%rbx), %esi
	callq	_set_bit
	movq	_SND_BELL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%rbx), %esi
	callq	_set_bit
	movq	_SND_CLICK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%rbx), %esi
	callq	_set_bit
	movq	16(%r15), %rax
	movq	%rax, 16(%rbx)
	movl	$4, (%rbx)
	movl	(%r13), %ecx
	movl	%ecx, 4(%rbx)
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.4:
	movl	(%rax), %edi
	movl	8(%rbx), %esi
	callq	___set_bit
	cmpl	$2, (%r13)
	jl	LBB0_7
## %bb.5:
	movl	$1, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rax
	movl	(%rax,%r12,4), %edi
	movl	8(%rbx), %esi
	callq	___set_bit
	incq	%r12
	movslq	(%r13), %rax
	cmpq	%rax, %r12
	jl	LBB0_6
LBB0_7:
	movq	_KEY_RESERVED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%rbx), %esi
	callq	___clear_bit
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_serio_set_drvdata
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_serio_open
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.8:
	movq	8(%r15), %rdi
	callq	_input_register_device
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	%eax, %r13d
	movq	%r14, %rdi
	callq	_serio_close
LBB0_11:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_serio_set_drvdata
	jmp	LBB0_12
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
LBB0_12:
	movq	%rbx, %rdi
	callq	_input_free_device
	movq	%r15, %rdi
	callq	_kfree
LBB0_13:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	(%r15), %rdi
	movq	_LK_CMD_POWERCYCLE_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_serio_write
	xorl	%r13d, %r13d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_lkkbd_reinit,4,2               ## @lkkbd_reinit
	.comm	_bell_volume,4,2                ## @bell_volume
	.comm	_keyclick_volume,4,2            ## @keyclick_volume
	.comm	_ctrlclick_volume,4,2           ## @ctrlclick_volume
	.comm	_lkkbd_keycode,4,2              ## @lkkbd_keycode
	.comm	_LK_NUM_KEYCODES,4,2            ## @LK_NUM_KEYCODES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DEC LK keyboard"

L_.str.1:                               ## @.str.1
	.asciz	"%s/input0"

	.comm	_BUS_RS232,4,2                  ## @BUS_RS232
	.comm	_SERIO_LKKBD,4,2                ## @SERIO_LKKBD
	.comm	_lkkbd_event,4,2                ## @lkkbd_event
	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_EV_LED,4,2                     ## @EV_LED
	.comm	_EV_SND,4,2                     ## @EV_SND
	.comm	_EV_REP,4,2                     ## @EV_REP
	.comm	_LED_CAPSL,4,2                  ## @LED_CAPSL
	.comm	_LED_SLEEP,4,2                  ## @LED_SLEEP
	.comm	_LED_COMPOSE,4,2                ## @LED_COMPOSE
	.comm	_LED_SCROLLL,4,2                ## @LED_SCROLLL
	.comm	_SND_BELL,4,2                   ## @SND_BELL
	.comm	_SND_CLICK,4,2                  ## @SND_CLICK
	.comm	_KEY_RESERVED,4,2               ## @KEY_RESERVED
	.comm	_LK_CMD_POWERCYCLE_RESET,4,2    ## @LK_CMD_POWERCYCLE_RESET
	.no_dead_strip	_lkkbd_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lkkbd_connect
_lkkbd_connect:                         ; @lkkbd_connect
	.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	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	mov	x19, x0
	bl	_input_allocate_device
	mov	x20, x0
	cmp	x19, #0
	ccmp	x0, #0, #4, ne
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_10
LBB0_2:
	stp	x21, x20, [x19]
	add	x0, x19, #44
Lloh6:
	adrp	x8, _lkkbd_reinit@GOTPAGE
Lloh7:
	ldr	x8, [x8, _lkkbd_reinit@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_INIT_WORK
Lloh9:
	adrp	x8, _bell_volume@GOTPAGE
Lloh10:
	ldr	x8, [x8, _bell_volume@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x19, #40]
Lloh12:
	adrp	x8, _keyclick_volume@GOTPAGE
Lloh13:
	ldr	x8, [x8, _keyclick_volume@GOTPAGEOFF]
Lloh14:
	adrp	x9, _ctrlclick_volume@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ctrlclick_volume@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #32]
Lloh18:
	adrp	x8, _lkkbd_keycode@GOTPAGE
Lloh19:
	ldr	x8, [x8, _lkkbd_keycode@GOTPAGEOFF]
	ldr	x0, [x19, #16]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x23, _LK_NUM_KEYCODES@GOTPAGE
Lloh22:
	ldr	x23, [x23, _LK_NUM_KEYCODES@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	w2, w8, #2
	bl	_memcpy
	ldr	w0, [x19, #28]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	w24, #4
	mov	w2, #4
	bl	_strlcpy
	ldr	w0, [x19, #24]
	mov	x25, x21
	ldr	x3, [x25], #8
Lloh25:
	adrp	x2, l_.str.1@PAGE
Lloh26:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w1, #4
	bl	_snprintf
	ldr	d0, [x19, #24]
	str	d0, [x20, #72]
Lloh27:
	adrp	x8, _BUS_RS232@GOTPAGE
Lloh28:
	ldr	x8, [x8, _BUS_RS232@GOTPAGEOFF]
Lloh29:
	adrp	x9, _SERIO_LKKBD@GOTPAGE
Lloh30:
	ldr	x9, [x9, _SERIO_LKKBD@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #64]
	str	xzr, [x20, #56]
	mov	w8, #256
	str	w8, [x20, #48]
	str	x25, [x20, #40]
Lloh33:
	adrp	x8, _lkkbd_event@GOTPAGE
Lloh34:
	ldr	x8, [x8, _lkkbd_event@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	str	w8, [x20, #36]
	mov	x0, x20
	mov	x1, x19
	bl	_input_set_drvdata
Lloh36:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
	ldr	w1, [x20, #32]
	bl	_set_bit
Lloh39:
	adrp	x8, _EV_LED@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EV_LED@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x8]
	ldr	w1, [x20, #32]
	bl	_set_bit
Lloh42:
	adrp	x8, _EV_SND@GOTPAGE
Lloh43:
	ldr	x8, [x8, _EV_SND@GOTPAGEOFF]
Lloh44:
	ldr	w0, [x8]
	ldr	w1, [x20, #32]
	bl	_set_bit
Lloh45:
	adrp	x8, _EV_REP@GOTPAGE
Lloh46:
	ldr	x8, [x8, _EV_REP@GOTPAGEOFF]
Lloh47:
	ldr	w0, [x8]
	ldr	w1, [x20, #32]
	bl	_set_bit
Lloh48:
	adrp	x8, _LED_CAPSL@GOTPAGE
Lloh49:
	ldr	x8, [x8, _LED_CAPSL@GOTPAGEOFF]
Lloh50:
	ldr	w0, [x8]
	ldr	w1, [x20, #28]
	bl	_set_bit
Lloh51:
	adrp	x8, _LED_SLEEP@GOTPAGE
Lloh52:
	ldr	x8, [x8, _LED_SLEEP@GOTPAGEOFF]
Lloh53:
	ldr	w0, [x8]
	ldr	w1, [x20, #28]
	bl	_set_bit
Lloh54:
	adrp	x8, _LED_COMPOSE@GOTPAGE
Lloh55:
	ldr	x8, [x8, _LED_COMPOSE@GOTPAGEOFF]
Lloh56:
	ldr	w0, [x8]
	ldr	w1, [x20, #28]
	bl	_set_bit
Lloh57:
	adrp	x8, _LED_SCROLLL@GOTPAGE
Lloh58:
	ldr	x8, [x8, _LED_SCROLLL@GOTPAGEOFF]
Lloh59:
	ldr	w0, [x8]
	ldr	w1, [x20, #28]
	bl	_set_bit
Lloh60:
	adrp	x8, _SND_BELL@GOTPAGE
Lloh61:
	ldr	x8, [x8, _SND_BELL@GOTPAGEOFF]
Lloh62:
	ldr	w0, [x8]
	ldr	w1, [x20, #24]
	bl	_set_bit
Lloh63:
	adrp	x8, _SND_CLICK@GOTPAGE
Lloh64:
	ldr	x8, [x8, _SND_CLICK@GOTPAGEOFF]
Lloh65:
	ldr	w0, [x8]
	ldr	w1, [x20, #24]
	bl	_set_bit
	ldr	x8, [x19, #16]
	str	x8, [x20, #16]
	str	w24, [x20]
	ldr	w9, [x23]
	str	w9, [x20, #4]
	cmp	w9, #1
	b.lt	LBB0_6
; %bb.3:
	ldr	w0, [x8]
	ldr	w1, [x20, #8]
	bl	___set_bit
	ldr	w8, [x23]
	cmp	w8, #2
	b.lt	LBB0_6
; %bb.4:
	mov	w24, #1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x24, lsl #2]
	ldr	w1, [x20, #8]
	bl	___set_bit
	add	x24, x24, #1
	ldrsw	x8, [x23]
	cmp	x24, x8
	b.lt	LBB0_5
LBB0_6:
Lloh66:
	adrp	x8, _KEY_RESERVED@GOTPAGE
Lloh67:
	ldr	x8, [x8, _KEY_RESERVED@GOTPAGEOFF]
Lloh68:
	ldr	w0, [x8]
	ldr	w1, [x20, #8]
	bl	___clear_bit
	mov	x0, x21
	mov	x1, x19
	bl	_serio_set_drvdata
	mov	x0, x21
	mov	x1, x22
	bl	_serio_open
	mov	x22, x0
	cbnz	w0, LBB0_9
; %bb.7:
	ldr	x0, [x19, #8]
	bl	_input_register_device
	mov	x22, x0
	cbz	w0, LBB0_12
; %bb.8:
	mov	x0, x21
	bl	_serio_close
LBB0_9:
	mov	x0, x21
	mov	x1, #0
	bl	_serio_set_drvdata
LBB0_10:
	mov	x0, x20
	bl	_input_free_device
	mov	x0, x19
	bl	_kfree
LBB0_11:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	x0, [x19]
Lloh69:
	adrp	x8, _LK_CMD_POWERCYCLE_RESET@GOTPAGE
Lloh70:
	ldr	x8, [x8, _LK_CMD_POWERCYCLE_RESET@GOTPAGEOFF]
Lloh71:
	ldr	w1, [x8]
	bl	_serio_write
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh31
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh16
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_lkkbd_reinit,4,2               ; @lkkbd_reinit
	.comm	_bell_volume,4,2                ; @bell_volume
	.comm	_keyclick_volume,4,2            ; @keyclick_volume
	.comm	_ctrlclick_volume,4,2           ; @ctrlclick_volume
	.comm	_lkkbd_keycode,4,2              ; @lkkbd_keycode
	.comm	_LK_NUM_KEYCODES,4,2            ; @LK_NUM_KEYCODES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DEC LK keyboard"

l_.str.1:                               ; @.str.1
	.asciz	"%s/input0"

	.comm	_BUS_RS232,4,2                  ; @BUS_RS232
	.comm	_SERIO_LKKBD,4,2                ; @SERIO_LKKBD
	.comm	_lkkbd_event,4,2                ; @lkkbd_event
	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_EV_LED,4,2                     ; @EV_LED
	.comm	_EV_SND,4,2                     ; @EV_SND
	.comm	_EV_REP,4,2                     ; @EV_REP
	.comm	_LED_CAPSL,4,2                  ; @LED_CAPSL
	.comm	_LED_SLEEP,4,2                  ; @LED_SLEEP
	.comm	_LED_COMPOSE,4,2                ; @LED_COMPOSE
	.comm	_LED_SCROLLL,4,2                ; @LED_SCROLLL
	.comm	_SND_BELL,4,2                   ; @SND_BELL
	.comm	_SND_CLICK,4,2                  ; @SND_CLICK
	.comm	_KEY_RESERVED,4,2               ; @KEY_RESERVED
	.comm	_LK_CMD_POWERCYCLE_RESET,4,2    ; @LK_CMD_POWERCYCLE_RESET
	.no_dead_strip	_lkkbd_connect
.subsections_via_symbols
