	.file	"extr_vchiq_core.c_sync_func.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"%d: sf %s@%x (%d->%d) - invalid/closed service %d"
	.align 8
.LC1:
	.string	"Rcvd Msg %s from %c%c%c%c s:%d d:%d len:%d"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"Rcvd"
	.section	.rodata.str1.8
	.align 8
.LC3:
	.string	"%d: sf OPENACK@%x,%x (%d->%d) v:%d"
	.section	.rodata.str1.1
.LC4:
	.string	"%d: sf DATA@%x,%x (%d->%d)"
	.section	.rodata.str1.8
	.align 8
.LC5:
	.string	"synchronous callback to service %d returns VCHIQ_RETRY"
	.align 8
.LC6:
	.string	"%d: sf unexpected msgid %x@%x,%x"
	.text
	.p2align 4
	.globl	sync_func
	.type	sync_func, @function
sync_func:
.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
	mov	r14, rdi
	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, 56
	.cfi_def_cfa_offset 112
	mov	rax, QWORD PTR 16[rdi]
	mov	QWORD PTR 16[rsp], rax
	mov	rax, QWORD PTR 8[rdi]
	mov	esi, DWORD PTR [rax]
	call	SLOT_DATA_FROM_INDEX@PLT
	mov	DWORD PTR 28[rsp], eax
	mov	rbx, rax
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rdi, QWORD PTR 16[rsp]
	call	remote_event_wait@PLT
	xor	eax, eax
	call	rmb@PLT
	mov	r13d, DWORD PTR [rbx]
	mov	r15d, DWORD PTR 4[rbx]
	mov	edi, r13d
	call	VCHIQ_MSG_TYPE@PLT
	mov	edi, r13d
	mov	ebp, eax
	call	VCHIQ_MSG_DSTPORT@PLT
	mov	edi, r13d
	mov	r12d, eax
	call	VCHIQ_MSG_SRCPORT@PLT
	mov	esi, r12d
	mov	rdi, r14
	mov	DWORD PTR 8[rsp], eax
	call	find_service_by_port@PLT
	mov	r10, rax
	test	rax, rax
	je	.L19
	mov	rdi, QWORD PTR vchiq_sync_log_level[rip]
	cmp	rdi, QWORD PTR VCHIQ_LOG_TRACE[rip]
	jge	.L20
.L5:
	mov	edx, DWORD PTR [r14]
	cmp	ebp, 128
	je	.L7
	cmp	ebp, 129
	je	.L8
	mov	r8d, DWORD PTR 28[rsp]
	mov	r9d, r15d
	mov	ecx, r13d
	xor	eax, eax
	lea	rsi, .LC6[rip]
	mov	QWORD PTR 8[rsp], r10
	call	vchiq_log_error@PLT
	mov	rsi, rbx
	mov	rdi, r14
	call	release_message_sync@PLT
	mov	r10, QWORD PTR 8[rsp]
