	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qt2160_get_key_matrix
_qt2160_get_key_matrix:                 ## @qt2160_get_key_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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rdi), %r15
	movq	24(%rdi), %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_QT2160_CMD_GSTAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$6, %ecx
	callq	_qt2160_read_block
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_err
	jmp	LBB0_7
LBB0_2:
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	movl	(%r12), %r15d
	movl	-72(%rbp), %r14d
	shll	$8, %r14d
	orl	-76(%rbp), %r14d
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	movl	%r14d, (%r12)
	movl	$1, %r13d
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	addl	%r13d, %r13d
	cmpq	$16, %rbx
	je	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %r12d
	andl	%r14d, %r12d
	movl	%r13d, %eax
	andl	%r15d, %eax
	cmpl	%r12d, %eax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	(%rax,%rbx,4), %esi
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_input_report_key
	testl	%r12d, %r12d
	leaq	L_.str.3(%rip), %rcx
	leaq	L_.str.4(%rip), %rax
	cmoveq	%rax, %rcx
	movq	-104(%rbp), %rdi                ## 8-byte Reload
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_5
LBB0_6:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_input_sync
	xorl	%r14d, %r14d
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	movl	%r14d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"requesting keys...\n"

	.comm	_QT2160_CMD_GSTAT,4,2           ## @QT2160_CMD_GSTAT
L_.str.1:                               ## @.str.1
	.asciz	"could not perform chip read.\n"

L_.str.2:                               ## @.str.2
	.asciz	"key %d %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"pressed"

L_.str.4:                               ## @.str.4
	.asciz	"released"

	.no_dead_strip	_qt2160_get_key_matrix
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qt2160_get_key_matrix
_qt2160_get_key_matrix:                 ; @qt2160_get_key_matrix
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldp	x21, x19, [x0, #16]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
Lloh5:
	adrp	x8, _QT2160_CMD_GSTAT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _QT2160_CMD_GSTAT@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #16
	mov	x0, x19
	mov	w3, #6
	bl	_qt2160_read_block
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_7
LBB0_2:
	mov	x24, #0
	ldr	w25, [x20]
	ldp	w9, w8, [sp, #20]
	orr	w26, w9, w8, lsl #8
	str	w26, [x20]
	mov	w27, #1
Lloh10:
	adrp	x28, l_.str.4@PAGE
Lloh11:
	add	x28, x28, l_.str.4@PAGEOFF
Lloh12:
	adrp	x22, l_.str.2@PAGE
Lloh13:
	add	x22, x22, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	lsl	w27, w27, #1
	cmp	x24, #16
	b.eq	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	and	w23, w27, w26
	and	w8, w27, w25
	cmp	w8, w23
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, #8]
	ldr	w1, [x8, x24, lsl #2]
	mov	x0, x21
	mov	x2, x23
	bl	_input_report_key
	cmp	w23, #0
Lloh14:
	adrp	x8, l_.str.3@PAGE
Lloh15:
	add	x8, x8, l_.str.3@PAGEOFF
	csel	x8, x28, x8, eq
	stp	x24, x8, [sp]
	mov	x0, x19
	mov	x1, x22
	bl	_dev_dbg
	b	LBB0_3
LBB0_6:
	mov	x0, x21
	bl	_input_sync
	mov	w22, #0
LBB0_7:
	ldr	x8, [sp, #40]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x22
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"requesting keys...\n"

	.comm	_QT2160_CMD_GSTAT,4,2           ; @QT2160_CMD_GSTAT
l_.str.1:                               ; @.str.1
	.asciz	"could not perform chip read.\n"

l_.str.2:                               ; @.str.2
	.asciz	"key %d %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"pressed"

l_.str.4:                               ; @.str.4
	.asciz	"released"

	.no_dead_strip	_qt2160_get_key_matrix
.subsections_via_symbols
