	.file	"extr_sh_flctl.c_set_addr.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	set_addr, @function
set_addr:
.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	ebp, edx
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	ebx, esi
	call	mtd_to_flctl@PLT
	mov	r12, rax
	cmp	ebx, -1
	je	.L2
	cmp	ebp, -1
	je	.L5
	mov	edx, DWORD PTR 16[rax]
	mov	eax, ebx
	sar	eax
	test	DWORD PTR NAND_BUSWIDTH_16[rip], edx
	cmovne	ebx, eax
	mov	eax, ebp
	sar	eax, 8
	cmp	QWORD PTR 8[r12], 0
	je	.L4
	and	ebx, 4095
	sal	eax, 24
	mov	esi, ebx
	mov	ebx, ebp
	sal	ebx, 16
	and	ebx, 16711680
	or	eax, ebx
	or	eax, esi
	mov	ebx, eax
	mov	rax, QWORD PTR ADRCNT2_E[rip]
	cmp	QWORD PTR [r12], rax
	je	.L14
	mov	ebp, ebx
.L2:
	mov	rdi, r12
	call	FLADR@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	edi, ebp
	pop	rbp
	.cfi_def_cfa_offset 16
	mov	esi, eax
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	writel@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	xor	ebp, ebp
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	mov	ecx, ebp
	sar	ebp, 16
	sal	ecx, 8
	sal	ebp, 24
	movzx	ecx, cx
	sal	eax, 16
	or	ebp, ecx
	and	eax, 16711680
	or	eax, ebp
	or	eax, ebx
	mov	ebp, eax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rdi, r12
	sar	ebp, 16
	call	FLADR2@PLT
	movzx	edi, bpl
	mov	ebp, ebx
	mov	esi, eax
	call	writel@PLT
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	set_addr, .-set_addr
	.comm	NAND_BUSWIDTH_16,4,4
	.comm	ADRCNT2_E,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_sh_flctl.c_set_addr.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_addr, %function
set_addr:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r5, r1
	mov	r4, r2
	bl	mtd_to_flctl
	cmn	r5, #1
	mov	r6, r0
	beq	.L2
	cmn	r4, #1
	moveq	r4, #0
	beq	.L2
	ldr	r3, .L16
	ldr	r2, [r0, #8]
	ldr	r3, [r3]
	asr	ip, r4, #8
	tst	r2, r3
	ldr	r3, [r0, #4]
	asrne	r5, r5, #1
	cmp	r3, #0
	beq	.L4
	ldr	r2, .L16+4
	lsl	r3, r4, #16
	ldr	r2, [r2]
	ldr	r1, [r0]
	lsl	r5, r5, #20
	and	r3, r3, #16711680
	lsr	r5, r5, #20
	orr	r3, r3, ip, lsl #24
	orr	r5, r3, r5
	cmp	r1, r2
	movne	r4, r5
	beq	.L15
.L2:
	mov	r0, r6
	bl	FLADR
	mov	r1, r0
	mov	r0, r4
	pop	{r4, r5, r6, lr}
	b	writel
.L4:
	lsl	r4, r4, #8
	bic	r4, r4, #16711680
	lsl	r3, ip, #16
	bic	r4, r4, #255
	and	r3, r3, #16711680
	orr	r4, r4, r3
	orr	r4, r4, r5
	b	.L2
.L15:
	bl	FLADR2
	asr	r4, r4, #16
	mov	r1, r0
	and	r0, r4, #255
	bl	writel
	mov	r4, r5
	b	.L2
.L17:
	.align	2
.L16:
	.word	NAND_BUSWIDTH_16
	.word	ADRCNT2_E
	.size	set_addr, .-set_addr
	.comm	NAND_BUSWIDTH_16,4,4
	.comm	ADRCNT2_E,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
