	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function sw_SetPixelFormat
LCPI0_0:
	.long	0x5f000000                      ## float 9.22337203E+18
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_sw_SetPixelFormat
	.p2align	4, 0x90
_sw_SetPixelFormat:                     ## @sw_SetPixelFormat
	.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	%edx, %ebx
	movq	%rsi, %r14
	movl	%edi, %r13d
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	callq	_TRACE
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_get_format
	movq	_FALSE@GOTPCREL(%rip), %rbx
	testq	%rax, %rax
	je	LBB0_14
## %bb.1:
	movq	%rax, %r15
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	movl	$24, %edx
	callq	_HeapAlloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, 16(%rax)
	movq	(%r15), %rax
	movq	_PFD_TYPE_RGBA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%r14b
	cmpq	$0, 8(%r15)
	setne	%r13b
	movq	_PFD_DOUBLEBUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	16(%r15), %eax
	setne	%bl
	movl	68(%r15), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_STENCIL_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	64(%r15), %edi
	movl	60(%r15), %esi
	callq	_max
	movl	56(%r15), %esi
	movl	%eax, %edi
	callq	_max
	movl	52(%r15), %esi
	movl	%eax, %edi
	callq	_max
	movl	%eax, %r9d
	movq	(%r15), %rax
	movq	_PFD_TYPE_COLORINDEX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	movl	48(%r15), %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
LBB0_5:
	xorl	%edi, %edi
	movb	%r14b, %dil
	xorl	%esi, %esi
	movb	%r13b, %sil
	xorl	%edx, %edx
	movb	%bl, %dl
	movq	24(%r15), %rcx
	movq	$-1, %r13
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
                                        ## kill: def $cl killed $cl killed $rcx
	shlq	%cl, %r13
	movq	8(%r15), %r12
	movq	$-1, %rax
	movq	32(%r15), %r11
	movq	$-1, %r14
	movl	%r11d, %ecx
	shlq	%cl, %r14
	movq	40(%r15), %r15
	movq	$-1, %r10
	movl	%r15d, %ecx
	shlq	%cl, %r10
	notq	%r13
	movl	%r12d, %ecx
	shlq	%cl, %rax
	notq	%r14
	notq	%r10
	notq	%rax
	testq	%rax, %rax
	js	LBB0_6
## %bb.7:
	cvtsi2ss	%rax, %xmm0
	jmp	LBB0_8
LBB0_2:
	leaq	L_.str.1(%rip), %rdi
	callq	_ERR
	jmp	LBB0_14
LBB0_6:
	movq	%rax, %rcx
	shrq	%rcx
	andl	$1, %eax
	orq	%rcx, %rax
	cvtsi2ss	%rax, %xmm0
	addss	%xmm0, %xmm0
LBB0_8:
	cvttss2si	%xmm0, %rcx
	movq	%rcx, %rax
	sarq	$63, %rax
	subss	LCPI0_0(%rip), %xmm0
	cvttss2si	%xmm0, %rbx
	andq	%rax, %rbx
	orq	%rcx, %rbx
	testq	%r12, %r12
	movl	$255, %eax
	cmovneq	%rbx, %rax
	subq	$8, %rsp
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	pushq	%r12
	pushq	%r15
	pushq	%r11
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	pushq	%rax
	pushq	%r10
	pushq	%r14
	pushq	%r13
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	callq	_gl_create_visual
	addq	$80, %rsp
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, 4(%rbx)
	testl	%eax, %eax
	je	LBB0_9
## %bb.11:
	movl	%eax, %edi
	callq	_gl_create_framebuffer
	movl	%eax, 8(%rbx)
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rbx)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	movq	_TRUE@GOTPCREL(%rip), %rbx
	jmp	LBB0_14
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	callq	_ERR
	jmp	LBB0_10
LBB0_12:
	leaq	L_.str.3(%rip), %rdi
	callq	_ERR
	movl	4(%rbx), %edi
	callq	_gl_destroy_visual
LBB0_10:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_HeapFree
	movq	_FALSE@GOTPCREL(%rip), %rbx
LBB0_14:
	movl	(%rbx), %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OpenGL software implementation START for hdc %p, format %i!\n"

	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
L_.str.1:                               ## @.str.1
	.asciz	"HeapAlloc FAILED!\n"

	.comm	_PFD_TYPE_RGBA,8,3              ## @PFD_TYPE_RGBA
	.comm	_PFD_DOUBLEBUFFER,4,2           ## @PFD_DOUBLEBUFFER
	.comm	_STENCIL_BITS,4,2               ## @STENCIL_BITS
	.comm	_PFD_TYPE_COLORINDEX,8,3        ## @PFD_TYPE_COLORINDEX
