	.file	"extr_swimpl.c_sw_SetPixelFormat.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"OpenGL software implementation START for hdc %p, format %i!\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"HeapAlloc FAILED!\n"
	.section	.rodata.str1.8
	.align 8
.LC3:
	.string	"Failed to allocate a GL visual.\n"
	.align 8
.LC4:
	.string	"Failed to allocate the mesa framebuffer structure.\n"
	.text
	.p2align 4
	.globl	sw_SetPixelFormat
	.type	sw_SetPixelFormat, @function
sw_SetPixelFormat:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, edi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, edx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	QWORD PTR [rsp], rsi
	mov	esi, edi
	lea	rdi, .LC0[rip]
	call	TRACE@PLT
	xor	esi, esi
	mov	edi, ebp
	call	get_format@PLT
	test	rax, rax
	je	.L18
	mov	ebp, DWORD PTR HEAP_ZERO_MEMORY[rip]
	mov	rbx, rax
	xor	eax, eax
	call	GetProcessHeap@PLT
	mov	edx, 24
	mov	edi, eax
	mov	esi, ebp
	call	HeapAlloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L20
	mov	r14, QWORD PTR 8[rbx]
	mov	QWORD PTR 16[rax], rbx
	mov	ebp, 255
	mov	r8, QWORD PTR 40[rbx]
	mov	rdx, QWORD PTR 32[rbx]
	mov	r15, QWORD PTR 24[rbx]
	test	r14, r14
	je	.L5
	mov	eax, 1
	mov	ecx, r14d
	sal	rax, cl
	sub	rax, 1
	js	.L6
	pxor	xmm0, xmm0
	cvtsi2ss	xmm0, rax
	comiss	xmm0, DWORD PTR .LC2[rip]
	jnb	.L8
.L24:
	cvttss2si	rbp, xmm0
.L5:
	mov	eax, 1
	mov	ecx, r8d
	xor	r11d, r11d
	mov	rsi, rax
	sal	rsi, cl
	mov	rcx, rsi
	mov	rsi, rax
	sub	rcx, 1
	mov	QWORD PTR 8[rsp], rcx
	mov	ecx, edx
	sal	rsi, cl
	mov	rcx, rsi
	sub	rcx, 1
	mov	QWORD PTR 16[rsp], rcx
	mov	ecx, r15d
	sal	rax, cl
	sub	rax, 1
	mov	QWORD PTR 24[rsp], rax
	mov	rax, QWORD PTR PFD_TYPE_COLORINDEX[rip]
	cmp	QWORD PTR [rbx], rax
	je	.L21
.L10:
	mov	r9d, DWORD PTR 52[rbx]
	mov	r10d, DWORD PTR 56[rbx]
	mov	DWORD PTR 60[rsp], r11d
	mov	esi, DWORD PTR 60[rbx]
	mov	edi, DWORD PTR 64[rbx]
	mov	QWORD PTR 48[rsp], rdx
	mov	QWORD PTR 40[rsp], r8
	mov	DWORD PTR 56[rsp], r9d
	mov	DWORD PTR 36[rsp], r10d
	call	max@PLT
	mov	r10d, DWORD PTR 36[rsp]
	mov	edi, eax
	mov	esi, r10d
	call	max@PLT
	mov	r9d, DWORD PTR 56[rsp]
	mov	edi, eax
	mov	esi, r9d
	call	max@PLT
	xor	r10d, r10d
	mov	ecx, DWORD PTR 68[rbx]
	mov	r9d, eax
	mov	eax, DWORD PTR 16[rbx]
	test	DWORD PTR PFD_DOUBLEBUFFER[rip], eax
	setne	r10b
	xor	esi, esi
	cmp	QWORD PTR 8[rbx], 0
	mov	rax, QWORD PTR PFD_TYPE_RGBA[rip]
	setne	sil
	xor	edi, edi
	cmp	QWORD PTR [rbx], rax
	sete	dil
	sub	rsp, 8
	.cfi_def_cfa_offset 136
	push	r14
	.cfi_def_cfa_offset 144
	mov	r8, QWORD PTR 56[rsp]
	push	r8
	.cfi_def_cfa_offset 152
	mov	rdx, QWORD PTR 72[rsp]
	mov	r8d, DWORD PTR STENCIL_BITS[rip]
	push	rdx
	.cfi_def_cfa_offset 160
	mov	edx, r10d
	push	r15
	.cfi_def_cfa_offset 168
	push	rbp
	.cfi_def_cfa_offset 176
	push	QWORD PTR 56[rsp]
	.cfi_def_cfa_offset 184
	push	QWORD PTR 72[rsp]
	.cfi_def_cfa_offset 192
	push	QWORD PTR 88[rsp]
	.cfi_def_cfa_offset 200
	mov	r11d, DWORD PTR 132[rsp]
	push	r11
	.cfi_def_cfa_offset 208
	call	gl_create_visual@PLT
	add	rsp, 80
	.cfi_def_cfa_offset 128
	mov	DWORD PTR 4[r12], eax
	mov	edi, eax
	test	eax, eax
	je	.L22
	call	gl_create_framebuffer@PLT
	mov	DWORD PTR 8[r12], eax
	test	eax, eax
	je	.L23
	mov	rax, QWORD PTR [rsp]
	mov	DWORD PTR [r12], r13d
	mov	QWORD PTR [rax], r12
	mov	eax, DWORD PTR TRUE[rip]
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	lea	rdi, .LC3[rip]
	call	ERR@PLT
