	.file	"extr_vchiq_core.c_find_service_for_instance.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Invalid service handle 0x%x"
	.text
	.p2align 4
	.globl	find_service_for_instance
	.type	find_service_for_instance, @function
find_service_for_instance:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdi
	lea	rdi, service_spinlock[rip]
	call	spin_lock@PLT
	mov	rdi, r13
	call	handle_to_service@PLT
	test	rax, rax
	je	.L4
	mov	r12, rax
	mov	rax, QWORD PTR VCHIQ_SRVSTATE_FREE[rip]
	cmp	QWORD PTR [r12], rax
	je	.L4
	cmp	QWORD PTR 8[r12], r13
	jne	.L4
	cmp	QWORD PTR 16[r12], rbx
	je	.L7
.L4:
	lea	rdi, service_spinlock[rip]
	xor	r12d, r12d
	call	spin_unlock@PLT
	mov	edi, DWORD PTR vchiq_core_log_level[rip]
	mov	rdx, r13
	lea	rsi, .LC0[rip]
	call	vchiq_log_info@PLT
	mov	rax, r12
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	xor	edi, edi
	cmp	QWORD PTR 24[r12], 0
	sete	dil
	call	BUG_ON@PLT
	add	QWORD PTR 24[r12], 1
	lea	rdi, service_spinlock[rip]
	call	spin_unlock@PLT
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	find_service_for_instance, .-find_service_for_instance
	.comm	vchiq_core_log_level,4,4
	.comm	service_spinlock,4,4
	.comm	VCHIQ_SRVSTATE_FREE,8,8
	.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_vchiq_core.c_find_service_for_instance.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Invalid service handle 0x%x\000"
	.text
	.align	2
	.global	find_service_for_instance
	.syntax unified
	.arm
	.fpu softvfp
	.type	find_service_for_instance, %function
find_service_for_instance:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r5, r1
	mov	r6, r0
	ldr	r0, .L8
	bl	spin_lock
	mov	r0, r5
	bl	handle_to_service
	subs	r4, r0, #0
	beq	.L4
	ldr	r3, .L8+4
	ldr	r2, [r4]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L4
	ldr	r3, [r4, #4]
	cmp	r3, r5
	bne	.L4
	ldr	r3, [r4, #8]
	cmp	r3, r6
	beq	.L7
.L4:
	mov	r4, #0
	ldr	r0, .L8
	bl	spin_unlock
	ldr	r3, .L8+8
	mov	r2, r5
	ldr	r0, [r3]
	ldr	r1, .L8+12
	bl	vchiq_log_info
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L7:
	ldr	r0, [r4, #12]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	BUG_ON
	ldr	r3, [r4, #12]
	ldr	r0, .L8
	add	r3, r3, #1
	str	r3, [r4, #12]
	bl	spin_unlock
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L9:
	.align	2
.L8:
	.word	service_spinlock
	.word	VCHIQ_SRVSTATE_FREE
	.word	vchiq_core_log_level
	.word	.LC0
	.size	find_service_for_instance, .-find_service_for_instance
	.comm	vchiq_core_log_level,4,4
	.comm	service_spinlock,4,4
	.comm	VCHIQ_SRVSTATE_FREE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
