	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hw_device_init_from_type
_hw_device_init_from_type:              ## @hw_device_init_from_type
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movl	%edi, %r12d
	movq	$0, -40(%rbp)
	callq	_hw_device_default_name
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	leaq	-40(%rbp), %rdi
	movl	%r12d, %esi
	movq	%r15, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_av_hwdevice_ctx_create
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_hw_device_add
	testq	%rax, %rax
	je	LBB0_1
## %bb.6:
	movq	%rbx, (%rax)
	movl	%r12d, 8(%rax)
	movq	-40(%rbp), %rcx
	movq	%rcx, 16(%rax)
	testq	%r14, %r14
	je	LBB0_8
## %bb.7:
	movq	%rax, (%r14)
	jmp	LBB0_8
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r15d
	jmp	LBB0_4
LBB0_3:
	movl	%eax, %r15d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%edi, %edi
	movl	%r15d, %ecx
	callq	_av_log
LBB0_4:
	leaq	-48(%rbp), %rdi
	callq	_av_freep
	leaq	-40(%rbp), %rdi
	callq	_av_buffer_unref
LBB0_8:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Device creation failed: %d.\n"

	.no_dead_strip	_hw_device_init_from_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hw_device_init_from_type
_hw_device_init_from_type:              ; @hw_device_init_from_type
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	str	xzr, [sp, #8]
	bl	_hw_device_default_name
	str	x0, [sp]
	cbz	x0, LBB0_5
; %bb.1:
	mov	x22, x0
	add	x0, sp, #8
	mov	x1, x21
	mov	x2, x19
	mov	x3, #0
	mov	w4, #0
	bl	_av_hwdevice_ctx_create
	tbnz	w0, #31, LBB0_6
; %bb.2:
	bl	_hw_device_add
	cbz	x0, LBB0_5
; %bb.3:
	str	x22, [x0]
	str	w21, [x0, #8]
	ldr	x8, [sp, #8]
	str	x8, [x0, #16]
	mov	w19, #0
	cbz	x20, LBB0_8
; %bb.4:
	str	x0, [x20]
	b	LBB0_8
LBB0_5:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x19, x0
	b	LBB0_7
LBB0_6:
	mov	x19, x0
Lloh3:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, #0
	mov	x3, x19
	bl	_av_log
LBB0_7:
	mov	x0, sp
	bl	_av_freep
	add	x0, sp, #8
	bl	_av_buffer_unref
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Device creation failed: %d.\n"

	.no_dead_strip	_hw_device_init_from_type
.subsections_via_symbols
