	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm2835_audio_init
_bcm2835_audio_init:                    ## @bcm2835_audio_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	%r14
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	leaq	4(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_vchi_initialise
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_3:
	movl	(%rbx), %edx
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_vchi_connect
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	movl	%eax, %esi
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_printf                         ## TAILCALL
LBB0_5:
	movq	_VC_AUDIOSERV_VER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_VC_AUDIOSERV_MIN_VER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_VCHI_VERSION_EX
	movl	%eax, -64(%rbp)
	movq	_VC_AUDIO_SERVER_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	movl	8(%r14), %eax
	movl	%eax, -56(%rbp)
	movq	$0, -48(%rbp)
	movl	$0, -40(%rbp)
	movq	_bcm2835_audio_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movl	%r14d, -32(%rbp)
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, -28(%rbp)
	movl	$0, -20(%rbp)
	movl	4(%r14), %edi
	leaq	-64(%rbp), %rsi
	movq	%r14, %rdx
	callq	_vchi_service_open
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movq	_VCHIQ_SERVICE_HANDLE_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
LBB0_7:
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vchi_initialise failed: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"vchi_connect failed: %d\n"

	.comm	_VC_AUDIOSERV_VER,4,2           ## @VC_AUDIOSERV_VER
	.comm	_VC_AUDIOSERV_MIN_VER,4,2       ## @VC_AUDIOSERV_MIN_VER
	.comm	_VC_AUDIO_SERVER_NAME,4,2       ## @VC_AUDIO_SERVER_NAME
	.comm	_bcm2835_audio_callback,4,2     ## @bcm2835_audio_callback
	.comm	_VCHIQ_SERVICE_HANDLE_INVALID,4,2 ## @VCHIQ_SERVICE_HANDLE_INVALID
	.no_dead_strip	_bcm2835_audio_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm2835_audio_init
_bcm2835_audio_init:                    ; @bcm2835_audio_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
	add	x20, x0, #4
	mov	x0, x20
	bl	_vchi_initialise
	mov	x1, x0
	cbz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	ldr	w2, [x20]
	mov	x0, #0
	bl	_vchi_connect
	cbz	w0, LBB0_5
; %bb.3:
	mov	x1, x0
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_4:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_printf
LBB0_5:
Lloh4:
	adrp	x8, _VC_AUDIOSERV_VER@GOTPAGE
Lloh5:
	ldr	x8, [x8, _VC_AUDIOSERV_VER@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x8, _VC_AUDIOSERV_MIN_VER@GOTPAGE
Lloh8:
	ldr	x8, [x8, _VC_AUDIOSERV_MIN_VER@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_VCHI_VERSION_EX
Lloh10:
	adrp	x8, _VC_AUDIO_SERVER_NAME@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VC_AUDIO_SERVER_NAME@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	stp	w0, w8, [sp]
	ldp	w0, w8, [x19, #4]
	str	w8, [sp, #8]
Lloh13:
	adrp	x8, _bcm2835_audio_callback@GOTPAGE
Lloh14:
	ldr	x8, [x8, _bcm2835_audio_callback@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	stp	wzr, w8, [sp, #24]
	str	xzr, [sp, #16]
	str	w19, [sp, #32]
	movi.2s	v0, #1
	stur	d0, [sp, #36]
	str	wzr, [sp, #44]
	mov	x1, sp
	mov	x2, x19
	bl	_vchi_service_open
	cbz	w0, LBB0_7
; %bb.6:
Lloh16:
	adrp	x8, _VCHIQ_SERVICE_HANDLE_INVALID@GOTPAGE
Lloh17:
	ldr	x8, [x8, _VCHIQ_SERVICE_HANDLE_INVALID@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vchi_initialise failed: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"vchi_connect failed: %d\n"

	.comm	_VC_AUDIOSERV_VER,4,2           ; @VC_AUDIOSERV_VER
	.comm	_VC_AUDIOSERV_MIN_VER,4,2       ; @VC_AUDIOSERV_MIN_VER
	.comm	_VC_AUDIO_SERVER_NAME,4,2       ; @VC_AUDIO_SERVER_NAME
	.comm	_bcm2835_audio_callback,4,2     ; @bcm2835_audio_callback
	.comm	_VCHIQ_SERVICE_HANDLE_INVALID,4,2 ; @VCHIQ_SERVICE_HANDLE_INVALID
	.no_dead_strip	_bcm2835_audio_init
.subsections_via_symbols
