	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmal_port_connect              ## -- Begin function mmal_port_connect
	.p2align	4, 0x90
_mmal_port_connect:                     ## @mmal_port_connect
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.1:
	movq	%rsi, %r14
	testq	%rsi, %rsi
	je	LBB0_10
## %bb.2:
	movq	%rdi, %rbx
	cmpq	$0, 8(%rdi)
	je	LBB0_10
## %bb.3:
	cmpq	$0, 8(%r14)
	je	LBB0_10
## %bb.4:
	movq	_MMAL_SUCCESS@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	(%rbx), %rax
	movq	_MMAL_PORT_TYPE_CLOCK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	cmpq	(%r14), %rax
	jne	LBB0_16
LBB0_6:
	movl	24(%rbx), %esi
	movl	24(%r14), %ecx
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rdx
	movq	%r14, %r8
	callq	_LOG_TRACE
	movq	8(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.7:
	movq	8(%r14), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_15
## %bb.8:
	movq	8(%rax), %r12
	movq	8(%rcx), %r13
	movq	%rbx, %rdi
	callq	_LOCK_CONNECTION
	cmpq	$0, 8(%r12)
	je	LBB0_17
## %bb.9:
	leaq	L_.str.4(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_LOG_ERROR
	movq	%rbx, %rdi
	callq	_UNLOCK_CONNECTION
	movq	_MMAL_EISCONN@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_10:
	leaq	L_.str(%rip), %rdi
LBB0_11:
	xorl	%eax, %eax
	callq	_LOG_ERROR
LBB0_12:
	movq	_MMAL_EINVAL@GOTPCREL(%rip), %rax
LBB0_13:
	movq	(%rax), %r15
LBB0_14:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_LOG_ERROR
	movq	_MMAL_ENOSYS@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_16:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_11
LBB0_17:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	cmpq	$0, 16(%rbx)
	je	LBB0_19
## %bb.18:
	leaq	L_.str.5(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_LOG_ERROR
	movq	%rbx, %rdi
	callq	_UNLOCK_CONNECTION
	jmp	LBB0_12
LBB0_19:
	movq	%r14, %rdi
	callq	_LOCK_CONNECTION
	cmpq	$0, 8(%r13)
	je	LBB0_21
## %bb.20:
	leaq	L_.str.4(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_LOG_ERROR
	movq	_MMAL_EISCONN@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	jmp	LBB0_25
LBB0_21:
	cmpq	$0, 16(%r14)
	je	LBB0_23
## %bb.22:
	leaq	L_.str.5(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_LOG_ERROR
	movq	_MMAL_EINVAL@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	jmp	LBB0_25
LBB0_23:
	movq	%r13, %rax
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r14, 8(%r13)
	movq	%rbx, 8(%rax)
	movl	$0, (%r13)
	movl	$0, (%rax)
	movq	%rax, %r12
	movq	(%rbx), %rax
	movq	_MMAL_PORT_TYPE_OUTPUT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%r14, %rax
	cmoveq	%rbx, %rax
	movq	8(%rax), %rax
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	*(%rax)
	movq	_MMAL_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_25
## %bb.24:
	movl	$1, (%r13)
	movl	$1, (%r12)
LBB0_25:
	movq	%r14, %rdi
	callq	_UNLOCK_CONNECTION
	movq	%rbx, %rdi
	callq	_UNLOCK_CONNECTION
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_MMAL_SUCCESS,8,3               ## @MMAL_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid port"

	.comm	_MMAL_EINVAL,8,3                ## @MMAL_EINVAL
	.comm	_MMAL_PORT_TYPE_CLOCK,8,3       ## @MMAL_PORT_TYPE_CLOCK
L_.str.1:                               ## @.str.1
	.asciz	"invalid port connection"

L_.str.2:                               ## @.str.2
	.asciz	"connecting %s(%p) to %s(%p)"

L_.str.3:                               ## @.str.3
	.asciz	"at least one pf_connect is NULL"

	.comm	_MMAL_ENOSYS,8,3                ## @MMAL_ENOSYS
L_.str.4:                               ## @.str.4
	.asciz	"port %p is already connected"

	.comm	_MMAL_EISCONN,8,3               ## @MMAL_EISCONN
L_.str.5:                               ## @.str.5
	.asciz	"port %p should not be enabled"

	.comm	_MMAL_PORT_TYPE_OUTPUT,8,3      ## @MMAL_PORT_TYPE_OUTPUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmal_port_connect              ; -- Begin function mmal_port_connect
	.p2align	2
_mmal_port_connect:                     ; @mmal_port_connect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	cbz	x0, LBB0_10
; %bb.1:
	mov	x20, x1
	cbz	x1, LBB0_10
; %bb.2:
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_10
; %bb.3:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_10
; %bb.4:
Lloh0:
	adrp	x22, _MMAL_SUCCESS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MMAL_SUCCESS@GOTPAGEOFF]
	ldr	x21, [x22]
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _MMAL_PORT_TYPE_CLOCK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MMAL_PORT_TYPE_CLOCK@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_16
LBB0_6:
	ldr	w1, [x19, #24]
	ldr	w3, [x20, #24]
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x2, x19
	mov	x4, x20
	bl	_LOG_TRACE
	ldr	x8, [x19, #8]
	ldr	x9, [x8]
	cbz	x9, LBB0_15
; %bb.7:
	ldr	x9, [x20, #8]
	ldr	x10, [x9]
	cbz	x10, LBB0_15
; %bb.8:
	ldr	x24, [x8, #8]
	ldr	x23, [x9, #8]
	mov	x0, x19
	bl	_LOCK_CONNECTION
	ldr	x8, [x24, #8]
	cbz	x8, LBB0_17
; %bb.9:
	str	x19, [sp]
Lloh7:
	adrp	x0, l_.str.4@PAGE
Lloh8:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_LOG_ERROR
	mov	x0, x19
	bl	_UNLOCK_CONNECTION
Lloh9:
	adrp	x8, _MMAL_EISCONN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MMAL_EISCONN@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
LBB0_11:
	bl	_LOG_ERROR
LBB0_12:
Lloh13:
	adrp	x8, _MMAL_EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MMAL_EINVAL@GOTPAGEOFF]
LBB0_13:
	ldr	x21, [x8]
LBB0_14:
	mov	x0, x21
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_15:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_LOG_ERROR
Lloh17:
	adrp	x8, _MMAL_ENOSYS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MMAL_ENOSYS@GOTPAGEOFF]
	b	LBB0_13
LBB0_16:
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_17:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_19
; %bb.18:
	str	x19, [sp]
Lloh21:
	adrp	x0, l_.str.5@PAGE
Lloh22:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_LOG_ERROR
	mov	x0, x19
	bl	_UNLOCK_CONNECTION
	b	LBB0_12
LBB0_19:
	mov	x0, x20
	bl	_LOCK_CONNECTION
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_21
; %bb.20:
	str	x20, [sp]
Lloh23:
	adrp	x0, l_.str.4@PAGE
Lloh24:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_LOG_ERROR
Lloh25:
	adrp	x8, _MMAL_EISCONN@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MMAL_EISCONN@GOTPAGEOFF]
Lloh27:
	ldr	x21, [x8]
	b	LBB0_25
LBB0_21:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_23
; %bb.22:
	str	x20, [sp]
Lloh28:
	adrp	x0, l_.str.5@PAGE
Lloh29:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_LOG_ERROR
Lloh30:
	adrp	x8, _MMAL_EINVAL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _MMAL_EINVAL@GOTPAGEOFF]
Lloh32:
	ldr	x21, [x8]
	b	LBB0_25
LBB0_23:
	str	x20, [x24, #8]
	str	x19, [x23, #8]
	str	wzr, [x24]
	str	wzr, [x23]
Lloh33:
	adrp	x8, _MMAL_PORT_TYPE_OUTPUT@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MMAL_PORT_TYPE_OUTPUT@GOTPAGEOFF]
	ldr	x9, [x19]
Lloh35:
	ldr	x8, [x8]
	cmp	x9, x8
	csel	x8, x19, x20, eq
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	mov	x0, x19
	mov	x1, x20
	blr	x8
	ldr	x8, [x22]
	cmp	x0, x8
	b.eq	LBB0_25
; %bb.24:
	mov	w8, #1
	str	w8, [x24]
	str	w8, [x23]
LBB0_25:
	mov	x0, x20
	bl	_UNLOCK_CONNECTION
	mov	x0, x19
	bl	_UNLOCK_CONNECTION
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_MMAL_SUCCESS,8,3               ; @MMAL_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid port"

	.comm	_MMAL_EINVAL,8,3                ; @MMAL_EINVAL
	.comm	_MMAL_PORT_TYPE_CLOCK,8,3       ; @MMAL_PORT_TYPE_CLOCK
l_.str.1:                               ; @.str.1
	.asciz	"invalid port connection"

l_.str.2:                               ; @.str.2
	.asciz	"connecting %s(%p) to %s(%p)"

l_.str.3:                               ; @.str.3
	.asciz	"at least one pf_connect is NULL"

	.comm	_MMAL_ENOSYS,8,3                ; @MMAL_ENOSYS
l_.str.4:                               ; @.str.4
	.asciz	"port %p is already connected"

	.comm	_MMAL_EISCONN,8,3               ; @MMAL_EISCONN
l_.str.5:                               ; @.str.5
	.asciz	"port %p should not be enabled"

	.comm	_MMAL_PORT_TYPE_OUTPUT,8,3      ; @MMAL_PORT_TYPE_OUTPUT
.subsections_via_symbols