.L17:
	xor	eax, eax
	call	GetProcessHeap@PLT
	mov	rdx, r12
	xor	esi, esi
	mov	edi, eax
	call	HeapFree@PLT
.L18:
	mov	eax, DWORD PTR FALSE[rip]
.L1:
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	mov	r11d, DWORD PTR 48[rbx]
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rcx, rax
	and	eax, 1
	pxor	xmm0, xmm0
	shr	rcx
	or	rcx, rax
	cvtsi2ss	xmm0, rcx
	addss	xmm0, xmm0
	comiss	xmm0, DWORD PTR .LC2[rip]
	jb	.L24
.L8:
	subss	xmm0, DWORD PTR .LC2[rip]
	cvttss2si	rbp, xmm0
	btc	rbp, 63
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L23:
	lea	rdi, .LC4[rip]
	call	ERR@PLT
	mov	edi, DWORD PTR 4[r12]
	call	gl_destroy_visual@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L20:
	lea	rdi, .LC1[rip]
	call	ERR@PLT
	mov	eax, DWORD PTR FALSE[rip]
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	sw_SetPixelFormat, .-sw_SetPixelFormat
	.comm	TRUE,4,4
	.comm	STENCIL_BITS,4,4
	.comm	PFD_TYPE_RGBA,8,8
	.comm	PFD_TYPE_COLORINDEX,8,8
	.comm	PFD_DOUBLEBUFFER,4,4
	.comm	HEAP_ZERO_MEMORY,4,4
	.comm	FALSE,4,4
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC2:
	.long	1593835520
	.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_swimpl.c_sw_SetPixelFormat.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"OpenGL software implementation START for hdc %p, fo"
	.ascii	"rmat %i!\012\000"
	.align	2
.LC1:
	.ascii	"HeapAlloc FAILED!\012\000"
	.global	__aeabi_ui2f
	.global	__aeabi_f2uiz
	.align	2
.LC2:
	.ascii	"Failed to allocate a GL visual.\012\000"
	.align	2
.LC3:
	.ascii	"Failed to allocate the mesa framebuffer structure.\012"
	.ascii	"\000"
	.text
	.align	2
	.global	sw_SetPixelFormat
	.syntax unified
	.arm
	.fpu softvfp
	.type	sw_SetPixelFormat, %function
