	.file	"extr_vchiq_core.c_vchiq_close_service.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d: close_service:%d"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"%d: close_service:%d - waiting in state %s"
	.text
	.p2align 4
	.globl	vchiq_close_service
	.type	vchiq_close_service, @function
vchiq_close_service:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	find_service_by_handle@PLT
	test	rax, rax
	je	.L17
	mov	ecx, DWORD PTR 8[rax]
	mov	rbp, rax
	mov	rax, QWORD PTR 16[rax]
	lea	rsi, .LC0[rip]
	mov	edi, DWORD PTR vchiq_core_log_level[rip]
	mov	r12, QWORD PTR VCHIQ_SUCCESS[rip]
	mov	edx, DWORD PTR 8[rax]
	call	vchiq_log_info@PLT
	mov	rax, QWORD PTR 0[rbp]
	cmp	rax, QWORD PTR VCHIQ_SRVSTATE_FREE[rip]
	je	.L4
	cmp	rax, QWORD PTR VCHIQ_SRVSTATE_LISTENING[rip]
	je	.L4
	cmp	rax, QWORD PTR VCHIQ_SRVSTATE_HIDDEN[rip]
	je	.L4
	mov	rdi, rbp
	call	mark_service_closing@PLT
	mov	rdi, QWORD PTR 16[rbp]
	mov	rax, QWORD PTR current[rip]
	cmp	QWORD PTR [rdi], rax
	je	.L19
	mov	edx, DWORD PTR VCHIQ_POLL_TERMINATE[rip]
	mov	rsi, rbp
	call	request_poll@PLT
.L7:
	lea	rbx, 24[rbp]
	lea	r13, .LC1[rip]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rax, QWORD PTR 0[rbp]
	cmp	rax, QWORD PTR VCHIQ_SRVSTATE_FREE[rip]
	je	.L10
	mov	rdx, QWORD PTR VCHIQ_SRVSTATE_LISTENING[rip]
	cmp	rax, rdx
	je	.L14
	mov	rcx, QWORD PTR VCHIQ_SRVSTATE_OPEN[rip]
	cmp	rax, rcx
	je	.L11
	mov	rsi, QWORD PTR srvstate_names[rip]
	mov	rdx, QWORD PTR 16[rbp]
	mov	ecx, DWORD PTR 8[rbp]
	mov	edi, DWORD PTR vchiq_core_log_level[rip]
	mov	r8d, DWORD PTR [rsi+rax*4]
	mov	edx, DWORD PTR 8[rdx]
	mov	rsi, r13
	call	vchiq_log_warning@PLT
.L12:
	mov	rdi, rbx
	call	down_interruptible@PLT
	test	rax, rax
	je	.L8
	mov	r12, QWORD PTR VCHIQ_RETRY[rip]
	cmp	QWORD PTR VCHIQ_SUCCESS[rip], r12
	je	.L20
.L10:
	mov	rdi, rbp
	call	unlock_service@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.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
.L4:
	.cfi_restore_state
	mov	rdi, rbp
	call	unlock_service@PLT
