	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function screenshot_dump
_screenshot_dump:                       ## @screenshot_dump
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -52(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r12d
	movl	%ecx, %r14d
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorl	%eax, %eax
	callq	_config_get_ptr
	movq	%rax, %r15
	movl	$1, %edi
	movl	$112, %esi
	callq	_calloc
	movq	%rax, %rbx
	movq	(%rax), %rax
	movb	$0, (%rax)
	cmpl	$0, 56(%rbp)
	je	LBB0_2
## %bb.1:
	movq	8(%rbx), %rdi
	movq	%r13, %rsi
	movl	$8, %edx
	callq	_strlcpy
LBB0_2:
	movq	%r13, %rsi
	movl	40(%rbp), %eax
	movl	%eax, 16(%rbx)
	movl	48(%rbp), %eax
	movl	%eax, 20(%rbx)
	movl	16(%rbp), %eax
	movl	%eax, 24(%rbx)
	movl	%r12d, 28(%rbx)
	movl	%r14d, 32(%rbx)
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 36(%rbx)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 104(%rbx)
	movq	24(%rbp), %rax
	movq	%rax, 96(%rbx)
	movl	$0, 40(%rbx)
	movl	32(%rbp), %r13d
	movl	%r13d, 44(%rbx)
	movl	16(%r15), %eax
	movl	%eax, 92(%rbx)
	movl	72(%rbp), %eax
	movl	%eax, 48(%rbx)
	cmpl	$0, 56(%rbp)
	jne	LBB0_19
## %bb.3:
	testl	%r13d, %r13d
	je	LBB0_5
## %bb.4:
	movq	8(%rbx), %rdi
	movl	$8, %edx
	callq	_strlcpy
	movq	8(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	movl	$8, %edx
	callq	_strlcat
	cmpl	$0, 64(%rbp)
	jne	LBB0_20
	jmp	LBB0_28
LBB0_5:
	movq	%r15, %r12
	cmpq	$0, 8(%r15)
	movq	%rsi, %r15
	je	LBB0_14
## %bb.6:
	movq	_RARCH_PATH_CONTENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_path_is_empty
	testq	%rax, %rax
	je	LBB0_12
## %bb.7:
	leaq	-72(%rbp), %rdi
	callq	_core_get_system_info
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movq	-72(%rbp), %rdi
	callq	_string_is_empty
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_13
LBB0_14:
	movq	(%rbx), %r14
	movq	%r15, %rdi
	callq	_path_basename
	movq	%r14, %rdi
	movq	%rax, %rsi
	movl	$8, %edx
	callq	_strlcpy
	movq	(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	movl	$8, %edx
	callq	_strlcat
	jmp	LBB0_15
LBB0_12:
	movq	%r15, %rdi
	callq	_path_basename
	movq	%rax, %rsi
	jmp	LBB0_13
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_29
LBB0_11:
	movq	-72(%rbp), %rsi
LBB0_13:
	movq	(%rbx), %rdi
	movq	_IMG_EXT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$8, %ecx
	callq	_fill_str_dated_filename
LBB0_15:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_string_is_empty
	testq	%rax, %rax
	jne	LBB0_17
## %bb.16:
	cmpq	$0, (%r12)
	je	LBB0_18
LBB0_17:
	movq	%rsp, %r12
	movq	_PATH_MAX_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r14, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%r15, %rsi
	movq	%rsp, %r15
	movb	$0, (%r15)
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_fill_pathname_basedir
	movq	(%rbx), %rdx
	movq	8(%rbx), %rdi
	movq	%r15, %rsi
	movl	$8, %ecx
	callq	_fill_pathname_join
	movq	%r12, %rsp
LBB0_19:
	cmpl	$0, 64(%rbp)
	je	LBB0_28
LBB0_20:
	xorl	%eax, %eax
	callq	_task_init
	movq	%rax, %r14
	movq	_TASK_TYPE_BLOCKING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 88(%r14)
	movq	%rbx, 80(%r14)
	movq	_task_screenshot_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 76(%r14)
	testl	%r13d, %r13d
	jne	LBB0_22
## %bb.21:
	movq	_MSG_TAKING_SCREENSHOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movl	%eax, %edi
	callq	_strdup
	movq	%rax, 64(%r14)
LBB0_22:
	movq	%r14, %rdi
	callq	_task_queue_push
	movq	%rax, %rcx
	movl	$1, %eax
	testq	%rcx, %rcx
	jne	LBB0_29
## %bb.23:
	cmpq	$0, 64(%r14)
	je	LBB0_25
## %bb.24:
	movq	%r14, %rdi
	callq	_task_free_title
LBB0_25:
	movq	%r14, %rdi
	callq	_free
	movq	56(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_27
## %bb.26:
	callq	_free
LBB0_27:
	movq	%rbx, %rdi
	callq	_free
	xorl	%eax, %eax
	jmp	LBB0_29
LBB0_18:
	movq	(%rbx), %rdx
	movq	8(%rbx), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	$8, %ecx
	callq	_fill_pathname_join
	cmpl	$0, 64(%rbp)
	jne	LBB0_20
LBB0_28:
	movq	%rbx, %rdi
	callq	_screenshot_dump_direct
LBB0_29:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_31
## %bb.30:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_31:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	".png"

	.comm	_RARCH_PATH_CONTENT,4,2         ## @RARCH_PATH_CONTENT
L_.str.1:                               ## @.str.1
	.asciz	"RetroArch"

	.comm	_IMG_EXT,4,2                    ## @IMG_EXT
	.comm	_PATH_MAX_LENGTH,4,2            ## @PATH_MAX_LENGTH
	.comm	_TASK_TYPE_BLOCKING,4,2         ## @TASK_TYPE_BLOCKING
	.comm	_task_screenshot_handler,4,2    ## @task_screenshot_handler
	.comm	_MSG_TAKING_SCREENSHOT,4,2      ## @MSG_TAKING_SCREENSHOT
	.comm	_task_screenshot_callback,4,2   ## @task_screenshot_callback
	.no_dead_strip	_screenshot_dump
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function screenshot_dump
_screenshot_dump:                       ; @screenshot_dump
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #48
	stur	x7, [x29, #-104]                ; 8-byte Folded Spill
	mov	x26, x6
	mov	x28, x4
	mov	x27, x3
	stp	x0, x2, [x29, #-128]            ; 16-byte Folded Spill
	mov	x24, x1
	ldr	w8, [x29, #36]
	stp	w5, w8, [x29, #-112]            ; 8-byte Folded Spill
	ldp	w22, w21, [x29, #24]
	ldp	w20, w23, [x29, #16]
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	bl	_config_get_ptr
	mov	x25, x0
	mov	w0, #1
	mov	w1, #112
	bl	_calloc
	mov	x19, x0
	ldr	x8, [x0]
	strb	wzr, [x8]
	cbz	w21, LBB0_2
; %bb.1:
	ldr	x0, [x19, #8]
	mov	x1, x24
	mov	w2, #8
	bl	_strlcpy
LBB0_2:
	stp	w23, w22, [x19, #16]
	stp	w26, w28, [x19, #24]
	ldur	w8, [x29, #-112]                ; 4-byte Folded Reload
	stp	w27, w8, [x19, #32]
	ldur	x9, [x29, #-120]                ; 8-byte Folded Reload
	ldur	x8, [x29, #-104]                ; 8-byte Folded Reload
	stp	x8, x9, [x19, #96]
	stp	wzr, w20, [x19, #40]
	mov	x22, x20
	ldr	w8, [x25, #16]
	str	w8, [x19, #92]
	ldur	w8, [x29, #-108]                ; 4-byte Folded Reload
	str	w8, [x19, #48]
	cbnz	w21, LBB0_17
; %bb.3:
	cbz	w22, LBB0_5
; %bb.4:
	ldr	x0, [x19, #8]
	mov	x1, x24
	mov	w2, #8
	bl	_strlcpy
	ldr	x0, [x19, #8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #8
	bl	_strlcat
	ldr	w8, [x29, #32]
	cbnz	w8, LBB0_18
	b	LBB0_28
LBB0_5:
	ldr	x8, [x25, #8]
	cbz	x8, LBB0_10
; %bb.6:
Lloh5:
	adrp	x8, _RARCH_PATH_CONTENT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RARCH_PATH_CONTENT@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_path_is_empty
	cbz	x0, LBB0_11
; %bb.7:
	sub	x0, x29, #96
	bl	_core_get_system_info
	cbz	w0, LBB0_29
; %bb.8:
	ldur	x0, [x29, #-96]
	bl	_string_is_empty
	cbz	x0, LBB0_12
; %bb.9:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_10:
	ldr	x23, [x19]
	mov	x0, x24
	bl	_path_basename
	mov	x1, x0
	mov	x0, x23
	mov	w2, #8
	bl	_strlcpy
	ldr	x0, [x19]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #8
	bl	_strlcat
	b	LBB0_14
LBB0_11:
	mov	x0, x24
	bl	_path_basename
	mov	x1, x0
	b	LBB0_13
LBB0_12:
	ldur	x1, [x29, #-96]
LBB0_13:
	ldr	x0, [x19]
Lloh12:
	adrp	x8, _IMG_EXT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IMG_EXT@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	w3, #8
	bl	_fill_str_dated_filename
LBB0_14:
	ldur	x0, [x29, #-128]                ; 8-byte Folded Reload
	bl	_string_is_empty
	cbnz	x0, LBB0_16
; %bb.15:
	ldr	x8, [x25]
	cbz	x8, LBB0_27
LBB0_16:
	mov	x20, sp
Lloh15:
	adrp	x8, _PATH_MAX_LENGTH@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PATH_MAX_LENGTH@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x9, x2
Lloh18:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh19:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x2, #15
	and	x9, x9, #0x1fffffff0
	sub	x21, x8, x9
	mov	sp, x21
	strb	wzr, [x21]
	mov	x0, x21
	mov	x1, x24
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_fill_pathname_basedir
	ldp	x2, x0, [x19]
	mov	x1, x21
	mov	w3, #8
	bl	_fill_pathname_join
	mov	sp, x20
LBB0_17:
	ldr	w8, [x29, #32]
	cbz	w8, LBB0_28
LBB0_18:
	bl	_task_init
	mov	x20, x0
Lloh20:
	adrp	x8, _TASK_TYPE_BLOCKING@GOTPAGE
Lloh21:
	ldr	x8, [x8, _TASK_TYPE_BLOCKING@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	str	w8, [x0, #88]
	str	x19, [x0, #80]
Lloh23:
	adrp	x8, _task_screenshot_handler@GOTPAGE
Lloh24:
	ldr	x8, [x8, _task_screenshot_handler@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	str	w8, [x0, #76]
	cbnz	w22, LBB0_20
; %bb.19:
Lloh26:
	adrp	x8, _MSG_TAKING_SCREENSHOT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MSG_TAKING_SCREENSHOT@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	bl	_strdup
	str	x0, [x20, #64]
LBB0_20:
	mov	x0, x20
	bl	_task_queue_push
	cbz	x0, LBB0_22
; %bb.21:
	mov	w0, #1
	b	LBB0_29
LBB0_22:
	ldr	x8, [x20, #64]
	cbz	x8, LBB0_24
; %bb.23:
	mov	x0, x20
	bl	_task_free_title
LBB0_24:
	mov	x0, x20
	bl	_free
	ldr	x0, [x19, #56]
	cbz	x0, LBB0_26
; %bb.25:
	bl	_free
LBB0_26:
	mov	x0, x19
	bl	_free
	mov	w0, #0
	b	LBB0_29
LBB0_27:
	ldp	x2, x0, [x19]
	ldur	x1, [x29, #-128]                ; 8-byte Folded Reload
	mov	w3, #8
	bl	_fill_pathname_join
	ldr	w8, [x29, #32]
	cbnz	w8, LBB0_18
LBB0_28:
	mov	x0, x19
	bl	_screenshot_dump_direct
LBB0_29:
	ldur	x8, [x29, #-88]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_31
; %bb.30:
	sub	sp, x29, #80
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_31:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	".png"

	.comm	_RARCH_PATH_CONTENT,4,2         ; @RARCH_PATH_CONTENT
l_.str.1:                               ; @.str.1
	.asciz	"RetroArch"

	.comm	_IMG_EXT,4,2                    ; @IMG_EXT
	.comm	_PATH_MAX_LENGTH,4,2            ; @PATH_MAX_LENGTH
	.comm	_TASK_TYPE_BLOCKING,4,2         ; @TASK_TYPE_BLOCKING
	.comm	_task_screenshot_handler,4,2    ; @task_screenshot_handler
	.comm	_MSG_TAKING_SCREENSHOT,4,2      ; @MSG_TAKING_SCREENSHOT
	.comm	_task_screenshot_callback,4,2   ; @task_screenshot_callback
	.no_dead_strip	_screenshot_dump
.subsections_via_symbols
