	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d3drm_device_set_ddraw_device_d3d
_d3drm_device_set_ddraw_device_d3d:     ## @d3drm_device_set_ddraw_device_d3d
	.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	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %rax
	movq	%rdi, %r14
	movq	$0, -40(%rbp)
	movq	_IID_IDirectDraw@GOTPCREL(%rip), %rsi
	leaq	-64(%rbp), %rdx
	movq	%rax, %rdi
	callq	_IDirect3D_QueryInterface
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_1
LBB0_11:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	32(%r14), %edi
	callq	_IDirect3DRM_AddRef
	movq	%r15, %rdi
	callq	_IDirect3DDevice_AddRef
	movq	_IID_IDirectDrawSurface@GOTPCREL(%rip), %rsi
	leaq	-32(%rbp), %rdx
	movq	%r15, %rdi
	callq	_IDirect3DDevice_QueryInterface
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	_IID_IDirect3DDevice2@GOTPCREL(%rip), %rsi
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	callq	_IDirect3DDevice_QueryInterface
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_11
## %bb.3:
	movq	-40(%rbp), %rdi
	leaq	-32(%rbp), %rsi
	callq	_IDirect3DDevice2_GetRenderTarget
	movl	%eax, %ebx
	movq	-40(%rbp), %rdi
	callq	_IDirect3DDevice2_Release
	movl	%ebx, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_11
LBB0_4:
	cmpq	$0, 24(%r14)
	je	LBB0_8
## %bb.5:
	cmpq	$0, -40(%rbp)
	je	LBB0_7
## %bb.6:
	movq	-32(%rbp), %rdi
	callq	_IDirectDrawSurface_Release
LBB0_7:
	movq	_D3DRMERR_BADOBJECT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_8:
	movl	$12, -56(%rbp)
	movq	-32(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	callq	_IDirectDrawSurface_GetSurfaceDesc
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	-32(%rbp), %rdi
	callq	_IDirectDrawSurface_Release
	jmp	LBB0_11
LBB0_10:
	movq	-64(%rbp), %rax
	movq	%rax, 24(%r14)
	movl	-48(%rbp), %eax
	movl	%eax, 20(%r14)
	movl	-52(%rbp), %eax
	movl	%eax, 16(%r14)
	movq	%r15, 8(%r14)
	movq	-32(%rbp), %rax
	movq	%rax, (%r14)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_IID_IDirectDraw,4,2            ## @IID_IDirectDraw
	.comm	_IID_IDirectDrawSurface,4,2     ## @IID_IDirectDrawSurface
	.comm	_IID_IDirect3DDevice2,4,2       ## @IID_IDirect3DDevice2
	.comm	_D3DRMERR_BADOBJECT,4,2         ## @D3DRMERR_BADOBJECT
	.no_dead_strip	_d3drm_device_set_ddraw_device_d3d
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3drm_device_set_ddraw_device_d3d
_d3drm_device_set_ddraw_device_d3d:     ; @d3drm_device_set_ddraw_device_d3d
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x2
	mov	x8, x1
	mov	x20, x0
	str	xzr, [sp, #24]
Lloh0:
	adrp	x1, _IID_IDirectDraw@GOTPAGE
Lloh1:
	ldr	x1, [x1, _IID_IDirectDraw@GOTPAGEOFF]
	add	x2, sp, #40
	mov	x0, x8
	bl	_IDirect3D_QueryInterface
	mov	x21, x0
	bl	_FAILED
	cbz	x0, LBB0_2
LBB0_1:
	mov	x0, x21
	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
	add	sp, sp, #96
	ret
LBB0_2:
	ldr	w0, [x20, #32]
	bl	_IDirect3DRM_AddRef
	mov	x0, x19
	bl	_IDirect3DDevice_AddRef
Lloh2:
	adrp	x1, _IID_IDirectDrawSurface@GOTPAGE
Lloh3:
	ldr	x1, [x1, _IID_IDirectDrawSurface@GOTPAGEOFF]
	add	x2, sp, #32
	mov	x0, x19
	bl	_IDirect3DDevice_QueryInterface
	bl	_FAILED
	cbz	x0, LBB0_5
; %bb.3:
Lloh4:
	adrp	x1, _IID_IDirect3DDevice2@GOTPAGE
Lloh5:
	ldr	x1, [x1, _IID_IDirect3DDevice2@GOTPAGEOFF]
	add	x2, sp, #24
	mov	x0, x19
	bl	_IDirect3DDevice_QueryInterface
	mov	x21, x0
	bl	_FAILED
	cbnz	x0, LBB0_1
; %bb.4:
	ldr	x0, [sp, #24]
	add	x1, sp, #32
	bl	_IDirect3DDevice2_GetRenderTarget
	mov	x21, x0
	ldr	x0, [sp, #24]
	bl	_IDirect3DDevice2_Release
	mov	x0, x21
	bl	_FAILED
	cbnz	x0, LBB0_1
LBB0_5:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_9
; %bb.6:
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_8
; %bb.7:
	ldr	x0, [sp, #32]
	bl	_IDirectDrawSurface_Release
LBB0_8:
Lloh6:
	adrp	x8, _D3DRMERR_BADOBJECT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _D3DRMERR_BADOBJECT@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x8]
	b	LBB0_1
LBB0_9:
	mov	w8, #12
	str	w8, [sp, #8]
	ldr	x0, [sp, #32]
	add	x1, sp, #8
	bl	_IDirectDrawSurface_GetSurfaceDesc
	mov	x21, x0
	bl	_FAILED
	cbz	x0, LBB0_11
; %bb.10:
	ldr	x0, [sp, #32]
	bl	_IDirectDrawSurface_Release
	b	LBB0_1
LBB0_11:
	ldr	x8, [sp, #40]
	str	x8, [x20, #24]
	ldur	d0, [sp, #12]
	str	d0, [x20, #16]
	ldr	x8, [sp, #32]
	stp	x8, x19, [x20]
	b	LBB0_1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_IID_IDirectDraw,4,2            ; @IID_IDirectDraw
	.comm	_IID_IDirectDrawSurface,4,2     ; @IID_IDirectDrawSurface
	.comm	_IID_IDirect3DDevice2,4,2       ; @IID_IDirect3DDevice2
	.comm	_D3DRMERR_BADOBJECT,4,2         ; @D3DRMERR_BADOBJECT
	.no_dead_strip	_d3drm_device_set_ddraw_device_d3d
.subsections_via_symbols
