	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function VMR9DefaultAllocatorPresenterImpl_create
_VMR9DefaultAllocatorPresenterImpl_create: ## @VMR9DefaultAllocatorPresenterImpl_create
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	$112, %edi
	callq	_CoTaskMemAlloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movl	(%rbx), %edi
	callq	_init_d3d9
	movl	%eax, 104(%r12)
	testl	%eax, %eax
	je	LBB0_11
## %bb.3:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	_D3DFMT_X8R8G8B8@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-44(%rbp), %r8
	movl	%eax, %edi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_IDirect3D9_EnumAdapterModes
	movq	%rax, %r13
	movq	_D3DERR_INVALIDCALL@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	je	LBB0_7
## %bb.4:
	movl	$1, %ebx
	leaq	-44(%rbp), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	104(%r12), %edi
	movq	_D3DFMT_X8R8G8B8@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %esi
	xorl	%ecx, %ecx
	movq	%r14, %r8
	callq	_IDirect3D9_EnumAdapterModes
	movq	%rax, %r13
	incl	%ebx
	cmpq	(%r15), %rax
	jne	LBB0_5
LBB0_7:
	movq	%r13, %rdi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_ERR
LBB0_9:
	movq	_D3DERR_NOTAVAILABLE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	jne	LBB0_13
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_ERR
	movl	104(%r12), %edi
	callq	_IDirect3D9_Release
	jmp	LBB0_12
LBB0_1:
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_11:
	leaq	L_.str(%rip), %rdi
	callq	_WARN
LBB0_12:
	movq	%r12, %rdi
	callq	_CoTaskMemFree
	movq	_VFW_E_DDRAW_CAPS_NOT_SUITABLE@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_13:
	movq	%r12, %rbx
	addq	$8, %rbx
	movq	_VMR9_ImagePresenter@GOTPCREL(%rip), %rax
	movq	%rax, 8(%r12)
	movq	_VMR9_SurfaceAllocator@GOTPCREL(%rip), %rax
	movq	%rax, 96(%r12)
	movl	$1, (%r12)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 88(%r12)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%r12)
	movups	%xmm0, 56(%r12)
	movups	%xmm0, 72(%r12)
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_CreateEventW
	movl	%eax, 32(%r12)
	movq	$0, 24(%r12)
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r12)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	movq	_S_OK@GOTPCREL(%rip), %rax
LBB0_14:
	movq	(%rax), %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_S_OK,8,3                       ## @S_OK
	.comm	_E_OUTOFMEMORY,8,3              ## @E_OUTOFMEMORY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not initialize d3d9.dll\n"

	.comm	_VFW_E_DDRAW_CAPS_NOT_SUITABLE,8,3 ## @VFW_E_DDRAW_CAPS_NOT_SUITABLE
	.comm	_D3DFMT_X8R8G8B8,4,2            ## @D3DFMT_X8R8G8B8
	.comm	_D3DERR_INVALIDCALL,8,3         ## @D3DERR_INVALIDCALL
L_.str.1:                               ## @.str.1
	.asciz	"HR: %08x\n"

	.comm	_D3DERR_NOTAVAILABLE,8,3        ## @D3DERR_NOTAVAILABLE
L_.str.2:                               ## @.str.2
	.asciz	"Format not supported\n"

	.comm	_VMR9_ImagePresenter,4,2        ## @VMR9_ImagePresenter
	.comm	_VMR9_SurfaceAllocator,4,2      ## @VMR9_SurfaceAllocator
	.comm	_FALSE,4,2                      ## @FALSE
	.no_dead_strip	_VMR9DefaultAllocatorPresenterImpl_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function VMR9DefaultAllocatorPresenterImpl_create
