	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sw_SetContext                  ## -- Begin function sw_SetContext
	.p2align	4, 0x90
_sw_SetContext:                         ## @sw_SetContext
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	16(%rdi), %r12
	movq	_WGL_DC_OBJ_DC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_7
## %bb.1:
	movl	8(%rdi), %edi
	testl	%edi, %edi
	je	LBB0_2
## %bb.3:
	leaq	-48(%rbp), %rsi
	callq	_GetClientRect
	testl	%eax, %eax
	je	LBB0_4
## %bb.6:
	movq	_WH_CALLWNDPROC@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_sw_call_window_proc@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_GetCurrentThreadId
	movl	%r15d, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	movl	%eax, %ecx
	callq	_SetWindowsHookEx
	movl	%eax, 8(%r14)
	movl	-48(%rbp), %r15d
	movl	-40(%rbp), %ebx
	subl	-44(%rbp), %r15d
	subl	-36(%rbp), %ebx
LBB0_14:
	testl	%r15d, %r15d
	movl	$1, %eax
	cmovel	%eax, %r15d
	testl	%ebx, %ebx
	cmovel	%eax, %ebx
	movq	(%r14), %rdi
	movl	(%r12), %esi
	callq	_gl_make_current
	movq	(%r14), %rdi
	callq	_setup_DD_pointers
	movq	(%r14), %rdi
	cmpq	$0, (%rdi)
	jne	LBB0_19
## %bb.15:
	cmpq	$0, 8(%rdi)
	jne	LBB0_19
## %bb.16:
	cmpq	$0, 16(%rdi)
	jne	LBB0_19
## %bb.17:
	cmpq	$0, 24(%rdi)
	jne	LBB0_19
## %bb.18:
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	%r15d, %ecx
	movl	%ebx, %r8d
	callq	_gl_Viewport
	movq	(%r14), %rdi
LBB0_19:
	callq	_gl_ResizeBuffersMESA
	movq	_sw_api_table@GOTPCREL(%rip), %rdi
	callq	_IntSetCurrentDispatchTable
	movq	_TRUE@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_7:
	movq	8(%r12), %rax
	cmpq	$0, (%rax)
	je	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_5
LBB0_2:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_5
LBB0_9:
	movl	4(%rdi), %edi
	movq	_OBJ_BITMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_GetCurrentObject
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	leaq	-48(%rbp), %rdx
	movl	%eax, %edi
	movl	$8, %esi
	callq	_GetObject
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movl	-48(%rbp), %r15d
	movl	-44(%rbp), %ebx
	jmp	LBB0_14
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_5
LBB0_12:
	leaq	L_.str.4(%rip), %rdi
LBB0_5:
	callq	_ERR
	movq	_FALSE@GOTPCREL(%rip), %rax
LBB0_20:
	movl	(%rax), %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WGL_DC_OBJ_DC,4,2              ## @WGL_DC_OBJ_DC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Physical DC without a window!\n"

	.comm	_FALSE,4,2                      ## @FALSE
L_.str.1:                               ## @.str.1
	.asciz	"GetClientRect failed!\n"

	.comm	_WH_CALLWNDPROC,4,2             ## @WH_CALLWNDPROC
	.comm	_sw_call_window_proc,4,2        ## @sw_call_window_proc
L_.str.2:                               ## @.str.2
	.asciz	"Memory DC called with a double buffered format.\n"

	.comm	_OBJ_BITMAP,4,2                 ## @OBJ_BITMAP
L_.str.3:                               ## @.str.3
	.asciz	"No Bitmap!\n"

L_.str.4:                               ## @.str.4
	.asciz	"GetObject failed!\n"

	.comm	_sw_api_table,4,2               ## @sw_api_table
	.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_SetContext                  ; -- Begin function sw_SetContext
	.p2align	2
