	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function create_service
_create_service:                        ## @create_service
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r12
	movl	%ecx, %ebx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_VCHIQ_SUCCESS@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	callq	_is_valid_instance
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	4(%r14), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_vcos_mutex_lock
	movl	(%r14), %eax
	testl	%ebx, %ebx
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_7
## %bb.3:
	testl	%eax, %eax
	jle	LBB0_17
## %bb.4:
	movq	16(%r14), %r12
	movq	_VCHIQ_SERVICE_HANDLE_INVALID@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rcx, (%r12)
	je	LBB0_23
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	addq	$72, %r12
	decq	%rax
	jne	LBB0_6
	jmp	LBB0_17
LBB0_1:
	movq	_VCHIQ_ERROR@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	jmp	LBB0_27
LBB0_7:
	testl	%eax, %eax
	jle	LBB0_17
## %bb.8:
	movq	16(%r14), %rcx
	movq	_VCHIQ_SERVICE_HANDLE_INVALID@GOTPCREL(%rip), %rdx
	movq	(%rdx), %r8
	incq	%rax
	xorl	%r12d, %r12d
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_9 Depth=1
	leaq	(%rcx,%rbx,8), %r12
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	decq	%rax
	cmpq	$1, %rax
	jbe	LBB0_12
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	leal	-2(%rax), %edx
	leaq	(%rdx,%rdx,8), %rbx
	movq	(%rcx,%rbx,8), %rsi
	cmpq	%r8, %rsi
	je	LBB0_10
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	64(%rcx,%rbx,8), %edx
	cmpl	8(%r15), %edx
	jne	LBB0_11
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	48(%rcx,%rbx,8), %rdi
	cmpq	(%r15), %rdi
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpq	%r9, 8(%rcx,%rbx,8)
	je	LBB0_11
LBB0_16:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_vcos_log_info
	movq	_VCHIQ_ERROR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_VCHIQ_SUCCESS@GOTPCREL(%rip), %r13
	jmp	LBB0_17
LBB0_12:
	testq	%r12, %r12
	movq	_VCHIQ_SUCCESS@GOTPCREL(%rip), %r13
	jne	LBB0_23
LBB0_17:
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	cmpq	(%r13), %r12
	jne	LBB0_20
## %bb.18:
	movslq	(%r14), %rax
	movq	_VCHIQ_MAX_INSTANCE_SERVICES@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_19
## %bb.21:
	movq	16(%r14), %rcx
	leal	1(%rax), %edx
	movl	%edx, (%r14)
	testq	%rcx, %rcx
	je	LBB0_20
## %bb.22:
	leaq	(%rax,%rax,8), %rax
	leaq	(%rcx,%rax,8), %r12
LBB0_23:
	movq	_handle_seq@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	movq	_VCHIQ_MAX_INSTANCE_SERVICES@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmovel	%edx, %ecx
	movq	%r12, %rsi
	subq	16(%r14), %rsi
	movslq	%ecx, %rcx
	sarq	$3, %rsi
	movabsq	$-8198552921648689607, %rdi     ## imm = 0x8E38E38E38E38E39
	imulq	%rsi, %rdi
	orq	%rcx, %rdi
	movq	%rdi, (%r12)
	addl	%edx, %ecx
	movl	%ecx, (%rax)
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_vcos_mutex_unlock
	movl	8(%r15), %eax
	movl	%eax, 64(%r12)
	movq	(%r15), %rax
	movq	%rax, 48(%r12)
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 8(%r12)
	movq	16(%r15), %rcx
	movq	%rcx, 56(%r12)
	movl	8(%r14), %edi
	movl	%edi, 40(%r12)
	movl	$-1, 16(%r12)
	movq	$0, 32(%r12)
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, 20(%r12)
	movups	(%r15), %xmm0
	movups	%xmm0, -104(%rbp)
	movq	%r12, -88(%rbp)
	movl	%ecx, -128(%rbp)
	xorl	%ecx, %ecx
	testq	%rax, %rax
	sete	%cl
	movl	%ecx, -112(%rbp)
	movq	_VCHIQ_SERVICE_HANDLE_INVALID@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	%rax, -120(%rbp)
	movq	_VCHIQ_IOC_CREATE_SERVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-128(%rbp), %rdx
	callq	_ioctl
	movl	%eax, %esi
	callq	_RETRY
	movq	_VCHIQ_ERROR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, %r13
	movq	_VCHIQ_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_25
## %bb.24:
	movl	(%r12), %edx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%edx, (%rax)
	movq	24(%r12), %rsi
	movl	8(%r15), %ecx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_vcos_log_info
	movq	%r13, %r12
	jmp	LBB0_27
