	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_alloc_input_device_context  ## -- Begin function ff_alloc_input_device_context
	.p2align	4, 0x90
_ff_alloc_input_device_context:         ## @ff_alloc_input_device_context
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	$0, (%rdi)
	testq	%rsi, %rsi
	jne	LBB0_4
## %bb.1:
	testq	%r12, %r12
	jne	LBB0_4
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_4:
	xorl	%eax, %eax
	callq	_avformat_alloc_context
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r14
	testq	%rbx, %rbx
	jne	LBB0_10
## %bb.7:
	movq	%r12, %rdi
	callq	_av_find_input_format
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_8
LBB0_10:
	movq	8(%rbx), %rax
	movq	_EINVAL@GOTPCREL(%rip), %r12
	testq	%rax, %rax
	je	LBB0_9
## %bb.11:
	movl	(%rax), %edi
	callq	_AV_IS_INPUT_DEVICE
	testl	%eax, %eax
	je	LBB0_9
## %bb.12:
	movq	%rbx, 8(%r14)
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	jle	LBB0_17
## %bb.13:
	callq	_av_mallocz
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_14
## %bb.15:
	movq	8(%r14), %rcx
	movq	8(%rcx), %rcx
	testq	%rcx, %rcx
	je	LBB0_18
## %bb.16:
	movq	%rcx, (%rax)
	movq	(%r14), %rdi
	callq	_av_opt_set_defaults
	jmp	LBB0_18
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %r12
	jmp	LBB0_9
LBB0_17:
	movq	$0, (%r14)
LBB0_18:
	movq	%r14, (%r15)
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %r12
LBB0_9:
	movl	(%r12), %edi
	callq	_AVERROR
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_avformat_free_context
	movl	%ebx, %eax
LBB0_19:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_alloc_input_device_context  ; -- Begin function ff_alloc_input_device_context
	.p2align	2
_ff_alloc_input_device_context:         ; @ff_alloc_input_device_context
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x22, x2
	mov	x21, x1
	mov	x20, x0
	str	xzr, [x0]
	cbnz	x1, LBB0_3
; %bb.1:
	cbnz	x22, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_15
LBB0_3:
	bl	_avformat_alloc_context
	cbz	x0, LBB0_14
; %bb.4:
	mov	x19, x0
	cbnz	x21, LBB0_6
; %bb.5:
	mov	x0, x22
	bl	_av_find_input_format
	mov	x21, x0
	cbz	x0, LBB0_12
LBB0_6:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_12
; %bb.7:
	ldr	w0, [x8]
	bl	_AV_IS_INPUT_DEVICE
	cbz	w0, LBB0_12
; %bb.8:
	str	x21, [x19, #8]
	ldr	x0, [x21]
	cmp	x0, #1
	b.lt	LBB0_16
; %bb.9:
	bl	_av_mallocz
	str	x0, [x19]
	cbz	x0, LBB0_19
; %bb.10:
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_17
; %bb.11:
	str	x8, [x0]
	ldr	x0, [x19]
	bl	_av_opt_set_defaults
	b	LBB0_17
LBB0_12:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x20, x0
	mov	x0, x19
	bl	_avformat_free_context
	mov	x0, x20
	b	LBB0_18
LBB0_14:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_15:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_16:
	str	xzr, [x19]
LBB0_17:
	str	x19, [x20]
	mov	w0, #0
LBB0_18:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_19:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
