	.file	"extr_pxa27x_keypad.c_pxa27x_keypad_build_keycode.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	pxa27x_keypad_build_keycode, @function
pxa27x_keypad_build_keycode:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rdi
	xor	esi, esi
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r8, QWORD PTR [r14]
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	r13, QWORD PTR 24[rdi]
	mov	rbp, QWORD PTR 16[rdi]
	mov	ecx, DWORD PTR 48[r13]
	mov	edx, DWORD PTR 52[r13]
	mov	edi, DWORD PTR 56[r13]
	mov	r9, rbp
	call	matrix_keypad_build_keymap@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L18
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	rdi, QWORD PTR [r14]
	call	ARRAY_SIZE@PLT
	mov	DWORD PTR 8[rbp], eax
	mov	eax, DWORD PTR 0[r13]
	test	eax, eax
	jle	.L3
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rax, QWORD PTR 8[r13]
	mov	rdx, QWORD PTR [r14]
	mov	esi, DWORD PTR 0[rbp]
	movzx	edi, WORD PTR [rax+rbx*2]
	mov	eax, DWORD PTR MAX_MATRIX_KEY_NUM[rip]
	add	eax, ebx
	add	rbx, 1
	cdqe
	mov	WORD PTR [rdx+rax*2], di
	call	__set_bit@PLT
	cmp	DWORD PTR 0[r13], ebx
	jg	.L4
.L3:
	cmp	QWORD PTR 40[r13], 0
	je	.L5
	movzx	eax, WORD PTR 16[r13]
	test	ax, ax
	je	.L6
	cmp	WORD PTR 18[r13], 0
	jne	.L19
.L6:
	movzx	edi, WORD PTR 20[r13]
	mov	rax, QWORD PTR 8[r14]
	mov	DWORD PTR [rax], edi
	mov	esi, DWORD PTR 4[rbp]
	call	__set_bit@PLT
.L5:
	cmp	QWORD PTR 32[r13], 0
	je	.L7
	movzx	eax, WORD PTR 22[r13]
	test	ax, ax
	je	.L8
	cmp	WORD PTR 24[r13], 0
	jne	.L20
.L8:
	movzx	edi, WORD PTR 26[r13]
	mov	rax, QWORD PTR 8[r14]
	mov	DWORD PTR 4[rax], edi
	mov	esi, DWORD PTR 4[rbp]
	call	__set_bit@PLT
.L7:
	mov	esi, DWORD PTR 0[rbp]
	mov	edi, DWORD PTR KEY_RESERVED[rip]
	call	__clear_bit@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	movsx	rcx, DWORD PTR MAX_MATRIX_KEY_NUM[rip]
	mov	rdx, QWORD PTR [r14]
	movzx	edi, ax
	mov	esi, DWORD PTR 0[rbp]
	mov	WORD PTR 4[rdx+rcx*2], ax
	call	__set_bit@PLT
	movzx	edi, WORD PTR 24[r13]
	movsx	rcx, DWORD PTR MAX_MATRIX_KEY_NUM[rip]
	mov	rdx, QWORD PTR [r14]
	mov	esi, DWORD PTR 0[rbp]
	mov	WORD PTR 6[rdx+rcx*2], di
	call	__set_bit@PLT
	mov	rax, QWORD PTR 8[r14]
	mov	DWORD PTR 4[rax], -1
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L19:
	movsx	rcx, DWORD PTR MAX_MATRIX_KEY_NUM[rip]
	mov	rdx, QWORD PTR [r14]
	movzx	edi, ax
	mov	esi, DWORD PTR 0[rbp]
	mov	WORD PTR [rdx+rcx*2], ax
	call	__set_bit@PLT
	movzx	edi, WORD PTR 18[r13]
	movsx	rcx, DWORD PTR MAX_MATRIX_KEY_NUM[rip]
	mov	rdx, QWORD PTR [r14]
	mov	esi, DWORD PTR 0[rbp]
	mov	WORD PTR 2[rdx+rcx*2], di
	call	__set_bit@PLT
	mov	rax, QWORD PTR 8[r14]
	mov	DWORD PTR [rax], -1
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	pxa27x_keypad_build_keycode, .-pxa27x_keypad_build_keycode
	.comm	MAX_MATRIX_KEY_NUM,4,4
	.comm	KEY_RESERVED,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_pxa27x_keypad.c_pxa27x_keypad_build_keycode.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	pxa27x_keypad_build_keycode, %function