_sw_SetContext:                         ; @sw_SetContext
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	ldr	x22, [x0, #16]
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _WGL_DC_OBJ_DC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WGL_DC_OBJ_DC@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.1:
	ldr	w0, [x0, #8]
	cbz	w0, LBB0_12
; %bb.2:
	mov	x1, sp
	bl	_GetClientRect
	cbz	w0, LBB0_13
; %bb.3:
Lloh3:
	adrp	x8, _WH_CALLWNDPROC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WH_CALLWNDPROC@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x8]
Lloh6:
	adrp	x8, _sw_call_window_proc@GOTPAGE
Lloh7:
	ldr	x8, [x8, _sw_call_window_proc@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x8]
	bl	_GetCurrentThreadId
	mov	x3, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, #0
	bl	_SetWindowsHookEx
	str	w0, [x19, #8]
	ldp	w8, w9, [sp]
	sub	w8, w8, w9
	ldp	w9, w10, [sp, #8]
	sub	w9, w9, w10
LBB0_4:
	cmp	w8, #0
	csinc	w20, w8, wzr, ne
	cmp	w9, #0
	csinc	w21, w9, wzr, ne
	ldr	x0, [x19]
	ldr	w1, [x22]
	bl	_gl_make_current
	ldr	x0, [x19]
	bl	_setup_DD_pointers
	ldr	x0, [x19]
	ldr	x8, [x0]
	cbnz	x8, LBB0_9
; %bb.5:
	ldr	x8, [x0, #8]
	cbnz	x8, LBB0_9
; %bb.6:
	ldr	x8, [x0, #16]
	cbnz	x8, LBB0_9
; %bb.7:
	ldr	x8, [x0, #24]
	cbnz	x8, LBB0_9
; %bb.8:
	mov	w1, #0
	mov	w2, #0
	mov	x3, x20
	mov	x4, x21
	bl	_gl_Viewport
	ldr	x0, [x19]
LBB0_9:
	bl	_gl_ResizeBuffersMESA
Lloh9:
	adrp	x0, _sw_api_table@GOTPAGE
Lloh10:
	ldr	x0, [x0, _sw_api_table@GOTPAGEOFF]
	bl	_IntSetCurrentDispatchTable
Lloh11:
	adrp	x8, _TRUE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_20
LBB0_10:
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_14
; %bb.11:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_19
LBB0_12:
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_19
LBB0_13:
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_19
LBB0_14:
	ldr	w0, [x0, #4]
Lloh19:
	adrp	x8, _OBJ_BITMAP@GOTPAGE
Lloh20:
	ldr	x8, [x8, _OBJ_BITMAP@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	bl	_GetCurrentObject
	cbz	w0, LBB0_17
; %bb.15:
	mov	x2, sp
	mov	w1, #8
	bl	_GetObject
	cbz	x0, LBB0_18
; %bb.16:
	ldp	w8, w9, [sp]
	b	LBB0_4
LBB0_17:
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_19
LBB0_18:
Lloh24:
	adrp	x0, l_.str.4@PAGE
Lloh25:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_19:
	bl	_ERR
Lloh26:
	adrp	x8, _FALSE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_20:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_WGL_DC_OBJ_DC,4,2              ; @WGL_DC_OBJ_DC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Physical DC without a window!\n"

	.comm	_FALSE,4,2                      ; @FALSE
l_.str.1:                               ; @.str.1
	.asciz	"GetClientRect failed!\n"

	.comm	_WH_CALLWNDPROC,4,2             ; @WH_CALLWNDPROC
	.comm	_sw_call_window_proc,4,2        ; @sw_call_window_proc
l_.str.2:                               ; @.str.2
	.asciz	"Memory DC called with a double buffered format.\n"

	.comm	_OBJ_BITMAP,4,2                 ; @OBJ_BITMAP
l_.str.3:                               ; @.str.3
	.asciz	"No Bitmap!\n"

l_.str.4:                               ; @.str.4
	.asciz	"GetObject failed!\n"

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