	.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, %rbx
	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, %r12
	testq	%r15, %r15
	je	LBB0_2
## %bb.1:
	testq	%r12, %r12
	je	LBB0_2
## %bb.3:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, (%r15)
	movq	%r12, 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
	movl	$8, %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(%r12)
	movl	24(%r15), %eax
	movl	%eax, 72(%r12)
	movq	_BUS_RS232@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 68(%r12)
	movq	_SERIO_LKKBD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%r12)
	movq	$0, 56(%r12)
	movl	$256, 48(%r12)                  ## imm = 0x100
	leaq	8(%r14), %rax
	movq	%rax, 40(%r12)
	movq	_lkkbd_event@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r12)
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_input_set_drvdata
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	32(%r12), %esi
	callq	___set_bit
	movq	_EV_LED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	32(%r12), %esi
	callq	___set_bit
	movq	_EV_SND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	32(%r12), %esi
	callq	___set_bit
	movq	_EV_REP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	32(%r12), %esi
	callq	___set_bit
	movq	_LED_CAPSL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	28(%r12), %esi
	callq	___set_bit
	movq	_LED_SLEEP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	28(%r12), %esi
	callq	___set_bit
	movq	_LED_COMPOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	28(%r12), %esi
	callq	___set_bit
	movq	_LED_SCROLLL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	28(%r12), %esi
	callq	___set_bit
	movq	_SND_BELL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%r12), %esi
	callq	___set_bit
	movq	_SND_CLICK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%r12), %esi
	callq	___set_bit
	movq	16(%r15), %rdi
	movq	%rdi, 16(%r12)
	movl	$4, (%r12)
	callq	_ARRAY_SIZE
	movl	%eax, 8(%r12)
	movq	_LK_NUM_KEYCODES@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_6
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rax
	movl	(%rax,%rbx,4), %edi
	movl	4(%r12), %esi
	callq	___set_bit
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jl	LBB0_5
LBB0_6:
	movq	_KEY_RESERVED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%r12), %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_10
## %bb.7:
	movq	8(%r15), %rdi
	callq	_input_register_device
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movl	%eax, %r13d
	movq	%r14, %rdi
	callq	_serio_close
LBB0_10:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_serio_set_drvdata
	jmp	LBB0_11
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
LBB0_11:
	movq	%r12, %rdi
	callq	_input_free_device
	movq	%r15, %rdi
	callq	_kfree
