	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cros_ec_keyb_register_bs
_cros_ec_keyb_register_bs:              ## @cros_ec_keyb_register_bs
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	16(%rdi), %rbx
	movl	$0, -48(%rbp)
	movq	_EC_MKBP_INFO_SUPPORTED@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_EC_MKBP_EVENT_BUTTON@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rcx
	movq	%rbx, %rdi
	movl	$4, %r8d
	callq	_cros_ec_keyb_info
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_20
## %bb.1:
	leaq	-48(%rbp), %r12
	movq	%r12, %rdi
	callq	_get_unaligned_le32
	movl	%eax, %r13d
	movl	(%r14), %esi
	movq	_EC_MKBP_EVENT_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r12, %rcx
	movl	$4, %r8d
	callq	_cros_ec_keyb_info
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_20
## %bb.2:
	leaq	-48(%rbp), %rdi
	callq	_get_unaligned_le32
	xorl	%r12d, %r12d
	movl	%r13d, %ecx
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	orl	%eax, %ecx
	je	LBB0_20
## %bb.3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %ecx
	leaq	L_.str(%rip), %rdx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_devm_kasprintf
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_devm_input_allocate_device
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	%rbx, %rcx
	movq	%rax, %rbx
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	leaq	L_.str.1(%rip), %rax
	movq	%rax, (%rbx)
	movq	%r14, 8(%rbx)
	movq	_EV_REP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	48(%rbx), %esi
	movq	%rcx, %r14
	callq	___set_bit
	movq	_BUS_VIRTUAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movl	$1, 24(%rbx)
	movq	$0, 32(%rbx)
	movq	%r14, 16(%rbx)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_input_set_drvdata
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, (%r15)
	movq	_cros_ec_keyb_bs@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_15