sw_SetPixelFormat:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r3, r1
	mov	r4, r2
	mov	r1, r0
	sub	sp, sp, #92
	mov	r6, r0
	ldr	r0, .L18
	str	r3, [sp, #52]
	bl	TRACE
	mov	r0, r4
	mov	r1, #0
	bl	get_format
	subs	r4, r0, #0
	beq	.L13
	bl	GetProcessHeap
	ldr	r3, .L18+4
	mov	r2, #16
	ldr	r1, [r3]
	bl	HeapAlloc
	subs	r5, r0, #0
	beq	.L15
	ldr	r2, .L18+8
	ldr	r3, .L18+12
	ldr	r8, [r4, #4]
	ldr	r0, [r4, #8]
	ldr	r1, [r2]
	ldr	r2, [r3]
	subs	r8, r8, #0
	movne	r8, #1
	tst	r0, r2
	movne	r2, #1
	moveq	r2, #0
	ldr	r3, .L18+16
	ldr	r7, [r4]
	ldr	r3, [r3]
	ldr	r0, [r4, #40]
	str	r4, [r5, #12]
	sub	r7, r7, r1
	ldr	r1, [r4, #36]
	str	r2, [sp, #56]
	str	r3, [sp, #60]
	ldr	fp, [r4, #44]
	bl	max
	ldr	r1, [r4, #32]
	bl	max
	ldr	r1, [r4, #28]
	bl	max
	ldr	r3, .L18+20
	ldr	r2, [r4]
	ldr	r3, [r3]
	str	r0, [sp, #64]
	cmp	r2, r3
	movne	r3, #0
	mov	r0, #1
	clz	r7, r7
	ldreq	r3, [r4, #24]
	ldr	r10, [r4, #12]
	ldr	r2, [r4, #20]
	ldr	r1, [r4, #4]
	str	r3, [sp, #72]
	ldr	r3, [r4, #16]
	lsl	ip, r0, r10
	lsl	r4, r0, r3
	lsl	r9, r0, r2
	cmp	r1, #0
	sub	ip, ip, #1
	moveq	r0, #255
	lsr	r7, r7, #5
	str	ip, [sp, #68]
	sub	r4, r4, #1
	sub	r9, r9, #1
	beq	.L6
	lsl	r0, r0, r1
	sub	r0, r0, #1
	str	r2, [sp, #84]
	str	r3, [sp, #80]
	str	r1, [sp, #76]
	bl	__aeabi_ui2f
	bl	__aeabi_f2uiz
	ldr	r1, [sp, #76]
	ldr	r3, [sp, #80]
	ldr	r2, [sp, #84]
.L6:
	str	r3, [sp, #32]
	ldr	r3, [sp, #68]
	str	r1, [sp, #40]
	str	r3, [sp, #12]
	ldr	r3, [sp, #72]
	str	r2, [sp, #36]
	str	r3, [sp, #8]
	ldr	r3, [sp, #64]
	str	r0, [sp, #24]
	str	r3, [sp, #4]
	ldr	r3, [sp, #60]
	str	r4, [sp, #16]
	str	r3, [sp]
	mov	r1, r8
	mov	r3, fp
	mov	r0, r7
	ldr	r2, [sp, #56]
	str	r10, [sp, #28]
	str	r9, [sp, #20]
	bl	gl_create_visual
	cmp	r0, #0
	mov	r4, r0
	str	r0, [r5, #4]
	beq	.L16
	bl	gl_create_framebuffer
	cmp	r0, #0
	mov	r4, r0
	str	r0, [r5, #8]
	beq	.L17
	ldr	r3, .L18+24
	str	r6, [r5]
	ldr	r0, [r3]
	ldr	r3, [sp, #52]
	str	r5, [r3]
	add	sp, sp, #92
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	ldr	r0, .L18+28
	bl	ERR
.L12:
	bl	GetProcessHeap
	mov	r2, r5
	mov	r1, r4
	bl	HeapFree
.L13:
	ldr	r3, .L18+32
	ldr	r0, [r3]
	add	sp, sp, #92
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	ldr	r0, .L18+36
	bl	ERR
	ldr	r3, .L18+32
	ldr	r0, [r3]
	add	sp, sp, #92
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L17:
	ldr	r0, .L18+40
	bl	ERR
	ldr	r0, [r5, #4]
	bl	gl_destroy_visual
	b	.L12
.L19:
	.align	2
.L18:
	.word	.LC0
	.word	HEAP_ZERO_MEMORY
	.word	PFD_TYPE_RGBA
	.word	PFD_DOUBLEBUFFER
	.word	STENCIL_BITS
	.word	PFD_TYPE_COLORINDEX
	.word	TRUE
	.word	.LC2
	.word	FALSE
	.word	.LC1
	.word	.LC3
	.size	sw_SetPixelFormat, .-sw_SetPixelFormat
	.comm	TRUE,4,4
	.comm	STENCIL_BITS,4,4
	.comm	PFD_TYPE_RGBA,4,4
	.comm	PFD_TYPE_COLORINDEX,4,4
	.comm	PFD_DOUBLEBUFFER,4,4
	.comm	HEAP_ZERO_MEMORY,4,4
	.comm	FALSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
