	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wined3d_swapchain_desc_from_present_parameters
_wined3d_swapchain_desc_from_present_parameters: ## @wined3d_swapchain_desc_from_present_parameters
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	testq	%rdx, %rdx
	movl	$3, %eax
	movl	$30, %ecx
	cmoveq	%rax, %rcx
	movq	(%rsi), %rsi
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.1:
	movq	%rdi, %r14
	movq	_D3DSWAPEFFECT_COPY@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rdi, %rax
	testq	%rdx, %rdx
	je	LBB0_3
## %bb.2:
	movq	_D3DSWAPEFFECT_FLIPEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_3:
	cmpq	%rax, %rsi
	jle	LBB0_6
LBB0_4:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	jmp	LBB0_5
LBB0_6:
	movq	8(%rbx), %rax
	cmpq	%rcx, %rax
	jg	LBB0_9
## %bb.7:
	cmpq	%rdi, %rsi
	jne	LBB0_10
## %bb.8:
	cmpq	$2, %rax
	jl	LBB0_10
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
LBB0_5:
	callq	_WARN
	movq	_FALSE@GOTPCREL(%rip), %rbx
LBB0_12:
	movq	(%rbx), %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_10:
	movl	60(%rbx), %eax
	movl	%eax, 76(%r14)
	movl	56(%rbx), %eax
	movl	%eax, 72(%r14)
	movl	52(%rbx), %edi
	callq	_wined3dformat_from_d3dformat
	movq	%rax, 64(%r14)
	movl	8(%rbx), %esi
	movl	$1, %edi
	callq	_max
	movl	%eax, 60(%r14)
	movq	_WINED3DUSAGE_RENDERTARGET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r14)
	movl	48(%rbx), %eax
	movl	%eax, 52(%r14)
	movl	44(%rbx), %eax
	movl	%eax, 48(%r14)
	movq	(%rbx), %rdi
	callq	_wined3dswapeffect_from_d3dswapeffect
	movl	%eax, 44(%r14)
	movl	40(%rbx), %eax
	movl	%eax, 40(%r14)
	movl	36(%rbx), %eax
	movl	%eax, 36(%r14)
	movl	32(%rbx), %eax
	movl	%eax, 32(%r14)
	movl	28(%rbx), %edi
	callq	_wined3dformat_from_d3dformat
	movq	%rax, 24(%r14)
	movl	16(%rbx), %eax
	movq	_D3DPRESENTFLAGS_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%eax, %edx
	movq	_WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH@GOTPCREL(%rip), %rsi
	orl	(%rsi), %edx
	movl	%edx, (%r14)
	movl	24(%rbx), %edx
	movl	%edx, 20(%r14)
	movl	20(%rbx), %edx
	movl	%edx, 16(%r14)
	movq	_TRUE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	movq	%rdx, 8(%r14)
	movl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	je	LBB0_12
## %bb.11:
	leaq	L_.str.2(%rip), %rdi
	callq	_FIXME
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_D3DSWAPEFFECT_FLIPEX,8,3       ## @D3DSWAPEFFECT_FLIPEX
	.comm	_D3DSWAPEFFECT_COPY,8,3         ## @D3DSWAPEFFECT_COPY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid swap effect %u passed.\n"

	.comm	_FALSE,8,3                      ## @FALSE
L_.str.1:                               ## @.str.1
	.asciz	"Invalid backbuffer count %u.\n"

	.comm	_WINED3DUSAGE_RENDERTARGET,4,2  ## @WINED3DUSAGE_RENDERTARGET
	.comm	_D3DPRESENTFLAGS_MASK,4,2       ## @D3DPRESENTFLAGS_MASK
	.comm	_WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH,4,2 ## @WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH
	.comm	_TRUE,8,3                       ## @TRUE