LBB0_25:
	movq	%rbx, %rdi
	callq	_vcos_mutex_lock
	movq	(%r14), %rax
	movq	%rax, (%r12)
	movq	%r13, %r12
	jmp	LBB0_26
LBB0_19:
	movq	_VCHIQ_ERROR@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
LBB0_20:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_vcos_mutex_unlock
	movq	%rbx, %rdi
	callq	_vcos_mutex_lock
LBB0_26:
	movq	%rbx, %rdi
	callq	_vcos_mutex_unlock
	movq	_VCHIQ_SERVICE_HANDLE_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
LBB0_27:
	movq	%r12, %rax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VCHIQ_SUCCESS,8,3              ## @VCHIQ_SUCCESS
	.comm	_VCHIQ_ERROR,8,3                ## @VCHIQ_ERROR
	.comm	_VCHIQ_SERVICE_HANDLE_INVALID,8,3 ## @VCHIQ_SERVICE_HANDLE_INVALID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"service %x already using fourcc 0x%x"

	.comm	_VCHIQ_MAX_INSTANCE_SERVICES,4,2 ## @VCHIQ_MAX_INSTANCE_SERVICES
	.comm	_handle_seq,4,2                 ## @handle_seq
	.comm	_VCHIQ_IOC_CREATE_SERVICE,4,2   ## @VCHIQ_IOC_CREATE_SERVICE
L_.str.1:                               ## @.str.1
	.asciz	"service handle %x lib_handle %x using fourcc 0x%x"

	.no_dead_strip	_create_service
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function create_service
_create_service:                        ; @create_service
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x4
	mov	x23, x3
	mov	x25, x2
	mov	x21, x1
	mov	x24, x0
Lloh0:
	adrp	x27, _VCHIQ_SUCCESS@GOTPAGE
Lloh1:
	ldr	x27, [x27, _VCHIQ_SUCCESS@GOTPAGEOFF]
	ldr	x22, [x27]
	bl	_is_valid_instance
	cbz	w0, LBB0_6
; %bb.1:
	add	x20, x24, #4
	mov	x0, x20
	bl	_vcos_mutex_lock
	ldr	w10, [x24]
Lloh2:
	adrp	x26, _VCHIQ_SERVICE_HANDLE_INVALID@GOTPAGE
Lloh3:
	ldr	x26, [x26, _VCHIQ_SERVICE_HANDLE_INVALID@GOTPAGEOFF]
	cmp	w10, #1
	cbz	w23, LBB0_7
; %bb.2:
	b.lt	LBB0_17
; %bb.3:
	ldr	x28, [x24, #16]
	ldr	x8, [x26]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x28]
	cmp	x9, x8
	b.eq	LBB0_21
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x28, x28, #72
	subs	x10, x10, #1
	b.ne	LBB0_4
	b	LBB0_17
LBB0_6:
Lloh4:
	adrp	x8, _VCHIQ_ERROR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _VCHIQ_ERROR@GOTPAGEOFF]
Lloh6:
	ldr	x22, [x8]
	b	LBB0_27
LBB0_7:
	b.lt	LBB0_17
