	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mkTempFile                     ## -- Begin function mkTempFile
	.p2align	4, 0x90
_mkTempFile:                            ## @mkTempFile
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_MAXPATHLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r12, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	testq	%rbx, %rbx
	jne	LBB0_2
## %bb.1:
	movq	_TMPPAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_2:
	movq	_mkTempFile.tmpdir(%rip), %rcx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.4:
	cmpb	$47, (%rbx)
	jne	LBB0_6
LBB0_5:
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movl	%r12d, %esi
	movq	%rbx, %rcx
	xorl	%eax, %eax
	callq	_snprintf
	jmp	LBB0_7
LBB0_3:
	xorl	%eax, %eax
	callq	_getTmpdir
	movq	%rax, %rcx
	movq	%rax, _mkTempFile.tmpdir(%rip)
	cmpb	$47, (%rbx)
	je	LBB0_5
LBB0_6:
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	movl	%r12d, %esi
	movq	%rbx, %r8
	xorl	%eax, %eax
	callq	_snprintf
LBB0_7:
	movq	%r15, %rdi
	callq	_mkstemp
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_9
## %bb.8:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_Punt
LBB0_9:
	movq	%r15, %rdi
	testq	%r14, %r14
	je	LBB0_11
## %bb.10:
	callq	_bmake_strdup
	movq	%rax, (%r14)
	jmp	LBB0_12
LBB0_11:
	callq	_unlink
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	movl	%ebx, %eax
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_mkTempFile.tmpdir,8,3 ## @mkTempFile.tmpdir
	.comm	_MAXPATHLEN,4,2                 ## @MAXPATHLEN
	.comm	_TMPPAT,8,3                     ## @TMPPAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

L_.str.1:                               ## @.str.1
	.asciz	"%s%s"

L_.str.2:                               ## @.str.2
	.asciz	"Could not create temporary file %s: %s"

	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mkTempFile                     ; -- Begin function mkTempFile
	.p2align	2
_mkTempFile:                            ; @mkTempFile
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #16
	mov	x19, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _MAXPATHLEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAXPATHLEN@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	mov	x9, x21
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x21, #15
	and	x9, x9, #0x1fffffff0
	sub	x20, x8, x9
	mov	sp, x20
Lloh8:
	adrp	x8, _TMPPAT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TMPPAT@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x0, #0
	csel	x22, x8, x0, eq
	adrp	x23, _mkTempFile.tmpdir@PAGE
	ldr	x3, [x23, _mkTempFile.tmpdir@PAGEOFF]
	cbnz	x3, LBB0_2
; %bb.1:
	bl	_getTmpdir
	mov	x3, x0
	str	x0, [x23, _mkTempFile.tmpdir@PAGEOFF]
LBB0_2:
	ldrb	w8, [x22]
	cmp	w8, #47
	b.ne	LBB0_4
; %bb.3:
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	x1, x21
	mov	x3, x22
	bl	_snprintf
	b	LBB0_5
LBB0_4:
	str	x22, [sp, #-16]!
Lloh13:
	adrp	x2, l_.str.1@PAGE
Lloh14:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x1, x21
	bl	_snprintf
	add	sp, sp, #16
LBB0_5:
	mov	x0, x20
	bl	_mkstemp
	mov	x21, x0
	tbnz	w0, #31, LBB0_8
; %bb.6:
	mov	x0, x20
	cbz	x19, LBB0_9
LBB0_7:
	bl	_bmake_strdup
	str	x0, [x19]
	b	LBB0_10
LBB0_8:
Lloh15:
	adrp	x8, _errno@GOTPAGE
Lloh16:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_strerror
	mov	x2, x0
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_Punt
	mov	x0, x20
	cbnz	x19, LBB0_7
LBB0_9:
	bl	_unlink
LBB0_10:
	ldur	x8, [x29, #-56]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x21
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_mkTempFile.tmpdir,8,3 ; @mkTempFile.tmpdir
	.comm	_MAXPATHLEN,4,2                 ; @MAXPATHLEN
	.comm	_TMPPAT,8,3                     ; @TMPPAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

l_.str.1:                               ; @.str.1
	.asciz	"%s%s"

l_.str.2:                               ; @.str.2
	.asciz	"Could not create temporary file %s: %s"

	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
