	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function context_set_gl_context
_context_set_gl_context:                ## @context_set_gl_context
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	56(%rdi), %r14
	movq	_FALSE@GOTPCREL(%rip), %r13
	movq	(%r13), %r15
	callq	_context_set_pixel_format
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	testq	%r15, %r15
	jne	LBB0_4
	jmp	LBB0_3
LBB0_1:
	movl	16(%rbx), %edx
	movl	24(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_WARN
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	testq	%r15, %r15
	jne	LBB0_4
LBB0_3:
	movl	16(%rbx), %edi
	movl	20(%rbx), %esi
	callq	_wglMakeCurrent
	testl	%eax, %eax
	jne	LBB0_15
LBB0_4:
	movl	16(%rbx), %r15d
	movl	20(%rbx), %r12d
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_WARN
	movl	$0, (%rbx)
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_WARN
	cmpq	$0, 48(%rbx)
	jne	LBB0_6
## %bb.5:
	testq	%r14, %r14
	je	LBB0_6
## %bb.7:
	movq	%r14, %rdi
	callq	_swapchain_get_backup_dc
	movl	%eax, 16(%rbx)
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%rbx)
	movq	_FALSE@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	%rax, 32(%rbx)
	movq	%rbx, %rdi
	callq	_context_set_pixel_format
	testl	%eax, %eax
	je	LBB0_10
## %bb.12:
	movl	16(%rbx), %edi
	movl	20(%rbx), %esi
	callq	_wglMakeCurrent
	testl	%eax, %eax
	je	LBB0_13
## %bb.14:
	movl	$1, (%rbx)
LBB0_15:
	movq	$0, 8(%rbx)
	movq	_TRUE@GOTPCREL(%rip), %r13
	jmp	LBB0_16
LBB0_6:
	leaq	L_.str.3(%rip), %rdi
	movq	%rbx, %rsi
	callq	_FIXME
LBB0_8:
	xorl	%edi, %edi
	callq	_context_set_current
LBB0_16:
	movq	(%r13), %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	16(%rbx), %edx
	movl	24(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_ERR
	jmp	LBB0_8
LBB0_13:
	movl	16(%rbx), %ebx
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str.4(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_ERR
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,8,3                      ## @FALSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to set pixel format %d on device context %p.\n"

	.comm	_TRUE,8,3                       ## @TRUE
L_.str.1:                               ## @.str.1
	.asciz	"Failed to make GL context %p current on device context %p, last error %#x.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Trying fallback to the backup window.\n"

L_.str.3:                               ## @.str.3
	.asciz	"Unable to get backup dc for destroyed context %p.\n"

L_.str.4:                               ## @.str.4
	.asciz	"Fallback to backup window (dc %p) failed too, last error %#x.\n"

	.no_dead_strip	_context_set_gl_context
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function context_set_gl_context
_context_set_gl_context:                ; @context_set_gl_context
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x0
	ldr	x20, [x0, #56]
Lloh0:
	adrp	x21, _FALSE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _FALSE@GOTPAGEOFF]
	ldr	x22, [x21]
	bl	_context_set_pixel_format
	cbz	w0, LBB0_2
; %bb.1:
	cbnz	x22, LBB0_4
	b	LBB0_3
LBB0_2:
	ldr	w8, [x19, #24]
	ldr	w9, [x19, #16]
	stp	x8, x9, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_WARN
Lloh4:
	adrp	x8, _TRUE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh6:
	ldr	x22, [x8]
	cbnz	x22, LBB0_4
LBB0_3:
	ldp	w0, w1, [x19, #16]
	bl	_wglMakeCurrent
	cbnz	w0, LBB0_10
LBB0_4:
	ldp	w23, w22, [x19, #16]
	bl	_GetLastError
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x23, x0, [sp, #8]
	str	x22, [sp]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_WARN
	str	wzr, [x19]
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_WARN
	ldr	x8, [x19, #48]
	cbnz	x8, LBB0_11
; %bb.5:
	cbz	x20, LBB0_11
; %bb.6:
	mov	x0, x20
	bl	_swapchain_get_backup_dc
	str	w0, [x19, #16]
	cbz	w0, LBB0_12
; %bb.7:
Lloh11:
	adrp	x8, _TRUE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	ldr	x9, [x21]
	stp	x9, x8, [x19, #32]
	mov	x0, x19
	bl	_context_set_pixel_format
	cbz	w0, LBB0_14
; %bb.8:
	ldp	w0, w1, [x19, #16]
	bl	_wglMakeCurrent
	cbz	w0, LBB0_15
; %bb.9:
	mov	w8, #1
	str	w8, [x19]
LBB0_10:
	str	xzr, [x19, #8]
Lloh14:
	adrp	x8, _TRUE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_13
LBB0_11:
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_FIXME
LBB0_12:
	mov	x0, #0
	bl	_context_set_current
Lloh18:
	adrp	x8, _FALSE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_13:
	ldr	x0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_14:
	ldr	w1, [x19, #24]
	ldr	w2, [x19, #16]
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERR
	b	LBB0_12
LBB0_15:
	ldr	w19, [x19, #16]
	bl	_GetLastError
	mov	x2, x0
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x19
	bl	_ERR
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,8,3                      ; @FALSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to set pixel format %d on device context %p.\n"

	.comm	_TRUE,8,3                       ; @TRUE
l_.str.1:                               ; @.str.1
	.asciz	"Failed to make GL context %p current on device context %p, last error %#x.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Trying fallback to the backup window.\n"

l_.str.3:                               ; @.str.3
	.asciz	"Unable to get backup dc for destroyed context %p.\n"

l_.str.4:                               ; @.str.4
	.asciz	"Fallback to backup window (dc %p) failed too, last error %#x.\n"

	.no_dead_strip	_context_set_gl_context
.subsections_via_symbols
