	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DDPrimarySurfaceTest           ## -- Begin function DDPrimarySurfaceTest
	.p2align	4, 0x90
_DDPrimarySurfaceTest:                  ## @DDPrimarySurfaceTest
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	movq	$0, -48(%rbp)
	movq	$0, -56(%rbp)
	leaq	-48(%rbp), %rsi
	xorl	%edi, %edi
	xorl	%edx, %edx
	callq	_DirectDrawCreate
	movq	_DD_OK@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_1
## %bb.2:
	movq	-48(%rbp), %rdi
	movq	(%rdi), %rax
	movq	_DDSCL_NORMAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%r15d, %esi
	callq	*(%rax)
	movq	_FALSE@GOTPCREL(%rip), %rbx
	cmpq	(%r12), %rax
	jne	LBB0_13
## %bb.3:
	leaq	-96(%rbp), %r14
	movq	%r14, %rdi
	movl	$24, %esi
	callq	_ZeroMemory
	movl	$24, -96(%rbp)
	movq	_DDSD_CAPS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -76(%rbp)
	movq	_DDSCAPS_PRIMARYSURFACE@GOTPCREL(%rip), %rax
	movq	_DDSCAPS_3DDEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, -80(%rbp)
	movq	$0, -88(%rbp)
	movq	-48(%rbp), %rdi
	movq	(%rdi), %rax
	leaq	-56(%rbp), %rdx
	movq	%r14, %rsi
	xorl	%ecx, %ecx
	callq	*8(%rax)
	cmpq	(%r12), %rax
	jne	LBB0_13
## %bb.4:
	movq	_TEST_DURATION@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	%r15d, %edi
	movl	$-1, %esi
	xorl	%ecx, %ecx
	callq	_SetTimer
	movq	%rax, %r14
	movq	_TRUE@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_12
## %bb.5:
	movq	_PM_REMOVE@GOTPCREL(%rip), %r13
	leaq	-72(%rbp), %r12
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$0, (%rbx)
	je	LBB0_12
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %r8d
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_PeekMessage
	testq	%rax, %rax
	je	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-72(%rbp), %rax
	movq	_WM_TIMER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpq	-64(%rbp), %r14
	je	LBB0_12
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%r12, %rdi
	callq	_TranslateMessage
	movq	%r12, %rdi
	callq	_DispatchMessage
	movq	-72(%rbp), %rax
	movq	_WM_PAINT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rdi
	callq	_DDRedrawFrame
	jmp	LBB0_11
LBB0_1:
	movq	_FALSE@GOTPCREL(%rip), %rbx
	jmp	LBB0_14
LBB0_12:
	movl	%r15d, %edi
	movq	%r14, %rsi
	callq	_KillTimer
	movq	-56(%rbp), %rdi
	movq	(%rdi), %rax
	callq	*(%rax)
LBB0_13:
	movq	-48(%rbp), %rdi
	movq	(%rdi), %rax
	callq	*16(%rax)
LBB0_14:
	movq	(%rbx), %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DD_OK,8,3                      ## @DD_OK
	.comm	_FALSE,8,3                      ## @FALSE
	.comm	_DDSCL_NORMAL,4,2               ## @DDSCL_NORMAL
	.comm	_DDSD_CAPS,4,2                  ## @DDSD_CAPS
	.comm	_DDSCAPS_PRIMARYSURFACE,4,2     ## @DDSCAPS_PRIMARYSURFACE
	.comm	_DDSCAPS_3DDEVICE,4,2           ## @DDSCAPS_3DDEVICE
	.comm	_TEST_DURATION,8,3              ## @TEST_DURATION
	.comm	_TRUE,8,3                       ## @TRUE
	.comm	_PM_REMOVE,4,2                  ## @PM_REMOVE
	.comm	_WM_TIMER,8,3                   ## @WM_TIMER
	.comm	_WM_PAINT,8,3                   ## @WM_PAINT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DDPrimarySurfaceTest           ; -- Begin function DDPrimarySurfaceTest
	.p2align	2
