	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atkbd_connect
_atkbd_connect:                         ## @atkbd_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	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$56, %edi
	callq	_kzalloc
	movq	%rax, %r13
	xorl	%eax, %eax
	callq	_input_allocate_device
	movq	%rax, %r15
	testq	%r13, %r13
	je	LBB0_23
## %bb.1:
	testq	%r15, %r15
	je	LBB0_23
## %bb.2:
	movq	%r15, 24(%r13)
	leaq	52(%r13), %rdi
	movq	%r14, %rsi
	callq	_ps2_init
	leaq	48(%r13), %rdi
	movq	_atkbd_event_work@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_DELAYED_WORK
	movq	%r13, %rdi
	addq	$44, %rdi
	callq	_mutex_init
	movl	16(%r14), %eax
	cmpl	$129, %eax
	je	LBB0_5
## %bb.3:
	cmpl	$128, %eax
	jne	LBB0_7
## %bb.4:
	movl	$1, (%r13)
LBB0_5:
	cmpq	$0, 8(%r14)
	je	LBB0_7
## %bb.6:
	movl	$1, 4(%r13)
LBB0_7:
	movq	_atkbd_softraw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r13)
	movq	_atkbd_softrepeat@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 32(%r13)
	movq	_atkbd_scroll@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 40(%r13)
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	$1, 8(%r13)
LBB0_9:
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_serio_set_drvdata
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_serio_open
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_22
## %bb.10:
	cmpl	$0, 4(%r13)
	je	LBB0_14
## %bb.11:
	movq	%r13, %rdi
	callq	_atkbd_probe
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_14:
	movabsq	$188016488349698, %rax          ## imm = 0xAB0000000002
	movq	%rax, 12(%r13)
	jmp	LBB0_15
LBB0_13:
	movq	_atkbd_set@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_atkbd_extra@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_atkbd_select_set
	movl	%eax, 12(%r13)
	movq	%r13, %rdi
	callq	_atkbd_reset_state
LBB0_15:
	movq	%r13, %rdi
	callq	_atkbd_set_keycode_table
	movq	%r13, %rdi
	callq	_atkbd_set_device_attrs
	movq	_atkbd_attribute_group@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_sysfs_create_group
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_21
## %bb.16:
	movq	%r13, %rdi
	callq	_atkbd_enable
	cmpq	$0, 8(%r14)
	je	LBB0_18
## %bb.17:
	movq	%r13, %rdi
	callq	_atkbd_activate
LBB0_18:
	movq	24(%r13), %rdi
	callq	_input_register_device
	testl	%eax, %eax
	je	LBB0_19
## %bb.20:
	movl	%eax, %ebx
	movq	_atkbd_attribute_group@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_sysfs_remove_group
LBB0_21:
	movq	%r14, %rdi
	callq	_serio_close
LBB0_22:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_serio_set_drvdata
LBB0_23:
	movq	%r15, %rdi
	callq	_input_free_device
	movq	%r13, %rdi
	callq	_kfree
LBB0_24:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	xorl	%ebx, %ebx
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_atkbd_event_work,4,2           ## @atkbd_event_work
	.comm	_atkbd_softraw,4,2              ## @atkbd_softraw
	.comm	_atkbd_softrepeat,8,3           ## @atkbd_softrepeat
	.comm	_atkbd_scroll,4,2               ## @atkbd_scroll
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_atkbd_set,4,2                  ## @atkbd_set
	.comm	_atkbd_extra,4,2                ## @atkbd_extra
	.comm	_atkbd_attribute_group,4,2      ## @atkbd_attribute_group
	.no_dead_strip	_atkbd_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function atkbd_connect
lCPI0_0:
	.long	2                               ; 0x2
	.long	43776                           ; 0xab00
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_atkbd_connect:                         ; @atkbd_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	x20, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w0, #56
	bl	_kzalloc
	mov	x19, x0
	bl	_input_allocate_device
	mov	x21, x0
	cmp	x19, #0
	ccmp	x0, #0, #4, ne
	b.ne	LBB0_2
; %bb.1:
	neg	w22, w23
	b	LBB0_22
