	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gpio_keys_attr_store_helper
_gpio_keys_attr_store_helper:           ## @gpio_keys_attr_store_helper
	.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
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movl	%edx, %edi
	callq	_get_n_events_by_type
	movl	%eax, %r12d
	movl	24(%r13), %edi
	movl	%r15d, %esi
	callq	_get_bm_events_by_type
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edi
	callq	_bitmap_zalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movl	%r12d, %edx
	callq	_bitmap_parselist
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.3:
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_bitmap_subset
	testl	%eax, %eax
	je	LBB0_22
## %bb.4:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	16(%r13), %rax
	cmpl	$0, (%rax)
	jle	LBB0_11
## %bb.5:
	movl	$8, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%r14
	movq	16(%r13), %rax
	movslq	(%rax), %rax
	addq	$16, %rbx
	cmpq	%rax, %r14
	jge	LBB0_11
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %r12
	movq	(%r12,%rbx), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-8(%r12,%rbx), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r12,%rbx), %rax
	cmpl	$0, 4(%rax)
	jne	LBB0_10
## %bb.9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_11:
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	16(%r13), %rax
	cmpl	$0, (%rax)
	jle	LBB0_18
## %bb.12:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_13
LBB0_16:                                ##   in Loop: Header=BB0_13 Depth=1
	callq	_gpio_keys_enable_button
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%r14
	movq	16(%r13), %rax
	movslq	(%rax), %rax
	addq	$16, %rbx
	cmpq	%rax, %r14
	jge	LBB0_18
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %r12
	movq	8(%r12,%rbx), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	(%r12,%rbx), %rax
	addq	%rbx, %r12
	movl	(%rax), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_test_bit
	movq	%r12, %rdi
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	callq	_gpio_keys_disable_button
	jmp	LBB0_17
LBB0_18:
	movq	%r13, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
LBB0_19:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_20
LBB0_22:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_20:
	movq	%r14, %rdi
	callq	_bitmap_free
LBB0_21:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_gpio_keys_attr_store_helper
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gpio_keys_attr_store_helper
_gpio_keys_attr_store_helper:           ; @gpio_keys_attr_store_helper
	.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	x21, x2
	mov	x24, x1
	mov	x20, x0
	mov	x0, x2
	bl	_get_n_events_by_type
	mov	x22, x0
	ldr	w0, [x20, #24]
	mov	x1, x21
	bl	_get_bm_events_by_type
	mov	x23, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_bitmap_zalloc
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x0
	mov	x0, x24
	mov	x1, x19
	mov	x2, x22
	bl	_bitmap_parselist
	mov	x24, x0
	cbnz	w0, LBB0_19
; %bb.2:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	bl	_bitmap_subset
	cbz	w0, LBB0_9
; %bb.3:
	ldr	x8, [x20, #16]
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.4:
	mov	x22, #0
	mov	x23, #0
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x23, x23, #1
	ldr	x8, [x20, #16]
	ldrsw	x8, [x8]
	add	x22, x22, #16
	cmp	x23, x8
	b.ge	LBB0_11
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	add	x24, x8, x22
	ldr	x9, [x24, #8]
	ldr	w9, [x9]
	cmp	w9, w21
	b.ne	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x8, x22]
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_bit
	cbz	x0, LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x24, #8]
	ldr	w8, [x8, #4]
	cbnz	w8, LBB0_5
LBB0_9:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_19
LBB0_10:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_20
LBB0_11:
	mov	x0, x20
	bl	_mutex_lock
	ldr	x8, [x20, #16]
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.12:
	mov	x23, #0
	mov	x24, #0
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x22
	bl	_gpio_keys_enable_button
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x24, x24, #1
	ldr	x8, [x20, #16]
	ldrsw	x8, [x8]
	add	x23, x23, #16
	cmp	x24, x8
	b.ge	LBB0_18
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	add	x22, x8, x23
	ldr	x9, [x22, #8]
	ldr	w9, [x9]
	cmp	w9, w21
	b.ne	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x8, x23]
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_bit
	cbz	x0, LBB0_13
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x22
	bl	_gpio_keys_disable_button
	b	LBB0_14
LBB0_18:
	mov	x0, x20
	bl	_mutex_unlock
	mov	w24, #0
LBB0_19:
	mov	x0, x19
	bl	_bitmap_free
LBB0_20:
	mov	x0, x24
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_gpio_keys_attr_store_helper
.subsections_via_symbols
