	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vivid_cec_alloc_adap           ## -- Begin function vivid_cec_alloc_adap
	.p2align	4, 0x90
_vivid_cec_alloc_adap:                  ## @vivid_cec_alloc_adap
	.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	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r8d
	movq	%rdi, %r14
	xorl	%eax, %eax
	testl	%edx, %edx
	setne	%al
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -32(%rbp)
	movq	_CEC_CAP_DEFAULTS@GOTPCREL(%rip), %rdx
	movq	_CEC_CAP_MONITOR_ALL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movq	_CEC_CAP_MONITOR_PIN@GOTPCREL(%rip), %rsi
	movq	(%rdi,%rax,8), %rcx
	orl	(%rdx), %ebx
	orl	(%rsi), %ebx
	leaq	L_.str(%rip), %rdx
	leaq	-42(%rbp), %r15
	movq	%r15, %rdi
	movl	$10, %esi
	callq	_snprintf
	movq	_vivid_cec_adap_ops@GOTPCREL(%rip), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	movl	$1, %r8d
	callq	_cec_allocate_adapter
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_2
## %bb.1:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CEC_CAP_DEFAULTS,4,2           ## @CEC_CAP_DEFAULTS
	.comm	_CEC_CAP_MONITOR_ALL,4,2        ## @CEC_CAP_MONITOR_ALL
	.comm	_CEC_CAP_MONITOR_PIN,4,2        ## @CEC_CAP_MONITOR_PIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s%d"

	.comm	_vivid_cec_adap_ops,4,2         ## @vivid_cec_adap_ops
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vivid_cec_alloc_adap           ; -- Begin function vivid_cec_alloc_adap
	.p2align	2
_vivid_cec_alloc_adap:                  ; @vivid_cec_alloc_adap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x4, x1
	mov	x19, x0
	cmp	w2, #0
	cset	w8, ne
Lloh0:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _CEC_CAP_DEFAULTS@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CEC_CAP_DEFAULTS@GOTPAGEOFF]
	str	x9, [sp, #24]
Lloh5:
	ldr	w9, [x10]
Lloh6:
	adrp	x10, _CEC_CAP_MONITOR_ALL@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CEC_CAP_MONITOR_ALL@GOTPAGEOFF]
Lloh8:
	adrp	x11, _CEC_CAP_MONITOR_PIN@GOTPAGE
Lloh9:
	ldr	x11, [x11, _CEC_CAP_MONITOR_PIN@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
Lloh11:
	ldr	w11, [x11]
	ldr	x3, [x0, w8, uxtw #3]
	orr	w8, w10, w9
	orr	w20, w8, w11
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	add	x0, sp, #14
	mov	w1, #10
	bl	_snprintf
Lloh14:
	adrp	x0, _vivid_cec_adap_ops@GOTPAGE
Lloh15:
	ldr	x0, [x0, _vivid_cec_adap_ops@GOTPAGEOFF]
	add	x2, sp, #14
	mov	x1, x19
	mov	x3, x20
	mov	w4, #1
	bl	_cec_allocate_adapter
	ldr	x8, [sp, #24]
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_2
; %bb.1:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_2:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CEC_CAP_DEFAULTS,4,2           ; @CEC_CAP_DEFAULTS
	.comm	_CEC_CAP_MONITOR_ALL,4,2        ; @CEC_CAP_MONITOR_ALL
	.comm	_CEC_CAP_MONITOR_PIN,4,2        ; @CEC_CAP_MONITOR_PIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s%d"

	.comm	_vivid_cec_adap_ops,4,2         ; @vivid_cec_adap_ops
.subsections_via_symbols