_VMR9DefaultAllocatorPresenterImpl_create: ; @VMR9DefaultAllocatorPresenterImpl_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x21, x0
	mov	w0, #112
	bl	_CoTaskMemAlloc
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x0
	ldr	w0, [x21]
	bl	_init_d3d9
	str	w0, [x19, #104]
	cbz	w0, LBB0_11
; %bb.2:
Lloh0:
	adrp	x24, _D3DFMT_X8R8G8B8@GOTPAGE
Lloh1:
	ldr	x24, [x24, _D3DFMT_X8R8G8B8@GOTPAGEOFF]
	ldr	w2, [x24]
	add	x4, sp, #12
	mov	w1, #0
	mov	w3, #0
	bl	_IDirect3D9_EnumAdapterModes
	mov	x22, x0
Lloh2:
	adrp	x25, _D3DERR_INVALIDCALL@GOTPAGE
Lloh3:
	ldr	x25, [x25, _D3DERR_INVALIDCALL@GOTPAGEOFF]
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_6
; %bb.3:
	mov	w23, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_FAILED
	cbz	x0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19, #104]
	ldr	w2, [x24]
	add	x4, sp, #12
	mov	x1, x23
	mov	w3, #0
	bl	_IDirect3D9_EnumAdapterModes
	mov	x22, x0
	ldr	x8, [x25]
	add	w23, w23, #1
	cmp	x0, x8
	b.ne	LBB0_4
LBB0_6:
	mov	x0, x22
	bl	_FAILED
	cbz	x0, LBB0_8
; %bb.7:
	str	x22, [sp]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERR
LBB0_8:
Lloh6:
	adrp	x8, _D3DERR_NOTAVAILABLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _D3DERR_NOTAVAILABLE@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x22, x8
	b.ne	LBB0_13
; %bb.9:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_ERR
	ldr	w0, [x19, #104]
	bl	_IDirect3D9_Release
	b	LBB0_12
LBB0_10:
Lloh11:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
	b	LBB0_14
LBB0_11:
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_WARN
LBB0_12:
	mov	x0, x19
	bl	_CoTaskMemFree
Lloh15:
	adrp	x8, _VFW_E_DDRAW_CAPS_NOT_SUITABLE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VFW_E_DDRAW_CAPS_NOT_SUITABLE@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:
Lloh17:
	adrp	x8, _VMR9_ImagePresenter@GOTPAGE
Lloh18:
	ldr	x8, [x8, _VMR9_ImagePresenter@GOTPAGEOFF]
	mov	x22, x19
	str	x8, [x22, #8]!
Lloh19:
	adrp	x8, _VMR9_SurfaceAllocator@GOTPAGE
Lloh20:
	ldr	x8, [x8, _VMR9_SurfaceAllocator@GOTPAGEOFF]
	mov	w9, #1
	str	w9, [x19]
	stp	x21, x8, [x19, #88]
	movi.2d	v0, #0000000000000000
	stur	q0, [x19, #40]
	stur	q0, [x19, #56]
	stur	q0, [x19, #72]
	mov	x0, #0
	mov	w1, #0
	mov	w2, #0
	mov	x3, #0
	bl	_CreateEventW
	str	w0, [x19, #32]
Lloh21:
	adrp	x8, _FALSE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
	str	xzr, [x19, #24]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	str	x22, [x20]
Lloh24:
	adrp	x8, _S_OK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
LBB0_14:
	ldr	x0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_S_OK,8,3                       ; @S_OK
	.comm	_E_OUTOFMEMORY,8,3              ; @E_OUTOFMEMORY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not initialize d3d9.dll\n"

	.comm	_VFW_E_DDRAW_CAPS_NOT_SUITABLE,8,3 ; @VFW_E_DDRAW_CAPS_NOT_SUITABLE
	.comm	_D3DFMT_X8R8G8B8,4,2            ; @D3DFMT_X8R8G8B8
	.comm	_D3DERR_INVALIDCALL,8,3         ; @D3DERR_INVALIDCALL
l_.str.1:                               ; @.str.1
	.asciz	"HR: %08x\n"

	.comm	_D3DERR_NOTAVAILABLE,8,3        ; @D3DERR_NOTAVAILABLE
l_.str.2:                               ; @.str.2
	.asciz	"Format not supported\n"

	.comm	_VMR9_ImagePresenter,4,2        ; @VMR9_ImagePresenter
	.comm	_VMR9_SurfaceAllocator,4,2      ; @VMR9_SurfaceAllocator
	.comm	_FALSE,4,2                      ; @FALSE
	.no_dead_strip	_VMR9DefaultAllocatorPresenterImpl_create
.subsections_via_symbols
