	.file	"extr_hermes.c_hermes_init.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	hermes_init, @function
hermes_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xor	edx, edx
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	DWORD PTR [rdi], 0
	mov	esi, DWORD PTR INTEN[rip]
	call	hermes_write_regn@PLT
	mov	esi, DWORD PTR EVACK[rip]
	mov	edx, 65535
	mov	rdi, rbp
	call	hermes_write_regn@PLT
	mov	ebx, DWORD PTR CMD_BUSY_TIMEOUT[rip]
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L24:
	test	DWORD PTR HERMES_CMD_BUSY[rip], eax
	je	.L3
	cmp	eax, 65535
	je	.L23
	mov	edi, 1
	sub	ebx, 1
	call	udelay@PLT
.L21:
	mov	esi, DWORD PTR CMD[rip]
	mov	rdi, rbp
	call	hermes_read_regn@PLT
	test	ebx, ebx
	jne	.L24
.L3:
	mov	esi, DWORD PTR EVSTAT[rip]
	mov	rdi, rbp
	call	hermes_read_regn@PLT
	mov	esi, DWORD PTR EVACK[rip]
	mov	rdi, rbp
	mov	edx, eax
	call	hermes_write_regn@PLT
	mov	esi, DWORD PTR HERMES_CMD_INIT[rip]
	mov	rdi, rbp
	xor	ecx, ecx
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	r9d, r9d
	xor	r8d, r8d
	xor	edx, edx
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	hermes_doicmd_wait@PLT
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	mov	eax, DWORD PTR ENODEV[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.cfi_endproc
.LFE0:
	.size	hermes_init, .-hermes_init
	.comm	INTEN,4,4
	.comm	HERMES_CMD_INIT,4,4
	.comm	HERMES_CMD_BUSY,4,4
	.comm	EVSTAT,4,4
	.comm	EVACK,4,4
	.comm	ENODEV,4,4
	.comm	CMD_BUSY_TIMEOUT,4,4
	.comm	CMD,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_hermes.c_hermes_init.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	hermes_init, %function
hermes_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r2, #0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r5, r0
	ldr	r3, .L20
	str	r2, [r0]
	ldr	r6, .L20+4
	ldr	r8, .L20+8
	ldr	r1, [r3]
	sub	sp, sp, #12
	bl	hermes_write_regn
	mov	r2, r6
	ldr	r1, [r8]
	mov	r0, r5
	bl	hermes_write_regn
	ldr	r3, .L20+12
	ldr	r7, .L20+16
	ldr	r4, [r3]
	mov	r0, r5
	ldr	r1, [r7]
	bl	hermes_read_regn
	cmp	r4, #0
	ldrne	r9, .L20+20
	bne	.L16
	b	.L4
.L19:
	cmp	r0, r6
	beq	.L18
	mov	r0, #1
	bl	udelay
	sub	r4, r4, #1
	mov	r0, r5
	ldr	r1, [r7]
	bl	hermes_read_regn
	cmp	r4, #0
	beq	.L4
.L16:
	ldr	r3, [r9]
	tst	r0, r3
	bne	.L19
.L4:
	ldr	r3, .L20+24
	mov	r0, r5
	ldr	r1, [r3]
	bl	hermes_read_regn
	ldr	r1, [r8]
	mov	r2, r0
	mov	r0, r5
	bl	hermes_write_regn
	mov	r3, #0
	ldr	r1, .L20+28
	str	r3, [sp, #4]
	str	r3, [sp]
	mov	r0, r5
	mov	r2, r3
	ldr	r1, [r1]
	bl	hermes_doicmd_wait
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L18:
	ldr	r3, .L20+32
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L21:
	.align	2
.L20:
	.word	INTEN
	.word	65535
	.word	EVACK
	.word	CMD_BUSY_TIMEOUT
	.word	CMD
	.word	HERMES_CMD_BUSY
	.word	EVSTAT
	.word	HERMES_CMD_INIT
	.word	ENODEV
	.size	hermes_init, .-hermes_init
	.comm	INTEN,4,4
	.comm	HERMES_CMD_INIT,4,4
	.comm	HERMES_CMD_BUSY,4,4
	.comm	EVSTAT,4,4
	.comm	EVACK,4,4
	.comm	ENODEV,4,4
	.comm	CMD_BUSY_TIMEOUT,4,4
	.comm	CMD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
