	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function ddrawstreamsample_create
LCPI0_0:
	.long	40                              ## 0x28
	.long	32                              ## 0x20
	.long	16711680                        ## 0xff0000
	.long	65280                           ## 0xff00
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_ddrawstreamsample_create:              ## @ddrawstreamsample_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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rdi
	movq	%rcx, %rsi
	callq	_TRACE
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	movl	$40, %edx
	callq	_HeapAlloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	addq	$8, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_DirectDrawStreamSample_Vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
	movl	$1, (%rbx)
	movq	%r14, 32(%rbx)
	movq	%r14, %rdi
	callq	_IMediaStream_AddRef
	testq	%r13, %r13
	je	LBB0_6
## %bb.3:
	movq	%r13, 24(%rbx)
	movq	%r13, %rdi
	callq	_IDirectDrawSurface_AddRef
LBB0_4:
	testq	%r12, %r12
	je	LBB0_10
## %bb.5:
	movl	(%r12), %eax
	movl	%eax, 16(%rbx)
LBB0_13:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r15)
	movq	_S_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_1:
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %r13d
	jmp	LBB0_15
LBB0_6:
	leaq	-56(%rbp), %rsi
	movq	%r14, %rdi
	callq	_IDirectDrawMediaStream_GetDirectDraw
	movl	%eax, %r13d
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_9
## %bb.7:
	movq	_DDSD_CAPS@GOTPCREL(%rip), %rax
	movq	_DDSD_HEIGHT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_DDSD_WIDTH@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_DDSD_PIXELFORMAT@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	$80, -144(%rbp)
	movl	%ecx, -140(%rbp)
	movabsq	$429496729700, %rax             ## imm = 0x6400000064
	movq	%rax, -136(%rbp)
	movq	_DDPF_RGB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [40,32,16711680,65280]
	movups	%xmm0, -104(%rbp)
	movl	$255, -88(%rbp)
	movq	$0, -80(%rbp)
	movq	_DDSCAPS_SYSTEMMEMORY@GOTPCREL(%rip), %rax
	movq	_DDSCAPS_OFFSCREENPLAIN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, -112(%rbp)
	movq	$0, -120(%rbp)
	movq	-56(%rbp), %rdi
	leaq	24(%rbx), %rdx
	leaq	-144(%rbp), %rsi
	xorl	%ecx, %ecx
	callq	_IDirectDraw_CreateSurface
	movl	%eax, %r13d
	movq	-56(%rbp), %rdi
	callq	_IDirectDraw_Release
	movl	%r13d, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_4
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	movl	%r13d, %esi
	callq	_ERR
LBB0_9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_IDirectDrawStreamSample_Release
LBB0_15:
	movl	%r13d, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	cmpq	$0, 24(%rbx)
	je	LBB0_13
## %bb.11:
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -144(%rbp)
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movaps	%xmm0, -112(%rbp)
	movaps	%xmm0, -128(%rbp)
	movl	$80, -144(%rbp)
	movq	24(%rbx), %rdi
	leaq	-144(%rbp), %rsi
	callq	_IDirectDrawSurface_GetSurfaceDesc
	movq	_S_OK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_13
## %bb.12:
	addq	$16, %rbx
	movl	-136(%rbp), %r8d
	movl	-132(%rbp), %ecx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_SetRect
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%p)\n"

	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_E_OUTOFMEMORY,4,2              ## @E_OUTOFMEMORY
	.comm	_DirectDrawStreamSample_Vtbl,4,2 ## @DirectDrawStreamSample_Vtbl
	.comm	_DDSD_CAPS,4,2                  ## @DDSD_CAPS
	.comm	_DDSD_HEIGHT,4,2                ## @DDSD_HEIGHT
	.comm	_DDSD_WIDTH,4,2                 ## @DDSD_WIDTH
	.comm	_DDSD_PIXELFORMAT,4,2           ## @DDSD_PIXELFORMAT
	.comm	_DDPF_RGB,4,2                   ## @DDPF_RGB
	.comm	_DDSCAPS_SYSTEMMEMORY,4,2       ## @DDSCAPS_SYSTEMMEMORY
	.comm	_DDSCAPS_OFFSCREENPLAIN,4,2     ## @DDSCAPS_OFFSCREENPLAIN
L_.str.1:                               ## @.str.1
	.asciz	"failed to create surface, 0x%08x\n"

	.comm	_S_OK,4,2                       ## @S_OK
	.no_dead_strip	_ddrawstreamsample_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function ddrawstreamsample_create
lCPI0_0:
	.long	40                              ; 0x28
	.long	32                              ; 0x20
	.long	16711680                        ; 0xff0000
	.long	65280                           ; 0xff00
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_ddrawstreamsample_create:              ; @ddrawstreamsample_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	mov	x19, x3
	mov	x22, x2
	mov	x24, x1
	mov	x23, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x3
	bl	_TRACE
	bl	_GetProcessHeap
Lloh2:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w2, #40
	bl	_HeapAlloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x21, x0
