	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function matrix_keypad_init_gpio
_matrix_keypad_init_gpio:               ## @matrix_keypad_init_gpio
	.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, %r15
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %r14
	cmpl	$0, (%r14)
	jle	LBB0_8
## %bb.1:
	xorl	%ebx, %ebx
	leaq	L_.str(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	movq	%r13, %rsi
	callq	_gpio_request
	testl	%eax, %eax
	jne	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	24(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	xorl	%esi, %esi
	cmpl	$0, 40(%r14)
	sete	%sil
	callq	_gpio_direction_output
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_8:
	movl	4(%r14), %eax
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	LBB0_17
## %bb.9:
	leaq	L_.str.2(%rip), %r13
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	movq	%r13, %rsi
	callq	_gpio_request
	testl	%eax, %eax
	jne	LBB0_11
## %bb.16:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	32(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_gpio_direction_input
	incq	%rbx
	movslq	4(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_10
LBB0_17:
	movq	8(%r14), %rdi
	testq	%rdi, %rdi
	jle	LBB0_18
## %bb.25:
	movq	_matrix_keypad_interrupt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%r14), %edx
	leaq	L_.str.4(%rip), %rcx
	movq	%r15, %r8
	callq	_request_any_context_irq
	testl	%eax, %eax
	jns	LBB0_28
## %bb.26:
	movl	%eax, %r12d
	leaq	L_.str.5(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	testl	%ebx, %ebx
	jg	LBB0_13
	jmp	LBB0_15
LBB0_3:
	movl	%eax, %r12d
	movq	24(%r14), %rax
	movl	(%rax,%rbx,4), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	testl	%ebx, %ebx
	jg	LBB0_5
	jmp	LBB0_29
LBB0_11:
	movl	%eax, %r12d
	movq	32(%r14), %rax
	movl	(%rax,%rbx,4), %edx
	leaq	L_.str.3(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	testl	%ebx, %ebx
	jle	LBB0_15
LBB0_13:
	movl	%ebx, %ebx
	incq	%rbx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	leal	-2(%rbx), %eax
	movq	32(%r14), %rcx
	movl	(%rcx,%rax,4), %edi
	callq	_gpio_free
	decq	%rbx
	cmpq	$1, %rbx
	ja	LBB0_14
LBB0_15:
	movl	(%r14), %ebx
	testl	%ebx, %ebx
	jle	LBB0_29
LBB0_5:
	movl	%ebx, %ebx
	incq	%rbx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	leal	-2(%rbx), %eax
	movq	24(%r14), %rcx
	movl	(%rcx,%rax,4), %edi
	callq	_gpio_free
	decq	%rbx
	cmpq	$1, %rbx
	ja	LBB0_6
	jmp	LBB0_29
LBB0_18:
	testl	%eax, %eax
	jle	LBB0_28
## %bb.19:
	xorl	%ebx, %ebx
	leaq	L_.str.4(%rip), %r13
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_gpio_to_irq
	movq	_matrix_keypad_interrupt@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_IRQF_TRIGGER_FALLING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_IRQF_TRIGGER_RISING@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	%rax, %rdi
	movq	%r13, %rcx
	movq	%r15, %r8
	callq	_request_any_context_irq
	testl	%eax, %eax
	js	LBB0_21
## %bb.27:                              ##   in Loop: Header=BB0_20 Depth=1
	incq	%rbx
	movslq	4(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_20
LBB0_28:
	movq	%r15, %rdi
	callq	_disable_row_irqs
	xorl	%r12d, %r12d
LBB0_29:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movl	%eax, %r12d
	movq	32(%r14), %rax
	movl	(%rax,%rbx,4), %edx
	leaq	L_.str.6(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	testl	%ebx, %ebx
	je	LBB0_24
## %bb.22:
	incq	%rbx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r14), %rax
	movl	-8(%rax,%rbx,4), %edi
	callq	_gpio_to_irq
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_free_irq
	decq	%rbx
	cmpq	$1, %rbx
	jg	LBB0_23
LBB0_24:
	movl	4(%r14), %ebx
	testl	%ebx, %ebx
	jg	LBB0_13
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"matrix_kbd_col"

L_.str.1:                               ## @.str.1
	.asciz	"failed to request GPIO%d for COL%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"matrix_kbd_row"

L_.str.3:                               ## @.str.3
	.asciz	"failed to request GPIO%d for ROW%d\n"

	.comm	_matrix_keypad_interrupt,4,2    ## @matrix_keypad_interrupt
L_.str.4:                               ## @.str.4
	.asciz	"matrix-keypad"

L_.str.5:                               ## @.str.5
	.asciz	"Unable to acquire clustered interrupt\n"

	.comm	_IRQF_TRIGGER_RISING,4,2        ## @IRQF_TRIGGER_RISING
	.comm	_IRQF_TRIGGER_FALLING,4,2       ## @IRQF_TRIGGER_FALLING
L_.str.6:                               ## @.str.6
	.asciz	"Unable to acquire interrupt for GPIO line %i\n"

	.no_dead_strip	_matrix_keypad_init_gpio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function matrix_keypad_init_gpio
_matrix_keypad_init_gpio:               ; @matrix_keypad_init_gpio
	.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	x19, x1
	mov	x20, x0
	ldr	x23, [x1]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x24, #0
Lloh0:
	adrp	x22, l_.str@PAGE
Lloh1:
	add	x22, x22, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, #24]
	ldr	w0, [x8, x24, lsl #2]
	mov	x1, x22
	bl	_gpio_request
	cbnz	w0, LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x23, #24]
	ldr	w0, [x8, x24, lsl #2]
	ldr	w8, [x23, #40]
	cmp	w8, #0
	cset	w1, eq
	bl	_gpio_direction_output
	add	x24, x24, #1
	ldrsw	x8, [x23]
	cmp	x24, x8
	b.lt	LBB0_2
LBB0_4:
	ldr	w8, [x23, #4]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.5:
	mov	x24, #0
Lloh2:
	adrp	x22, l_.str.2@PAGE
Lloh3:
	add	x22, x22, l_.str.2@PAGEOFF
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, #32]
	ldr	w0, [x8, x24, lsl #2]
	mov	x1, x22
	bl	_gpio_request
	cbnz	w0, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x23, #32]
	ldr	w0, [x8, x24, lsl #2]
	bl	_gpio_direction_input
	add	x24, x24, #1
	ldrsw	x8, [x23, #4]
	cmp	x24, x8
	b.lt	LBB0_6
	b	LBB0_10
LBB0_8:
	mov	x21, x0
	ldr	x8, [x23, #24]
	ldr	w8, [x8, x24, lsl #2]
	stp	x8, x24, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	cmp	w24, #1
	b.ge	LBB0_18
	b	LBB0_25
LBB0_9:
	mov	w24, #0
LBB0_10:
	ldr	x0, [x23, #8]
	cmp	x0, #0
	b.le	LBB0_20
; %bb.11:
Lloh6:
	adrp	x8, _matrix_keypad_interrupt@GOTPAGE
Lloh7:
	ldr	x8, [x8, _matrix_keypad_interrupt@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w2, [x23, #16]
Lloh9:
	adrp	x3, l_.str.4@PAGE
Lloh10:
	add	x3, x3, l_.str.4@PAGEOFF
	mov	x4, x19
	bl	_request_any_context_irq
	tbz	w0, #31, LBB0_24
; %bb.12:
	mov	x21, x0
Lloh11:
	adrp	x1, l_.str.5@PAGE
Lloh12:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_14
LBB0_13:
	mov	x21, x0
	ldr	x8, [x23, #32]
	ldr	w8, [x8, x24, lsl #2]
	stp	x8, x24, [sp]
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_14:
	mov	x0, x20
	bl	_dev_err
	cmp	w24, #1
	b.lt	LBB0_17
LBB0_15:
	mov	w8, w24
	add	x19, x8, #1
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	sub	w8, w19, #2
	ldr	x9, [x23, #32]
	ldr	w0, [x9, w8, uxtw #2]
	bl	_gpio_free
	sub	x19, x19, #1
	cmp	x19, #1
	b.hi	LBB0_16
LBB0_17:
	ldr	w24, [x23]
	cmp	w24, #1
	b.lt	LBB0_25
LBB0_18:
	mov	w8, w24
	add	x19, x8, #1
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	sub	w8, w19, #2
	ldr	x9, [x23, #24]
	ldr	w0, [x9, w8, uxtw #2]
	bl	_gpio_free
	sub	x19, x19, #1
	cmp	x19, #1
	b.hi	LBB0_19
	b	LBB0_25
LBB0_20:
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.21:
	mov	x24, #0
Lloh15:
	adrp	x25, _matrix_keypad_interrupt@GOTPAGE
Lloh16:
	ldr	x25, [x25, _matrix_keypad_interrupt@GOTPAGEOFF]
Lloh17:
	adrp	x26, _IRQF_TRIGGER_RISING@GOTPAGE
Lloh18:
	ldr	x26, [x26, _IRQF_TRIGGER_RISING@GOTPAGEOFF]
Lloh19:
	adrp	x27, _IRQF_TRIGGER_FALLING@GOTPAGE
Lloh20:
	ldr	x27, [x27, _IRQF_TRIGGER_FALLING@GOTPAGEOFF]
Lloh21:
	adrp	x22, l_.str.4@PAGE
Lloh22:
	add	x22, x22, l_.str.4@PAGEOFF
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, #32]
	ldr	w0, [x8, x24, lsl #2]
	bl	_gpio_to_irq
	ldr	w1, [x25]
	ldr	w8, [x26]
	ldr	w9, [x27]
	orr	w2, w9, w8
	mov	x3, x22
	mov	x4, x19
	bl	_request_any_context_irq
	tbnz	w0, #31, LBB0_26
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x23, #4]
	cmp	x24, x8
	b.lt	LBB0_22
LBB0_24:
	mov	x0, x19
	bl	_disable_row_irqs
	mov	w21, #0
LBB0_25:
	mov	x0, x21
	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
LBB0_26:
	mov	x21, x0
	ldr	x8, [x23, #32]
	ldr	w8, [x8, x24, lsl #2]
	str	x8, [sp]
Lloh23:
	adrp	x1, l_.str.6@PAGE
Lloh24:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	cbz	w24, LBB0_29
; %bb.27:
	sub	x20, x24, #1
LBB0_28:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, #32]
	ldr	w0, [x8, x20, lsl #2]
	bl	_gpio_to_irq
	mov	x1, x19
	bl	_free_irq
	add	x8, x20, #1
	sub	x20, x20, #1
	cmp	x8, #1
	b.gt	LBB0_28
LBB0_29:
	ldr	w24, [x23, #4]
	cmp	w24, #1
	b.ge	LBB0_15
	b	LBB0_17
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"matrix_kbd_col"

l_.str.1:                               ; @.str.1
	.asciz	"failed to request GPIO%d for COL%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"matrix_kbd_row"

l_.str.3:                               ; @.str.3
	.asciz	"failed to request GPIO%d for ROW%d\n"

	.comm	_matrix_keypad_interrupt,4,2    ; @matrix_keypad_interrupt
l_.str.4:                               ; @.str.4
	.asciz	"matrix-keypad"

l_.str.5:                               ; @.str.5
	.asciz	"Unable to acquire clustered interrupt\n"

	.comm	_IRQF_TRIGGER_RISING,4,2        ; @IRQF_TRIGGER_RISING
	.comm	_IRQF_TRIGGER_FALLING,4,2       ; @IRQF_TRIGGER_FALLING
l_.str.6:                               ; @.str.6
	.asciz	"Unable to acquire interrupt for GPIO line %i\n"

	.no_dead_strip	_matrix_keypad_init_gpio
.subsections_via_symbols
