	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_take_screenshot                ## -- Begin function take_screenshot
	.p2align	4, 0x90
_take_screenshot:                       ## @take_screenshot
	.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	%r9d, %r12d
	movl	%r8d, %r15d
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r14
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	leaq	-48(%rbp), %rdi
	leaq	-44(%rbp), %rsi
	leaq	-68(%rbp), %rdx
	leaq	-64(%rbp), %rcx
	callq	_runloop_get_status
	movq	%r14, %rdi
	callq	_string_is_empty
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r13, %rdi
	callq	_string_is_empty
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_7
LBB0_2:
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	-44(%rbp), %r12d
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_video_driver_supports_viewport_read
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_video_driver_prefer_viewport_read
	xorl	%r15d, %r15d
	testq	%rax, %rax
	setne	%r15b
LBB0_4:
	xorl	%eax, %eax
	callq	_video_driver_supports_read_frame_raw
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_video_driver_get_pixel_format
                                        ## kill: def $eax killed $eax def $rax
	subq	$8, %rsp
	movq	%r14, %rdi
	movq	%r13, %rsi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	%r12d, %r8d
	movl	-60(%rbp), %r9d                 ## 4-byte Reload
	pushq	%rax
	pushq	%rbx
	pushq	%r15
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	pushq	-88(%rbp)                       ## 8-byte Folded Reload
	callq	_take_screenshot_choice
	addq	$48, %rsp
	movl	%eax, %ebx
	cmpl	$0, -48(%rbp)
	je	LBB0_7
## %bb.5:
	cmpl	$0, -44(%rbp)
	jne	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	callq	_video_driver_cached_frame
LBB0_7:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_take_screenshot                ; -- Begin function take_screenshot
	.p2align	2
_take_screenshot:                       ; @take_screenshot
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x24, x0
	stp	xzr, xzr, [sp, #16]
	add	x0, sp, #28
	add	x1, sp, #24
	add	x2, sp, #20
	add	x3, sp, #16
	bl	_runloop_get_status
	mov	x0, x24
	bl	_string_is_empty
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x23
	bl	_string_is_empty
	cbz	x0, LBB0_3
; %bb.2:
	mov	w19, #0
	b	LBB0_9
LBB0_3:
	ldp	w26, w25, [sp, #24]
	bl	_video_driver_supports_viewport_read
	cbz	x0, LBB0_5
; %bb.4:
	bl	_video_driver_prefer_viewport_read
	cmp	x0, #0
	cset	w28, ne
	b	LBB0_6
LBB0_5:
	mov	w28, #0
LBB0_6:
	bl	_video_driver_supports_read_frame_raw
	mov	x27, x0
	bl	_video_driver_get_pixel_format
	stp	w27, w0, [sp, #4]
	str	w28, [sp]
	mov	x0, x24
	mov	x1, x23
	mov	x2, x22
	mov	x3, x25
	mov	x4, x26
	mov	x5, x21
	mov	x6, x20
	mov	x7, x19
	bl	_take_screenshot_choice
	mov	x19, x0
	ldr	w8, [sp, #28]
	cbz	w8, LBB0_9
; %bb.7:
	ldr	w8, [sp, #24]
	cbnz	w8, LBB0_9
; %bb.8:
	bl	_video_driver_cached_frame
LBB0_9:
	mov	x0, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
