	.file	"extr_xpc_channel.c_xpc_connect_channel.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	xpc_connect_channel, @function
xpc_connect_channel:
.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
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR [rdi]
	lea	rdx, [rax+rax*4]
	mov	rax, QWORD PTR xpc_registrations[rip]
	lea	rbx, [rax+rdx*8]
	lea	r12, 8[rbx]
	mov	rdi, r12
	call	mutex_trylock@PLT
	test	rax, rax
	jne	.L2
	mov	eax, DWORD PTR xpRetry[rip]
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L11
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L2:
	.cfi_restore_state
	mov	rdi, QWORD PTR 0[rbp]
	call	XPC_CHANNEL_REGISTERED@PLT
	test	eax, eax
	je	.L12
	mov	rsi, QWORD PTR [rsp]
	lea	r13, 32[rbp]
	mov	rdi, r13
	call	spin_lock_irqsave@PLT
	mov	edi, DWORD PTR 8[rbp]
	and	edi, DWORD PTR XPC_C_CONNECTED[rip]
	call	DBUG_ON@PLT
	mov	edi, DWORD PTR 8[rbp]
	and	edi, DWORD PTR XPC_C_OPENREQUEST[rip]
	call	DBUG_ON@PLT
	mov	eax, DWORD PTR 8[rbp]
	test	DWORD PTR XPC_C_DISCONNECTING[rip], eax
	jne	.L13
	mov	eax, DWORD PTR 36[rbx]
	lea	rdi, 64[rbp]
	mov	DWORD PTR 72[rbp], eax
	mov	eax, DWORD PTR 32[rbx]
	mov	DWORD PTR 68[rbp], eax
	call	atomic_read@PLT
	xor	edi, edi
	test	rax, rax
	setne	dil
	call	DBUG_ON@PLT
	lea	rdi, 60[rbp]
	call	atomic_read@PLT
	xor	edi, edi
	test	rax, rax
	setne	dil
	call	DBUG_ON@PLT
	lea	rdi, 56[rbp]
	call	atomic_read@PLT
	xor	edi, edi
	test	rax, rax
	setne	dil
	call	DBUG_ON@PLT
	mov	rax, QWORD PTR 24[rbx]
	xor	edi, edi
	mov	QWORD PTR 48[rbp], rax
	test	rax, rax
	sete	dil
	call	DBUG_ON@PLT
	mov	eax, DWORD PTR 16[rbx]
	mov	DWORD PTR 40[rbp], eax
	mov	eax, DWORD PTR 12[rbx]
	mov	DWORD PTR 36[rbp], eax
	mov	eax, DWORD PTR 8[rbp]
	test	DWORD PTR XPC_C_ROPENREQUEST[rip], eax
	je	.L6
	mov	rax, QWORD PTR 16[rbp]
	cmp	QWORD PTR [rbx], rax
	jne	.L14
