	.file	"extr_rcar_jpu.c_jpu_open.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	jpu_open, @function
jpu_open:
.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, rdi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	video_drvdata@PLT
	mov	rdi, r12
	mov	rbx, rax
	call	video_devdata@PLT
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	mov	edi, 56
	mov	r14, rax
	call	kzalloc@PLT
	test	rax, rax
	je	.L12
	lea	r13, 8[rax]
	mov	rbp, rax
	mov	rsi, r14
	mov	rdi, r13
	call	v4l2_fh_init@PLT
	lea	rax, 48[rbp]
	mov	rdi, r13
	mov	QWORD PTR 16[rbp], rax
	mov	QWORD PTR [r12], r13
	call	v4l2_fh_add@PLT
	lea	rax, 20[rbx]
	mov	QWORD PTR 40[rbp], rbx
	mov	rdi, rbp
	cmp	r14, rax
	mov	ecx, DWORD PTR V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE[rip]
	lea	rdx, 32[rbp]
	lea	rsi, 36[rbp]
	sete	al
	movzx	eax, al
	mov	DWORD PTR 0[rbp], eax
	call	__jpu_try_fmt@PLT
	lea	rdx, 24[rbp]
	lea	rsi, 28[rbp]
	mov	rdi, rbp
	mov	ecx, DWORD PTR V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE[rip]
	call	__jpu_try_fmt@PLT
	mov	edi, DWORD PTR 16[rbx]
	mov	edx, DWORD PTR jpu_queue_init[rip]
	mov	rsi, rbp
	call	v4l2_m2m_ctx_init@PLT
	mov	DWORD PTR 8[rbp], eax
	mov	edi, eax
	call	IS_ERR@PLT
	test	rax, rax
	jne	.L13
	mov	rdi, rbp
	call	jpu_controls_create@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L5
	lea	r14, 8[rbx]
	mov	rdi, r14
	call	mutex_lock_interruptible@PLT
	mov	r12d, DWORD PTR ERESTARTSYS[rip]
	neg	r12d
	test	rax, rax
	jne	.L5
	mov	rax, QWORD PTR [rbx]
	test	rax, rax
	jne	.L7
	mov	edi, DWORD PTR 12[rbx]
	call	clk_prepare_enable@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L8
	mov	rdi, rbx
	call	jpu_reset@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L9
	mov	rax, QWORD PTR [rbx]
.L7:
	add	rax, 1
	mov	rdi, r14
	xor	r12d, r12d
	mov	QWORD PTR [rbx], rax
	call	mutex_unlock@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
.L13:
	.cfi_restore_state
	mov	edi, DWORD PTR 8[rbp]
	call	PTR_ERR@PLT
	mov	r12d, eax
.L5:
	mov	rdi, r13
	call	v4l2_fh_del@PLT
	mov	rdi, r13
	call	v4l2_fh_exit@PLT
	mov	rdi, rbp
	call	kfree@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
.L12:
	.cfi_restore_state
	mov	r12d, DWORD PTR ENOMEM[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
.L9:
	.cfi_restore_state
	mov	edi, DWORD PTR 12[rbx]
	call	clk_disable_unprepare@PLT
.L8:
	mov	rdi, r14
	call	mutex_unlock@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	jpu_open, .-jpu_open
	.comm	jpu_queue_init,4,4
	.comm	V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,4,4
	.comm	V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ERESTARTSYS,4,4
	.comm	ENOMEM,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_rcar_jpu.c_jpu_open.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	jpu_open, %function
jpu_open:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r8, r0
	bl	video_drvdata
	mov	r5, r0
	mov	r0, r8
	bl	video_devdata
	ldr	r3, .L15
	mov	r6, r0
	ldr	r1, [r3]
	mov	r0, #36
	bl	kzalloc
	subs	r4, r0, #0
	beq	.L12
	add	r7, r4, #4
	mov	r1, r6
	mov	r0, r7
	bl	v4l2_fh_init
	add	r3, r4, #32
	str	r3, [r4, #8]
	mov	r0, r7
	str	r7, [r8]
	bl	v4l2_fh_add
	add	r3, r5, #16
	sub	r6, r6, r3
	clz	r6, r6
	mov	r2, r4
	ldr	r3, .L15+4
	lsr	r6, r6, #5
	ldr	r3, [r3]
	str	r5, [r4, #28]
	add	r1, r4, #24
	str	r6, [r2], #20
	mov	r0, r4
	bl	__jpu_try_fmt
	ldr	r3, .L15+8
	add	r2, r4, #12
	ldr	r3, [r3]
	add	r1, r4, #16
	mov	r0, r4
	bl	__jpu_try_fmt
	ldr	r3, .L15+12
	mov	r1, r4
	ldr	r2, [r3]
	ldr	r0, [r5, #12]
	bl	v4l2_m2m_ctx_init
	str	r0, [r4, #4]
	bl	IS_ERR
	cmp	r0, #0
	bne	.L13
	mov	r0, r4
	bl	jpu_controls_create
	subs	r6, r0, #0
	blt	.L5
	add	r8, r5, #4
	mov	r0, r8
	bl	mutex_lock_interruptible
	subs	r6, r0, #0
	bne	.L14
	ldr	r3, [r5]
	cmp	r3, #0
	bne	.L7
	ldr	r0, [r5, #8]
	bl	clk_prepare_enable
	subs	r9, r0, #0
	blt	.L8
	mov	r0, r5
	bl	jpu_reset
	subs	r9, r0, #0
	bne	.L9
	ldr	r3, [r5]
.L7:
	add	r3, r3, #1
	mov	r0, r8
	str	r3, [r5]
	bl	mutex_unlock
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	ldr	r0, [r4, #4]
	bl	PTR_ERR
	mov	r6, r0
.L5:
	mov	r0, r7
	bl	v4l2_fh_del
	mov	r0, r7
	bl	v4l2_fh_exit
	mov	r0, r4
	bl	kfree
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L12:
	ldr	r3, .L15+16
	ldr	r6, [r3]
	rsb	r6, r6, #0
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L14:
	ldr	r3, .L15+20
	ldr	r6, [r3]
	rsb	r6, r6, #0
	b	.L5
.L9:
	ldr	r0, [r5, #8]
	bl	clk_disable_unprepare
.L8:
	mov	r0, r8
	bl	mutex_unlock
	mov	r6, r9
	b	.L5
.L16:
	.align	2
.L15:
	.word	GFP_KERNEL
	.word	V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
	.word	V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.word	jpu_queue_init
	.word	ENOMEM
	.word	ERESTARTSYS
	.size	jpu_open, .-jpu_open
	.comm	jpu_queue_init,4,4
	.comm	V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,4,4
	.comm	V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ERESTARTSYS,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
