	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmal_vc_init_fd                ## -- Begin function mmal_vc_init_fd
	.p2align	4, 0x90
_mmal_vc_init_fd:                       ## @mmal_vc_init_fd
	.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
	movl	%edi, %ebx
	movq	_init_once@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_once@GOTPCREL(%rip), %rdi
	callq	_vcos_once
	movq	_client@GOTPCREL(%rip), %r13
	leaq	8(%r13), %r15
	movq	%r15, %rdi
	callq	_vcos_mutex_lock
	movl	12(%r13), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 12(%r13)
	testl	%eax, %eax
	jle	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_vcos_mutex_unlock
	movq	_MMAL_SUCCESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_16
LBB0_2:
	movq	_VCOS_LOG_CATEGORY@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	L_.str(%rip), %rdi
	callq	_vcos_log_register
	movq	_mmal_vchiq_instance@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vchiq_initialise_fd
	movq	_VCHIQ_SUCCESS@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_17
## %bb.3:
	movl	(%r14), %edi
	callq	_vchiq_connect
	cmpq	(%rbx), %rax
	jne	LBB0_4
## %bb.6:
	leaq	-64(%rbp), %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	xorl	%eax, %eax
	callq	_MMAL_CONTROL_FOURCC
	movl	%eax, -44(%rbp)
	movq	_mmal_vc_vchiq_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	%r13, -56(%rbp)
	movq	_WORKER_VER_MAJOR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	movq	_WORKER_VER_MINIMUM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movl	(%r14), %edi
	leaq	16(%r13), %rdx
	leaq	-64(%rbp), %rsi
	callq	_vchiq_open_service
	cmpq	(%rbx), %rax
	jne	LBB0_7
## %bb.8:
	movl	$1, (%r13)
	leaq	20(%r13), %r12
	movq	%r12, %rdi
	callq	_create_waitpool
	movq	%rax, %rbx
	movq	_MMAL_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_12
## %bb.9:
	movq	%rax, %rbx
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	leaq	24(%r13), %rdi
	leaq	L_.str.5(%rip), %rsi
	callq	_vcos_mutex_create
	movq	_VCOS_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.10:
	movl	$1, 4(%r13)
	movq	%r15, %rdi
	callq	_vcos_mutex_unlock
	xorl	%eax, %eax
	callq	_mmal_vc_release
	movq	(%rbx), %rbx
	jmp	LBB0_16
LBB0_17:
	leaq	L_.str.1(%rip), %rdi
	callq	_LOG_ERROR
	movq	_MMAL_EIO@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_15
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_5
LBB0_7:
	leaq	L_.str.3(%rip), %rdi
LBB0_5:
	callq	_LOG_ERROR
	movq	_MMAL_EIO@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_14:
	movl	(%r14), %edi
	callq	_vchiq_shutdown
LBB0_15:
	movl	(%r12), %edi
	callq	_vcos_log_unregister
	decl	12(%r13)
	movq	%r15, %rdi
	callq	_vcos_mutex_unlock
LBB0_16:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	L_.str.4(%rip), %rdi
	callq	_LOG_ERROR
	jmp	LBB0_13
LBB0_11:
	leaq	L_.str.6(%rip), %rdi
	callq	_LOG_ERROR
	movq	_MMAL_ENOSPC@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_destroy_waitpool
LBB0_13:
	movl	$0, (%r13)
	movl	16(%r13), %edi
	callq	_vchiq_close_service
	movq	_VCOS_LOG_CATEGORY@GOTPCREL(%rip), %r12
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_MMAL_EIO,8,3                   ## @MMAL_EIO
	.comm	_once,4,2                       ## @once
	.comm	_init_once,4,2                  ## @init_once
	.comm	_client,28,2                    ## @client
	.comm	_MMAL_SUCCESS,8,3               ## @MMAL_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mmalipc"

	.comm	_VCOS_LOG_CATEGORY,4,2          ## @VCOS_LOG_CATEGORY
	.comm	_mmal_vchiq_instance,4,2        ## @mmal_vchiq_instance
	.comm	_VCHIQ_SUCCESS,8,3              ## @VCHIQ_SUCCESS
