	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmal_graph_add_connection      ## -- Begin function mmal_graph_add_connection
	.p2align	4, 0x90
_mmal_graph_add_connection:             ## @mmal_graph_add_connection
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.1:
	movq	%rsi, %rbx
	movl	(%rsi), %edx
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	movq	%rbx, %rcx
	callq	_LOG_TRACE
	movq	(%r14), %rax
	movq	_GRAPH_CONNECTIONS_MAX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_2
## %bb.3:
	movq	%rbx, %rdi
	callq	_mmal_connection_acquire
	movq	(%r14), %rax
	movq	8(%r14), %rcx
	leaq	1(%rax), %rdx
	movq	%rdx, (%r14)
	movq	%rbx, (%rcx,%rax,8)
	movq	_MMAL_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_5:
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_LOG_TRACE
	movq	_MMAL_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_LOG_ERROR
	movq	_MMAL_ENOSPC@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"graph: %p, connection: %s(%p)"

	.comm	_MMAL_EINVAL,4,2                ## @MMAL_EINVAL
	.comm	_GRAPH_CONNECTIONS_MAX,8,3      ## @GRAPH_CONNECTIONS_MAX
L_.str.1:                               ## @.str.1
	.asciz	"no space for connection %s"

	.comm	_MMAL_ENOSPC,4,2                ## @MMAL_ENOSPC
	.comm	_MMAL_SUCCESS,4,2               ## @MMAL_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmal_graph_add_connection      ; -- Begin function mmal_graph_add_connection
	.p2align	2
_mmal_graph_add_connection:             ; @mmal_graph_add_connection
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	cbz	x1, LBB0_3
; %bb.1:
	mov	x20, x1
	ldr	w2, [x1]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x3, x20
	bl	_LOG_TRACE
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _GRAPH_CONNECTIONS_MAX@GOTPAGE
Lloh3:
	ldr	x9, [x9, _GRAPH_CONNECTIONS_MAX@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_4
; %bb.2:
	mov	x0, x20
	bl	_mmal_connection_acquire
	ldp	x9, x8, [x19]
	add	x10, x9, #1
	str	x10, [x19]
	str	x20, [x8, x9, lsl #3]
Lloh5:
	adrp	x8, _MMAL_SUCCESS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MMAL_SUCCESS@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	w2, #0
	mov	x3, #0
	bl	_LOG_TRACE
Lloh9:
	adrp	x8, _MMAL_EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MMAL_EINVAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
	ldr	w1, [x20]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_LOG_ERROR
Lloh13:
	adrp	x8, _MMAL_ENOSPC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MMAL_ENOSPC@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"graph: %p, connection: %s(%p)"

	.comm	_MMAL_EINVAL,4,2                ; @MMAL_EINVAL
	.comm	_GRAPH_CONNECTIONS_MAX,8,3      ; @GRAPH_CONNECTIONS_MAX
l_.str.1:                               ; @.str.1
	.asciz	"no space for connection %s"

	.comm	_MMAL_ENOSPC,4,2                ; @MMAL_ENOSPC
	.comm	_MMAL_SUCCESS,4,2               ; @MMAL_SUCCESS
.subsections_via_symbols
