	.file	"extr_swapchain.c_swapchain_cleanup.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Destroying swapchain %p.\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"Something's still holding the front buffer (%p).\n"
	.align 8
.LC2:
	.string	"Something's still holding back buffer %u (%p).\n"
	.align 8
.LC3:
	.string	"Failed to restore display mode, hr %#x.\n"
	.align 8
.LC4:
	.string	"Destroying backup wined3d window %p, dc %p.\n"
	.text
	.p2align 4
	.type	swapchain_cleanup, @function
swapchain_cleanup:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	rsi, rdi
	xor	eax, eax
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	lea	rdi, .LC0[rip]
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	TRACE@PLT
	mov	rdi, rbp
	lea	rdx, 88[rbp]
	xor	esi, esi
	call	wined3d_swapchain_set_gamma_ramp@PLT
	mov	rdi, QWORD PTR 80[rbp]
	test	rdi, rdi
	je	.L2
	xor	esi, esi
	call	wined3d_texture_set_swapchain@PLT
	mov	rdi, QWORD PTR 80[rbp]
	call	wined3d_texture_decref@PLT
	test	rax, rax
	jne	.L37
.L3:
	mov	QWORD PTR 80[rbp], 0
.L2:
	mov	rdi, QWORD PTR 72[rbp]
	test	rdi, rdi
	je	.L4
	mov	rax, QWORD PTR 32[rbp]
	lea	rbx, -1[rax]
	test	rax, rax
	je	.L5
	lea	r12, .LC2[rip]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	sub	rbx, 1
	mov	rdi, QWORD PTR 72[rbp]
	cmp	rbx, -1
	je	.L5
.L7:
	mov	rdi, QWORD PTR [rdi+rbx*8]
	xor	esi, esi
	call	wined3d_texture_set_swapchain@PLT
	mov	rax, QWORD PTR 72[rbp]
	mov	rdi, QWORD PTR [rax+rbx*8]
	call	wined3d_texture_decref@PLT
	test	rax, rax
	je	.L6
	mov	rax, QWORD PTR 72[rbp]
	mov	rsi, rbx
	mov	rdi, r12
	mov	rdx, QWORD PTR [rax+rbx*8]
	xor	eax, eax
	sub	rbx, 1
	call	WARN@PLT
	mov	rdi, QWORD PTR 72[rbp]
	cmp	rbx, -1
	jne	.L7
.L5:
	call	heap_free@PLT
	mov	QWORD PTR 72[rbp], 0
.L4:
	mov	rax, QWORD PTR 16[rbp]
	mov	esi, DWORD PTR wined3d_swapchain_destroy_object[rip]
	mov	rdx, rbp
	mov	rdi, QWORD PTR 16[rax]
	call	wined3d_cs_destroy_object@PLT
	mov	rax, QWORD PTR 16[rbp]
	mov	esi, DWORD PTR WINED3D_CS_QUEUE_DEFAULT[rip]
	mov	rdi, QWORD PTR 16[rax]
	mov	rax, QWORD PTR [rdi]
	call	[QWORD PTR [rax]]
	mov	eax, DWORD PTR 56[rbp]
	test	eax, eax
	jne	.L9
	cmp	QWORD PTR 48[rbp], 0
	jne	.L38
.L9:
	mov	rdx, QWORD PTR 8[rbp]
	test	rdx, rdx
	jne	.L39
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	movsx	rsi, DWORD PTR 0[rbp]
	lea	rdi, .LC4[rip]
	xor	eax, eax
	call	TRACE@PLT
	mov	edi, DWORD PTR 0[rbp]
	mov	rsi, QWORD PTR 8[rbp]
	call	wined3d_release_dc@PLT
	mov	edi, DWORD PTR 0[rbp]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	DestroyWindow@PLT
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	mov	rsi, QWORD PTR 80[rbp]
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	WARN@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L38:
	mov	rax, QWORD PTR 16[rbp]
	lea	rdx, 64[rbp]
	mov	rcx, QWORD PTR [rax]
	mov	edi, DWORD PTR 8[rax]
	mov	esi, DWORD PTR [rcx]
	call	wined3d_set_adapter_display_mode@PLT
	mov	edi, eax
	mov	r12d, eax
	call	FAILED@PLT
	test	rax, rax
	jne	.L40
.L11:
	mov	eax, DWORD PTR 40[rbp]
	test	DWORD PTR WINED3D_SWAPCHAIN_RESTORE_WINDOW_RECT[rip], eax
	je	.L9
	mov	rdi, QWORD PTR 16[rbp]
	mov	esi, DWORD PTR 28[rbp]
	lea	rdx, 24[rbp]
	call	wined3d_device_restore_fullscreen_window@PLT
	mov	rdi, QWORD PTR 16[rbp]
	call	wined3d_device_release_focus_window@PLT
	jmp	.L9
.L40:
	mov	esi, r12d
	lea	rdi, .LC3[rip]
	call	ERR@PLT
	jmp	.L11
	.cfi_endproc
