	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc_vchi_khronos_init           ## -- Begin function vc_vchi_khronos_init
	.p2align	4, 0x90
_vc_vchi_khronos_init:                  ## @vc_vchi_khronos_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_bulk_event@GOTPCREL(%rip), %rdi
	xorl	%esi, %esi
	callq	_vcos_event_create
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_UNUSED_NDEBUG
	movq	_VCOS_SUCCESS@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	(%rax), %rbx
	sete	%dil
	callq	_vcos_assert
	movq	_khrn_vchiq_instance@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_vchiq_initialise
	movq	_VCHIQ_SUCCESS@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	jne	LBB0_1
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_vcos_log_trace
	movl	(%r14), %edi
	callq	_vchiq_connect
	cmpq	(%r13), %rax
	jne	LBB0_4
## %bb.5:
	movq	$0, -48(%rbp)
	movq	_VC_KHRN_VERSION@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)
	movq	%rax, -64(%rbp)
	movq	_FOURCC_KHAN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
	movq	_khan_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movl	(%r14), %edi
	movq	_vchiq_khan_service@GOTPCREL(%rip), %rdx
	leaq	-72(%rbp), %r12
	movq	%r12, %rsi
	callq	_vchiq_open_service
	movq	%rax, %r15
	movq	_FOURCC_KHRN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
	movq	_khrn_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movl	(%r14), %edi
	movq	_vchiq_khrn_service@GOTPCREL(%rip), %rdx
	movq	%r12, %rsi
	callq	_vchiq_open_service
	movq	%rax, %rbx
	movq	_FOURCC_KHHN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
	movq	_khhn_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movl	(%r14), %edi
	movq	_vchiq_khhn_service@GOTPCREL(%rip), %rdx
	movq	%r12, %rsi
	callq	_vchiq_open_service
	movq	(%r13), %rcx
	cmpq	%rcx, %r15
	jne	LBB0_8
## %bb.6:
	cmpq	%rcx, %rbx
	jne	LBB0_8
## %bb.7:
	cmpq	%rcx, %rax
	jne	LBB0_8
## %bb.9:
	movq	_khrn_queue@GOTPCREL(%rip), %rdi
	movl	$64, %esi
	callq	_vchiu_queue_init
	movq	_khhn_queue@GOTPCREL(%rip), %rdi
	movl	$64, %esi
	callq	_vchiu_queue_init
	leaq	L_.str.4(%rip), %rdi
	callq	_vcos_log_trace
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
LBB0_2:
	callq	_vcos_log_error
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_bulk_event,4,2                 ## @bulk_event
	.comm	_VCOS_SUCCESS,8,3               ## @VCOS_SUCCESS
	.comm	_khrn_vchiq_instance,4,2        ## @khrn_vchiq_instance
	.comm	_VCHIQ_SUCCESS,8,3              ## @VCHIQ_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"* failed to open vchiq device"

L_.str.1:                               ## @.str.1
	.asciz	"gldemo: connecting"

L_.str.2:                               ## @.str.2
	.asciz	"* failed to connect"

	.comm	_VC_KHRN_VERSION,8,3            ## @VC_KHRN_VERSION
	.comm	_FOURCC_KHAN,4,2                ## @FOURCC_KHAN
	.comm	_khan_callback,4,2              ## @khan_callback
	.comm	_vchiq_khan_service,4,2         ## @vchiq_khan_service
	.comm	_FOURCC_KHRN,4,2                ## @FOURCC_KHRN
	.comm	_khrn_callback,4,2              ## @khrn_callback
	.comm	_vchiq_khrn_service,4,2         ## @vchiq_khrn_service
	.comm	_FOURCC_KHHN,4,2                ## @FOURCC_KHHN
	.comm	_khhn_callback,4,2              ## @khhn_callback
	.comm	_vchiq_khhn_service,4,2         ## @vchiq_khhn_service
L_.str.3:                               ## @.str.3
	.asciz	"* failed to add service - already in use?"

	.comm	_khrn_queue,4,2                 ## @khrn_queue
	.comm	_khhn_queue,4,2                 ## @khhn_queue
L_.str.4:                               ## @.str.4
	.asciz	"gldemo: connected"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc_vchi_khronos_init           ; -- Begin function vc_vchi_khronos_init
	.p2align	2
_vc_vchi_khronos_init:                  ; @vc_vchi_khronos_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	x0, _bulk_event@GOTPAGE
Lloh1:
	ldr	x0, [x0, _bulk_event@GOTPAGEOFF]
	mov	x1, #0
	bl	_vcos_event_create
	mov	x19, x0
	bl	_UNUSED_NDEBUG
Lloh2:
	adrp	x8, _VCOS_SUCCESS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VCOS_SUCCESS@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x19, x8
	cset	w0, eq
	bl	_vcos_assert
Lloh5:
	adrp	x19, _khrn_vchiq_instance@GOTPAGE
Lloh6:
	ldr	x19, [x19, _khrn_vchiq_instance@GOTPAGEOFF]
	mov	x0, x19
	bl	_vchiq_initialise