LBB0_12:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	(%r15), %rdi
	movq	_LK_CMD_POWERCYCLE_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_serio_write
	xorl	%r13d, %r13d
	jmp	LBB0_12
	.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
	.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	_LK_NUM_KEYCODES,4,2            ## @LK_NUM_KEYCODES
	.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	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	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_9
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:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _ctrlclick_volume@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ctrlclick_volume@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #32]
	ldr	x0, [x19, #16]
Lloh18:
	adrp	x8, _lkkbd_keycode@GOTPAGE
Lloh19:
	ldr	x8, [x8, _lkkbd_keycode@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	w2, #8
	bl	_memcpy
	ldr	w0, [x19, #28]
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	mov	w23, #4
	mov	w2, #4
	bl	_strlcpy
	ldr	w0, [x19, #24]
	mov	x24, x21
	ldr	x3, [x24], #8
Lloh23:
	adrp	x2, l_.str.1@PAGE
Lloh24:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w1, #4
	bl	_snprintf
	ldr	d0, [x19, #24]
	str	d0, [x20, #72]
Lloh25:
	adrp	x8, _BUS_RS232@GOTPAGE
Lloh26:
	ldr	x8, [x8, _BUS_RS232@GOTPAGEOFF]
Lloh27:
	adrp	x9, _SERIO_LKKBD@GOTPAGE
Lloh28:
	ldr	x9, [x9, _SERIO_LKKBD@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #64]
	str	xzr, [x20, #56]
	mov	w8, #256
	str	w8, [x20, #48]
	str	x24, [x20, #40]
Lloh31:
	adrp	x8, _lkkbd_event@GOTPAGE
Lloh32:
	ldr	x8, [x8, _lkkbd_event@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	str	w8, [x20, #36]
	mov	x0, x20
	mov	x1, x19
	bl	_input_set_drvdata
Lloh34:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	ldr	w1, [x20, #32]
	bl	___set_bit
Lloh37:
	adrp	x8, _EV_LED@GOTPAGE
Lloh38:
	ldr	x8, [x8, _EV_LED@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
	ldr	w1, [x20, #32]
	bl	___set_bit
Lloh40:
	adrp	x8, _EV_SND@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EV_SND@GOTPAGEOFF]
Lloh42:
	ldr	w0, [x8]
	ldr	w1, [x20, #32]
	bl	___set_bit
Lloh43:
	adrp	x8, _EV_REP@GOTPAGE
Lloh44:
	ldr	x8, [x8, _EV_REP@GOTPAGEOFF]
Lloh45:
	ldr	w0, [x8]
	ldr	w1, [x20, #32]
	bl	___set_bit
Lloh46:
	adrp	x8, _LED_CAPSL@GOTPAGE
Lloh47:
	ldr	x8, [x8, _LED_CAPSL@GOTPAGEOFF]
Lloh48:
	ldr	w0, [x8]
	ldr	w1, [x20, #28]
	bl	___set_bit
Lloh49:
	adrp	x8, _LED_SLEEP@GOTPAGE
Lloh50:
	ldr	x8, [x8, _LED_SLEEP@GOTPAGEOFF]
Lloh51:
	ldr	w0, [x8]
	ldr	w1, [x20, #28]
	bl	___set_bit
Lloh52:
	adrp	x8, _LED_COMPOSE@GOTPAGE
Lloh53:
	ldr	x8, [x8, _LED_COMPOSE@GOTPAGEOFF]
Lloh54:
	ldr	w0, [x8]
	ldr	w1, [x20, #28]
	bl	___set_bit
Lloh55:
	adrp	x8, _LED_SCROLLL@GOTPAGE
Lloh56:
	ldr	x8, [x8, _LED_SCROLLL@GOTPAGEOFF]
Lloh57:
	ldr	w0, [x8]
	ldr	w1, [x20, #28]
	bl	___set_bit
Lloh58:
	adrp	x8, _SND_BELL@GOTPAGE
Lloh59:
	ldr	x8, [x8, _SND_BELL@GOTPAGEOFF]
Lloh60:
	ldr	w0, [x8]
	ldr	w1, [x20, #24]
	bl	___set_bit
Lloh61:
	adrp	x8, _SND_CLICK@GOTPAGE
Lloh62:
	ldr	x8, [x8, _SND_CLICK@GOTPAGEOFF]
Lloh63:
	ldr	w0, [x8]
	ldr	w1, [x20, #24]
	bl	___set_bit
	ldr	x0, [x19, #16]
	str	x0, [x20, #16]
	str	w23, [x20]
	bl	_ARRAY_SIZE
	str	w0, [x20, #8]
Lloh64:
	adrp	x23, _LK_NUM_KEYCODES@GOTPAGE
Lloh65:
	ldr	x23, [x23, _LK_NUM_KEYCODES@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x24, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x24, lsl #2]
	ldr	w1, [x20, #4]
	bl	___set_bit
	add	x24, x24, #1
	ldrsw	x8, [x23]
	cmp	x24, x8
	b.lt	LBB0_4
LBB0_5:
Lloh66:
	adrp	x8, _KEY_RESERVED@GOTPAGE
Lloh67:
	ldr	x8, [x8, _KEY_RESERVED@GOTPAGEOFF]
Lloh68:
	ldr	w0, [x8]
	ldr	w1, [x20, #4]
	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_8
; %bb.6:
	ldr	x0, [x19, #8]
	bl	_input_register_device
	mov	x22, x0
	cbz	w0, LBB0_11
; %bb.7:
	mov	x0, x21
	bl	_serio_close
LBB0_8:
	mov	x0, x21
	mov	x1, #0
	bl	_serio_set_drvdata
LBB0_9:
	mov	x0, x20
	bl	_input_free_device
	mov	x0, x19
	bl	_kfree
LBB0_10:
	mov	x0, x22
	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_11:
	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_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh29
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.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
	.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	_LK_NUM_KEYCODES,4,2            ; @LK_NUM_KEYCODES
	.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