.LFE0:
	.size	swapchain_cleanup, .-swapchain_cleanup
	.comm	wined3d_swapchain_destroy_object,4,4
	.comm	WINED3D_SWAPCHAIN_RESTORE_WINDOW_RECT,4,4
	.comm	WINED3D_CS_QUEUE_DEFAULT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_swapchain.c_swapchain_cleanup.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Destroying swapchain %p.\012\000"
	.align	2
.LC1:
	.ascii	"Something's still holding the front buffer (%p).\012"
	.ascii	"\000"
	.align	2
.LC2:
	.ascii	"Something's still holding back buffer %u (%p).\012\000"
	.align	2
.LC3:
	.ascii	"Failed to restore display mode, hr %#x.\012\000"
	.align	2
.LC4:
	.ascii	"Destroying backup wined3d window %p, dc %p.\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	swapchain_cleanup, %function
swapchain_cleanup:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r5, r0
	ldr	r0, .L43
	mov	r1, r5
	bl	TRACE
	mov	r0, r5
	mov	r1, #0
	add	r2, r5, #48
	bl	wined3d_swapchain_set_gamma_ramp
	ldr	r0, [r5, #44]
	cmp	r0, #0
	beq	.L2
	mov	r1, #0
	bl	wined3d_texture_set_swapchain
	ldr	r0, [r5, #44]
	bl	wined3d_texture_decref
	cmp	r0, #0
	bne	.L40
.L3:
	mov	r3, #0
	str	r3, [r5, #44]
.L2:
	ldr	r0, [r5, #40]
	cmp	r0, #0
	beq	.L4
	ldr	r4, [r5, #20]
	cmp	r4, #0
	sub	r4, r4, #1
	beq	.L5
	ldr	r6, .L43+4
	b	.L7
.L6:
	sub	r4, r4, #1
	cmn	r4, #1
	ldr	r0, [r5, #40]
	beq	.L5
.L7:
	mov	r1, #0
	ldr	r0, [r0, r4, lsl #2]
	bl	wined3d_texture_set_swapchain
	ldr	r3, [r5, #40]
	ldr	r0, [r3, r4, lsl #2]
	bl	wined3d_texture_decref
	cmp	r0, #0
	beq	.L6
	ldr	r3, [r5, #40]
	mov	r1, r4
	ldr	r2, [r3, r4, lsl #2]
	mov	r0, r6
	sub	r4, r4, #1
	bl	WARN
	cmn	r4, #1
	ldr	r0, [r5, #40]
	bne	.L7
.L5:
	bl	heap_free
	mov	r3, #0
	str	r3, [r5, #40]
.L4:
	ldr	r3, [r5, #8]
	ldr	r2, .L43+8
	ldr	r0, [r3, #8]
	ldr	r1, [r2]
	mov	r2, r5
	bl	wined3d_cs_destroy_object
	ldr	r2, [r5, #8]
	ldr	r3, .L43+12
	ldr	r0, [r2, #8]
	ldr	r1, [r3]
	ldr	r3, [r0]
	ldr	r3, [r3]
	blx	r3
	ldr	r3, [r5, #32]
	cmp	r3, #0
	bne	.L9
	ldr	r3, [r5, #28]
	cmp	r3, #0
	bne	.L41
.L9:
	ldr	r2, [r5, #4]
	cmp	r2, #0
	popeq	{r4, r5, r6, pc}
	ldr	r1, [r5]
	ldr	r0, .L43+16
	bl	TRACE
	ldm	r5, {r0, r1}
	bl	wined3d_release_dc
	ldr	r0, [r5]
	pop	{r4, r5, r6, lr}
	b	DestroyWindow
.L40:
	ldr	r1, [r5, #44]
	ldr	r0, .L43+20
	bl	WARN
	b	.L3
.L41:
	ldr	r3, [r5, #8]
	add	r2, r5, #36
	ldr	r1, [r3]
	ldr	r0, [r3, #4]
	ldr	r1, [r1]
	bl	wined3d_set_adapter_display_mode
	mov	r4, r0
	bl	FAILED
	cmp	r0, #0
	bne	.L42
.L11:
	ldr	r3, .L43+24
	ldr	r2, [r5, #24]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L9
	ldr	r1, [r5, #16]
	ldr	r0, [r5, #8]
	add	r2, r5, #12
	bl	wined3d_device_restore_fullscreen_window
	ldr	r0, [r5, #8]
	bl	wined3d_device_release_focus_window
	b	.L9
.L42:
	mov	r1, r4
	ldr	r0, .L43+28
	bl	ERR
	b	.L11
.L44:
	.align	2
.L43:
	.word	.LC0
	.word	.LC2
	.word	wined3d_swapchain_destroy_object
	.word	WINED3D_CS_QUEUE_DEFAULT
	.word	.LC4
	.word	.LC1
	.word	WINED3D_SWAPCHAIN_RESTORE_WINDOW_RECT
	.word	.LC3
	.size	swapchain_cleanup, .-swapchain_cleanup
	.comm	wined3d_swapchain_destroy_object,4,4
	.comm	WINED3D_SWAPCHAIN_RESTORE_WINDOW_RECT,4,4
	.comm	WINED3D_CS_QUEUE_DEFAULT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
