	.file	"extr_memory.c_hl_mem_ioctl.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"in_reset"
.LC1:
	.string	"disabled"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"Device is %s. Can't execute MEMORY IOCTL\n"
	.section	.rodata.str1.1
.LC3:
	.string	"DRAM alloc is not supported\n"
	.section	.rodata.str1.8
	.align 8
.LC4:
	.string	"alloc size must be larger than 0\n"
	.align 8
.LC5:
	.string	"Unknown opcode for memory IOCTL\n"
	.text
	.p2align 4
	.globl	hl_mem_ioctl
	.type	hl_mem_ioctl, @function
hl_mem_ioctl:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	r13, QWORD PTR 8[rdi]
	mov	r14, QWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	DWORD PTR [rsp], 0
	mov	rdi, r13
	mov	DWORD PTR 4[rsp], 0
	call	hl_device_disabled_or_in_reset@PLT
	test	rax, rax
	jne	.L17
	mov	ecx, DWORD PTR 8[r13]
	test	ecx, ecx
	je	.L18
	mov	eax, DWORD PTR [r12]
	cmp	eax, 130
	je	.L6
	jg	.L7
	cmp	eax, 128
	je	.L8
	cmp	eax, 129
	jne	.L10
	mov	rdx, rsp
	mov	rsi, r12
	mov	rdi, r14
	call	map_device_va@PLT
	mov	edx, 16
	xor	esi, esi
	mov	rdi, r12
	mov	r13d, eax
	call	memset@PLT
	mov	eax, DWORD PTR [rsp]
	mov	DWORD PTR [r12], eax
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L19
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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
.L7:
	.cfi_restore_state
	cmp	eax, 131
	jne	.L10
	mov	edx, DWORD PTR 4[r13]
	test	edx, edx
	je	.L20
	mov	eax, DWORD PTR 12[r12]
	test	eax, eax
	je	.L21
	lea	rdx, 4[rsp]
	mov	rsi, r12
	mov	rdi, r14
	call	alloc_device_memory@PLT
	mov	edx, 16
	xor	esi, esi
	mov	rdi, r12
	mov	r13d, eax
	call	memset@PLT
	mov	eax, DWORD PTR 4[rsp]
	mov	DWORD PTR 4[r12], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	lea	rdi, 12[r13]
	call	atomic_read@PLT
	lea	rdx, .LC0[rip]
	mov	edi, DWORD PTR 0[r13]
	lea	rsi, .LC2[rip]
	test	rax, rax
	lea	rax, .LC1[rip]
	cmove	rdx, rax
	call	dev_warn_ratelimited@PLT
	mov	r13d, DWORD PTR EBUSY[rip]
	neg	r13d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	mov	esi, DWORD PTR 4[r12]
	mov	rdi, r14
	call	unmap_device_va@PLT
	mov	r13d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	mov	edi, DWORD PTR 0[r13]
	lea	rsi, .LC5[rip]
	call	dev_err@PLT
	mov	r13d, DWORD PTR ENOTTY[rip]
	neg	r13d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rsi, r12
	mov	rdi, rbp
	call	mem_ioctl_no_mmu@PLT
	mov	r13d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	esi, DWORD PTR 8[r12]
	mov	rdi, r14
	call	free_device_memory@PLT
	mov	r13d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	mov	edi, DWORD PTR 0[r13]
	lea	rsi, .LC4[rip]
	call	dev_err@PLT
	mov	r13d, DWORD PTR EINVAL[rip]
	neg	r13d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	mov	edi, DWORD PTR 0[r13]
	lea	rsi, .LC3[rip]
	call	dev_err@PLT
	mov	r13d, DWORD PTR EINVAL[rip]
	neg	r13d
	jmp	.L1
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	hl_mem_ioctl, .-hl_mem_ioctl
	.comm	ENOTTY,4,4
	.comm	EINVAL,4,4
	.comm	EBUSY,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_memory.c_hl_mem_ioctl.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"in_reset\000"
	.align	2
