	.file	"extr_apex_driver.c_apex_enter_reset.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"DMAs did not quiesce within timeout (%d ms)\n"
	.align 8
.LC1:
	.string	"RAM did not shut down within timeout (%d ms)\n"
	.text
	.p2align 4
	.type	apex_enter_reset, @function
apex_enter_reset:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	QWORD PTR bypass_top_level[rip], 0
	je	.L2
	xor	eax, eax
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r9d, 32
	mov	r8d, 1
	xor	ecx, ecx
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	edx, DWORD PTR APEX_BAR2_REG_IDLEGENERATOR_IDLEGEN_IDLEREGISTER[rip]
	mov	esi, DWORD PTR APEX_BAR_INDEX[rip]
	call	gasket_read_modify_write_64@PLT
	mov	ecx, DWORD PTR APEX_BAR2_REG_USER_HIB_DMA_PAUSE[rip]
	mov	esi, 1
	mov	rdi, rbx
	mov	edx, DWORD PTR APEX_BAR_INDEX[rip]
	call	gasket_dev_write_64@PLT
	mov	eax, DWORD PTR APEX_RESET_RETRY[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	mov	esi, DWORD PTR APEX_BAR_INDEX[rip]
	mov	r9d, DWORD PTR APEX_RESET_DELAY[rip]
	mov	edx, DWORD PTR APEX_BAR2_REG_USER_HIB_DMA_PAUSED[rip]
	mov	rdi, rbx
	mov	r8d, 1
	push	rax
	.cfi_def_cfa_offset 64
	mov	ecx, 1
	call	gasket_wait_with_reschedule@PLT
	pop	rsi
	.cfi_def_cfa_offset 56
	pop	rdi
	.cfi_def_cfa_offset 48
	test	rax, rax
	jne	.L13
	mov	edx, DWORD PTR APEX_BAR2_REG_SCU_2[rip]
	mov	esi, DWORD PTR APEX_BAR_INDEX[rip]
	mov	ecx, 1
	mov	r9d, 2
	mov	r8d, 2
	mov	rdi, rbx
	call	gasket_read_modify_write_32@PLT
	mov	edx, DWORD PTR APEX_BAR2_REG_SCU_2[rip]
	mov	ecx, 1
	mov	esi, DWORD PTR APEX_BAR_INDEX[rip]
	mov	r9d, 18
	mov	r8d, 2
	mov	rdi, rbx
	call	gasket_read_modify_write_32@PLT
	mov	edx, DWORD PTR APEX_BAR2_REG_SCU_3[rip]
	mov	ecx, 3
	mov	esi, DWORD PTR APEX_BAR_INDEX[rip]
	mov	r9d, 14
	mov	r8d, 2
	mov	rdi, rbx
	call	gasket_read_modify_write_32@PLT
	mov	edi, 6
	mov	r13d, DWORD PTR APEX_RESET_RETRY[rip]
	mov	r12d, DWORD PTR APEX_RESET_DELAY[rip]
	call	BIT@PLT
	mov	edi, 6
	mov	ebp, eax
	call	BIT@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	mov	r9d, r12d
	mov	r8d, ebp
	push	r13
	.cfi_def_cfa_offset 64
	mov	edx, DWORD PTR APEX_BAR2_REG_SCU_3[rip]
	mov	ecx, eax
	mov	rdi, rbx
	mov	esi, DWORD PTR APEX_BAR_INDEX[rip]
	call	gasket_wait_with_reschedule@PLT
	pop	rdx
	.cfi_def_cfa_offset 56
	pop	rcx
	.cfi_def_cfa_offset 48
	test	rax, rax
	jne	.L14
	xor	eax, eax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	edx, DWORD PTR APEX_RESET_RETRY[rip]
	mov	edi, DWORD PTR [rbx]
	lea	rsi, .LC0[rip]
	imul	edx, DWORD PTR APEX_RESET_DELAY[rip]
	call	dev_err@PLT
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	neg	eax
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	edx, DWORD PTR APEX_RESET_RETRY[rip]
	mov	edi, DWORD PTR [rbx]
	lea	rsi, .LC1[rip]
	imul	edx, DWORD PTR APEX_RESET_DELAY[rip]
	call	dev_err@PLT
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	neg	eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	apex_enter_reset, .-apex_enter_reset
	.comm	bypass_top_level,8,8
	.comm	ETIMEDOUT,4,4
	.comm	APEX_RESET_RETRY,4,4
	.comm	APEX_RESET_DELAY,4,4
	.comm	APEX_BAR_INDEX,4,4
	.comm	APEX_BAR2_REG_USER_HIB_DMA_PAUSED,4,4
	.comm	APEX_BAR2_REG_USER_HIB_DMA_PAUSE,4,4
	.comm	APEX_BAR2_REG_SCU_3,4,4
	.comm	APEX_BAR2_REG_SCU_2,4,4
	.comm	APEX_BAR2_REG_IDLEGENERATOR_IDLEGEN_IDLEREGISTER,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_apex_driver.c_apex_enter_reset.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"DMAs did not quiesce within timeout (%d ms)\012\000"
	.align	2
.LC1:
	.ascii	"RAM did not shut down within timeout (%d ms)\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	apex_enter_reset, %function
apex_enter_reset:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L15
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L2
	mov	r0, #0
	bx	lr
.L2:
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r1, #32
	mov	r6, #1
	mov	r4, r0
	sub	sp, sp, #16
	ldr	r5, .L15+4
	ldr	r2, .L15+8
	str	r1, [sp, #4]
	str	r6, [sp]
	ldr	r2, [r2]
	ldr	r1, [r5]
	bl	gasket_read_modify_write_64
	ldr	r3, .L15+12
	ldr	r9, .L15+16
	ldr	r8, .L15+20
	mov	r1, r6
	ldr	r2, [r5]
	ldr	r3, [r3]
	mov	r0, r4
	bl	gasket_dev_write_64
	ldr	r1, [r9]
	ldr	r3, [r8]
	ldr	r2, .L15+24
	str	r3, [sp, #4]
	str	r6, [sp]
	str	r1, [sp, #8]
	mov	r3, r6
	mov	r0, r4
	ldr	r1, [r5]
	ldr	r2, [r2]
	bl	gasket_wait_with_reschedule
	cmp	r0, #0
	bne	.L13
	mov	r7, #2
	ldr	r10, .L15+28
	str	r7, [sp, #4]
	str	r7, [sp]
	mov	r3, r6
	ldr	r1, [r5]
	ldr	r2, [r10]
	mov	r0, r4
	bl	gasket_read_modify_write_32
	mov	r1, #18
	str	r7, [sp]
	str	r1, [sp, #4]
	mov	r3, r6
	ldr	r1, [r5]
	ldr	r2, [r10]
	mov	r0, r4
	bl	gasket_read_modify_write_32
	mov	r3, #14
	ldr	r6, .L15+32
	str	r7, [sp]
	str	r3, [sp, #4]
	ldr	r2, [r6]
	ldr	r1, [r5]
	mov	r3, #3
	mov	r0, r4
	bl	gasket_read_modify_write_32
	mov	r0, #6
	ldr	r7, [r6]
	ldr	r6, [r5]
	bl	BIT
	mov	r5, r0
	mov	r0, #6
	bl	BIT
	ldr	lr, [r9]
	ldr	ip, [r8]
	mov	r3, r5
	stm	sp, {r0, ip, lr}
	mov	r2, r7
	mov	r1, r6
	mov	r0, r4
	bl	gasket_wait_with_reschedule
	cmp	r0, #0
	moveq	r0, #0
	bne	.L14
.L1:
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	ldr	r3, [r9]
	ldr	r2, [r8]
	ldr	r0, [r4]
	mul	r2, r3, r2
	ldr	r1, .L15+36
	bl	dev_err
	ldr	r3, .L15+40
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L14:
	ldr	r3, [r9]
	ldr	r2, [r8]
	ldr	r0, [r4]
	mul	r2, r3, r2
	ldr	r1, .L15+44
	bl	dev_err
	ldr	r3, .L15+40
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L16:
	.align	2
.L15:
	.word	bypass_top_level
	.word	APEX_BAR_INDEX
	.word	APEX_BAR2_REG_IDLEGENERATOR_IDLEGEN_IDLEREGISTER
	.word	APEX_BAR2_REG_USER_HIB_DMA_PAUSE
	.word	APEX_RESET_RETRY
	.word	APEX_RESET_DELAY
	.word	APEX_BAR2_REG_USER_HIB_DMA_PAUSED
	.word	APEX_BAR2_REG_SCU_2
	.word	APEX_BAR2_REG_SCU_3
	.word	.LC0
	.word	ETIMEDOUT
	.word	.LC1
	.size	apex_enter_reset, .-apex_enter_reset
	.comm	bypass_top_level,4,4
	.comm	ETIMEDOUT,4,4
	.comm	APEX_RESET_RETRY,4,4
	.comm	APEX_RESET_DELAY,4,4
	.comm	APEX_BAR_INDEX,4,4
	.comm	APEX_BAR2_REG_USER_HIB_DMA_PAUSED,4,4
	.comm	APEX_BAR2_REG_USER_HIB_DMA_PAUSE,4,4
	.comm	APEX_BAR2_REG_SCU_3,4,4
	.comm	APEX_BAR2_REG_SCU_2,4,4
	.comm	APEX_BAR2_REG_IDLEGENERATOR_IDLEGEN_IDLEREGISTER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