.L17:
	mov	r12, QWORD PTR VCHIQ_ERROR[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	mov	rax, r12
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	rcx, rdx
.L11:
	mov	rax, QWORD PTR VCHIQ_SUCCESS[rip]
	cmp	r12, rax
	jne	.L10
.L13:
	cmp	rcx, rdx
	cmovne	rax, QWORD PTR VCHIQ_ERROR[rip]
	mov	r12, rax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L19:
	xor	esi, esi
	mov	rdi, rbp
	call	vchiq_close_service_internal@PLT
	xor	edi, edi
	cmp	QWORD PTR VCHIQ_RETRY[rip], rax
	sete	dil
	mov	r12, rax
	call	BUG_ON@PLT
	jmp	.L7
.L20:
	mov	rcx, QWORD PTR 0[rbp]
	cmp	rcx, QWORD PTR VCHIQ_SRVSTATE_FREE[rip]
	je	.L10
	mov	rdx, QWORD PTR VCHIQ_SRVSTATE_LISTENING[rip]
	mov	rax, r12
	jmp	.L13
	.cfi_endproc
.LFE0:
	.size	vchiq_close_service, .-vchiq_close_service
	.comm	vchiq_core_log_level,4,4
	.comm	srvstate_names,8,8
	.comm	current,8,8
	.comm	VCHIQ_SUCCESS,8,8
	.comm	VCHIQ_SRVSTATE_OPEN,8,8
	.comm	VCHIQ_SRVSTATE_LISTENING,8,8
	.comm	VCHIQ_SRVSTATE_HIDDEN,8,8
	.comm	VCHIQ_SRVSTATE_FREE,8,8
	.comm	VCHIQ_RETRY,8,8
	.comm	VCHIQ_POLL_TERMINATE,4,4
	.comm	VCHIQ_ERROR,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_vchiq_close_service.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%d: close_service:%d\000"
	.align	2
.LC1:
	.ascii	"%d: close_service:%d - waiting in state %s\000"
	.text
	.align	2
	.global	vchiq_close_service
	.syntax unified
	.arm
	.fpu softvfp
	.type	vchiq_close_service, %function
vchiq_close_service:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #12
	bl	find_service_by_handle
	subs	r4, r0, #0
	beq	.L19
	ldr	r3, [r4, #8]
	ldr	r7, .L23
	ldr	ip, .L23+4
	ldr	r5, .L23+8
	ldr	r2, [r3, #4]
	ldr	r0, [r7]
	ldr	r3, [r4, #4]
	ldr	r1, .L23+12
	ldr	r9, [ip]
	bl	vchiq_log_info
	ldr	r2, [r5]
	ldr	r3, [r4]
	cmp	r3, r2
	beq	.L4
	ldr	r6, .L23+16
	ldr	r2, [r6]
	cmp	r3, r2
	beq	.L4
	ldr	r2, .L23+20
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L4
	mov	r0, r4
	bl	mark_service_closing
	ldr	r0, [r4, #8]
	ldr	r3, .L23+24
	ldr	r2, [r0]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L21
	ldr	r3, .L23+28
	mov	r1, r4
	ldr	r2, [r3]
	bl	request_poll
.L7:
	ldr	fp, .L23+32
	ldr	r10, .L23+36
	add	r8, r4, #12
	b	.L12
.L8:
	ldr	r3, [r4]
	ldr	r2, [r5]
	cmp	r3, r2
	beq	.L10
	ldr	r2, [r6]
	cmp	r3, r2
	beq	.L14
	ldr	r1, .L23+40
	ldr	r1, [r1]
	cmp	r3, r1
	beq	.L11
	ldr	r1, [fp]
	ldr	r2, [r4, #8]
	ldr	r1, [r1, r3, lsl #2]
	ldr	r2, [r2, #4]
	ldr	r3, [r4, #4]
	ldr	r0, [r7]
	str	r1, [sp]
	mov	r1, r10
	bl	vchiq_log_warning
.L12:
	mov	r0, r8
	bl	down_interruptible
	cmp	r0, #0
	beq	.L8
	ldr	r2, .L23+44
	ldr	r3, .L23+4
	ldr	r9, [r2]
	ldr	r3, [r3]
	cmp	r3, r9
	beq	.L22
.L10:
	mov	r0, r4
	bl	unlock_service
	mov	r0, r9
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	mov	r0, r4
	bl	unlock_service
.L19:
	ldr	r3, .L23+48
	ldr	r9, [r3]
	mov	r0, r9
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	mov	r1, r2
.L11:
	ldr	r3, .L23+4
	ldr	r3, [r3]
	cmp	r9, r3
	bne	.L10
.L13:
	cmp	r1, r2
	ldrne	r3, .L23+48
	moveq	r9, r3
	ldrne	r9, [r3]
	b	.L10
.L21:
	mov	r1, #0
	mov	r0, r4
	bl	vchiq_close_service_internal
	mov	r9, r0
	ldr	r3, .L23+44
	ldr	r0, [r3]
	sub	r0, r0, r9
	clz	r0, r0
	lsr	r0, r0, #5
	bl	BUG_ON
	b	.L7
.L22:
	ldr	r3, [r5]
	ldr	r1, [r4]
	cmp	r1, r3
	beq	.L10
	mov	r3, r9
	ldr	r2, [r6]
	b	.L13
.L24:
	.align	2
.L23:
	.word	vchiq_core_log_level
	.word	VCHIQ_SUCCESS
	.word	VCHIQ_SRVSTATE_FREE
	.word	.LC0
	.word	VCHIQ_SRVSTATE_LISTENING
	.word	VCHIQ_SRVSTATE_HIDDEN
	.word	current
	.word	VCHIQ_POLL_TERMINATE
	.word	srvstate_names
	.word	.LC1
	.word	VCHIQ_SRVSTATE_OPEN
	.word	VCHIQ_RETRY
	.word	VCHIQ_ERROR
	.size	vchiq_close_service, .-vchiq_close_service
	.comm	vchiq_core_log_level,4,4
	.comm	srvstate_names,4,4
	.comm	current,4,4
	.comm	VCHIQ_SUCCESS,4,4
	.comm	VCHIQ_SRVSTATE_OPEN,4,4
	.comm	VCHIQ_SRVSTATE_LISTENING,4,4
	.comm	VCHIQ_SRVSTATE_HIDDEN,4,4
	.comm	VCHIQ_SRVSTATE_FREE,4,4
	.comm	VCHIQ_RETRY,4,4
	.comm	VCHIQ_POLL_TERMINATE,4,4
	.comm	VCHIQ_ERROR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