.LC1:
	.ascii	"disabled\000"
	.align	2
.LC2:
	.ascii	"Device is %s. Can't execute MEMORY IOCTL\012\000"
	.align	2
.LC3:
	.ascii	"DRAM alloc is not supported\012\000"
	.align	2
.LC4:
	.ascii	"alloc size must be larger than 0\012\000"
	.align	2
.LC5:
	.ascii	"Unknown opcode for memory IOCTL\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	hl_mem_ioctl
	.syntax unified
	.arm
	.fpu softvfp
	.type	hl_mem_ioctl, %function
hl_mem_ioctl:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r3, #0
	mov	r4, r0
	ldr	r6, [r0, #4]
	ldr	r2, .L23
	sub	sp, sp, #20
	mov	r0, r6
	ldr	r2, [r2]
	str	r2, [sp, #12]
	mov	r2,#0
	mov	r5, r1
	ldr	r7, [r4]
	str	r3, [sp, #4]
	str	r3, [sp, #8]
	bl	hl_device_disabled_or_in_reset
	cmp	r0, #0
	bne	.L18
	ldr	r3, [r6, #8]
	cmp	r3, #0
	beq	.L19
	ldr	r3, [r5]
	sub	r3, r3, #128
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L6
.L8:
	.word	.L11
	.word	.L10
	.word	.L9
	.word	.L7
.L18:
	mov	r0, r6
	ldr	r4, [r0], #12
	bl	atomic_read
	mov	r1, r0
	ldr	r3, .L23+4
	cmp	r1, #0
	mov	r0, r4
	ldr	r2, .L23+8
	ldr	r1, .L23+12
	moveq	r2, r3
	bl	dev_warn_ratelimited
	ldr	r3, .L23+16
	ldr	r4, [r3]
	rsb	r4, r4, #0
.L1:
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L20
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L7:
	ldr	r3, [r6, #4]
	cmp	r3, #0
	beq	.L21
	ldr	r3, [r5, #12]
	cmp	r3, #0
	beq	.L22
	mov	r1, r5
	add	r2, sp, #8
	mov	r0, r7
	bl	alloc_device_memory
	mov	r2, #16
	mov	r4, r0
	mov	r1, #0
	mov	r0, r5
	bl	memset
	ldr	r3, [sp, #8]
	str	r3, [r5, #4]
	b	.L1
.L11:
	mov	r0, r7
	ldr	r1, [r5, #4]
	bl	unmap_device_va
	mov	r4, r0
	b	.L1
.L10:
	mov	r1, r5
	add	r2, sp, #4
	mov	r0, r7
	bl	map_device_va
	mov	r2, #12
	mov	r4, r0
	mov	r1, #0
	add	r0, r5, #4
	bl	memset
	ldr	r3, [sp, #4]
	str	r3, [r5]
	b	.L1
.L9:
	mov	r0, r7
	ldr	r1, [r5, #8]
	bl	free_device_memory
	mov	r4, r0
	b	.L1
.L19:
	mov	r0, r4
	mov	r1, r5
	bl	mem_ioctl_no_mmu
	mov	r4, r0
	b	.L1
.L22:
	ldr	r0, [r6]
	ldr	r1, .L23+20
	bl	dev_err
	ldr	r3, .L23+24
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L21:
	ldr	r0, [r6]
	ldr	r1, .L23+28
	bl	dev_err
	ldr	r3, .L23+24
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L20:
	bl	__stack_chk_fail
.L6:
	ldr	r0, [r6]
	ldr	r1, .L23+32
	bl	dev_err
	ldr	r3, .L23+36
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L24:
	.align	2
.L23:
	.word	.LC6
	.word	.LC1
	.word	.LC0
	.word	.LC2
	.word	EBUSY
	.word	.LC4
	.word	EINVAL
	.word	.LC3
	.word	.LC5
	.word	ENOTTY
	.size	hl_mem_ioctl, .-hl_mem_ioctl
	.comm	ENOTTY,4,4
	.comm	EINVAL,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