.L7:
	mov	rdi, r12
	mov	r12, rsp
	call	mutex_unlock@PLT
	mov	eax, DWORD PTR XPC_C_OPENREQUEST[rip]
	mov	rsi, r12
	mov	rdi, rbp
	or	eax, DWORD PTR XPC_C_CONNECTING[rip]
	or	DWORD PTR 8[rbp], eax
	call	[QWORD PTR xpc_arch_ops[rip]]
	mov	rsi, r12
	mov	rdi, rbp
	call	xpc_process_connect@PLT
	mov	rsi, QWORD PTR [rsp]
	mov	rdi, r13
	call	spin_unlock_irqrestore@PLT
	mov	eax, DWORD PTR xpSuccess[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rax, QWORD PTR [rbx]
	xor	edx, edx
	mov	rdi, rbp
	xor	esi, esi
	mov	QWORD PTR 16[rbp], rax
	call	XPC_SET_REASON@PLT
	mov	eax, DWORD PTR XPC_C_DISCONNECTED[rip]
	mov	rdx, QWORD PTR 24[rbp]
	not	eax
	and	DWORD PTR 8[rbp], eax
	mov	rax, QWORD PTR xpc_partitions[rip]
	lea	rdi, [rax+rdx*4]
	call	atomic_inc@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rdi, r12
	call	mutex_unlock@PLT
	mov	eax, DWORD PTR xpUnregistered[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rsi, QWORD PTR [rsp]
	mov	rdi, r13
	call	spin_unlock_irqrestore@PLT
	mov	rdi, r12
	call	mutex_unlock@PLT
	mov	eax, DWORD PTR 12[rbp]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rdi, r12
	call	mutex_unlock@PLT
	mov	esi, DWORD PTR xpUnequalMsgSizes[rip]
	mov	rdx, rsp
	mov	rdi, rbp
	call	XPC_DISCONNECT_CHANNEL@PLT
	mov	rsi, QWORD PTR [rsp]
	mov	rdi, r13
	call	spin_unlock_irqrestore@PLT
	mov	eax, DWORD PTR xpUnequalMsgSizes[rip]
	jmp	.L1
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	xpc_connect_channel, .-xpc_connect_channel
	.comm	xpc_registrations,8,8
	.comm	xpc_partitions,8,8
	.comm	xpc_arch_ops,8,8
	.comm	xpUnregistered,4,4
	.comm	xpUnequalMsgSizes,4,4
	.comm	xpSuccess,4,4
	.comm	xpRetry,4,4
	.comm	XPC_C_ROPENREQUEST,4,4
	.comm	XPC_C_OPENREQUEST,4,4
	.comm	XPC_C_DISCONNECTING,4,4
	.comm	XPC_C_DISCONNECTED,4,4
	.comm	XPC_C_CONNECTING,4,4
	.comm	XPC_C_CONNECTED,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_xpc_channel.c_xpc_connect_channel.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	xpc_connect_channel, %function
xpc_connect_channel:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r2, .L15
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, [r0]
	ldr	r8, [r2]
	rsb	r3, r3, r3, lsl #3
	add	r6, r8, r3, lsl #2
	ldr	r2, .L15+4
	add	r7, r6, #4
	sub	sp, sp, #8
	mov	r4, r0
	mov	r0, r7
	ldr	r2, [r2]
	str	r2, [sp, #4]
	mov	r2,#0
	lsl	r5, r3, #2
	bl	mutex_trylock
	cmp	r0, #0
	bne	.L2
	ldr	r3, .L15+8
	ldr	r0, [r3]
.L1:
	ldr	r3, .L15+4
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L11
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r0, [r4]
	bl	XPC_CHANNEL_REGISTERED
	cmp	r0, #0
	beq	.L12
	add	r9, r4, #20
	ldr	r1, [sp]
	mov	r0, r9
	bl	spin_lock_irqsave
	ldr	r3, .L15+12
	ldr	r0, [r4, #4]
	ldr	r3, [r3]
	ldr	r10, .L15+16
	and	r0, r0, r3
	bl	DBUG_ON
	ldr	r3, [r10]
	ldr	r0, [r4, #4]
	and	r0, r0, r3
	bl	DBUG_ON
	ldr	r3, .L15+20
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L13
	ldr	r2, [r6, #24]
	ldr	r3, [r6, #20]
	add	r0, r4, #44
	str	r2, [r4, #52]
	str	r3, [r4, #48]
	bl	atomic_read
	subs	r0, r0, #0
	movne	r0, #1
	bl	DBUG_ON
	add	r0, r4, #40
	bl	atomic_read
	subs	r0, r0, #0
	movne	r0, #1
	bl	DBUG_ON
	add	r0, r4, #36
	bl	atomic_read
	subs	r0, r0, #0
	movne	r0, #1
	bl	DBUG_ON
	ldr	r3, [r6, #16]
	clz	r0, r3
	str	r3, [r4, #32]
	lsr	r0, r0, #5
	bl	DBUG_ON
	ldr	r3, .L15+24
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	ldr	r0, [r6, #12]
	ldr	r1, [r6, #8]
	ands	r2, r2, r3
	str	r0, [r4, #28]
	str	r1, [r4, #24]
	beq	.L6
	ldr	r2, [r8, r5]
	ldr	r3, [r4, #12]
	cmp	r2, r3
	bne	.L14
.L7:
	mov	r0, r7
	bl	mutex_unlock
	ldr	r3, .L15+28
	ldr	r2, [r10]
	ldr	r1, [r3]
	ldr	r3, [r4, #4]
	orr	r2, r2, r1
	ldr	r1, .L15+32
	orr	r3, r3, r2
	str	r3, [r4, #4]
	mov	r0, r4
	ldr	r3, [r1]
	mov	r1, sp
	blx	r3
	mov	r1, sp
	mov	r0, r4
	bl	xpc_process_connect
	mov	r0, r9
	ldr	r1, [sp]
	bl	spin_unlock_irqrestore
	ldr	r3, .L15+36
	ldr	r0, [r3]
	b	.L1
.L6:
	ldr	r3, [r8, r5]
	mov	r1, r2
	str	r3, [r4, #12]
	mov	r0, r4
	bl	XPC_SET_REASON
	ldr	r3, .L15+40
	ldr	r2, .L15+44
	ldr	r1, [r3]
	ldr	r3, [r4, #4]
	ldr	r2, [r2]
	ldr	r0, [r4, #16]
	bic	r3, r3, r1
	str	r3, [r4, #4]
	add	r0, r2, r0, lsl #2
	bl	atomic_inc
	b	.L7
.L12:
	mov	r0, r7
	bl	mutex_unlock
	ldr	r3, .L15+48
	ldr	r0, [r3]
	b	.L1
.L13:
	ldr	r1, [sp]
	mov	r0, r9
	bl	spin_unlock_irqrestore
	mov	r0, r7
	bl	mutex_unlock
	ldr	r0, [r4, #8]
	b	.L1
.L14:
	ldr	r5, .L15+52
	mov	r0, r7
	bl	mutex_unlock
	mov	r2, sp
	ldr	r1, [r5]
	mov	r0, r4
	bl	XPC_DISCONNECT_CHANNEL
	mov	r0, r9
	ldr	r1, [sp]
	bl	spin_unlock_irqrestore
	ldr	r0, [r5]
	b	.L1
.L11:
	bl	__stack_chk_fail
.L16:
	.align	2
.L15:
	.word	xpc_registrations
	.word	.LC0
	.word	xpRetry
	.word	XPC_C_CONNECTED
	.word	XPC_C_OPENREQUEST
	.word	XPC_C_DISCONNECTING
	.word	XPC_C_ROPENREQUEST
	.word	XPC_C_CONNECTING
	.word	xpc_arch_ops
	.word	xpSuccess
	.word	XPC_C_DISCONNECTED
	.word	xpc_partitions
	.word	xpUnregistered
	.word	xpUnequalMsgSizes
	.size	xpc_connect_channel, .-xpc_connect_channel
	.comm	xpc_registrations,4,4
	.comm	xpc_partitions,4,4
	.comm	xpc_arch_ops,4,4
	.comm	xpUnregistered,4,4
	.comm	xpUnequalMsgSizes,4,4
	.comm	xpSuccess,4,4
	.comm	xpRetry,4,4
	.comm	XPC_C_ROPENREQUEST,4,4
	.comm	XPC_C_OPENREQUEST,4,4
	.comm	XPC_C_DISCONNECTING,4,4
	.comm	XPC_C_DISCONNECTED,4,4
	.comm	XPC_C_CONNECTING,4,4
	.comm	XPC_C_CONNECTED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