.L13:
	mov	rdi, r10
	call	unlock_service@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	mov	edi, ebp
	call	msg_type_str@PLT
	push	r12
	.cfi_def_cfa_offset 120
	mov	edx, DWORD PTR [r14]
	lea	rsi, .LC0[rip]
	push	r12
	.cfi_def_cfa_offset 128
	mov	rdi, QWORD PTR vchiq_sync_log_level[rip]
	mov	ecx, eax
	xor	eax, eax
	mov	r9d, DWORD PTR 24[rsp]
	mov	r8d, DWORD PTR 44[rsp]
	call	vchiq_log_error@PLT
	mov	rsi, rbx
	mov	rdi, r14
	call	release_message_sync@PLT
	pop	r9
	.cfi_def_cfa_offset 120
	pop	r10
	.cfi_def_cfa_offset 112
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	mov	QWORD PTR 32[rsp], r10
	sub	rsp, 8
	.cfi_def_cfa_offset 120
	mov	r8d, r15d
	lea	rsi, .LC4[rip]
	push	r12
	.cfi_def_cfa_offset 128
	mov	ebp, DWORD PTR 24[rsp]
	mov	ecx, DWORD PTR 44[rsp]
	mov	r9d, ebp
	call	vchiq_log_trace@PLT
	pop	rax
	.cfi_def_cfa_offset 120
	pop	rdx
	.cfi_def_cfa_offset 112
	mov	r10, QWORD PTR 32[rsp]
	cmp	DWORD PTR [r10], ebp
	jne	.L13
	mov	eax, DWORD PTR VCHIQ_SRVSTATE_OPENSYNC[rip]
	cmp	DWORD PTR 8[r10], eax
	jne	.L13
	mov	esi, DWORD PTR VCHIQ_MESSAGE_AVAILABLE[rip]
	xor	ecx, ecx
	mov	rdi, r10
	mov	rdx, rbx
	mov	QWORD PTR 8[rsp], r10
	call	make_service_callback@PLT
	cmp	eax, DWORD PTR VCHIQ_RETRY[rip]
	mov	r10, QWORD PTR 8[rsp]
	jne	.L13
	mov	rdi, QWORD PTR vchiq_sync_log_level[rip]
	mov	edx, r12d
	lea	rsi, .LC5[rip]
	xor	eax, eax
	call	vchiq_log_error@PLT
	mov	r10, QWORD PTR 8[rsp]
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L7:
	cmp	r15d, 3
	ja	.L10
	mov	eax, DWORD PTR 16[r10]
.L11:
	mov	QWORD PTR 32[rsp], r10
	lea	rsi, .LC3[rip]
	mov	r8d, r15d
	push	rax
	.cfi_def_cfa_offset 120
	push	r12
	.cfi_def_cfa_offset 128
	mov	r9d, DWORD PTR 24[rsp]
	mov	ecx, DWORD PTR 44[rsp]
	call	vchiq_log_info@PLT
	pop	rcx
	.cfi_def_cfa_offset 120
	pop	rsi
	.cfi_def_cfa_offset 112
	mov	r10, QWORD PTR 32[rsp]
	mov	eax, DWORD PTR VCHIQ_SRVSTATE_OPENING[rip]
	cmp	DWORD PTR 8[r10], eax
	je	.L21
