	.file	"extr_camera.c_gb_camera_configure_streams.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	gb_camera_configure_streams, @function
gb_camera_configure_streams:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 88
	.cfi_def_cfa_offset 144
	mov	r14d, DWORD PTR [rsi]
	mov	QWORD PTR 16[rsp], rdi
	mov	QWORD PTR 40[rsp], rsi
	mov	QWORD PTR 32[rsp], rdx
	mov	QWORD PTR 24[rsp], rcx
	mov	QWORD PTR 48[rsp], r8
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 72[rsp], rax
	xor	eax, eax
	cmp	DWORD PTR GB_CAMERA_MAX_STREAMS[rip], r14d
	jnb	.L2
	mov	r15d, DWORD PTR EINVAL[rip]
	neg	r15d
.L1:
	mov	rax, QWORD PTR 72[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L33
	add	rsp, 88
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edx, r14d
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	lea	rax, 0[0+rdx*8]
	sub	rax, rdx
	lea	rax, 24[0+rax*8]
	mov	rdi, rax
	mov	QWORD PTR 56[rsp], rax
	mov	QWORD PTR 64[rsp], rax
	call	kmalloc@PLT
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	mov	rdi, QWORD PTR 64[rsp]
	mov	rbp, rax
	call	kmalloc@PLT
	mov	r13, rax
	test	rbp, rbp
	je	.L24
	test	rax, rax
	je	.L24
	mov	rax, QWORD PTR 32[rsp]
	mov	DWORD PTR 0[rbp], r14d
	mov	eax, DWORD PTR [rax]
	mov	QWORD PTR 16[rbp], 0
	mov	DWORD PTR 4[rbp], eax
	test	r14d, r14d
	je	.L10
	lea	eax, -1[r14]
	mov	rdx, QWORD PTR 24[rsp]
	xor	r12d, r12d
	lea	rax, [rax+rax*2]
	sal	rax, 4
	lea	r15, 24[rdx]
	lea	rax, 72[rdx+rax]
	mov	QWORD PTR 8[rsp], rax
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdi, QWORD PTR 16[r15]
	mov	rbx, QWORD PTR 8[rbp]
	add	r15, 48
	call	cpu_to_le16@PLT
	add	rbx, r12
	add	r12, 56
	mov	QWORD PTR 40[rbx], rax
	mov	rdi, QWORD PTR -40[r15]
	call	cpu_to_le16@PLT
	mov	QWORD PTR 32[rbx], rax
	mov	rdi, QWORD PTR -48[r15]
	call	cpu_to_le16@PLT
	mov	QWORD PTR 48[rbx], 0
	mov	QWORD PTR 24[rbx], rax
	cmp	QWORD PTR 8[rsp], r15
	jne	.L9
.L10:
	mov	rbx, QWORD PTR 16[rsp]
	lea	r12, 8[rbx]
	mov	rdi, r12
	call	mutex_lock@PLT
	mov	edi, DWORD PTR 12[rbx]
	call	gb_pm_runtime_get_sync@PLT
	mov	r15d, eax
	test	eax, eax
	jne	.L7
	mov	rax, QWORD PTR 16[rsp]
	mov	edi, DWORD PTR 16[rax]
	test	edi, edi
	jne	.L11
	mov	r15d, DWORD PTR EINVAL[rip]
	mov	edi, DWORD PTR 12[rax]
	neg	r15d
.L12:
	call	gb_pm_runtime_put_autosuspend@PLT
.L7:
	mov	rdi, r12
	call	mutex_unlock@PLT
	mov	rdi, rbp
	call	kfree@PLT
	mov	rdi, r13
	call	kfree@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	sub	rsp, 8
	.cfi_def_cfa_offset 152
	mov	esi, DWORD PTR GB_CAMERA_TYPE_CONFIGURE_STREAMS[rip]
	mov	r9, r13
	mov	rcx, rbp
	lea	rax, 72[rsp]
	mov	edx, DWORD PTR GB_OPERATION_FLAG_SHORT_RESPONSE[rip]
	push	rax
	.cfi_def_cfa_offset 160
	mov	r8, QWORD PTR 72[rsp]
	call	gb_camera_operation_sync_flags@PLT
	pop	rsi
	.cfi_def_cfa_offset 152
	pop	rdi
	.cfi_def_cfa_offset 144
	mov	r15d, eax
	test	eax, eax
	js	.L16
	mov	rdi, QWORD PTR 16[rsp]
	mov	edx, r14d
	mov	rsi, r13
	call	gb_camera_configure_streams_validate_response@PLT
	mov	r15d, eax
	test	eax, eax
	js	.L16
	mov	eax, DWORD PTR 4[r13]
	mov	rcx, QWORD PTR 32[rsp]
	xor	edx, edx
	mov	DWORD PTR [rcx], eax
	mov	rcx, QWORD PTR 40[rsp]
	mov	eax, DWORD PTR 0[r13]
	mov	DWORD PTR [rcx], eax
	mov	ecx, DWORD PTR 0[r13]
	test	ecx, ecx
	je	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	mov	eax, edx
	mov	rsi, QWORD PTR 8[r13]
	mov	DWORD PTR 8[rsp], edx
	lea	rcx, 0[0+rax*8]
	lea	rbx, [rax+rax*2]
	sub	rcx, rax
	sal	rbx, 4
	add	rbx, QWORD PTR 24[rsp]
	lea	r14, [rsi+rcx*8]
	mov	rdi, QWORD PTR 40[r14]
	call	le16_to_cpu@PLT
	mov	rdi, QWORD PTR 32[r14]
	mov	QWORD PTR 40[rbx], rax
	call	le16_to_cpu@PLT
	mov	rdi, QWORD PTR 24[r14]
	mov	QWORD PTR 32[rbx], rax
	call	le16_to_cpu@PLT
	mov	rcx, QWORD PTR 8[r14]
	mov	QWORD PTR 24[rbx], rax
	mov	eax, DWORD PTR 16[r14]
	mov	DWORD PTR 16[rbx], eax
	mov	rax, QWORD PTR 8[rbx]
	mov	esi, DWORD PTR [rcx]
	mov	DWORD PTR [rax], esi
	mov	ecx, DWORD PTR 4[rcx]
	mov	DWORD PTR 4[rax], ecx
	mov	edi, DWORD PTR [r14]
	call	le32_to_cpu@PLT
	mov	edx, DWORD PTR 8[rsp]
	mov	DWORD PTR [rbx], eax
	add	edx, 1
	cmp	DWORD PTR 0[r13], edx
	ja	.L15
.L18:
	mov	eax, DWORD PTR 4[r13]
	test	DWORD PTR GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED[rip], eax
	jne	.L16
	mov	eax, DWORD PTR 4[rbp]
	test	DWORD PTR GB_CAMERA_CONFIGURE_STREAMS_TEST_ONLY[rip], eax
	mov	rax, QWORD PTR 16[rsp]
	jne	.L34
	mov	rcx, QWORD PTR GB_CAMERA_STATE_CONFIGURED[rip]
	cmp	QWORD PTR [rax], rcx
	je	.L35
.L20:
	mov	rbx, QWORD PTR 16[rsp]
	mov	eax, DWORD PTR 0[r13]
	mov	edi, DWORD PTR 12[rbx]
	test	eax, eax
	je	.L12
	call	gb_pm_runtime_get_noresume@PLT
	mov	rdx, QWORD PTR 48[rsp]
	mov	rsi, r13
	mov	rdi, rbx
	call	gb_camera_setup_data_connection@PLT
	mov	r15d, eax
	test	eax, eax
	js	.L36
	mov	rcx, QWORD PTR 16[rsp]
	mov	rax, QWORD PTR GB_CAMERA_STATE_CONFIGURED[rip]
	mov	edi, DWORD PTR 12[rcx]
	mov	QWORD PTR [rcx], rax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rax, QWORD PTR 16[rsp]
	mov	edi, DWORD PTR 12[rax]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L24:
	mov	rdi, rbp
	call	kfree@PLT
	mov	rdi, r13
	call	kfree@PLT
	mov	r15d, DWORD PTR ENOMEM[rip]
	neg	r15d
	jmp	.L1
.L34:
	mov	edi, DWORD PTR 12[rax]
	jmp	.L12
.L35:
	mov	rdi, rax
	mov	rbx, rax
	call	gb_camera_teardown_data_connection@PLT
	mov	rax, QWORD PTR GB_CAMERA_STATE_UNCONFIGURED[rip]
	mov	edi, DWORD PTR 12[rbx]
	mov	QWORD PTR [rbx], rax
	call	gb_pm_runtime_put_noidle@PLT
	jmp	.L20
.L36:
	mov	edx, 24
	xor	esi, esi
	mov	rdi, rbp
	call	memset@PLT
	mov	rbx, QWORD PTR 16[rsp]
	mov	r8, r13
	mov	rdx, rbp
	mov	esi, DWORD PTR GB_CAMERA_TYPE_CONFIGURE_STREAMS[rip]
	mov	r9d, 24
	mov	ecx, 24
	mov	edi, DWORD PTR 16[rbx]
	call	gb_operation_sync@PLT
	mov	rax, QWORD PTR 32[rsp]
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR 40[rsp]
	mov	DWORD PTR [rax], 0
	mov	edi, DWORD PTR 12[rbx]
	call	gb_pm_runtime_put_noidle@PLT
	mov	edi, DWORD PTR 12[rbx]
	jmp	.L12
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	gb_camera_configure_streams, .-gb_camera_configure_streams
	.comm	GFP_KERNEL,4,4
	.comm	GB_OPERATION_FLAG_SHORT_RESPONSE,4,4
	.comm	GB_CAMERA_TYPE_CONFIGURE_STREAMS,4,4
	.comm	GB_CAMERA_STATE_UNCONFIGURED,8,8
	.comm	GB_CAMERA_STATE_CONFIGURED,8,8
	.comm	GB_CAMERA_MAX_STREAMS,4,4
	.comm	GB_CAMERA_CONFIGURE_STREAMS_TEST_ONLY,4,4
	.comm	GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED,4,4
	.comm	ENOMEM,4,4
	.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_camera.c_gb_camera_configure_streams.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	gb_camera_configure_streams, %function
gb_camera_configure_streams:
	@ args = 4, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	ip, r1
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #52
	str	r1, [sp, #32]
	ldr	r1, .L38
	str	r3, [sp, #24]
	ldr	r3, .L38+4
	ldr	r9, [ip]
	ldr	r1, [r1]
	str	r0, [sp, #16]
	str	r2, [sp, #20]
	ldr	r3, [r3]
	str	r3, [sp, #44]
	mov	r3,#0
	ldr	r3, [sp, #88]
	cmp	r1, r9
	str	r3, [sp, #36]
	bcs	.L2
	ldr	r3, .L38+8
	ldr	r4, [r3]
	rsb	r4, r4, #0
.L1:
	ldr	r3, .L38+4
	ldr	r2, [r3]
	ldr	r3, [sp, #44]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L34
	mov	r0, r4
	add	sp, sp, #52
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	rsb	r8, r9, r9, lsl #3
	ldr	r4, .L38+12
	lsl	r8, r8, #2
	add	fp, r8, #16
	ldr	r1, [r4]
	mov	r0, fp
	str	fp, [sp, #40]
	bl	kmalloc
	ldr	r1, [r4]
	mov	r6, r0
	ldr	r0, [sp, #40]
	bl	kmalloc
	clz	r3, r0
	cmp	r6, #0
	lsr	r3, r3, #5
	moveq	r3, #1
	cmp	r3, #0
	str	r0, [sp, #28]
	bne	.L35
	ldr	r2, [sp, #20]
	str	r9, [r6]
	ldr	r2, [r2]
	cmp	r9, #0
	str	r2, [r6, #4]
	str	r3, [r6, #12]
	beq	.L9
	mov	r7, r3
	mov	r10, r3
	ldr	r5, [sp, #24]
.L8:
	ldr	r0, [r5, #20]
	ldr	r4, [r6, #8]
	bl	cpu_to_le16
	add	r4, r4, r7
	str	r0, [r4, #20]
	ldr	r0, [r5, #16]
	bl	cpu_to_le16
	str	r0, [r4, #16]
	ldr	r0, [r5, #12]
	bl	cpu_to_le16
	add	r7, r7, #28
	cmp	r8, r7
	str	r0, [r4, #12]
	str	r10, [r4, #24]
	add	r5, r5, #24
	bne	.L8
.L9:
	ldr	r4, [sp, #16]
	add	r5, r4, #4
	mov	r0, r5
	bl	mutex_lock
	ldr	r0, [r4, #8]
	bl	gb_pm_runtime_get_sync
	subs	r4, r0, #0
	bne	.L6
	ldr	r2, [sp, #16]
	ldr	r0, [r2, #12]
	cmp	r0, #0
	bne	.L10
	ldr	r3, .L38+8
	ldr	r0, [r2, #8]
	ldr	r4, [r3]
	rsb	r4, r4, #0
.L11:
	bl	gb_pm_runtime_put_autosuspend
.L6:
	mov	r0, r5
	bl	mutex_unlock
	mov	r0, r6
	bl	kfree
	ldr	r0, [sp, #28]
	bl	kfree
	b	.L1
.L10:
	ldr	r1, [sp, #28]
	ldr	r2, .L38+16
	str	r1, [sp, #4]
	ldr	r1, .L38+20
	str	fp, [sp]
	add	r3, sp, #40
	ldr	r2, [r2]
	ldr	r1, [r1]
	str	r3, [sp, #8]
	mov	r3, r6
	bl	gb_camera_operation_sync_flags
	subs	r4, r0, #0
	blt	.L32
	mov	r2, r9
	ldr	r1, [sp, #28]
	ldr	r0, [sp, #16]
	bl	gb_camera_configure_streams_validate_response
	subs	r4, r0, #0
	blt	.L32
	ldr	r2, [sp, #28]
	ldr	r1, [sp, #20]
	ldr	r3, [r2, #4]
	str	r3, [r1]
	ldr	r3, [r2]
	ldr	r1, [sp, #32]
	str	r3, [r1]
	ldr	r3, [r2]
	cmp	r3, #0
	beq	.L18
	mov	r9, #0
	mov	r10, r9
	ldr	fp, [sp, #28]
	ldr	r7, [sp, #24]
	str	r4, [sp, #24]
.L17:
	ldr	r4, [fp, #8]
	add	r10, r10, #1
	add	r8, r4, r9
	ldr	r0, [r8, #20]
	bl	le16_to_cpu
	str	r0, [r7, #20]
	ldr	r0, [r8, #16]
	bl	le16_to_cpu
	str	r0, [r7, #16]
	ldr	r0, [r8, #12]
	bl	le16_to_cpu
	ldr	r2, [r8, #8]
	str	r0, [r7, #12]
	ldr	r1, [r8, #4]
	str	r2, [r7, #8]
	ldr	r0, [r1]
	ldr	r2, [r7, #4]
	str	r0, [r2]
	ldr	r1, [r1, #4]
	str	r1, [r2, #4]
	ldr	r0, [r4, r9]
	bl	le32_to_cpu
	str	r0, [r7], #24
	ldr	r3, [fp]
	add	r9, r9, #28
	cmp	r3, r10
	bhi	.L17
	ldr	r4, [sp, #24]
.L18:
	ldr	r2, .L38+24
	ldr	r1, [sp, #28]
	ldr	r2, [r2]
	ldr	r1, [r1, #4]
	tst	r1, r2
	bne	.L32
	ldr	r2, .L38+28
	ldr	r1, [r6, #4]
	ldr	r2, [r2]
	tst	r1, r2
	bne	.L32
	ldr	r2, [sp, #16]
	ldr	r7, .L38+32
	ldr	r1, [r2]
	ldr	r2, [r7]
	cmp	r1, r2
	beq	.L36
.L20:
	ldr	r8, [sp, #16]
	cmp	r3, #0
	ldr	r0, [r8, #8]
	beq	.L11
	bl	gb_pm_runtime_get_noresume
	mov	r0, r8
	ldr	r2, [sp, #36]
	ldr	r1, [sp, #28]
	bl	gb_camera_setup_data_connection
	subs	r4, r0, #0
	blt	.L37
	ldr	r2, [sp, #16]
	ldr	r3, [r7]
	ldr	r0, [r2, #8]
	str	r3, [r2]
	b	.L11
.L32:
	ldr	r3, [sp, #16]
	ldr	r0, [r3, #8]
	b	.L11
.L35:
	mov	r0, r6
	bl	kfree
	ldr	r0, [sp, #28]
	bl	kfree
	ldr	r3, .L38+36
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L36:
	ldr	r8, [sp, #16]
	mov	r0, r8
	bl	gb_camera_teardown_data_connection
	ldr	r3, .L38+40
	ldr	r0, [r8, #8]
	ldr	r3, [r3]
	str	r3, [r8]
	bl	gb_pm_runtime_put_noidle
	ldr	r3, [sp, #28]
	ldr	r3, [r3]
	b	.L20
.L37:
	mov	r7, #16
	mov	r1, #0
	mov	r2, r7
	mov	r0, r6
	bl	memset
	ldr	r2, [sp, #28]
	str	r7, [sp, #4]
	str	r2, [sp]
	mov	r3, r7
	ldr	r2, .L38+20
	ldr	r7, [sp, #16]
	ldr	r1, [r2]
	ldr	r0, [r7, #12]
	mov	r2, r6
	bl	gb_operation_sync
	mov	r3, #0
	ldr	r2, [sp, #20]
	str	r3, [r2]
	ldr	r2, [sp, #32]
	str	r3, [r2]
	ldr	r0, [r7, #8]
	bl	gb_pm_runtime_put_noidle
	ldr	r0, [r7, #8]
	b	.L11
.L34:
	bl	__stack_chk_fail
.L39:
	.align	2
.L38:
	.word	GB_CAMERA_MAX_STREAMS
	.word	.LC0
	.word	EINVAL
	.word	GFP_KERNEL
	.word	GB_OPERATION_FLAG_SHORT_RESPONSE
	.word	GB_CAMERA_TYPE_CONFIGURE_STREAMS
	.word	GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED
	.word	GB_CAMERA_CONFIGURE_STREAMS_TEST_ONLY
	.word	GB_CAMERA_STATE_CONFIGURED
	.word	ENOMEM
	.word	GB_CAMERA_STATE_UNCONFIGURED
	.size	gb_camera_configure_streams, .-gb_camera_configure_streams
	.comm	GFP_KERNEL,4,4
	.comm	GB_OPERATION_FLAG_SHORT_RESPONSE,4,4
	.comm	GB_CAMERA_TYPE_CONFIGURE_STREAMS,4,4
	.comm	GB_CAMERA_STATE_UNCONFIGURED,4,4
	.comm	GB_CAMERA_STATE_CONFIGURED,4,4
	.comm	GB_CAMERA_MAX_STREAMS,4,4
	.comm	GB_CAMERA_CONFIGURE_STREAMS_TEST_ONLY,4,4
	.comm	GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