pxa27x_keypad_build_keycode:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r6, r0
	ldr	r5, [r0, #12]
	ldr	r7, [r0, #8]
	ldr	r1, [r6]
	sub	sp, sp, #12
	ldr	r3, [r5, #28]
	ldr	r2, [r5, #32]
	ldr	r0, [r5, #36]
	stm	sp, {r1, r7}
	mov	r1, #0
	bl	matrix_keypad_build_keymap
	subs	r8, r0, #0
	beq	.L30
	mov	r0, r8
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L30:
	ldr	r0, [r6]
	bl	ARRAY_SIZE
	ldr	r3, [r5]
	str	r0, [r7, #8]
	cmp	r3, #0
	ble	.L3
	mov	r4, r8
	ldr	r9, .L33
.L4:
	ldr	r1, [r5, #4]
	ldr	r3, [r9]
	lsl	r2, r4, #1
	ldrh	r0, [r1, r2]
	add	r3, r4, r3
	ldr	r2, [r6]
	lsl	r3, r3, #1
	strh	r0, [r2, r3]	@ movhi
	ldr	r1, [r7]
	bl	__set_bit
	ldr	r3, [r5]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L4
.L3:
	ldr	r3, [r5, #24]
	cmp	r3, #0
	beq	.L5
	ldrh	r0, [r5, #8]
	cmp	r0, #0
	beq	.L6
	ldrh	r3, [r5, #10]
	cmp	r3, #0
	bne	.L31
.L6:
	ldrh	r0, [r5, #12]
	ldr	r3, [r6, #4]
	str	r0, [r3]
	ldr	r1, [r7, #4]
	bl	__set_bit
.L5:
	ldr	r3, [r5, #20]
	cmp	r3, #0
	beq	.L7
	ldrh	r0, [r5, #14]
	cmp	r0, #0
	beq	.L8
	ldrh	r3, [r5, #16]
	cmp	r3, #0
	bne	.L32
.L8:
	ldrh	r0, [r5, #18]
	ldr	r3, [r6, #4]
	str	r0, [r3, #4]
	ldr	r1, [r7, #4]
	bl	__set_bit
.L7:
	ldr	r3, .L33+4
	ldr	r1, [r7]
	ldr	r0, [r3]
	bl	__clear_bit
	mov	r0, r8
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L32:
	ldr	r4, .L33
	ldr	r3, [r6]
	ldr	r2, [r4]
	ldr	r1, [r7]
	add	r3, r3, r2, lsl #1
	strh	r0, [r3, #4]	@ movhi
	bl	__set_bit
	ldr	r2, [r4]
	ldr	r3, [r6]
	ldrh	r0, [r5, #16]
	add	r3, r3, r2, lsl #1
	strh	r0, [r3, #6]	@ movhi
	ldr	r1, [r7]
	bl	__set_bit
	mvn	r2, #0
	ldr	r3, [r6, #4]
	str	r2, [r3, #4]
	b	.L7
.L31:
	ldr	r4, .L33
	ldr	r2, [r6]
	ldr	r3, [r4]
	ldr	r1, [r7]
	lsl	r3, r3, #1
	strh	r0, [r2, r3]	@ movhi
	bl	__set_bit
	ldr	r2, [r4]
	ldr	r3, [r6]
	ldrh	r0, [r5, #10]
	add	r3, r3, r2, lsl #1
	strh	r0, [r3, #2]	@ movhi
	ldr	r1, [r7]
	bl	__set_bit
	mvn	r2, #0
	ldr	r3, [r6, #4]
	str	r2, [r3]
	b	.L5
.L34:
	.align	2
.L33:
	.word	MAX_MATRIX_KEY_NUM
	.word	KEY_RESERVED
	.size	pxa27x_keypad_build_keycode, .-pxa27x_keypad_build_keycode
	.comm	MAX_MATRIX_KEY_NUM,4,4
	.comm	KEY_RESERVED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
