	.file	"extr_nspire-keypad.c_nspire_keypad_chip_init.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	nspire_keypad_chip_init, @function
nspire_keypad_chip_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	edi, DWORD PTR 32[rdi]
	call	clk_get_rate@PLT
	mov	r12, QWORD PTR 0[rbp]
	movsx	rbx, eax
	sar	eax, 31
	imul	rbx, rbx, 1125899907
	sar	rbx, 50
	sub	ebx, eax
	mov	eax, 1
	movsx	rbx, ebx
	test	rbx, rbx
	cmove	rbx, rax
	xor	edi, edi
	imul	r12, rbx
	cmp	r12, 65535
	seta	dil
	call	WARN_ON@PLT
	imul	rbx, QWORD PTR 8[rbp]
	xor	edi, edi
	cmp	rbx, 16383
	seta	dil
	sal	r12, 16
	call	WARN_ON@PLT
	lea	rdi, 0[0+rbx*4]
	mov	ebx, r12d
	mov	rsi, QWORD PTR KEYPAD_SCAN_MODE[rip]
	movzx	edi, di
	add	rsi, QWORD PTR 24[rbp]
	or	rdi, rbx
	or	rdi, 3
	call	writel@PLT
	mov	edi, DWORD PTR KEYPAD_BITMASK_COLS[rip]
	movzx	eax, BYTE PTR KEYPAD_BITMASK_ROWS[rip]
	mov	rsi, QWORD PTR KEYPAD_CNTL[rip]
	add	rsi, QWORD PTR 24[rbp]
	sal	edi, 8
	movzx	edi, di
	or	edi, eax
	movsx	rdi, edi
	call	writel@PLT
	mov	DWORD PTR 16[rbp], 2
	mov	edi, 2
	mov	rsi, QWORD PTR KEYPAD_INTMSK[rip]
	add	rsi, QWORD PTR 24[rbp]
	call	writel@PLT
	mov	rsi, QWORD PTR KEYPAD_UNKNOWN_INT[rip]
	xor	edi, edi
	add	rsi, QWORD PTR 24[rbp]
	call	writel@PLT
	mov	rsi, QWORD PTR KEYPAD_UNKNOWN_INT_STS[rip]
	add	rsi, QWORD PTR 24[rbp]
	mov	rdi, -1
	call	writel@PLT
	pop	rbx
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	nspire_keypad_chip_init, .-nspire_keypad_chip_init
	.comm	KEYPAD_UNKNOWN_INT_STS,8,8
	.comm	KEYPAD_UNKNOWN_INT,8,8
	.comm	KEYPAD_SCAN_MODE,8,8
	.comm	KEYPAD_INTMSK,8,8
	.comm	KEYPAD_CNTL,8,8
	.comm	KEYPAD_BITMASK_ROWS,4,4
	.comm	KEYPAD_BITMASK_COLS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_nspire-keypad.c_nspire_keypad_chip_init.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	nspire_keypad_chip_init, %function
nspire_keypad_chip_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	ldr	r0, [r0, #16]
	bl	clk_get_rate
	ldr	r3, .L4
	asr	r4, r0, #31
	smull	r2, r0, r3, r0
	rsb	r4, r4, r0, asr #18
	cmp	r4, #1
	movcc	r4, #1
	ldr	r7, [r5]
	ldr	r6, .L4+4
	mul	r7, r4, r7
	cmp	r7, #65536
	movcc	r0, #0
	movcs	r0, #1
	bl	WARN_ON
	ldr	r0, [r5, #4]
	mul	r4, r0, r4
	cmp	r4, #16384
	movcc	r0, #0
	movcs	r0, #1
	bl	WARN_ON
	ldr	r3, .L4+8
	ldr	r1, [r5, #12]
	ldr	r3, [r3]
	and	r4, r6, r4, lsl #2
	orr	r4, r4, r7, lsl #16
	add	r1, r1, r3
	orr	r0, r4, #3
	bl	writel
	ldr	r2, .L4+12
	ldr	r1, .L4+16
	ldr	r3, .L4+20
	ldr	r2, [r2]
	ldrb	r0, [r1]	@ zero_extendqisi2
	ldr	r3, [r3]
	ldr	r1, [r5, #12]
	and	r6, r6, r2, lsl #8
	add	r1, r1, r3
	orr	r0, r6, r0
	bl	writel
	mov	r0, #2
	ldr	r3, .L4+24
	ldr	r1, [r5, #12]
	ldr	r3, [r3]
	str	r0, [r5, #8]
	add	r1, r1, r3
	bl	writel
	ldr	r3, .L4+28
	ldr	r1, [r5, #12]
	ldr	r3, [r3]
	mov	r0, #0
	add	r1, r1, r3
	bl	writel
	ldr	r3, .L4+32
	ldr	r1, [r5, #12]
	ldr	r3, [r3]
	mvn	r0, #0
	add	r1, r1, r3
	bl	writel
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L5:
	.align	2
.L4:
	.word	1125899907
	.word	65535
	.word	KEYPAD_SCAN_MODE
	.word	KEYPAD_BITMASK_COLS
	.word	KEYPAD_BITMASK_ROWS
	.word	KEYPAD_CNTL
	.word	KEYPAD_INTMSK
	.word	KEYPAD_UNKNOWN_INT
	.word	KEYPAD_UNKNOWN_INT_STS
	.size	nspire_keypad_chip_init, .-nspire_keypad_chip_init
	.comm	KEYPAD_UNKNOWN_INT_STS,4,4
	.comm	KEYPAD_UNKNOWN_INT,4,4
	.comm	KEYPAD_SCAN_MODE,4,4
	.comm	KEYPAD_INTMSK,4,4
	.comm	KEYPAD_CNTL,4,4
	.comm	KEYPAD_BITMASK_ROWS,4,4
	.comm	KEYPAD_BITMASK_COLS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
