	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc_gpuserv_init                ## -- Begin function vc_gpuserv_init
	.p2align	4, 0x90
_vc_gpuserv_init:                       ## @vc_gpuserv_init
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_init_once@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_gpuserv_client_once@GOTPCREL(%rip), %rdi
	callq	_vcos_once
	movq	_gpuserv_client@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_vcos_mutex_lock
	movl	8(%rbx), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 8(%rbx)
	testl	%eax, %eax
	jle	LBB0_2
## %bb.1:
	movq	_gpuserv_client@GOTPCREL(%rip), %rdi
	callq	_vcos_mutex_unlock
	movq	_VCOS_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_10
LBB0_2:
	movq	_VCOS_LOG_CATEGORY@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_VCOS_LOG_TRACE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_vcos_log_set_level
	movl	(%r14), %esi
	leaq	L_.str(%rip), %rdi
	callq	_vcos_log_register
	movq	_VCOS_FUNCTION@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_vcos_log_trace
	movq	_gpuserv_client_vchiq_instance@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	callq	_vchiq_initialise
	movq	_VCHIQ_SUCCESS@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_3
## %bb.5:
	movl	(%r15), %edi
	callq	_vchiq_connect
	cmpq	(%r12), %rax
	jne	LBB0_6
## %bb.7:
	leaq	-64(%rbp), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movl	$71, %edi
	movl	$80, %esi
	movl	$85, %edx
	movl	$83, %ecx
	callq	_VCHIQ_MAKE_FOURCC
	movl	%eax, -44(%rbp)
	movq	_gpuserv_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	$0, -56(%rbp)
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, -64(%rbp)
	movl	(%r15), %edi
	addq	$4, %rbx
	leaq	-64(%rbp), %rsi
	movq	%rbx, %rdx
	callq	_vchiq_open_service
	cmpq	(%r12), %rax
	jne	LBB0_8
## %bb.9:
	movq	_gpuserv_client@GOTPCREL(%rip), %rdi
	callq	_vcos_mutex_unlock
	jmp	LBB0_10
LBB0_3:
	movl	(%r13), %esi
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_4
LBB0_6:
	movl	(%r13), %esi
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_4
LBB0_8:
	movl	(%r13), %esi
	leaq	L_.str.4(%rip), %rdi
LBB0_4:
	movq	%rax, %rdx
	callq	_vcos_log_error
	movq	_gpuserv_client@GOTPCREL(%rip), %rdi
	callq	_vcos_mutex_unlock
	movl	$-1, %r14d
LBB0_10:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gpuserv_client_once,4,2        ## @gpuserv_client_once
	.comm	_init_once,4,2                  ## @init_once
	.comm	_gpuserv_client,12,2            ## @gpuserv_client
	.comm	_VCOS_SUCCESS,4,2               ## @VCOS_SUCCESS
	.comm	_VCOS_LOG_CATEGORY,4,2          ## @VCOS_LOG_CATEGORY
	.comm	_VCOS_LOG_TRACE,4,2             ## @VCOS_LOG_TRACE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gpuserv"

L_.str.1:                               ## @.str.1
	.asciz	"%s: starting initialisation"

	.comm	_VCOS_FUNCTION,4,2              ## @VCOS_FUNCTION
	.comm	_gpuserv_client_vchiq_instance,4,2 ## @gpuserv_client_vchiq_instance
	.comm	_VCHIQ_SUCCESS,8,3              ## @VCHIQ_SUCCESS
L_.str.2:                               ## @.str.2
	.asciz	"%s: failed to initialise vchiq: %d"

L_.str.3:                               ## @.str.3
	.asciz	"%s: failed to connect to vchiq: %d"

	.comm	_gpuserv_callback,4,2           ## @gpuserv_callback
L_.str.4:                               ## @.str.4
	.asciz	"%s: could not open vchiq service: %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc_gpuserv_init                ; -- Begin function vc_gpuserv_init
	.p2align	2
