	.file	"extr_psycho_common.c_psycho_iommu_init.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	psycho_iommu_init
	.type	psycho_iommu_init, @function
psycho_iommu_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14d, ecx
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, edx
	mov	rdx, QWORD PTR PSYCHO_IOMMU_TSBBASE[rip]
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rax, QWORD PTR 8[rdi]
	mov	rbx, QWORD PTR 16[rdi]
	mov	rdi, QWORD PTR PSYCHO_IOMMU_CONTROL[rip]
	add	rdx, rax
	mov	QWORD PTR 8[rbx], rdx
	mov	rdx, QWORD PTR PSYCHO_IOMMU_FLUSH[rip]
	add	rdi, rax
	mov	QWORD PTR [rbx], rdi
	add	rdx, rax
	mov	QWORD PTR 24[rbx], 0
	mov	QWORD PTR 48[rbx], rdx
	mov	rdx, QWORD PTR PSYCHO_IOMMU_TAG[rip]
	add	rdx, rax
	add	rax, r8
	mov	QWORD PTR 40[rbx], rdx
	mov	QWORD PTR 32[rbx], rax
	call	upa_readq@PLT
	mov	rsi, QWORD PTR [rbx]
	or	eax, DWORD PTR PSYCHO_IOMMU_CTRL_DENAB[rip]
	mov	edi, eax
	call	upa_writeq@PLT
	mov	rdi, rbp
	call	psycho_iommu_flush@PLT
	mov	r8d, DWORD PTR 0[rbp]
	mov	esi, r13d
	mov	edx, r12d
	sal	esi, 13
	mov	ecx, r14d
	mov	rdi, rbx
	call	iommu_table_init@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L10
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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	edi, DWORD PTR 16[rbx]
	mov	rbp, QWORD PTR 8[rbx]
	call	__pa@PLT
	mov	rsi, rbp
	mov	edi, eax
	call	upa_writeq@PLT
	mov	rdi, QWORD PTR [rbx]
	call	upa_readq@PLT
	mov	r8d, eax
	mov	eax, DWORD PTR PSYCHO_IOMMU_CTRL_TSBSZ[rip]
	or	eax, DWORD PTR PSYCHO_IOMMU_CTRL_TBWSZ[rip]
	not	eax
	and	eax, r8d
	or	eax, DWORD PTR PSYCHO_IOMMU_CTRL_ENAB[rip]
	cmp	r13d, 64
	je	.L3
	cmp	r13d, 128
	je	.L4
	mov	r12d, DWORD PTR EINVAL[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	neg	r12d
	mov	eax, r12d
	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
.L3:
	.cfi_restore_state
	or	eax, DWORD PTR PSYCHO_IOMMU_TSBSZ_64K[rip]
	mov	edi, eax
.L6:
	mov	rsi, QWORD PTR [rbx]
	call	upa_writeq@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L4:
	.cfi_restore_state
	or	eax, DWORD PTR PSYCHO_IOMMU_TSBSZ_128K[rip]
	mov	edi, eax
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	psycho_iommu_init, .-psycho_iommu_init
	.comm	PSYCHO_IOMMU_TSBSZ_64K,4,4
	.comm	PSYCHO_IOMMU_TSBSZ_128K,4,4
	.comm	PSYCHO_IOMMU_TSBBASE,8,8
	.comm	PSYCHO_IOMMU_TAG,8,8
	.comm	PSYCHO_IOMMU_FLUSH,8,8
	.comm	PSYCHO_IOMMU_CTRL_TSBSZ,4,4
	.comm	PSYCHO_IOMMU_CTRL_TBWSZ,4,4
	.comm	PSYCHO_IOMMU_CTRL_ENAB,4,4
	.comm	PSYCHO_IOMMU_CTRL_DENAB,4,4
	.comm	PSYCHO_IOMMU_CONTROL,8,8
	.comm	EINVAL,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_psycho_common.c_psycho_iommu_init.c"
	.text
	.align	2
	.global	psycho_iommu_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	psycho_iommu_init, %function
psycho_iommu_init:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	mov	lr, #0
	ldr	r4, .L11
	ldr	r6, .L11+4
	ldr	ip, [r5, #4]
	ldr	r7, [r4]
	ldr	r8, [r6]
	ldr	r4, [r5, #8]
	ldr	r0, .L11+8
	ldr	r6, .L11+12
	sub	sp, sp, #8
	add	r7, r7, ip
	ldr	r0, [r0]
	ldr	r6, [r6]
	str	r7, [r4, #24]
	ldr	r7, [sp, #32]
	add	r0, ip, r0
	add	r8, r8, ip
	add	r6, r6, ip
	add	ip, ip, r7
	str	ip, [r4, #16]
	str	lr, [r4, #12]
	stm	r4, {r0, r8}
	str	r6, [r4, #20]
	mov	r8, r2
	mov	r7, r1
	mov	r6, r3
	bl	upa_readq
	ldr	r3, .L11+16
	ldr	r1, [r4]
	ldr	r3, [r3]
	orr	r0, r0, r3
	bl	upa_writeq
	mov	r0, r5
	bl	psycho_iommu_flush
	ldr	r2, [r5]
	mov	r3, r6
	str	r2, [sp]
	mov	r0, r4
	mov	r2, r8
	lsl	r1, r7, #13
	bl	iommu_table_init
	subs	r5, r0, #0
	beq	.L10
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	ldr	r0, [r4, #8]
	bl	__pa
	ldr	r1, [r4, #4]
	bl	upa_writeq
	ldr	r0, [r4]
	bl	upa_readq
	ldr	r2, .L11+20
	ldr	r3, .L11+24
	ldr	r1, [r2]
	ldr	r3, [r3]
	ldr	r2, .L11+28
	orr	r3, r3, r1
	ldr	r2, [r2]
	bic	r0, r0, r3
	cmp	r7, #64
	orr	r0, r0, r2
	beq	.L3
	cmp	r7, #128
	beq	.L4
	ldr	r3, .L11+32
	ldr	r0, [r3]
	rsb	r5, r0, #0
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L3:
	ldr	r3, .L11+36
	ldr	r3, [r3]
	orr	r0, r0, r3
.L6:
	ldr	r1, [r4]
	bl	upa_writeq
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	ldr	r3, .L11+40
	ldr	r3, [r3]
	orr	r0, r0, r3
	b	.L6
.L12:
	.align	2
.L11:
	.word	PSYCHO_IOMMU_FLUSH
	.word	PSYCHO_IOMMU_TSBBASE
	.word	PSYCHO_IOMMU_CONTROL
	.word	PSYCHO_IOMMU_TAG
	.word	PSYCHO_IOMMU_CTRL_DENAB
	.word	PSYCHO_IOMMU_CTRL_TBWSZ
	.word	PSYCHO_IOMMU_CTRL_TSBSZ
	.word	PSYCHO_IOMMU_CTRL_ENAB
	.word	EINVAL
	.word	PSYCHO_IOMMU_TSBSZ_64K
	.word	PSYCHO_IOMMU_TSBSZ_128K
	.size	psycho_iommu_init, .-psycho_iommu_init
	.comm	PSYCHO_IOMMU_TSBSZ_64K,4,4
	.comm	PSYCHO_IOMMU_TSBSZ_128K,4,4
	.comm	PSYCHO_IOMMU_TSBBASE,4,4
	.comm	PSYCHO_IOMMU_TAG,4,4
	.comm	PSYCHO_IOMMU_FLUSH,4,4
	.comm	PSYCHO_IOMMU_CTRL_TSBSZ,4,4
	.comm	PSYCHO_IOMMU_CTRL_TBWSZ,4,4
	.comm	PSYCHO_IOMMU_CTRL_ENAB,4,4
	.comm	PSYCHO_IOMMU_CTRL_DENAB,4,4
	.comm	PSYCHO_IOMMU_CONTROL,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
