	.file	"extr_smc91c92_cs.c_mot_setup.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mot_setup, @function
mot_setup:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	xor	r13d, r13d
	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	r14, QWORD PTR [rdi]
	mov	r12d, DWORD PTR [r14]
.L5:
	mov	edi, 2
	mov	ebp, 200
	call	SMC_SELECT_BANK@PLT
	mov	rsi, QWORD PTR POINTER[rip]
	mov	edi, DWORD PTR MOT_EEPROM[rip]
	add	rsi, r12
	add	edi, r13d
	call	outw@PLT
	mov	edi, 1
	call	SMC_SELECT_BANK@PLT
	mov	rsi, QWORD PTR CONTROL[rip]
	mov	edi, DWORD PTR CTL_RELOAD[rip]
	or	edi, DWORD PTR CTL_EE_SELECT[rip]
	add	rsi, r12
	call	outw@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L11:
	sub	ebp, 1
	je	.L10
.L3:
	mov	edi, 10
	call	udelay@PLT
	mov	rdi, QWORD PTR CONTROL[rip]
	mov	ebx, DWORD PTR CTL_RELOAD[rip]
	or	ebx, DWORD PTR CTL_STORE[rip]
	add	rdi, r12
	call	inw@PLT
	and	ebx, eax
	jne	.L11
	mov	rdi, QWORD PTR GENERAL[rip]
	add	rdi, r12
	call	inw@PLT
	mov	rdx, QWORD PTR 8[r14]
	movzx	ecx, al
	movzx	eax, ah
	mov	DWORD PTR [rdx+r13*8], ecx
	mov	DWORD PTR 4[rdx+r13*8], eax
	add	r13, 1
	cmp	r13, 3
	jne	.L5
	mov	eax, ebx
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L10:
	.cfi_restore_state
	mov	ebx, -1
	mov	eax, ebx
	pop	rbx
	.cfi_def_cfa_offset 40
	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
	.cfi_endproc
.LFE0:
	.size	mot_setup, .-mot_setup
	.comm	POINTER,8,8
	.comm	MOT_EEPROM,4,4
	.comm	GENERAL,8,8
	.comm	CTL_STORE,4,4
	.comm	CTL_RELOAD,4,4
	.comm	CTL_EE_SELECT,4,4
	.comm	CONTROL,8,8
	.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_smc91c92_cs.c_mot_setup.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mot_setup, %function
mot_setup:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r9, #0
	ldr	r3, [r0]
	sub	sp, sp, #12
	ldr	fp, .L12
	ldr	r5, [r3]
	ldr	r7, .L12+4
	ldr	r6, .L12+8
	ldr	r8, .L12+12
	str	r3, [sp, #4]
.L5:
	mov	r0, #2
	bl	SMC_SELECT_BANK
	ldr	r3, .L12+16
	ldr	r1, [fp]
	ldr	r0, [r3]
	add	r1, r5, r1
	add	r0, r9, r0
	bl	outw
	mov	r0, #1
	bl	SMC_SELECT_BANK
	ldr	r3, .L12+20
	ldr	r1, [r7]
	ldr	r0, [r6]
	ldr	r3, [r3]
	add	r1, r5, r1
	orr	r0, r0, r3
	bl	outw
	mov	r4, #200
	b	.L3
.L11:
	subs	r4, r4, #1
	beq	.L10
.L3:
	mov	r0, #10
	bl	udelay
	ldr	r0, [r7]
	ldr	r10, [r6]
	ldr	r3, [r8]
	add	r0, r5, r0
	orr	r10, r10, r3
	bl	inw
	ands	r10, r10, r0
	bne	.L11
	ldr	r3, .L12+24
	ldr	r0, [r3]
	add	r0, r5, r0
	bl	inw
	ldr	r3, [sp, #4]
	and	r1, r0, #255
	ldr	r2, [r3, #4]
	asr	r0, r0, #8
	str	r1, [r2, r9, lsl #3]
	add	r2, r2, r9, lsl #3
	add	r9, r9, #1
	and	r0, r0, #255
	cmp	r9, #3
	str	r0, [r2, #4]
	bne	.L5
	mov	r3, r10
	mov	r0, r3
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L10:
	mvn	r3, #0
	mov	r0, r3
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	.align	2
.L12:
	.word	POINTER
	.word	CONTROL
	.word	CTL_RELOAD
	.word	CTL_STORE
	.word	MOT_EEPROM
	.word	CTL_EE_SELECT
	.word	GENERAL
	.size	mot_setup, .-mot_setup
	.comm	POINTER,4,4
	.comm	MOT_EEPROM,4,4
	.comm	GENERAL,4,4
	.comm	CTL_STORE,4,4
	.comm	CTL_RELOAD,4,4
	.comm	CTL_EE_SELECT,4,4
	.comm	CONTROL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
