	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cros_ec_keyb_register_matrix
_cros_ec_keyb_register_matrix:          ## @cros_ec_keyb_register_matrix
	.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	%rdi, %rbx
	movq	40(%rdi), %r14
	movq	48(%rdi), %r12
	leaq	16(%rdi), %rsi
	leaq	8(%rdi), %rdx
	movq	%r14, %rdi
	callq	_matrix_keypad_parse_properties
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.1:
	movl	8(%rbx), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_devm_kzalloc
	movq	%rax, 32(%rbx)
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movl	8(%rbx), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_devm_kzalloc
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movl	(%r15), %esi
	movl	(%r12), %ecx
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_devm_kasprintf
	testq	%rax, %rax
	je	LBB0_2
## %bb.5:
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_devm_input_allocate_device
	testq	%rax, %rax
	je	LBB0_2
## %bb.6:
	movq	%rax, %r12
	movq	_CROS_EC_DEV_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%r12)
	movq	%r15, (%r12)
	movq	_EV_REP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	40(%r12), %esi
	callq	___set_bit
	movq	_BUS_VIRTUAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r12)
	movl	$1, 16(%r12)
	movq	$0, 24(%r12)
	movq	%r14, 8(%r12)
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_of_property_read_bool
	movl	%eax, 20(%rbx)
	movl	8(%rbx), %ecx
	movl	16(%rbx), %edx
	xorl	%r15d, %r15d
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	movq	%r12, %r9
	callq	_matrix_keypad_build_keymap
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r13d
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movl	%r13d, %r15d
	jmp	LBB0_10
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_10:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	8(%rbx), %edi
	callq	_get_count_order
	movl	%eax, 12(%rbx)
	movq	_EV_MSC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MSC_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_input_set_capability
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_input_set_drvdata
	movq	%r12, (%rbx)
	movq	%rbx, %rdi
	callq	_cros_ec_keyb_compute_valid_keys
	movq	(%rbx), %rdi
	callq	_input_register_device
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movl	%ebx, %r15d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/input0"

	.comm	_CROS_EC_DEV_NAME,4,2           ## @CROS_EC_DEV_NAME
	.comm	_EV_REP,4,2                     ## @EV_REP
	.comm	_BUS_VIRTUAL,4,2                ## @BUS_VIRTUAL
L_.str.1:                               ## @.str.1
	.asciz	"google,needs-ghost-filter"

L_.str.2:                               ## @.str.2
	.asciz	"cannot build key matrix\n"

	.comm	_EV_MSC,4,2                     ## @EV_MSC
	.comm	_MSC_SCAN,4,2                   ## @MSC_SCAN
L_.str.3:                               ## @.str.3
	.asciz	"cannot register input device\n"

	.no_dead_strip	_cros_ec_keyb_register_matrix
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cros_ec_keyb_register_matrix
_cros_ec_keyb_register_matrix:          ; @cros_ec_keyb_register_matrix
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x0
	ldp	x19, x21, [x0, #40]
	add	x1, x0, #16
	add	x2, x0, #8
	mov	x0, x19
	bl	_matrix_keypad_parse_properties
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	w1, [x20, #8]
Lloh0:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_devm_kzalloc
	str	x0, [x20, #32]
	cbz	x0, LBB0_7
; %bb.2:
	ldr	w1, [x20, #8]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_devm_kzalloc
	str	x0, [x20, #24]
	cbz	x0, LBB0_7
; %bb.3:
	ldr	w1, [x22]
	ldr	w3, [x21]
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_devm_kasprintf
	cbz	x0, LBB0_7
; %bb.4:
	mov	x22, x0
	mov	x0, x19
	bl	_devm_input_allocate_device
	cbz	x0, LBB0_7
; %bb.5:
	mov	x21, x0
Lloh4:
	adrp	x8, _CROS_EC_DEV_NAME@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CROS_EC_DEV_NAME@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	w8, [x0, #44]
	str	x22, [x0]
Lloh7:
	adrp	x8, _EV_REP@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EV_REP@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	ldr	w1, [x21, #40]
	bl	___set_bit
Lloh10:
	adrp	x8, _BUS_VIRTUAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BUS_VIRTUAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x21, #32]
	mov	w8, #1
	str	w8, [x21, #16]
	str	xzr, [x21, #24]
	str	x19, [x21, #8]
	ldr	w0, [x19]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_of_property_read_bool
	str	w0, [x20, #20]
	ldr	w2, [x20, #16]
	ldr	w3, [x20, #8]
	mov	x0, #0
	mov	x1, #0
	mov	x4, #0
	mov	x5, x21
	bl	_matrix_keypad_build_keymap
	cbz	w0, LBB0_9
; %bb.6:
	mov	x22, x0
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_7:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_8:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_9:
	ldr	w0, [x20, #8]
	bl	_get_count_order
	str	w0, [x20, #12]
Lloh20:
	adrp	x8, _EV_MSC@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EV_MSC@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x8, _MSC_SCAN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MSC_SCAN@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_input_set_capability
	mov	x0, x21
	mov	x1, x20
	bl	_input_set_drvdata
	str	x21, [x20]
	mov	x0, x20
	bl	_cros_ec_keyb_compute_valid_keys
	ldr	x0, [x20]
	bl	_input_register_device
	mov	x22, x0
	cbz	w0, LBB0_8
; %bb.10:
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_11:
	mov	x0, x19
	bl	_dev_err
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/input0"

	.comm	_CROS_EC_DEV_NAME,4,2           ; @CROS_EC_DEV_NAME
	.comm	_EV_REP,4,2                     ; @EV_REP
	.comm	_BUS_VIRTUAL,4,2                ; @BUS_VIRTUAL
l_.str.1:                               ; @.str.1
	.asciz	"google,needs-ghost-filter"

l_.str.2:                               ; @.str.2
	.asciz	"cannot build key matrix\n"

	.comm	_EV_MSC,4,2                     ; @EV_MSC
	.comm	_MSC_SCAN,4,2                   ; @MSC_SCAN
l_.str.3:                               ; @.str.3
	.asciz	"cannot register input device\n"

	.no_dead_strip	_cros_ec_keyb_register_matrix
.subsections_via_symbols
