	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tosakbd_scankeyboard
_tosakbd_scankeyboard:                  ## @tosakbd_scankeyboard
	.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, %r14
	callq	_platform_get_drvdata
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_spin_lock_irqsave
	cmpq	$0, 24(%rbx)
	jne	LBB0_15
## %bb.1:
	movq	_TOSA_KEY_STROBE_NUM@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.3:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%r12d, %edi
	callq	_tosakbd_reset_col
	incl	%r12d
	movq	_TOSA_KEY_STROBE_NUM@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jae	LBB0_13
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	xorl	%eax, %eax
	callq	_tosakbd_discharge_all
	movq	_KB_DISCHARGE_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_udelay
	movl	%r12d, %edi
	callq	_tosakbd_activate_col
	movq	_KB_ACTIVATE_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_udelay
	movl	%r12d, %edi
	callq	_GET_ROWS_STATUS
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	_TOSA_KEY_SENSE_NUM@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r15d, %r15d
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_6 Depth=2
	movl	%r12d, %ebx
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=2
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	8(%rcx), %edi
	movq	16(%rcx), %rax
	movl	(%rax,%rbx,4), %esi
	movl	%r14d, %edx
	callq	_input_report_key
	cmpl	$1, %r14d
	sbbl	$-1, %r13d
	incl	%r15d
	movq	_TOSA_KEY_SENSE_NUM@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jae	LBB0_12
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r15d, %edi
	movl	%r12d, %esi
	callq	_SCANCODE
	movl	%eax, %r12d
	movl	%r15d, %edi
	callq	_KB_ROWMASK
	movl	%eax, %r14d
	andl	-60(%rbp), %r14d                ## 4-byte Folded Reload
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	16(%rcx), %rax
	movl	%r12d, %ebx
	cmpl	$0, (%rax,%rbx,4)
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_warn
	jmp	LBB0_10
LBB0_2:
	xorl	%r13d, %r13d
LBB0_13:
	xorl	%eax, %eax
	callq	_tosakbd_activate_all
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	8(%rbx), %edi
	callq	_input_sync
	testl	%r13d, %r13d
	je	LBB0_15
## %bb.14:
	addq	$4, %rbx
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	_SCAN_INTERVAL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_mod_timer
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_15:
	movq	%rbx, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TOSA_KEY_STROBE_NUM,4,2        ## @TOSA_KEY_STROBE_NUM
	.comm	_KB_DISCHARGE_DELAY,4,2         ## @KB_DISCHARGE_DELAY
	.comm	_KB_ACTIVATE_DELAY,4,2          ## @KB_ACTIVATE_DELAY
	.comm	_TOSA_KEY_SENSE_NUM,4,2         ## @TOSA_KEY_SENSE_NUM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unhandled scancode: 0x%02x\n"

	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_SCAN_INTERVAL,8,3              ## @SCAN_INTERVAL
	.no_dead_strip	_tosakbd_scankeyboard
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tosakbd_scankeyboard
_tosakbd_scankeyboard:                  ; @tosakbd_scankeyboard
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	bl	_platform_get_drvdata
	mov	x19, x0
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #24]
	cbnz	x8, LBB0_14
; %bb.1:
Lloh0:
	adrp	x8, _TOSA_KEY_STROBE_NUM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TOSA_KEY_STROBE_NUM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_11
; %bb.2:
	mov	w21, #0
	mov	w27, #0
Lloh3:
	adrp	x28, _TOSA_KEY_SENSE_NUM@GOTPAGE
Lloh4:
	ldr	x28, [x28, _TOSA_KEY_SENSE_NUM@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_tosakbd_reset_col
	add	w21, w21, #1
Lloh5:
	adrp	x8, _TOSA_KEY_STROBE_NUM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TOSA_KEY_STROBE_NUM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w21, w8
	b.hs	LBB0_12
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	bl	_tosakbd_discharge_all
Lloh8:
	adrp	x8, _KB_DISCHARGE_DELAY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _KB_DISCHARGE_DELAY@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_udelay
	mov	x0, x21
	bl	_tosakbd_activate_col
Lloh11:
	adrp	x8, _KB_ACTIVATE_DELAY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _KB_ACTIVATE_DELAY@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_udelay
	mov	x0, x21
	bl	_GET_ROWS_STATUS
	ldr	w8, [x28]
	cbz	w8, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x0
	mov	w24, #0
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=2
	mov	w22, w26
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	ldr	w0, [x19, #8]
	ldr	x8, [x19, #16]
	ldr	w1, [x8, x22, lsl #2]
	mov	x2, x25
	bl	_input_report_key
	cmp	w25, #0
	cinc	w27, w27, ne
	add	w24, w24, #1
	ldr	w8, [x28]
	cmp	w24, w8
	b.hs	LBB0_3
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x24
	mov	x1, x21
	bl	_SCANCODE
	mov	x26, x0
	mov	x0, x24
	bl	_KB_ROWMASK
	ands	w25, w0, w23
	b.eq	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	x8, [x19, #16]
	mov	w22, w26
	ldr	w8, [x8, w26, uxtw #2]
	cbnz	w8, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=2
	mov	x0, x20
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x26
	bl	_dev_warn
	b	LBB0_7
LBB0_11:
	mov	w27, #0
LBB0_12:
	bl	_tosakbd_activate_all
	ldr	w0, [x19, #8]
	bl	_input_sync
	cbz	w27, LBB0_14
; %bb.13:
Lloh16:
	adrp	x8, _jiffies@GOTPAGE
Lloh17:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
	add	x0, x19, #4
Lloh18:
	ldr	x8, [x8]
Lloh19:
	adrp	x9, _SCAN_INTERVAL@GOTPAGE
Lloh20:
	ldr	x9, [x9, _SCAN_INTERVAL@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_mod_timer
LBB0_14:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_TOSA_KEY_STROBE_NUM,4,2        ; @TOSA_KEY_STROBE_NUM
	.comm	_KB_DISCHARGE_DELAY,4,2         ; @KB_DISCHARGE_DELAY
	.comm	_KB_ACTIVATE_DELAY,4,2          ; @KB_ACTIVATE_DELAY
	.comm	_TOSA_KEY_SENSE_NUM,4,2         ; @TOSA_KEY_SENSE_NUM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unhandled scancode: 0x%02x\n"

	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_SCAN_INTERVAL,8,3              ; @SCAN_INTERVAL
	.no_dead_strip	_tosakbd_scankeyboard
.subsections_via_symbols
