	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dmlab_destroy_context
_dmlab_destroy_context:                 ## @dmlab_destroy_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	%rdi, %rbx
	movq	32(%rdi), %rdi
	movq	80(%rbx), %r14
	cmpq	$0, 72(%rdi)
	je	LBB0_2
## %bb.1:
	callq	_dmlab_stop_recording
	movq	32(%rbx), %rdi
LBB0_2:
	cmpq	$0, 64(%rdi)
	je	LBB0_4
## %bb.3:
	callq	_dmlab_stop_video
	movq	32(%rbx), %rdi
LBB0_4:
	movq	(%rdi), %rax
	movq	_DMLAB_RECORDING_ERROR_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.5:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%rdi), %rdx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_fprintf
LBB0_6:
	leaq	40(%rbx), %r15
	cmpq	$0, 56(%rbx)
	jne	LBB0_9
## %bb.7:
	cmpq	$0, 48(%rbx)
	jne	LBB0_9
## %bb.8:
	cmpq	$0, (%r15)
	je	LBB0_15
LBB0_9:
	leaq	56(%rbx), %r12
	movq	_re@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	callq	*(%rcx)
	cmpq	$0, (%r12)
	je	LBB0_11
## %bb.10:
	movl	$1, %edi
	movq	%r12, %rsi
	callq	_qglDeleteBuffers
LBB0_11:
	cmpq	$0, 48(%rbx)
	je	LBB0_13
## %bb.12:
	leaq	48(%rbx), %rsi
	movl	$1, %edi
	callq	_qglDeleteBuffers
LBB0_13:
	cmpq	$0, (%r15)
	je	LBB0_15
## %bb.14:
	movl	$1, %edi
	movq	%r15, %rsi
	callq	_qglDeleteBuffers
LBB0_15:
	movq	%r14, %rdi
	callq	_dmlab_release_context
	movq	32(%rbx), %rdi
	callq	_free
	movq	24(%rbx), %rdi
	callq	_free
	movq	16(%rbx), %rdi
	callq	_free
	movq	%rbx, %rdi
	callq	_free
	xorl	%eax, %eax
	callq	_GLimp_Shutdown
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DMLabUnloadIOQ3Module          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DMLAB_RECORDING_ERROR_NONE,8,3 ## @DMLAB_RECORDING_ERROR_NONE
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ERROR: %s"

	.comm	_re,8,3                         ## @re
	.no_dead_strip	_dmlab_destroy_context
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dmlab_destroy_context
_dmlab_destroy_context:                 ; @dmlab_destroy_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	x19, x0
	ldr	x20, [x0, #80]
	ldr	x0, [x0, #32]
	ldr	x8, [x0, #72]
	cbz	x8, LBB0_2
; %bb.1:
	bl	_dmlab_stop_recording
	ldr	x0, [x19, #32]
LBB0_2:
	ldr	x8, [x0, #64]
	cbz	x8, LBB0_4
; %bb.3:
	bl	_dmlab_stop_video
	ldr	x0, [x19, #32]
LBB0_4:
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _DMLAB_RECORDING_ERROR_NONE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMLAB_RECORDING_ERROR_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_6
; %bb.5:
Lloh3:
	adrp	x8, _stderr@GOTPAGE
Lloh4:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	x2, [x0, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x8
	bl	_fprintf
LBB0_6:
	mov	x22, x19
	ldr	x8, [x22, #56]!
	sub	x21, x22, #16
	cbnz	x8, LBB0_9
; %bb.7:
	ldr	x8, [x19, #48]
	cbnz	x8, LBB0_9
; %bb.8:
	ldr	x8, [x21]
	cbz	x8, LBB0_15
LBB0_9:
Lloh8:
	adrp	x8, _re@GOTPAGE
Lloh9:
	ldr	x8, [x8, _re@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	blr	x8
	ldr	x8, [x22]
	cbz	x8, LBB0_11
; %bb.10:
	mov	w0, #1
	mov	x1, x22
	bl	_qglDeleteBuffers
LBB0_11:
	mov	x1, x19
	ldr	x8, [x1, #48]!
	cbz	x8, LBB0_13
; %bb.12:
	mov	w0, #1
	bl	_qglDeleteBuffers
LBB0_13:
	ldr	x8, [x21]
	cbz	x8, LBB0_15
; %bb.14:
	mov	w0, #1
	mov	x1, x21
	bl	_qglDeleteBuffers
LBB0_15:
	mov	x0, x20
	bl	_dmlab_release_context
	ldr	x0, [x19, #32]
	bl	_free
	ldr	x0, [x19, #24]
	bl	_free
	ldr	x0, [x19, #16]
	bl	_free
	mov	x0, x19
	bl	_free
	bl	_GLimp_Shutdown
	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
	b	_DMLabUnloadIOQ3Module
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_DMLAB_RECORDING_ERROR_NONE,8,3 ; @DMLAB_RECORDING_ERROR_NONE
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ERROR: %s"

	.comm	_re,8,3                         ; @re
	.no_dead_strip	_dmlab_destroy_context
.subsections_via_symbols