L_.str.2:                               ## @.str.2
	.asciz	"Unhandled flags %#x.\n"

	.no_dead_strip	_wined3d_swapchain_desc_from_present_parameters
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wined3d_swapchain_desc_from_present_parameters
_wined3d_swapchain_desc_from_present_parameters: ; @wined3d_swapchain_desc_from_present_parameters
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	w8, #30
	mov	w9, #3
	cmp	x2, #0
	csel	x9, x9, x8, eq
	ldr	x1, [x1]
	cbz	x1, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _D3DSWAPEFFECT_COPY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D3DSWAPEFFECT_COPY@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x8]
Lloh3:
	adrp	x8, _D3DSWAPEFFECT_FLIPEX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _D3DSWAPEFFECT_FLIPEX@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x2, #0
	csel	x8, x10, x8, eq
	cmp	x1, x8
	b.le	LBB0_3
LBB0_2:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	b	LBB0_8
LBB0_3:
	ldr	x8, [x20, #8]
	cmp	x8, x9
	b.gt	LBB0_7
; %bb.4:
	cmp	x1, x10
	ccmp	x8, #2, #8, eq
	b.ge	LBB0_7
; %bb.5:
	mov	x19, x0
	ldr	d0, [x20, #56]
	str	d0, [x0, #72]
	ldr	w0, [x20, #52]
	bl	_wined3dformat_from_d3dformat
	str	x0, [x19, #64]
	ldr	w1, [x20, #8]
	mov	w0, #1
	bl	_max
Lloh8:
	adrp	x8, _WINED3DUSAGE_RENDERTARGET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WINED3DUSAGE_RENDERTARGET@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	stp	w8, w0, [x19, #56]
	ldur	d0, [x20, #44]
	str	d0, [x19, #48]
	ldr	x0, [x20]
	bl	_wined3dswapeffect_from_d3dswapeffect
	ldr	w8, [x20, #40]
	stp	w8, w0, [x19, #40]
	ldr	d0, [x20, #32]
	str	d0, [x19, #32]
	ldr	w0, [x20, #28]
	bl	_wined3dformat_from_d3dformat
	str	x0, [x19, #24]
	ldr	w9, [x20, #16]
Lloh11:
	adrp	x10, _D3DPRESENTFLAGS_MASK@GOTPAGE
Lloh12:
	ldr	x10, [x10, _D3DPRESENTFLAGS_MASK@GOTPAGEOFF]
	ldr	w8, [x10]
Lloh13:
	adrp	x11, _WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH@GOTPAGE
Lloh14:
	ldr	x11, [x11, _WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH@GOTPAGEOFF]
	and	w8, w8, w9
Lloh15:
	ldr	w11, [x11]
	orr	w8, w8, w11
	str	w8, [x19]
	ldur	d0, [x20, #20]
	str	d0, [x19, #16]
Lloh16:
	adrp	x8, _TRUE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	ldr	x11, [x8]
	str	x11, [x19, #8]
	ldr	w10, [x10]
	bics	w1, w9, w10
	b.eq	LBB0_9
; %bb.6:
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_FIXME
Lloh20:
	adrp	x8, _TRUE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x8
LBB0_8:
	bl	_WARN
Lloh24:
	adrp	x8, _FALSE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_9:
	ldr	x0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_D3DSWAPEFFECT_FLIPEX,8,3       ; @D3DSWAPEFFECT_FLIPEX
	.comm	_D3DSWAPEFFECT_COPY,8,3         ; @D3DSWAPEFFECT_COPY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid swap effect %u passed.\n"

	.comm	_FALSE,8,3                      ; @FALSE
l_.str.1:                               ; @.str.1
	.asciz	"Invalid backbuffer count %u.\n"

	.comm	_WINED3DUSAGE_RENDERTARGET,4,2  ; @WINED3DUSAGE_RENDERTARGET
	.comm	_D3DPRESENTFLAGS_MASK,4,2       ; @D3DPRESENTFLAGS_MASK
	.comm	_WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH,4,2 ; @WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH
	.comm	_TRUE,8,3                       ; @TRUE
l_.str.2:                               ; @.str.2
	.asciz	"Unhandled flags %#x.\n"

	.no_dead_strip	_wined3d_swapchain_desc_from_present_parameters
.subsections_via_symbols