.L12:
	mov	rsi, rbx
	mov	rdi, r14
	mov	QWORD PTR 8[rsp], r10
	call	release_message_sync@PLT
	mov	r10, QWORD PTR 8[rsp]
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	mov	edi, DWORD PTR 20[rax]
	mov	QWORD PTR 40[rsp], rax
	call	VCHIQ_FOURCC_AS_4CHARS@PLT
	mov	edi, ebp
	mov	DWORD PTR 32[rsp], eax
	call	msg_type_str@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 120
	mov	r9d, r12d
	mov	rdi, QWORD PTR vchiq_sync_log_level[rip]
	push	r15
	.cfi_def_cfa_offset 128
	mov	r8d, DWORD PTR 24[rsp]
	mov	edx, eax
	lea	rsi, .LC1[rip]
	mov	ecx, DWORD PTR 48[rsp]
	call	vchiq_log_trace@PLT
	test	r15d, r15d
	pop	rdi
	.cfi_def_cfa_offset 120
	mov	rdi, QWORD PTR vchiq_sync_log_level[rip]
	pop	r8
	.cfi_def_cfa_offset 112
	mov	r10, QWORD PTR 40[rsp]
	jle	.L5
	mov	esi, r15d
	mov	edi, 16
	mov	QWORD PTR 32[rsp], r10
	call	min@PLT
	mov	rdx, QWORD PTR 8[rbx]
	lea	rdi, .LC2[rip]
	xor	esi, esi
	mov	ecx, eax
	call	vchiq_log_dump_mem@PLT
	mov	rdi, QWORD PTR vchiq_sync_log_level[rip]
	mov	r10, QWORD PTR 32[rsp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rax, QWORD PTR 8[rbx]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR 16[r10], eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L21:
	mov	eax, DWORD PTR 8[rsp]
	mov	esi, DWORD PTR VCHIQ_SRVSTATE_OPENSYNC[rip]
	mov	rdi, r10
	mov	QWORD PTR 8[rsp], r10
	mov	DWORD PTR [r10], eax
	call	vchiq_set_service_state@PLT
	mov	r10, QWORD PTR 8[rsp]
	mov	DWORD PTR 4[r10], 1
	lea	rdi, 12[r10]
	call	up@PLT
	mov	r10, QWORD PTR 8[rsp]
	jmp	.L12
	.cfi_endproc
.LFE0:
	.size	sync_func, .-sync_func
	.comm	vchiq_sync_log_level,8,8
	.comm	VCHIQ_SRVSTATE_OPENSYNC,4,4
	.comm	VCHIQ_SRVSTATE_OPENING,4,4
	.comm	VCHIQ_RETRY,4,4
	.comm	VCHIQ_MESSAGE_AVAILABLE,4,4
	.comm	VCHIQ_LOG_TRACE,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_sync_func.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%d: sf %s@%x (%d->%d) - invalid/closed service %d\000"
	.align	2
.LC1:
	.ascii	"Rcvd Msg %s from %c%c%c%c s:%d d:%d len:%d\000"
	.align	2
.LC2:
	.ascii	"Rcvd\000"
	.align	2
.LC3:
	.ascii	"%d: sf OPENACK@%x,%x (%d->%d) v:%d\000"
	.align	2
.LC4:
	.ascii	"%d: sf DATA@%x,%x (%d->%d)\000"
	.align	2
.LC5:
	.ascii	"synchronous callback to service %d returns VCHIQ_RE"
	.ascii	"TRY\000"
	.align	2
.LC6:
	.ascii	"%d: sf unexpected msgid %x@%x,%x\000"
	.text
	.align	2
	.global	sync_func
	.syntax unified
	.arm
	.fpu softvfp
	.type	sync_func, %function
sync_func:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, [r0, #4]
	ldr	r2, [r0, #8]
	sub	sp, sp, #36
	ldr	r1, [r3]
	mov	r10, r0
	str	r2, [sp, #20]
	bl	SLOT_DATA_FROM_INDEX
	mov	r9, r0
.L2:
	ldr	r0, [sp, #20]
	bl	remote_event_wait
	bl	rmb
	ldm	r9, {r8, fp}
	mov	r0, r8
	bl	VCHIQ_MSG_TYPE
	mov	r6, r0
	mov	r0, r8
	bl	VCHIQ_MSG_DSTPORT
	mov	r5, r0
	mov	r0, r8
	bl	VCHIQ_MSG_SRCPORT
	mov	r1, r5
	mov	r7, r0
	mov	r0, r10
	bl	find_service_by_port
	subs	r4, r0, #0
	beq	.L21
	ldr	r3, .L23
	ldr	r1, [r3]
	ldr	r3, .L23+4
	ldr	r3, [r3]
	cmp	r1, r3
	bge	.L22
.L5:
	cmp	r6, #128
	ldr	r2, [r10]
	beq	.L7
	cmp	r6, #129
	beq	.L8
	mov	r0, r1
	mov	r3, r8
	stm	sp, {r9, fp}
	ldr	r1, .L23+8
	bl	vchiq_log_error
.L19:
	mov	r1, r9
	mov	r0, r10
	bl	release_message_sync
.L13:
	mov	r0, r4
	bl	unlock_service
	b	.L2
.L21:
	ldr	r3, .L23
	mov	r0, r6
	ldr	r4, [r3]
	ldr	r6, [r10]
	bl	msg_type_str
	mov	r2, r6
	mov	r3, r0
	ldr	r1, .L23+12
	mov	r0, r4
	str	r5, [sp, #12]
	str	r5, [sp, #8]
	str	r7, [sp, #4]
	str	r9, [sp]
	bl	vchiq_log_error
	mov	r1, r9
	mov	r0, r10
	bl	release_message_sync
	b	.L2
.L8:
	mov	r0, r1
	mov	r3, r9
	ldr	r1, .L23+16
	str	r5, [sp, #8]
	str	r7, [sp, #4]
	str	fp, [sp]
	bl	vchiq_log_trace
	ldr	r3, [r4]
	cmp	r3, r7
	bne	.L13
	ldr	r3, .L23+20
	ldr	r2, [r4, #8]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L13
	ldr	r1, .L23+24
	mov	r3, #0
	mov	r2, r9
	mov	r0, r4
	ldr	r1, [r1]
	bl	make_service_callback
	ldr	r3, .L23+28
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L13
	ldr	r3, .L23
	mov	r2, r5
	ldr	r1, .L23+32
	ldr	r0, [r3]
	bl	vchiq_log_error
	b	.L13
.L7:
	cmp	fp, #3
	ldrhi	r3, [r9, #8]
	ldrls	r3, [r4, #16]
	ldrhi	r3, [r3]
	mov	r0, r1
	strhi	r3, [r4, #16]
	ldr	r1, .L23+36
	str	r3, [sp, #12]
	str	r5, [sp, #8]
	mov	r3, r9
	str	r7, [sp, #4]
	str	fp, [sp]
	bl	vchiq_log_info
	ldr	r3, .L23+40
	ldr	r2, [r4, #8]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L19
	ldr	r3, .L23+20
	mov	r0, r4
	ldr	r1, [r3]
	str	r7, [r4]
	bl	vchiq_set_service_state
	mov	r3, #1
	add	r0, r4, #12
	str	r3, [r4, #4]
	bl	up
	b	.L19
.L22:
	ldr	r3, [r4, #20]
	mov	r0, r6
	str	r1, [sp, #28]
	str	r3, [sp, #24]
	bl	msg_type_str
	mov	r2, r0
	ldr	r3, [sp, #24]
	str	r2, [sp, #24]
	mov	r0, r3
	bl	VCHIQ_FOURCC_AS_4CHARS
	ldr	r1, [sp, #28]
	mov	r3, r0
	stmib	sp, {r5, fp}
	mov	r0, r1
	ldr	r2, [sp, #24]
	ldr	r1, .L23+44
	str	r7, [sp]
	bl	vchiq_log_trace
	cmp	fp, #0
	ble	.L18
	ldr	r2, [r9, #8]
	mov	r1, fp
	mov	r0, #16
	str	r2, [sp, #24]
	bl	min
	mov	r1, #0
	mov	r3, r0
	ldr	r2, [sp, #24]
	ldr	r0, .L23+48
	bl	vchiq_log_dump_mem
.L18:
	ldr	r3, .L23
	ldr	r1, [r3]
	b	.L5
.L24:
	.align	2
.L23:
	.word	vchiq_sync_log_level
	.word	VCHIQ_LOG_TRACE
	.word	.LC6
	.word	.LC0
	.word	.LC4
	.word	VCHIQ_SRVSTATE_OPENSYNC
	.word	VCHIQ_MESSAGE_AVAILABLE
	.word	VCHIQ_RETRY
	.word	.LC5
	.word	.LC3
	.word	VCHIQ_SRVSTATE_OPENING
	.word	.LC1
	.word	.LC2
	.size	sync_func, .-sync_func
	.comm	vchiq_sync_log_level,4,4
	.comm	VCHIQ_SRVSTATE_OPENSYNC,4,4
	.comm	VCHIQ_SRVSTATE_OPENING,4,4
	.comm	VCHIQ_RETRY,4,4
	.comm	VCHIQ_MESSAGE_AVAILABLE,4,4
	.comm	VCHIQ_LOG_TRACE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