Lloh5:
	adrp	x8, _DirectDrawStreamSample_Vtbl@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DirectDrawStreamSample_Vtbl@GOTPAGEOFF]
	mov	x20, x0
	str	x8, [x20, #8]!
	mov	w8, #1
	str	w8, [x0]
	str	x23, [x0, #32]
	mov	x0, x23
	bl	_IMediaStream_AddRef
	cbz	x24, LBB0_7
; %bb.2:
	str	x24, [x21, #24]
	mov	x0, x24
	bl	_IDirectDrawSurface_AddRef
LBB0_3:
Lloh7:
	adrp	x23, _S_OK@GOTPAGE
Lloh8:
	ldr	x23, [x23, _S_OK@GOTPAGEOFF]
	cbz	x22, LBB0_12
; %bb.4:
	ldr	w8, [x22]
	str	w8, [x21, #16]
LBB0_5:
	str	x20, [x19]
	ldr	w23, [x23]
	b	LBB0_11
LBB0_6:
Lloh9:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
Lloh11:
	ldr	w23, [x8]
	b	LBB0_11
LBB0_7:
	add	x1, sp, #8
	mov	x0, x23
	bl	_IDirectDrawMediaStream_GetDirectDraw
	mov	x23, x0
	bl	_FAILED
	cbnz	x0, LBB0_10
; %bb.8:
Lloh12:
	adrp	x8, _DDSD_CAPS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DDSD_CAPS@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _DDSD_HEIGHT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _DDSD_HEIGHT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh18:
	adrp	x9, _DDSD_WIDTH@GOTPAGE
Lloh19:
	ldr	x9, [x9, _DDSD_WIDTH@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh21:
	adrp	x9, _DDSD_PIXELFORMAT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _DDSD_PIXELFORMAT@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w8, w9
	mov	w9, #80
	stp	w9, w8, [sp, #16]
	movi.2s	v0, #100
	str	d0, [sp, #24]
Lloh24:
	adrp	x8, _DDPF_RGB@GOTPAGE
Lloh25:
	ldr	x8, [x8, _DDPF_RGB@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [sp, #88]
Lloh27:
	adrp	x8, lCPI0_0@PAGE
Lloh28:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
	stur	q0, [sp, #56]
	mov	w8, #255
	str	w8, [sp, #72]
	str	xzr, [sp, #80]
Lloh29:
	adrp	x8, _DDSCAPS_SYSTEMMEMORY@GOTPAGE
Lloh30:
	ldr	x8, [x8, _DDSCAPS_SYSTEMMEMORY@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	adrp	x9, _DDSCAPS_OFFSCREENPLAIN@GOTPAGE
Lloh33:
	ldr	x9, [x9, _DDSCAPS_OFFSCREENPLAIN@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp, #48]
	str	xzr, [sp, #40]
	ldr	x0, [sp, #8]
	add	x2, x21, #24
	add	x1, sp, #16
	mov	x3, #0
	bl	_IDirectDraw_CreateSurface
	mov	x23, x0
	ldr	x0, [sp, #8]
	bl	_IDirectDraw_Release
	mov	x0, x23
	bl	_FAILED
	cbz	x0, LBB0_3
; %bb.9:
Lloh35:
	adrp	x0, l_.str.1@PAGE
Lloh36:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x23
	bl	_ERR
LBB0_10:
	mov	x0, x20
	bl	_IDirectDrawStreamSample_Release
LBB0_11:
	mov	x0, x23
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_12:
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_5
; %bb.13:
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #64]
	stp	q0, q0, [sp, #32]
	str	q0, [sp, #16]
	mov	w8, #80
	str	w8, [sp, #16]
	ldr	x0, [x21, #24]
	add	x1, sp, #16
	bl	_IDirectDrawSurface_GetSurfaceDesc
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.14:
	add	x0, x21, #16
	ldp	w4, w3, [sp, #24]
	mov	w1, #0
	mov	w2, #0
	bl	_SetRect
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdr	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%p)\n"

	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_E_OUTOFMEMORY,4,2              ; @E_OUTOFMEMORY
	.comm	_DirectDrawStreamSample_Vtbl,4,2 ; @DirectDrawStreamSample_Vtbl
	.comm	_DDSD_CAPS,4,2                  ; @DDSD_CAPS
	.comm	_DDSD_HEIGHT,4,2                ; @DDSD_HEIGHT
	.comm	_DDSD_WIDTH,4,2                 ; @DDSD_WIDTH
	.comm	_DDSD_PIXELFORMAT,4,2           ; @DDSD_PIXELFORMAT
	.comm	_DDPF_RGB,4,2                   ; @DDPF_RGB
	.comm	_DDSCAPS_SYSTEMMEMORY,4,2       ; @DDSCAPS_SYSTEMMEMORY
	.comm	_DDSCAPS_OFFSCREENPLAIN,4,2     ; @DDSCAPS_OFFSCREENPLAIN
l_.str.1:                               ; @.str.1
	.asciz	"failed to create surface, 0x%08x\n"

	.comm	_S_OK,4,2                       ; @S_OK
	.no_dead_strip	_ddrawstreamsample_create
.subsections_via_symbols
