	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_context_create_wgl_attribs     ## -- Begin function context_create_wgl_attribs
	.p2align	4, 0x90
_context_create_wgl_attribs:            ## @context_create_wgl_attribs
	.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, -88(%rbp)                 ## 4-byte Spill
	movl	%esi, -84(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_context_debug_output_enabled
	xorl	%r13d, %r13d
	movl	$0, %r14d
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_WGL_CONTEXT_DEBUG_BIT_ARB@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_2:
	movq	_WGL_CONTEXT_MAJOR_VERSION_ARB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	movl	(%r12), %ebx
	movl	%ebx, %eax
	sarl	$16, %eax
	movl	%eax, -76(%rbp)
	movq	_WGL_CONTEXT_MINOR_VERSION_ARB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movzwl	%bx, %eax
	movl	%eax, -68(%rbp)
	movl	$3, %edi
	movl	$2, %esi
	callq	_MAKEDWORD_VERSION
	movq	_WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB@GOTPCREL(%rip), %r15
	cmpl	%eax, %ebx
	jl	LBB0_4
## %bb.3:
	movl	(%r15), %r13d
LBB0_4:
	orl	%r14d, %r13d
	movl	-88(%rbp), %esi                 ## 4-byte Reload
	movl	-84(%rbp), %edi                 ## 4-byte Reload
	je	LBB0_5
## %bb.6:
	movq	_WGL_CONTEXT_FLAGS_ARB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movl	%r13d, -60(%rbp)
	movl	$6, %r14d
	jmp	LBB0_7
LBB0_5:
	movl	$4, %r14d
LBB0_7:
	movl	%r14d, %eax
	movl	$0, -80(%rbp,%rax,4)
	leaq	-80(%rbp), %rdx
	callq	*8(%r12)
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_8
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	(%r15), %eax
	testl	%r13d, %eax
	je	LBB0_9
## %bb.10:
	notl	%eax
	decl	%r14d
	andl	%eax, -80(%rbp,%r14,4)
	leaq	-80(%rbp), %rdx
	movl	-84(%rbp), %edi                 ## 4-byte Reload
	movl	-88(%rbp), %esi                 ## 4-byte Reload
	callq	*8(%r12)
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_WARN
	jmp	LBB0_12
LBB0_9:
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_WGL_CONTEXT_DEBUG_BIT_ARB,4,2  ## @WGL_CONTEXT_DEBUG_BIT_ARB
	.comm	_WGL_CONTEXT_MAJOR_VERSION_ARB,4,2 ## @WGL_CONTEXT_MAJOR_VERSION_ARB
	.comm	_WGL_CONTEXT_MINOR_VERSION_ARB,4,2 ## @WGL_CONTEXT_MINOR_VERSION_ARB
	.comm	_WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,4,2 ## @WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
	.comm	_WGL_CONTEXT_FLAGS_ARB,4,2      ## @WGL_CONTEXT_FLAGS_ARB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to create a WGL context with wglCreateContextAttribsARB, last error %#x.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_context_create_wgl_attribs     ; -- Begin function context_create_wgl_attribs
	.p2align	2
_context_create_wgl_attribs:            ; @context_create_wgl_attribs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	bl	_context_debug_output_enabled
Lloh3:
	adrp	x8, _WGL_CONTEXT_DEBUG_BIT_ARB@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WGL_CONTEXT_DEBUG_BIT_ARB@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	x0, #0
Lloh6:
	adrp	x9, _WGL_CONTEXT_MAJOR_VERSION_ARB@GOTPAGE
Lloh7:
	ldr	x9, [x9, _WGL_CONTEXT_MAJOR_VERSION_ARB@GOTPAGEOFF]
	csel	w23, wzr, w8, eq
Lloh8:
	ldr	w8, [x9]
	ldr	w24, [x21]
	asr	w9, w24, #16
	stp	w8, w9, [sp, #12]
Lloh9:
	adrp	x8, _WGL_CONTEXT_MINOR_VERSION_ARB@GOTPAGE
Lloh10:
	ldr	x8, [x8, _WGL_CONTEXT_MINOR_VERSION_ARB@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w9, w24, #0xffff
	stp	w8, w9, [sp, #20]
	mov	w0, #3
	mov	w1, #2
	bl	_MAKEDWORD_VERSION
Lloh12:
	adrp	x22, _WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB@GOTPAGE
Lloh13:
	ldr	x22, [x22, _WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w24, w0
	csel	w8, wzr, w8, lt
	orr	w23, w8, w23
	cbz	w23, LBB0_2
; %bb.1:
Lloh14:
	adrp	x8, _WGL_CONTEXT_FLAGS_ARB@GOTPAGE
Lloh15:
	ldr	x8, [x8, _WGL_CONTEXT_FLAGS_ARB@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	stp	w8, w23, [sp, #28]
	mov	w24, #6
	b	LBB0_3
LBB0_2:
	mov	w24, #4
LBB0_3:
	add	x8, sp, #12
	str	wzr, [x8, w24, uxtw #2]
	ldr	x8, [x21, #8]
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x19
	blr	x8
	cbnz	w0, LBB0_8
; %bb.4:
	ldr	w8, [x22]
	tst	w8, w23
	b.eq	LBB0_7
; %bb.5:
	sub	w9, w24, #1
	lsl	x9, x9, #2
	add	x10, sp, #12
	ldr	w11, [x10, x9]
	bic	w8, w11, w8
	str	w8, [x10, x9]
	ldr	x8, [x21, #8]
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x19
	blr	x8
	cbnz	w0, LBB0_8
; %bb.6:
	bl	_GetLastError
	mov	x1, x0
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_WARN
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldr	x8, [sp, #40]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_WGL_CONTEXT_DEBUG_BIT_ARB,4,2  ; @WGL_CONTEXT_DEBUG_BIT_ARB
	.comm	_WGL_CONTEXT_MAJOR_VERSION_ARB,4,2 ; @WGL_CONTEXT_MAJOR_VERSION_ARB
	.comm	_WGL_CONTEXT_MINOR_VERSION_ARB,4,2 ; @WGL_CONTEXT_MINOR_VERSION_ARB
	.comm	_WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,4,2 ; @WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
	.comm	_WGL_CONTEXT_FLAGS_ARB,4,2      ; @WGL_CONTEXT_FLAGS_ARB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to create a WGL context with wglCreateContextAttribsARB, last error %#x.\n"

.subsections_via_symbols