L_.str.1:                               ## @.str.1
	.asciz	"failed to initialise vchiq"

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

	.comm	_mmal_vc_vchiq_callback,4,2     ## @mmal_vc_vchiq_callback
	.comm	_WORKER_VER_MAJOR,4,2           ## @WORKER_VER_MAJOR
	.comm	_WORKER_VER_MINIMUM,4,2         ## @WORKER_VER_MINIMUM
L_.str.3:                               ## @.str.3
	.asciz	"could not open vchiq service"

L_.str.4:                               ## @.str.4
	.asciz	"could not create wait pool"

L_.str.5:                               ## @.str.5
	.asciz	"mmal client bulk lock"

	.comm	_VCOS_SUCCESS,8,3               ## @VCOS_SUCCESS
L_.str.6:                               ## @.str.6
	.asciz	"could not create bulk lock"

	.comm	_MMAL_ENOSPC,8,3                ## @MMAL_ENOSPC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmal_vc_init_fd                ; -- Begin function mmal_vc_init_fd
	.p2align	2
_mmal_vc_init_fd:                       ; @mmal_vc_init_fd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, _init_once@GOTPAGE
Lloh1:
	ldr	x8, [x8, _init_once@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, _once@GOTPAGE
Lloh4:
	ldr	x0, [x0, _once@GOTPAGEOFF]
	bl	_vcos_once
Lloh5:
	adrp	x21, _client@GOTPAGE
Lloh6:
	ldr	x21, [x21, _client@GOTPAGEOFF]
	add	x19, x21, #8
	mov	x0, x19
	bl	_vcos_mutex_lock
	ldr	w8, [x21, #12]
	add	w9, w8, #1
	str	w9, [x21, #12]
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_vcos_mutex_unlock
Lloh7:
	adrp	x8, _MMAL_SUCCESS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MMAL_SUCCESS@GOTPAGEOFF]
Lloh9:
	ldr	x20, [x8]
	b	LBB0_14
LBB0_2:
Lloh10:
	adrp	x22, _VCOS_LOG_CATEGORY@GOTPAGE
Lloh11:
	ldr	x22, [x22, _VCOS_LOG_CATEGORY@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_vcos_log_register
Lloh14:
	adrp	x19, _mmal_vchiq_instance@GOTPAGE
Lloh15:
	ldr	x19, [x19, _mmal_vchiq_instance@GOTPAGEOFF]
	mov	x0, x19
	mov	x1, x20
	bl	_vchiq_initialise_fd
Lloh16:
	adrp	x20, _VCHIQ_SUCCESS@GOTPAGE
Lloh17:
	ldr	x20, [x20, _VCHIQ_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x20]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.3:
	ldr	w0, [x19]
	bl	_vchiq_connect
	ldr	x8, [x20]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.4:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	bl	_MMAL_CONTROL_FOURCC
Lloh18:
	adrp	x8, _mmal_vc_vchiq_callback@GOTPAGE
Lloh19:
	ldr	x8, [x8, _mmal_vc_vchiq_callback@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	stp	w8, w0, [sp, #24]
	str	x21, [sp, #16]
Lloh21:
	adrp	x8, _WORKER_VER_MAJOR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _WORKER_VER_MAJOR@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _WORKER_VER_MINIMUM@GOTPAGE
Lloh25:
	ldr	x9, [x9, _WORKER_VER_MINIMUM@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #8]
	ldr	w0, [x19]
	add	x2, x21, #16
	add	x1, sp, #8
	bl	_vchiq_open_service
	ldr	x8, [x20]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.5:
	mov	w8, #1
	mov	x0, x21
	str	w8, [x0], #20
	bl	_create_waitpool
Lloh27:
	adrp	x23, _MMAL_SUCCESS@GOTPAGE
Lloh28:
	ldr	x23, [x23, _MMAL_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_15
; %bb.6:
	add	x0, x21, #24
Lloh29:
	adrp	x1, l_.str.5@PAGE
Lloh30:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_vcos_mutex_create
Lloh31:
	adrp	x8, _VCOS_SUCCESS@GOTPAGE
Lloh32:
	ldr	x8, [x8, _VCOS_SUCCESS@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_16
; %bb.7:
	mov	w8, #1
	str	w8, [x21, #4]
	add	x0, x21, #8
	bl	_vcos_mutex_unlock
	bl	_mmal_vc_release
	ldr	x20, [x23]
	b	LBB0_14
LBB0_8:
Lloh34:
	adrp	x0, l_.str.1@PAGE
Lloh35:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_LOG_ERROR
Lloh36:
	adrp	x8, _MMAL_EIO@GOTPAGE
Lloh37:
	ldr	x8, [x8, _MMAL_EIO@GOTPAGEOFF]
Lloh38:
	ldr	x20, [x8]
	b	LBB0_13
LBB0_9:
Lloh39:
	adrp	x0, l_.str.2@PAGE
Lloh40:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh41:
	adrp	x0, l_.str.3@PAGE
Lloh42:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_11:
	bl	_LOG_ERROR
Lloh43:
	adrp	x8, _MMAL_EIO@GOTPAGE
Lloh44:
	ldr	x8, [x8, _MMAL_EIO@GOTPAGEOFF]
Lloh45:
	ldr	x20, [x8]
LBB0_12:
	ldr	w0, [x19]
	bl	_vchiq_shutdown
LBB0_13:
	ldr	w0, [x22]
	bl	_vcos_log_unregister
	ldr	w8, [x21, #12]
	sub	w8, w8, #1
	str	w8, [x21, #12]
	add	x0, x21, #8
	bl	_vcos_mutex_unlock
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_15:
	mov	x20, x0
Lloh46:
	adrp	x0, l_.str.4@PAGE
Lloh47:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_LOG_ERROR
	b	LBB0_17
LBB0_16:
Lloh48:
	adrp	x0, l_.str.6@PAGE
Lloh49:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_LOG_ERROR
Lloh50:
	adrp	x8, _MMAL_ENOSPC@GOTPAGE
Lloh51:
	ldr	x8, [x8, _MMAL_ENOSPC@GOTPAGEOFF]
Lloh52:
	ldr	x20, [x8]
	add	x0, x21, #20
	bl	_destroy_waitpool
LBB0_17:
	str	wzr, [x21]
	ldr	w0, [x21, #16]
	bl	_vchiq_close_service
	b	LBB0_12
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpAdd	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_MMAL_EIO,8,3                   ; @MMAL_EIO
	.comm	_once,4,2                       ; @once
	.comm	_init_once,4,2                  ; @init_once
	.comm	_client,28,2                    ; @client
	.comm	_MMAL_SUCCESS,8,3               ; @MMAL_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mmalipc"

	.comm	_VCOS_LOG_CATEGORY,4,2          ; @VCOS_LOG_CATEGORY
	.comm	_mmal_vchiq_instance,4,2        ; @mmal_vchiq_instance
	.comm	_VCHIQ_SUCCESS,8,3              ; @VCHIQ_SUCCESS
l_.str.1:                               ; @.str.1
	.asciz	"failed to initialise vchiq"

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

	.comm	_mmal_vc_vchiq_callback,4,2     ; @mmal_vc_vchiq_callback
	.comm	_WORKER_VER_MAJOR,4,2           ; @WORKER_VER_MAJOR
	.comm	_WORKER_VER_MINIMUM,4,2         ; @WORKER_VER_MINIMUM
l_.str.3:                               ; @.str.3
	.asciz	"could not open vchiq service"

l_.str.4:                               ; @.str.4
	.asciz	"could not create wait pool"

l_.str.5:                               ; @.str.5
	.asciz	"mmal client bulk lock"

	.comm	_VCOS_SUCCESS,8,3               ; @VCOS_SUCCESS
l_.str.6:                               ; @.str.6
	.asciz	"could not create bulk lock"

	.comm	_MMAL_ENOSPC,8,3                ; @MMAL_ENOSPC
.subsections_via_symbols