_vc_gpuserv_init:                       ; @vc_gpuserv_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, _init_once@GOTPAGE
Lloh1:
	ldr	x8, [x8, _init_once@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, _gpuserv_client_once@GOTPAGE
Lloh4:
	ldr	x0, [x0, _gpuserv_client_once@GOTPAGEOFF]
	bl	_vcos_once
Lloh5:
	adrp	x19, _gpuserv_client@GOTPAGE
Lloh6:
	ldr	x19, [x19, _gpuserv_client@GOTPAGEOFF]
	mov	x0, x19
	bl	_vcos_mutex_lock
	ldr	w8, [x19, #8]
	add	w9, w8, #1
	str	w9, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.1:
Lloh7:
	adrp	x0, _gpuserv_client@GOTPAGE
Lloh8:
	ldr	x0, [x0, _gpuserv_client@GOTPAGEOFF]
	bl	_vcos_mutex_unlock
Lloh9:
	adrp	x8, _VCOS_SUCCESS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VCOS_SUCCESS@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	b	LBB0_10
LBB0_2:
Lloh12:
	adrp	x20, _VCOS_LOG_CATEGORY@GOTPAGE
Lloh13:
	ldr	x20, [x20, _VCOS_LOG_CATEGORY@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh14:
	adrp	x8, _VCOS_LOG_TRACE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VCOS_LOG_TRACE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_vcos_log_set_level
	ldr	w1, [x20]
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_vcos_log_register
Lloh19:
	adrp	x21, _VCOS_FUNCTION@GOTPAGE
Lloh20:
	ldr	x21, [x21, _VCOS_FUNCTION@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_vcos_log_trace
Lloh23:
	adrp	x20, _gpuserv_client_vchiq_instance@GOTPAGE
Lloh24:
	ldr	x20, [x20, _gpuserv_client_vchiq_instance@GOTPAGEOFF]
	mov	x0, x20
	bl	_vchiq_initialise
Lloh25:
	adrp	x22, _VCHIQ_SUCCESS@GOTPAGE
Lloh26:
	ldr	x22, [x22, _VCHIQ_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.3:
	ldr	w0, [x20]
	bl	_vchiq_connect
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.4:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	mov	w0, #71
	mov	w1, #80
	mov	w2, #85
	mov	w3, #83
	bl	_VCHIQ_MAKE_FOURCC
Lloh27:
	adrp	x8, _gpuserv_callback@GOTPAGE
Lloh28:
	ldr	x8, [x8, _gpuserv_callback@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	stp	w8, w0, [sp, #24]
	str	xzr, [sp, #16]
	movi.2s	v0, #1
	str	d0, [sp, #8]
	ldr	w0, [x20]
	add	x2, x19, #4
	add	x1, sp, #8
	bl	_vchiq_open_service
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.5:
Lloh30:
	adrp	x0, _gpuserv_client@GOTPAGE
Lloh31:
	ldr	x0, [x0, _gpuserv_client@GOTPAGEOFF]
	bl	_vcos_mutex_unlock
	mov	w0, #0
	b	LBB0_10
LBB0_6:
	mov	x2, x0
	ldr	w1, [x21]
Lloh32:
	adrp	x0, l_.str.2@PAGE
Lloh33:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_7:
	mov	x2, x0
	ldr	w1, [x21]
Lloh34:
	adrp	x0, l_.str.3@PAGE
Lloh35:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_9
LBB0_8:
	mov	x2, x0
	ldr	w1, [x21]
Lloh36:
	adrp	x0, l_.str.4@PAGE
Lloh37:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_9:
	bl	_vcos_log_error
Lloh38:
	adrp	x0, _gpuserv_client@GOTPAGE
Lloh39:
	ldr	x0, [x0, _gpuserv_client@GOTPAGEOFF]
	bl	_vcos_mutex_unlock
	mov	w0, #-1
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_gpuserv_client_once,4,2        ; @gpuserv_client_once
	.comm	_init_once,4,2                  ; @init_once
	.comm	_gpuserv_client,12,2            ; @gpuserv_client
	.comm	_VCOS_SUCCESS,4,2               ; @VCOS_SUCCESS
	.comm	_VCOS_LOG_CATEGORY,4,2          ; @VCOS_LOG_CATEGORY
	.comm	_VCOS_LOG_TRACE,4,2             ; @VCOS_LOG_TRACE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gpuserv"

l_.str.1:                               ; @.str.1
	.asciz	"%s: starting initialisation"

	.comm	_VCOS_FUNCTION,4,2              ; @VCOS_FUNCTION
	.comm	_gpuserv_client_vchiq_instance,4,2 ; @gpuserv_client_vchiq_instance
	.comm	_VCHIQ_SUCCESS,8,3              ; @VCHIQ_SUCCESS
l_.str.2:                               ; @.str.2
	.asciz	"%s: failed to initialise vchiq: %d"

l_.str.3:                               ; @.str.3
	.asciz	"%s: failed to connect to vchiq: %d"

	.comm	_gpuserv_callback,4,2           ; @gpuserv_callback
l_.str.4:                               ; @.str.4
	.asciz	"%s: could not open vchiq service: %d"

.subsections_via_symbols