LBB0_2:
	str	x21, [x19, #24]
	add	x0, x19, #52
	mov	x1, x20
	bl	_ps2_init
	add	x0, x19, #48
Lloh6:
	adrp	x8, _atkbd_event_work@GOTPAGE
Lloh7:
	ldr	x8, [x8, _atkbd_event_work@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_INIT_DELAYED_WORK
	add	x0, x19, #44
	bl	_mutex_init
	ldr	w8, [x20, #16]
	cmp	w8, #129
	b.eq	LBB0_5
; %bb.3:
	cmp	w8, #128
	b.ne	LBB0_7
; %bb.4:
	mov	w8, #1
	str	w8, [x19]
LBB0_5:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_7
; %bb.6:
	mov	w8, #1
	str	w8, [x19, #4]
LBB0_7:
Lloh9:
	adrp	x8, _atkbd_softraw@GOTPAGE
Lloh10:
	ldr	x8, [x8, _atkbd_softraw@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x19, #8]
Lloh12:
	adrp	x8, _atkbd_softrepeat@GOTPAGE
Lloh13:
	ldr	x8, [x8, _atkbd_softrepeat@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	str	x8, [x19, #32]
Lloh15:
	adrp	x9, _atkbd_scroll@GOTPAGE
Lloh16:
	ldr	x9, [x9, _atkbd_scroll@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	str	w9, [x19, #40]
	cbz	x8, LBB0_9
; %bb.8:
	mov	w8, #1
	str	w8, [x19, #8]
LBB0_9:
	mov	x0, x20
	mov	x1, x19
	bl	_serio_set_drvdata
	mov	x0, x20
	mov	x1, x22
	bl	_serio_open
	mov	x22, x0
	cbnz	w0, LBB0_21
; %bb.10:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_13
; %bb.11:
	mov	x0, x19
	bl	_atkbd_probe
	cbz	x0, LBB0_14
; %bb.12:
Lloh18:
	adrp	x8, _ENODEV@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_20
LBB0_13:
Lloh21:
	adrp	x8, lCPI0_0@PAGE
Lloh22:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [x19, #12]
	b	LBB0_15
LBB0_14:
Lloh23:
	adrp	x8, _atkbd_set@GOTPAGE
Lloh24:
	ldr	x8, [x8, _atkbd_set@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x8, _atkbd_extra@GOTPAGE
Lloh27:
	ldr	x8, [x8, _atkbd_extra@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_atkbd_select_set
	str	w0, [x19, #12]
	mov	x0, x19
	bl	_atkbd_reset_state
LBB0_15:
	mov	x0, x19
	bl	_atkbd_set_keycode_table
	mov	x0, x19
	bl	_atkbd_set_device_attrs
Lloh29:
	adrp	x1, _atkbd_attribute_group@GOTPAGE
Lloh30:
	ldr	x1, [x1, _atkbd_attribute_group@GOTPAGEOFF]
	mov	x0, x20
	bl	_sysfs_create_group
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.16:
	mov	x0, x19
	bl	_atkbd_enable
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_18
; %bb.17:
	mov	x0, x19
	bl	_atkbd_activate
LBB0_18:
	ldr	x0, [x19, #24]
	bl	_input_register_device
	mov	x22, x0
	cbz	w0, LBB0_23
; %bb.19:
Lloh31:
	adrp	x1, _atkbd_attribute_group@GOTPAGE
Lloh32:
	ldr	x1, [x1, _atkbd_attribute_group@GOTPAGEOFF]
	mov	x0, x20
	bl	_sysfs_remove_group
LBB0_20:
	mov	x0, x20
	bl	_serio_close
LBB0_21:
	mov	x0, x20
	mov	x1, #0
	bl	_serio_set_drvdata
LBB0_22:
	mov	x0, x21
	bl	_input_free_device
	mov	x0, x19
	bl	_kfree
LBB0_23:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdr	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_atkbd_event_work,4,2           ; @atkbd_event_work
	.comm	_atkbd_softraw,4,2              ; @atkbd_softraw
	.comm	_atkbd_softrepeat,8,3           ; @atkbd_softrepeat
	.comm	_atkbd_scroll,4,2               ; @atkbd_scroll
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_atkbd_set,4,2                  ; @atkbd_set
	.comm	_atkbd_extra,4,2                ; @atkbd_extra
	.comm	_atkbd_attribute_group,4,2      ; @atkbd_attribute_group
	.no_dead_strip	_atkbd_connect
.subsections_via_symbols