## %bb.7:
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_8 Depth=1
	movl	12(%rbx,%r13), %edi
	callq	_BIT
	testl	%eax, -60(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_10
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	(%rbx,%r13), %rsi
	movl	8(%rbx,%r13), %edx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_input_set_capability
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	incq	%r14
	movq	%r15, %rbx
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	cltq
	addq	$16, %r13
	cmpq	%rax, %r14
	jge	LBB0_15
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %r15
	movq	(%rbx), %rbx
	movq	(%rbx,%r13), %rax
	movq	_EV_KEY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
	jmp	LBB0_11
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	(%rbx,%r13), %rax
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	_EV_SW@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	12(%rbx,%r13), %edi
	callq	_BIT
	testl	%eax, -64(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_13
	jmp	LBB0_14
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_20
LBB0_15:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_cros_ec_keyb_query_switches
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_19
LBB0_17:
	movq	(%r14), %rdi
	callq	_input_register_device
	testl	%eax, %eax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_20
## %bb.18:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
LBB0_19:
	callq	_dev_err
	movl	%ebx, %r12d
LBB0_20:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EC_MKBP_INFO_SUPPORTED,4,2     ## @EC_MKBP_INFO_SUPPORTED
	.comm	_EC_MKBP_EVENT_BUTTON,4,2       ## @EC_MKBP_EVENT_BUTTON
	.comm	_EC_MKBP_EVENT_SWITCH,4,2       ## @EC_MKBP_EVENT_SWITCH
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/input1"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"cros_ec_buttons"

	.comm	_EV_REP,4,2                     ## @EV_REP
	.comm	_BUS_VIRTUAL,4,2                ## @BUS_VIRTUAL
	.comm	_cros_ec_keyb_bs,8,3            ## @cros_ec_keyb_bs
	.comm	_EV_KEY,8,3                     ## @EV_KEY
	.comm	_EV_SW,8,3                      ## @EV_SW
L_.str.2:                               ## @.str.2
	.asciz	"cannot query switches\n"

L_.str.3:                               ## @.str.3
	.asciz	"cannot register input device\n"

	.no_dead_strip	_cros_ec_keyb_register_bs
.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_bs
_cros_ec_keyb_register_bs:              ; @cros_ec_keyb_register_bs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	ldp	x19, x23, [x0, #8]
	str	wzr, [sp, #8]
Lloh0:
	adrp	x24, _EC_MKBP_INFO_SUPPORTED@GOTPAGE
Lloh1:
	ldr	x24, [x24, _EC_MKBP_INFO_SUPPORTED@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh2:
	adrp	x8, _EC_MKBP_EVENT_BUTTON@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EC_MKBP_EVENT_BUTTON@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	x0, x23
	mov	w4, #4
	bl	_cros_ec_keyb_info
	mov	x22, x0
	cbnz	w0, LBB0_21
; %bb.1:
	add	x0, sp, #8
	bl	_get_unaligned_le32
	mov	x21, x0
	ldr	w1, [x24]
Lloh5:
	adrp	x8, _EC_MKBP_EVENT_SWITCH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EC_MKBP_EVENT_SWITCH@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	x0, x23
	mov	w4, #4
	bl	_cros_ec_keyb_info
	mov	x22, x0
	cbnz	w0, LBB0_21
; %bb.2:
	add	x0, sp, #8
	bl	_get_unaligned_le32
	orr	w8, w21, w0
	cbz	w8, LBB0_14
; %bb.3:
	mov	x22, x0
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	ldr	w3, [x23]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_devm_kasprintf
	cbz	x0, LBB0_15
; %bb.4:
	mov	x24, x0
	mov	x0, x19
	bl	_devm_input_allocate_device
	cbz	x0, LBB0_15
; %bb.5:
	mov	x23, x0
Lloh13:
	adrp	x8, l_.str.1@PAGE
Lloh14:
	add	x8, x8, l_.str.1@PAGEOFF
	stp	x8, x24, [x0]
Lloh15:
	adrp	x8, _EV_REP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EV_REP@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	ldr	w1, [x23, #48]
	bl	___set_bit
Lloh18:
	adrp	x8, _BUS_VIRTUAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BUS_VIRTUAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x23, #40]
	mov	w8, #1
	str	w8, [x23, #24]
	str	xzr, [x23, #32]
	str	x19, [x23, #16]
	mov	x0, x23
	mov	x1, x20
	bl	_input_set_drvdata
	str	x23, [x20]
Lloh21:
	adrp	x24, _cros_ec_keyb_bs@GOTPAGE
Lloh22:
	ldr	x24, [x24, _cros_ec_keyb_bs@GOTPAGEOFF]
	ldr	x0, [x24]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_16
; %bb.6:
	mov	x25, #0
	mov	x26, #0
Lloh23:
	adrp	x27, _EV_KEY@GOTPAGE
Lloh24:
	ldr	x27, [x27, _EV_KEY@GOTPAGEOFF]
	b	LBB0_10
LBB0_7:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x8, x28, x25
	ldr	w0, [x8, #12]
	bl	_BIT
	tst	w0, w21
	b.eq	LBB0_11
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x8, x28, x25
	ldr	x1, [x8]
	ldr	w2, [x8, #8]
	mov	x0, x23
	bl	_input_set_capability
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x26, x26, #1
	ldr	x0, [x24]
	bl	_ARRAY_SIZE
	add	x25, x25, #16
	cmp	x26, w0, sxtw
	b.ge	LBB0_16
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x28, [x24]
	ldr	x8, [x28, x25]
	ldr	x9, [x27]
	cmp	x8, x9
	b.eq	LBB0_7
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x28, x25]
LBB0_12:                                ;   in Loop: Header=BB0_10 Depth=1
Lloh25:
	adrp	x9, _EV_SW@GOTPAGE
Lloh26:
	ldr	x9, [x9, _EV_SW@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x8, x28, x25
	ldr	w0, [x8, #12]
	bl	_BIT
	tst	w0, w22
	b.ne	LBB0_8
	b	LBB0_9
LBB0_14:
	mov	w22, #0
	b	LBB0_21
LBB0_15:
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_21
LBB0_16:
	mov	x0, x20
	bl	_cros_ec_keyb_query_switches
	cbz	w0, LBB0_18
; %bb.17:
	mov	x22, x0
Lloh31:
	adrp	x1, l_.str.2@PAGE
Lloh32:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_20
LBB0_18:
	ldr	x0, [x20]
	bl	_input_register_device
	mov	x22, x0
	cbz	w0, LBB0_21
; %bb.19:
Lloh33:
	adrp	x1, l_.str.3@PAGE
Lloh34:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_20:
	mov	x0, x19
	bl	_dev_err
LBB0_21:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_EC_MKBP_INFO_SUPPORTED,4,2     ; @EC_MKBP_INFO_SUPPORTED
	.comm	_EC_MKBP_EVENT_BUTTON,4,2       ; @EC_MKBP_EVENT_BUTTON
	.comm	_EC_MKBP_EVENT_SWITCH,4,2       ; @EC_MKBP_EVENT_SWITCH
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/input1"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"cros_ec_buttons"

	.comm	_EV_REP,4,2                     ; @EV_REP
	.comm	_BUS_VIRTUAL,4,2                ; @BUS_VIRTUAL
	.comm	_cros_ec_keyb_bs,8,3            ; @cros_ec_keyb_bs
	.comm	_EV_KEY,8,3                     ; @EV_KEY
	.comm	_EV_SW,8,3                      ; @EV_SW
l_.str.2:                               ; @.str.2
	.asciz	"cannot query switches\n"

l_.str.3:                               ; @.str.3
	.asciz	"cannot register input device\n"

	.no_dead_strip	_cros_ec_keyb_register_bs
.subsections_via_symbols
