	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function keyscan_start
_keyscan_start:                         ## @keyscan_start
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	24(%rdi), %edi
	callq	_clk_enable
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movl	(%rbx), %r15d
	movl	24(%rbx), %edi
	callq	_clk_get_rate
	cltq
	imulq	$1125899907, %rax, %rdi         ## imm = 0x431BDE83
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$50, %rdi
	addl	%eax, %edi
	imull	%r15d, %edi
	movq	_KEYSCAN_DEBOUNCE_TIME_OFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%rbx), %rsi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_writel
	movl	4(%rbx), %eax
	decl	%eax
	movq	_KEYSCAN_MATRIX_DIM_X_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	8(%rbx), %edi
	decl	%edi
	movq	_KEYSCAN_MATRIX_DIM_Y_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edi
	orl	%eax, %edi
	movq	_KEYSCAN_MATRIX_DIM_OFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%rbx), %rsi
	callq	_writel
	movq	_KEYSCAN_CONFIG_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_KEYSCAN_CONFIG_OFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%rbx), %rsi
	callq	_writel
LBB0_2:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KEYSCAN_DEBOUNCE_TIME_OFF,8,3  ## @KEYSCAN_DEBOUNCE_TIME_OFF
	.comm	_KEYSCAN_MATRIX_DIM_X_SHIFT,4,2 ## @KEYSCAN_MATRIX_DIM_X_SHIFT
	.comm	_KEYSCAN_MATRIX_DIM_Y_SHIFT,4,2 ## @KEYSCAN_MATRIX_DIM_Y_SHIFT
	.comm	_KEYSCAN_MATRIX_DIM_OFF,8,3     ## @KEYSCAN_MATRIX_DIM_OFF
	.comm	_KEYSCAN_CONFIG_ENABLE,4,2      ## @KEYSCAN_CONFIG_ENABLE
	.comm	_KEYSCAN_CONFIG_OFF,8,3         ## @KEYSCAN_CONFIG_OFF
	.no_dead_strip	_keyscan_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function keyscan_start
_keyscan_start:                         ; @keyscan_start
	.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
	ldr	w0, [x0, #24]
	bl	_clk_enable
	mov	x19, x0
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w21, [x20]
	ldr	w0, [x20, #24]
	bl	_clk_get_rate
	mov	w8, #56963
	movk	w8, #17179, lsl #16
	smull	x8, w0, w8
	lsr	x9, x8, #63
	asr	x8, x8, #50
	add	w8, w8, w9
	mul	w0, w8, w21
	ldr	x8, [x20, #16]
Lloh0:
	adrp	x9, _KEYSCAN_DEBOUNCE_TIME_OFF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _KEYSCAN_DEBOUNCE_TIME_OFF@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldp	w8, w9, [x20, #4]
	sub	w8, w8, #1
Lloh3:
	adrp	x10, _KEYSCAN_MATRIX_DIM_X_SHIFT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _KEYSCAN_MATRIX_DIM_X_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	lsl	w8, w8, w10
	sub	w9, w9, #1
Lloh6:
	adrp	x10, _KEYSCAN_MATRIX_DIM_Y_SHIFT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _KEYSCAN_MATRIX_DIM_Y_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w0, w9, w8
	ldr	x8, [x20, #16]
Lloh9:
	adrp	x9, _KEYSCAN_MATRIX_DIM_OFF@GOTPAGE
Lloh10:
	ldr	x9, [x9, _KEYSCAN_MATRIX_DIM_OFF@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
Lloh12:
	adrp	x8, _KEYSCAN_CONFIG_ENABLE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _KEYSCAN_CONFIG_ENABLE@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldr	x8, [x20, #16]
Lloh15:
	adrp	x9, _KEYSCAN_CONFIG_OFF@GOTPAGE
Lloh16:
	ldr	x9, [x9, _KEYSCAN_CONFIG_OFF@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
LBB0_2:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_KEYSCAN_DEBOUNCE_TIME_OFF,8,3  ; @KEYSCAN_DEBOUNCE_TIME_OFF
	.comm	_KEYSCAN_MATRIX_DIM_X_SHIFT,4,2 ; @KEYSCAN_MATRIX_DIM_X_SHIFT
	.comm	_KEYSCAN_MATRIX_DIM_Y_SHIFT,4,2 ; @KEYSCAN_MATRIX_DIM_Y_SHIFT
	.comm	_KEYSCAN_MATRIX_DIM_OFF,8,3     ; @KEYSCAN_MATRIX_DIM_OFF
	.comm	_KEYSCAN_CONFIG_ENABLE,4,2      ; @KEYSCAN_CONFIG_ENABLE
	.comm	_KEYSCAN_CONFIG_OFF,8,3         ; @KEYSCAN_CONFIG_OFF
	.no_dead_strip	_keyscan_start
.subsections_via_symbols
