	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gl_create_context              ## -- Begin function gl_create_context
	.p2align	4, 0x90
_gl_create_context:                     ## @gl_create_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r14
	xorl	%edi, %edi
	callq	_assert
	movl	$1, %edi
	callq	_assert
	movl	$1, %edi
	callq	_assert
	xorl	%edi, %edi
	callq	_assert
	movl	$1, %edi
	callq	_assert
	movl	$1, %edi
	callq	_assert
	xorl	%eax, %eax
	callq	_gl_init_math
	xorl	%eax, %eax
	callq	_gl_init_lists
	xorl	%eax, %eax
	callq	_gl_init_eval
	movl	$1, %edi
	movl	$72, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_15
## %bb.1:
	movq	%rax, %rbx
	movq	%r12, 64(%rax)
	movq	%r14, 56(%rax)
	movq	$0, 48(%rax)
	xorl	%eax, %eax
	callq	_gl_alloc_vb
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_14
## %bb.2:
	xorl	%eax, %eax
	callq	_gl_alloc_pb
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	testq	%r15, %r15
	je	LBB0_7
## %bb.4:
	movq	24(%r15), %rax
	movq	%rax, 24(%rbx)
	jmp	LBB0_8
LBB0_6:
	movq	16(%rbx), %rdi
	jmp	LBB0_13
LBB0_7:
	xorl	%eax, %eax
	callq	_alloc_shared_state
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_12
LBB0_8:
	incl	(%rax)
	movq	%rbx, %rdi
	callq	_initialize_context
	cmpq	$0, (%r14)
	jne	LBB0_10
## %bb.9:
	movq	_GL_FRONT@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_GL_BACK@GOTPCREL(%rip), %rax
LBB0_11:
	movq	(%rax), %rax
	movq	%rax, 40(%rbx)
	movq	%rax, 32(%rbx)
	movq	%rbx, %rdi
	callq	_gl_init_api_function_pointers
	movl	(%rbx), %eax
	movl	%eax, 4(%rbx)
	jmp	LBB0_16
LBB0_12:
	movq	16(%rbx), %rdi
	callq	_free
	movq	8(%rbx), %rdi
LBB0_13:
	callq	_free
LBB0_14:
	movq	%rbx, %rdi
	callq	_free
LBB0_15:
	xorl	%ebx, %ebx
LBB0_16:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GL_BACK,8,3                    ## @GL_BACK
	.comm	_GL_FRONT,8,3                   ## @GL_FRONT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gl_create_context              ; -- Begin function gl_create_context
	.p2align	2
_gl_create_context:                     ; @gl_create_context
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x22, x2
	mov	x21, x1
	mov	x20, x0
	mov	w0, #0
	bl	_assert
	mov	w0, #1
	bl	_assert
	mov	w0, #1
	bl	_assert
	mov	w0, #0
	bl	_assert
	mov	w0, #1
	bl	_assert
	mov	w0, #1
	bl	_assert
	bl	_gl_init_math
	bl	_gl_init_lists
	bl	_gl_init_eval
	mov	w0, #1
	mov	w1, #72
	bl	_calloc
	mov	x19, x0
	cbz	x0, LBB0_11
; %bb.1:
	stp	x20, x22, [x19, #56]
	str	xzr, [x19, #48]
	bl	_gl_alloc_vb
	str	x0, [x19, #16]
	cbz	x0, LBB0_10
; %bb.2:
	bl	_gl_alloc_pb
	str	x0, [x19, #8]
	cbz	x0, LBB0_5
; %bb.3:
	cbz	x21, LBB0_6
; %bb.4:
	ldr	x0, [x21, #24]
	str	x0, [x19, #24]
	b	LBB0_7
LBB0_5:
	ldr	x0, [x19, #16]
	b	LBB0_9
LBB0_6:
	bl	_alloc_shared_state
	str	x0, [x19, #24]
	cbz	x0, LBB0_8
LBB0_7:
	ldr	w8, [x0]
	add	w8, w8, #1
	str	w8, [x0]
	mov	x0, x19
	bl	_initialize_context
Lloh0:
	adrp	x8, _GL_FRONT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GL_FRONT@GOTPAGEOFF]
Lloh2:
	adrp	x9, _GL_BACK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _GL_BACK@GOTPAGEOFF]
	ldr	x10, [x20]
	cmp	x10, #0
	csel	x8, x8, x9, eq
	ldr	x8, [x8]
	stp	x8, x8, [x19, #32]
	mov	x0, x19
	bl	_gl_init_api_function_pointers
	ldr	w8, [x19]
	str	w8, [x19, #4]
	b	LBB0_11
LBB0_8:
	ldr	x0, [x19, #16]
	bl	_free
	ldr	x0, [x19, #8]
LBB0_9:
	bl	_free
LBB0_10:
	mov	x0, x19
	bl	_free
	mov	x19, #0
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_GL_BACK,8,3                    ; @GL_BACK
	.comm	_GL_FRONT,8,3                   ; @GL_FRONT
.subsections_via_symbols