_DDPrimarySurfaceTest:                  ; @DDPrimarySurfaceTest
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x0
	stp	xzr, xzr, [sp, #32]
	add	x1, sp, #40
	mov	x0, #0
	mov	x2, #0
	bl	_DirectDrawCreate
Lloh0:
	adrp	x20, _DD_OK@GOTPAGE
Lloh1:
	ldr	x20, [x20, _DD_OK@GOTPAGEOFF]
	ldr	x8, [x20]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.1:
	ldr	x0, [sp, #40]
	ldr	x8, [x0]
	ldr	x8, [x8]
Lloh2:
	adrp	x9, _DDSCL_NORMAL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DDSCL_NORMAL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x9]
	mov	x1, x19
	blr	x8
	ldr	x8, [x20]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.2:
	mov	w21, #24
	add	x0, sp, #8
	mov	w1, #24
	bl	_ZeroMemory
	str	w21, [sp, #8]
Lloh5:
	adrp	x8, _DDSD_CAPS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DDSD_CAPS@GOTPAGEOFF]
Lloh7:
	adrp	x9, _DDSCAPS_PRIMARYSURFACE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _DDSCAPS_PRIMARYSURFACE@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _DDSCAPS_3DDEVICE@GOTPAGE
Lloh12:
	ldr	x10, [x10, _DDSCAPS_3DDEVICE@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	orr	w9, w10, w9
	stp	w9, w8, [sp, #24]
	str	xzr, [sp, #16]
	ldr	x0, [sp, #40]
	ldr	x8, [x0]
	ldr	x8, [x8, #8]
	add	x1, sp, #8
	add	x2, sp, #32
	mov	x3, #0
	blr	x8
	ldr	x8, [x20]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.3:
Lloh14:
	adrp	x8, _TEST_DURATION@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TEST_DURATION@GOTPAGEOFF]
Lloh16:
	ldr	x2, [x8]
	mov	x0, x19
	mov	w1, #-1
	mov	x3, #0
	bl	_SetTimer
	mov	x20, x0
Lloh17:
	adrp	x21, _TRUE@GOTPAGE
Lloh18:
	ldr	x21, [x21, _TRUE@GOTPAGEOFF]
	ldr	x8, [x21]
	cbz	x8, LBB0_12
; %bb.4:
Lloh19:
	adrp	x22, _PM_REMOVE@GOTPAGE
Lloh20:
	ldr	x22, [x22, _PM_REMOVE@GOTPAGEOFF]
Lloh21:
	adrp	x23, _WM_TIMER@GOTPAGE
Lloh22:
	ldr	x23, [x23, _WM_TIMER@GOTPAGEOFF]
Lloh23:
	adrp	x24, _WM_PAINT@GOTPAGE
Lloh24:
	ldr	x24, [x24, _WM_PAINT@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x21]
	cbz	x8, LBB0_12
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w4, [x22]
	add	x0, sp, #48
	mov	x1, #0
	mov	w2, #0
	mov	w3, #0
	bl	_PeekMessage
	cbz	x0, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x23]
	ldp	x9, x10, [sp, #48]
	cmp	x9, x8
	ccmp	x20, x10, #0, eq
	b.eq	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x0, sp, #48
	bl	_TranslateMessage
	add	x0, sp, #48
	bl	_DispatchMessage
	ldr	x8, [sp, #48]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [sp, #32]
	bl	_DDRedrawFrame
	b	LBB0_5
LBB0_10:
Lloh25:
	adrp	x19, _FALSE@GOTPAGE
Lloh26:
	ldr	x19, [x19, _FALSE@GOTPAGEOFF]
	b	LBB0_14
LBB0_11:
Lloh27:
	adrp	x19, _FALSE@GOTPAGE
Lloh28:
	ldr	x19, [x19, _FALSE@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
	mov	x0, x19
	mov	x1, x20
	bl	_KillTimer
	ldr	x0, [sp, #32]
	ldr	x8, [x0]
	ldr	x8, [x8]
	blr	x8
Lloh29:
	adrp	x19, _TRUE@GOTPAGE
Lloh30:
	ldr	x19, [x19, _TRUE@GOTPAGEOFF]
LBB0_13:
	ldr	x0, [sp, #40]
	ldr	x8, [x0]
	ldr	x8, [x8, #16]
	blr	x8
LBB0_14:
	ldr	x0, [x19]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_DD_OK,8,3                      ; @DD_OK
	.comm	_FALSE,8,3                      ; @FALSE
	.comm	_DDSCL_NORMAL,4,2               ; @DDSCL_NORMAL
	.comm	_DDSD_CAPS,4,2                  ; @DDSD_CAPS
	.comm	_DDSCAPS_PRIMARYSURFACE,4,2     ; @DDSCAPS_PRIMARYSURFACE
	.comm	_DDSCAPS_3DDEVICE,4,2           ; @DDSCAPS_3DDEVICE
	.comm	_TEST_DURATION,8,3              ; @TEST_DURATION
	.comm	_TRUE,8,3                       ; @TRUE
	.comm	_PM_REMOVE,4,2                  ; @PM_REMOVE
	.comm	_WM_TIMER,8,3                   ; @WM_TIMER
	.comm	_WM_PAINT,8,3                   ; @WM_PAINT
.subsections_via_symbols
