	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcm_host_init                  ## -- Begin function bcm_host_init
	.p2align	4, 0x90
_bcm_host_init:                         ## @bcm_host_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	%rbx
	subq	$152, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	cmpb	$0, _bcm_host_init.initted(%rip)
	jne	LBB0_4
## %bb.1:
	movb	$1, _bcm_host_init.initted(%rip)
	xorl	%eax, %eax
	callq	_vcos_init
	leaq	-168(%rbp), %rdi
	callq	_vchiq_initialise
	movq	_VCHIQ_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	callq	_vcos_log
	movq	_global_initialise_instance@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	callq	_vchi_initialise
	movl	%eax, %r14d
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_vcos_assert
	movq	(%r15), %rax
	movq	%rax, -168(%rbp)
	xorl	%eax, %eax
	callq	_single_get_func_table
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_vchi_mphi_message_driver_func_table
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_vchi_create_connection
	movq	_global_connection@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	leaq	L_.str.2(%rip), %rdi
	callq	_vcos_log
	movq	(%r15), %rdx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_vchi_connect
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_vc_vchi_gencmd_init
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_vc_vchi_dispmanx_init
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_vc_vchi_tv_init
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_vc_vchi_cec_init
	testl	%r14d, %r14d
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.3(%rip), %rdx
	leaq	-160(%rbp), %rdi
	movl	$128, %esi
	callq	_vc_gencmd
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_vcos_assert
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_7
## %bb.5:
	addq	$152, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
LBB0_6:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	$-1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_bcm_host_init.initted,1,2 ## @bcm_host_init.initted
	.comm	_VCHIQ_SUCCESS,8,3              ## @VCHIQ_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"vchi_initialise"

	.comm	_global_initialise_instance,8,3 ## @global_initialise_instance
	.comm	_global_connection,4,2          ## @global_connection
L_.str.2:                               ## @.str.2
	.asciz	"vchi_connect"

L_.str.3:                               ## @.str.3
	.asciz	"set_vll_dir /sd/vlls"

L_str:                                  ## @str
	.asciz	"* failed to open vchiq instance"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcm_host_init                  ; -- Begin function bcm_host_init
	.p2align	2
_bcm_host_init:                         ; @bcm_host_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	adrp	x8, _bcm_host_init.initted@PAGE
	ldrb	w9, [x8, _bcm_host_init.initted@PAGEOFF]
	tbnz	w9, #0, LBB0_4
; %bb.1:
	mov	w9, #1
	strb	w9, [x8, _bcm_host_init.initted@PAGEOFF]
	bl	_vcos_init
	mov	x0, sp
	bl	_vchiq_initialise
Lloh3:
	adrp	x8, _VCHIQ_SUCCESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VCHIQ_SUCCESS@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.2:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_vcos_log
Lloh8:
	adrp	x20, _global_initialise_instance@GOTPAGE
Lloh9:
	ldr	x20, [x20, _global_initialise_instance@GOTPAGEOFF]
	mov	x0, x20
	bl	_vchi_initialise
	mov	x19, x0
	cmp	w0, #0
	cset	w0, eq
	bl	_vcos_assert
	ldr	x8, [x20]
	str	x8, [sp]
	bl	_single_get_func_table
	mov	x21, x0
	bl	_vchi_mphi_message_driver_func_table
	mov	x1, x0
	mov	x0, x21
	bl	_vchi_create_connection
Lloh10:
	adrp	x21, _global_connection@GOTPAGE
Lloh11:
	ldr	x21, [x21, _global_connection@GOTPAGEOFF]
	str	w0, [x21]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_vcos_log
	ldr	x2, [x20]
	mov	x0, x21
	mov	w1, #1
	bl	_vchi_connect
	ldr	x0, [x20]
	mov	x1, x21
	mov	w2, #1
	bl	_vc_vchi_gencmd_init
	ldr	x0, [x20]
	mov	x1, x21
	mov	w2, #1
	bl	_vc_vchi_dispmanx_init
	ldr	x0, [x20]
	mov	x1, x21
	mov	w2, #1
	bl	_vc_vchi_tv_init
	ldr	x0, [x20]
	mov	x1, x21
	mov	w2, #1
	bl	_vc_vchi_cec_init
	cbnz	w19, LBB0_4
; %bb.3:
Lloh14:
	adrp	x2, l_.str.3@PAGE
Lloh15:
	add	x2, x2, l_.str.3@PAGEOFF
	add	x0, sp, #8
	mov	w1, #128
	bl	_vc_gencmd
	cmp	w0, #0
	cset	w0, eq
	bl	_vcos_assert
LBB0_4:
	ldur	x8, [x29, #-40]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_6:
	bl	___stack_chk_fail
LBB0_7:
Lloh19:
	adrp	x0, l_str@PAGE
Lloh20:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w0, #-1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_bcm_host_init.initted,1,2 ; @bcm_host_init.initted
	.comm	_VCHIQ_SUCCESS,8,3              ; @VCHIQ_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"vchi_initialise"

	.comm	_global_initialise_instance,8,3 ; @global_initialise_instance
	.comm	_global_connection,4,2          ; @global_connection
l_.str.2:                               ; @.str.2
	.asciz	"vchi_connect"

l_.str.3:                               ; @.str.3
	.asciz	"set_vll_dir /sd/vlls"

l_str:                                  ; @str
	.asciz	"* failed to open vchiq instance"

.subsections_via_symbols
