	.file	"extr_r852.c_r852_dma_enable.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	r852_dma_enable, @function
r852_dma_enable:
.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
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	esi, DWORD PTR R852_DMA_SETTINGS[rip]
	call	r852_read_reg_dword@PLT
	mov	edx, DWORD PTR R852_DMA_READ[rip]
	mov	ecx, DWORD PTR R852_DMA_INTERNAL[rip]
	mov	r8d, eax
	mov	r12d, DWORD PTR R852_DMA_MEMORY[rip]
	mov	eax, edx
	or	eax, ecx
	or	eax, r12d
	not	eax
	and	eax, r8d
	cmp	QWORD PTR 16[rbp], 0
	je	.L2
	or	eax, edx
.L2:
	mov	rsi, QWORD PTR DMA_INTERNAL[rip]
	cmp	QWORD PTR 0[rbp], rsi
	je	.L8
	mov	edi, DWORD PTR 8[rbp]
	or	r12d, eax
.L6:
	call	cpu_to_le32@PLT
	mov	esi, DWORD PTR R852_DMA_ADDR[rip]
	mov	rdi, rbp
	mov	edx, eax
	call	r852_write_reg_dword@PLT
	mov	esi, DWORD PTR R852_DMA_ADDR[rip]
	mov	rdi, rbp
	call	r852_read_reg_dword@PLT
	mov	esi, DWORD PTR R852_DMA_SETTINGS[rip]
	mov	edx, r12d
	mov	rdi, rbp
	call	r852_write_reg_dword@PLT
	mov	esi, DWORD PTR R852_DMA_IRQ_ENABLE[rip]
	mov	rdi, rbp
	call	r852_read_reg_dword@PLT
	mov	edx, DWORD PTR R852_DMA_IRQ_INTERNAL[rip]
	mov	esi, DWORD PTR R852_DMA_IRQ_ENABLE[rip]
	mov	rdi, rbp
	or	edx, DWORD PTR R852_DMA_IRQ_ERROR[rip]
	or	edx, DWORD PTR R852_DMA_IRQ_MEMORY[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	or	edx, eax
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	r852_write_reg_dword@PLT
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	or	ecx, eax
	mov	edi, DWORD PTR 12[rbp]
	mov	r12d, ecx
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	r852_dma_enable, .-r852_dma_enable
	.comm	R852_DMA_SETTINGS,4,4
	.comm	R852_DMA_READ,4,4
	.comm	R852_DMA_MEMORY,4,4
	.comm	R852_DMA_IRQ_MEMORY,4,4
	.comm	R852_DMA_IRQ_INTERNAL,4,4
	.comm	R852_DMA_IRQ_ERROR,4,4
	.comm	R852_DMA_IRQ_ENABLE,4,4
	.comm	R852_DMA_INTERNAL,4,4
	.comm	R852_DMA_ADDR,4,4
	.comm	DMA_INTERNAL,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_r852.c_r852_dma_enable.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	r852_dma_enable, %function
r852_dma_enable:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r7, .L11
	mov	r4, r0
	ldr	r1, [r7]
	bl	r852_read_reg_dword
	ldr	r1, .L11+4
	ldr	r2, .L11+8
	ldr	r3, .L11+12
	ldr	ip, [r1]
	ldr	r2, [r2]
	ldr	r5, [r3]
	ldr	r1, [r4, #12]
	orr	r3, r2, ip
	orr	r3, r3, r5
	bic	r3, r0, r3
	cmp	r1, #0
	orrne	r3, r3, r2
	ldr	r2, .L11+16
	ldr	r1, [r4]
	ldr	r2, [r2]
	ldr	r6, .L11+20
	cmp	r1, r2
	ldreq	r0, [r4, #8]
	ldrne	r0, [r4, #4]
	orreq	r5, ip, r3
	orrne	r5, r5, r3
	ldr	r8, [r6]
	bl	cpu_to_le32
	mov	r1, r8
	mov	r2, r0
	mov	r0, r4
	bl	r852_write_reg_dword
	ldr	r1, [r6]
	mov	r0, r4
	ldr	r6, .L11+24
	bl	r852_read_reg_dword
	mov	r2, r5
	ldr	r1, [r7]
	mov	r0, r4
	bl	r852_write_reg_dword
	ldr	r1, [r6]
	mov	r0, r4
	bl	r852_read_reg_dword
	mov	r2, r0
	ldr	r3, .L11+28
	ldr	r0, .L11+32
	ldr	r1, .L11+36
	ldr	r0, [r0]
	ldr	r3, [r3]
	ldr	r1, [r1]
	orr	r3, r3, r0
	orr	r3, r3, r1
	mov	r0, r4
	ldr	r1, [r6]
	orr	r2, r3, r2
	pop	{r4, r5, r6, r7, r8, lr}
	b	r852_write_reg_dword
.L12:
	.align	2
.L11:
	.word	R852_DMA_SETTINGS
	.word	R852_DMA_INTERNAL
	.word	R852_DMA_READ
	.word	R852_DMA_MEMORY
	.word	DMA_INTERNAL
	.word	R852_DMA_ADDR
	.word	R852_DMA_IRQ_ENABLE
	.word	R852_DMA_IRQ_INTERNAL
	.word	R852_DMA_IRQ_ERROR
	.word	R852_DMA_IRQ_MEMORY
	.size	r852_dma_enable, .-r852_dma_enable
	.comm	R852_DMA_SETTINGS,4,4
	.comm	R852_DMA_READ,4,4
	.comm	R852_DMA_MEMORY,4,4
	.comm	R852_DMA_IRQ_MEMORY,4,4
	.comm	R852_DMA_IRQ_INTERNAL,4,4
	.comm	R852_DMA_IRQ_ERROR,4,4
	.comm	R852_DMA_IRQ_ENABLE,4,4
	.comm	R852_DMA_INTERNAL,4,4
	.comm	R852_DMA_ADDR,4,4
	.comm	DMA_INTERNAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