; %bb.8:
	mov	x28, #0
	ldr	x8, [x24, #16]
	ldr	x9, [x26]
	add	x10, x10, #1
	mov	w11, #72
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	mov	x28, x13
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	sub	x10, x10, #1
	cmp	x10, #1
	b.ls	LBB0_16
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	sub	w12, w10, #2
	umaddl	x13, w12, w11, x8
	ldr	x1, [x13]
	cmp	x1, x9
	b.eq	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	madd	x13, x12, x11, x8
	ldr	w2, [x13, #64]
	ldr	w13, [x21, #8]
	cmp	w2, w13
	b.ne	LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	madd	x13, x12, x11, x8
	ldr	x13, [x13, #48]
	ldr	x14, [x21]
	cmp	x13, x14
	b.ne	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	madd	x12, x12, x11, x8
	ldr	x12, [x12, #8]
	cmp	x12, x25
	b.eq	LBB0_10
LBB0_15:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_vcos_log_info
Lloh9:
	adrp	x8, _VCHIQ_ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VCHIQ_ERROR@GOTPAGEOFF]
Lloh11:
	ldr	x22, [x8]
	b	LBB0_17
LBB0_16:
	cbnz	x28, LBB0_21
LBB0_17:
	ldr	x8, [x27]
	cmp	x22, x8
	b.ne	LBB0_25
; %bb.18:
	ldrsw	x8, [x24]
Lloh12:
	adrp	x9, _VCHIQ_MAX_INSTANCE_SERVICES@GOTPAGE
Lloh13:
	ldr	x9, [x9, _VCHIQ_MAX_INSTANCE_SERVICES@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_24
; %bb.19:
	ldr	x9, [x24, #16]
	add	w10, w8, #1
	str	w10, [x24]
	cbz	x9, LBB0_25
; %bb.20:
	mov	w10, #72
	madd	x28, x8, x10, x9
LBB0_21:
Lloh15:
	adrp	x8, _handle_seq@GOTPAGE
Lloh16:
	ldr	x8, [x8, _handle_seq@GOTPAGEOFF]
	ldr	w9, [x8]
Lloh17:
	adrp	x10, _VCHIQ_MAX_INSTANCE_SERVICES@GOTPAGE
Lloh18:
	ldr	x10, [x10, _VCHIQ_MAX_INSTANCE_SERVICES@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	cmp	w9, #0
	csel	w9, w10, w9, eq
	sxtw	x11, w9
	ldr	x12, [x24, #16]
	sub	x12, x28, x12
	asr	x12, x12, #3
	mov	x13, #36409
	movk	x13, #14563, lsl #16
	movk	x13, #58254, lsl #32
	movk	x13, #36408, lsl #48
	mul	x12, x12, x13
	orr	x11, x12, x11
	str	x11, [x28]
	add	w9, w10, w9
	str	w9, [x8]
	mov	x0, x20
	bl	_vcos_mutex_unlock
	ldr	w8, [x21, #8]
	str	w8, [x28, #64]
	ldr	x8, [x21]
	str	x8, [x28, #48]
	str	x25, [x28, #8]
	ldr	x9, [x21, #16]
	str	x9, [x28, #56]
	ldr	w0, [x24, #8]
	str	w0, [x28, #40]
	mov	w9, #-1
	str	xzr, [x28, #32]
	stp	w9, w23, [x28, #16]
	ldr	q0, [x21]
	stur	q0, [sp, #40]
	str	x28, [sp, #56]
	str	w23, [sp, #16]
	cmp	x8, #0
	cset	w8, eq
	str	w8, [sp, #32]
	ldr	x8, [x26]
	str	x8, [sp, #24]
Lloh20:
	adrp	x8, _VCHIQ_IOC_CREATE_SERVICE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _VCHIQ_IOC_CREATE_SERVICE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	add	x2, sp, #16
	bl	_ioctl
	mov	x1, x0
	bl	_RETRY
Lloh23:
	adrp	x8, _VCHIQ_ERROR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _VCHIQ_ERROR@GOTPAGEOFF]
Lloh25:
	ldr	x22, [x8]
	ldr	x8, [x27]
	cmp	x22, x8
	b.ne	LBB0_23
; %bb.22:
	ldr	w2, [x28]
	str	w2, [x19]
	ldr	x1, [x28, #24]
	ldr	w8, [x21, #8]
	str	x8, [sp]
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_vcos_log_info
	b	LBB0_27
LBB0_23:
	mov	x0, x20
	bl	_vcos_mutex_lock
	ldr	x8, [x26]
	str	x8, [x28]
	b	LBB0_26
LBB0_24:
Lloh28:
	adrp	x8, _VCHIQ_ERROR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _VCHIQ_ERROR@GOTPAGEOFF]
Lloh30:
	ldr	x22, [x8]
LBB0_25:
	mov	x0, x20
	bl	_vcos_mutex_unlock
	mov	x0, x20
	bl	_vcos_mutex_lock
LBB0_26:
	mov	x0, x20
	bl	_vcos_mutex_unlock
	ldr	x8, [x26]
	str	w8, [x19]
LBB0_27:
	mov	x0, x22
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_VCHIQ_SUCCESS,8,3              ; @VCHIQ_SUCCESS
	.comm	_VCHIQ_ERROR,8,3                ; @VCHIQ_ERROR
	.comm	_VCHIQ_SERVICE_HANDLE_INVALID,8,3 ; @VCHIQ_SERVICE_HANDLE_INVALID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"service %x already using fourcc 0x%x"

	.comm	_VCHIQ_MAX_INSTANCE_SERVICES,4,2 ; @VCHIQ_MAX_INSTANCE_SERVICES
	.comm	_handle_seq,4,2                 ; @handle_seq
	.comm	_VCHIQ_IOC_CREATE_SERVICE,4,2   ; @VCHIQ_IOC_CREATE_SERVICE
l_.str.1:                               ; @.str.1
	.asciz	"service handle %x lib_handle %x using fourcc 0x%x"

	.no_dead_strip	_create_service
.subsections_via_symbols