L_.str.2:                               ## @.str.2
	.asciz	"Failed to allocate a GL visual.\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to allocate the mesa framebuffer structure.\n"

	.comm	_TRUE,4,2                       ## @TRUE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sw_SetPixelFormat              ; -- Begin function sw_SetPixelFormat
	.p2align	2
_sw_SetPixelFormat:                     ; @sw_SetPixelFormat
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_TRACE
	mov	x0, x19
	mov	x1, #0
	bl	_get_format
	cbz	x0, LBB0_12
; %bb.1:
	mov	x22, x0
	bl	_GetProcessHeap
Lloh2:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w2, #24
	bl	_HeapAlloc
	cbz	x0, LBB0_4
; %bb.2:
	mov	x19, x0
	str	x22, [x0, #16]
Lloh5:
	adrp	x8, _PFD_TYPE_RGBA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PFD_TYPE_RGBA@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldp	x9, x10, [x22]
	cmp	x9, x8
	cset	w23, eq
	cmp	x10, #0
	cset	w24, ne
	ldr	w8, [x22, #16]
Lloh8:
	adrp	x9, _PFD_DOUBLEBUFFER@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PFD_DOUBLEBUFFER@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w25, ne
	ldp	w0, w26, [x22, #64]
Lloh11:
	adrp	x8, _STENCIL_BITS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _STENCIL_BITS@GOTPAGEOFF]
Lloh13:
	ldr	w27, [x8]
	ldr	w1, [x22, #60]
	bl	_max
	ldr	w1, [x22, #56]
	bl	_max
	ldr	w1, [x22, #52]
	bl	_max
	mov	x5, x0
	ldr	x8, [x22]
Lloh14:
	adrp	x9, _PFD_TYPE_COLORINDEX@GOTPAGE
Lloh15:
	ldr	x9, [x9, _PFD_TYPE_COLORINDEX@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	ldr	w6, [x22, #48]
	b	LBB0_6
LBB0_4:
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERR
	b	LBB0_12
LBB0_5:
	mov	w6, #0
LBB0_6:
	mov	x8, #-1
	ldp	x9, x10, [x22, #24]
	lsl	x11, x8, x9
	mvn	x7, x11
	lsl	x11, x8, x10
	mvn	x11, x11
	ldr	x12, [x22, #40]
	lsl	x13, x8, x12
	ldr	x14, [x22, #8]
	lsl	x8, x8, x14
	mvn	x8, x8
	ucvtf	s0, x8
	mvn	x8, x13
	fcvtzu	x13, s0
	mov	w15, #255
	cmp	x14, #0
	csel	x13, x15, x13, eq
	stp	x12, x14, [sp, #40]
	stp	x9, x10, [sp, #24]
	stp	x11, x8, [sp]
	str	x13, [sp, #16]
	mov	x0, x23
	mov	x1, x24
	mov	x2, x25
	mov	x3, x26
	mov	x4, x27
	bl	_gl_create_visual
	str	w0, [x19, #4]
	cbz	w0, LBB0_9
; %bb.7:
	bl	_gl_create_framebuffer
	str	w0, [x19, #8]
	cbz	w0, LBB0_10
; %bb.8:
	str	w21, [x19]
	str	x19, [x20]
Lloh19:
	adrp	x8, _TRUE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_13
LBB0_9:
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_ERR
	b	LBB0_11
LBB0_10:
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_ERR
	ldr	w0, [x19, #4]
	bl	_gl_destroy_visual
LBB0_11:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x19
	bl	_HeapFree
LBB0_12:
Lloh25:
	adrp	x8, _FALSE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
	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
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OpenGL software implementation START for hdc %p, format %i!\n"

	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
l_.str.1:                               ; @.str.1
	.asciz	"HeapAlloc FAILED!\n"

	.comm	_PFD_TYPE_RGBA,8,3              ; @PFD_TYPE_RGBA
	.comm	_PFD_DOUBLEBUFFER,4,2           ; @PFD_DOUBLEBUFFER
	.comm	_STENCIL_BITS,4,2               ; @STENCIL_BITS
	.comm	_PFD_TYPE_COLORINDEX,8,3        ; @PFD_TYPE_COLORINDEX
l_.str.2:                               ; @.str.2
	.asciz	"Failed to allocate a GL visual.\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to allocate the mesa framebuffer structure.\n"

	.comm	_TRUE,4,2                       ; @TRUE
.subsections_via_symbols
