	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function FD31_GetTemplate
_FD31_GetTemplate:                      ## @FD31_GetTemplate
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	24(%rdi), %rbx
	movl	(%rbx), %eax
	movq	_OFN_ENABLETEMPLATEHANDLE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.1:
	movl	4(%rbx), %edi
	callq	_LockResource
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_9
LBB0_2:
	movq	_TRUE@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_3:
	movq	_OFN_ENABLETEMPLATE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.4:
	movq	16(%r14), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.5:
	movl	8(%rax), %edi
	movq	(%rax), %rsi
	movq	_RT_DIALOG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_FindResourceA
	testl	%eax, %eax
	jne	LBB0_6
	jmp	LBB0_13
LBB0_9:
	movq	_CDERR_LOADRESFAILURE@GOTPCREL(%rip), %rbx
	jmp	LBB0_14
LBB0_10:
	movq	_COMDLG32_hInstance@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	cmpq	$0, 8(%r14)
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str(%rip), %rsi
	cmoveq	%rax, %rsi
	movq	_RT_DIALOG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_FindResourceA
	testl	%eax, %eax
	je	LBB0_13
## %bb.11:
	movl	(%rbx), %edi
	jmp	LBB0_7
LBB0_12:
	movl	4(%rbx), %edi
	movl	8(%rbx), %esi
	movq	_RT_DIALOG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_FindResourceW
	testl	%eax, %eax
	je	LBB0_13
LBB0_6:
	movl	4(%rbx), %edi
LBB0_7:
	movl	%eax, %esi
	callq	_LoadResource
	movq	_CDERR_LOADRESFAILURE@GOTPCREL(%rip), %rbx
	testl	%eax, %eax
	je	LBB0_14
## %bb.8:
	movl	%eax, %edi
	callq	_LockResource
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_2
	jmp	LBB0_14
LBB0_13:
	movq	_CDERR_FINDRESFAILURE@GOTPCREL(%rip), %rbx
LBB0_14:
	movl	(%rbx), %edi
	callq	_COMDLG32_SetCommDlgExtendedError
	movq	_FALSE@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OFN_ENABLETEMPLATEHANDLE,4,2   ## @OFN_ENABLETEMPLATEHANDLE
	.comm	_CDERR_LOADRESFAILURE,4,2       ## @CDERR_LOADRESFAILURE
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_OFN_ENABLETEMPLATE,4,2         ## @OFN_ENABLETEMPLATE
	.comm	_RT_DIALOG,8,3                  ## @RT_DIALOG
	.comm	_CDERR_FINDRESFAILURE,4,2       ## @CDERR_FINDRESFAILURE
	.comm	_COMDLG32_hInstance,4,2         ## @COMDLG32_hInstance
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OPEN_FILE"

L_.str.1:                               ## @.str.1
	.asciz	"SAVE_FILE"

	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_FD31_GetTemplate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function FD31_GetTemplate
_FD31_GetTemplate:                      ; @FD31_GetTemplate
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0, #24]
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _OFN_ENABLETEMPLATEHANDLE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _OFN_ENABLETEMPLATEHANDLE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	ldr	w0, [x20, #4]
LBB0_2:
	bl	_LockResource
	str	x0, [x19]
	cbz	x0, LBB0_11
; %bb.3:
Lloh3:
	adrp	x8, _TRUE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_14
LBB0_4:
Lloh5:
	adrp	x9, _OFN_ENABLETEMPLATE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _OFN_ENABLETEMPLATE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.5:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_9
; %bb.6:
	ldr	w0, [x8, #8]
	ldr	x1, [x8]
Lloh8:
	adrp	x8, _RT_DIALOG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RT_DIALOG@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	bl	_FindResourceA
	mov	x1, x0
	cbnz	w0, LBB0_10
	b	LBB0_12
LBB0_7:
Lloh11:
	adrp	x20, _COMDLG32_hInstance@GOTPAGE
Lloh12:
	ldr	x20, [x20, _COMDLG32_hInstance@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh13:
	adrp	x8, l_.str@PAGE
Lloh14:
	add	x8, x8, l_.str@PAGEOFF
Lloh15:
	adrp	x9, l_.str.1@PAGE
Lloh16:
	add	x9, x9, l_.str.1@PAGEOFF
	ldr	x10, [x19, #8]
	cmp	x10, #0
	csel	x1, x9, x8, eq
Lloh17:
	adrp	x8, _RT_DIALOG@GOTPAGE
Lloh18:
	ldr	x8, [x8, _RT_DIALOG@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	bl	_FindResourceA
	cbz	w0, LBB0_12
; %bb.8:
	mov	x1, x0
	ldr	w0, [x20]
	bl	_LoadResource
	cbnz	w0, LBB0_2
	b	LBB0_11
LBB0_9:
	ldp	w0, w1, [x20, #4]
Lloh20:
	adrp	x8, _RT_DIALOG@GOTPAGE
Lloh21:
	ldr	x8, [x8, _RT_DIALOG@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	bl	_FindResourceW
	mov	x1, x0
	cbz	w0, LBB0_12
LBB0_10:
	ldr	w0, [x20, #4]
	bl	_LoadResource
	cbnz	w0, LBB0_2
LBB0_11:
Lloh23:
	adrp	x8, _CDERR_LOADRESFAILURE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CDERR_LOADRESFAILURE@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
Lloh25:
	adrp	x8, _CDERR_FINDRESFAILURE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CDERR_FINDRESFAILURE@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
	bl	_COMDLG32_SetCommDlgExtendedError
Lloh27:
	adrp	x8, _FALSE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_14:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_OFN_ENABLETEMPLATEHANDLE,4,2   ; @OFN_ENABLETEMPLATEHANDLE
	.comm	_CDERR_LOADRESFAILURE,4,2       ; @CDERR_LOADRESFAILURE
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_OFN_ENABLETEMPLATE,4,2         ; @OFN_ENABLETEMPLATE
	.comm	_RT_DIALOG,8,3                  ; @RT_DIALOG
	.comm	_CDERR_FINDRESFAILURE,4,2       ; @CDERR_FINDRESFAILURE
	.comm	_COMDLG32_hInstance,4,2         ; @COMDLG32_hInstance
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OPEN_FILE"

l_.str.1:                               ; @.str.1
	.asciz	"SAVE_FILE"

	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_FD31_GetTemplate
.subsections_via_symbols