Lloh7:
	adrp	x22, _VCHIQ_SUCCESS@GOTPAGE
Lloh8:
	ldr	x22, [x22, _VCHIQ_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.1:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_vcos_log_trace
	ldr	w0, [x19]
	bl	_vchiq_connect
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.2:
	str	xzr, [sp, #24]
Lloh11:
	adrp	x8, _VC_KHRN_VERSION@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VC_KHRN_VERSION@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	stp	x8, x8, [sp, #8]
Lloh14:
	adrp	x8, _FOURCC_KHAN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FOURCC_KHAN@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _khan_callback@GOTPAGE
Lloh18:
	ldr	x9, [x9, _khan_callback@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	stp	w9, w8, [sp]
	ldr	w0, [x19]
Lloh20:
	adrp	x2, _vchiq_khan_service@GOTPAGE
Lloh21:
	ldr	x2, [x2, _vchiq_khan_service@GOTPAGEOFF]
	mov	x1, sp
	bl	_vchiq_open_service
	mov	x21, x0
Lloh22:
	adrp	x8, _FOURCC_KHRN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _FOURCC_KHRN@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _khrn_callback@GOTPAGE
Lloh26:
	ldr	x9, [x9, _khrn_callback@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	stp	w9, w8, [sp]
	ldr	w0, [x19]
Lloh28:
	adrp	x2, _vchiq_khrn_service@GOTPAGE
Lloh29:
	ldr	x2, [x2, _vchiq_khrn_service@GOTPAGEOFF]
	mov	x1, sp
	bl	_vchiq_open_service
	mov	x20, x0
Lloh30:
	adrp	x8, _FOURCC_KHHN@GOTPAGE
Lloh31:
	ldr	x8, [x8, _FOURCC_KHHN@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
Lloh33:
	adrp	x9, _khhn_callback@GOTPAGE
Lloh34:
	ldr	x9, [x9, _khhn_callback@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	stp	w9, w8, [sp]
	ldr	w0, [x19]
Lloh36:
	adrp	x2, _vchiq_khhn_service@GOTPAGE
Lloh37:
	ldr	x2, [x2, _vchiq_khhn_service@GOTPAGEOFF]
	mov	x1, sp
	bl	_vchiq_open_service
	ldr	x8, [x22]
	cmp	x21, x8
	b.ne	LBB0_8
; %bb.3:
	cmp	x20, x8
	b.ne	LBB0_8
; %bb.4:
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.5:
Lloh38:
	adrp	x0, _khrn_queue@GOTPAGE
Lloh39:
	ldr	x0, [x0, _khrn_queue@GOTPAGEOFF]
	mov	w1, #64
	bl	_vchiu_queue_init
Lloh40:
	adrp	x0, _khhn_queue@GOTPAGE
Lloh41:
	ldr	x0, [x0, _khhn_queue@GOTPAGEOFF]
	mov	w1, #64
	bl	_vchiu_queue_init
Lloh42:
	adrp	x0, l_.str.4@PAGE
Lloh43:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_vcos_log_trace
	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
LBB0_6:
Lloh44:
	adrp	x0, l_.str@PAGE
Lloh45:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_9
LBB0_7:
Lloh46:
	adrp	x0, l_.str.2@PAGE
Lloh47:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh48:
	adrp	x0, l_.str.3@PAGE
Lloh49:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_9:
	bl	_vcos_log_error
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_bulk_event,4,2                 ; @bulk_event
	.comm	_VCOS_SUCCESS,8,3               ; @VCOS_SUCCESS
	.comm	_khrn_vchiq_instance,4,2        ; @khrn_vchiq_instance
	.comm	_VCHIQ_SUCCESS,8,3              ; @VCHIQ_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"* failed to open vchiq device"

l_.str.1:                               ; @.str.1
	.asciz	"gldemo: connecting"

l_.str.2:                               ; @.str.2
	.asciz	"* failed to connect"

	.comm	_VC_KHRN_VERSION,8,3            ; @VC_KHRN_VERSION
	.comm	_FOURCC_KHAN,4,2                ; @FOURCC_KHAN
	.comm	_khan_callback,4,2              ; @khan_callback
	.comm	_vchiq_khan_service,4,2         ; @vchiq_khan_service
	.comm	_FOURCC_KHRN,4,2                ; @FOURCC_KHRN
	.comm	_khrn_callback,4,2              ; @khrn_callback
	.comm	_vchiq_khrn_service,4,2         ; @vchiq_khrn_service
	.comm	_FOURCC_KHHN,4,2                ; @FOURCC_KHHN
	.comm	_khhn_callback,4,2              ; @khhn_callback
	.comm	_vchiq_khhn_service,4,2         ; @vchiq_khhn_service
l_.str.3:                               ; @.str.3
	.asciz	"* failed to add service - already in use?"

	.comm	_khrn_queue,4,2                 ; @khrn_queue
	.comm	_khhn_queue,4,2                 ; @khhn_queue
l_.str.4:                               ; @.str.4
	.asciz	"gldemo: connected"

.subsections_via_symbols
