	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_create_tempfile                ## -- Begin function create_tempfile
	.p2align	4, 0x90
_create_tempfile:                       ## @create_tempfile
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_16
## %bb.1:
	movq	%rsi, %r15
	testq	%rsi, %rsi
	je	LBB0_16
## %bb.2:
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:
	movq	%rax, %rbx
	cmpb	$0, (%rax)
	je	LBB0_9
## %bb.4:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_strlen
	movq	%rax, %r14
	leaq	14(%rax), %rdi
	callq	_malloc
	movq	%rax, %r13
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_err
LBB0_6:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_strncpy
	addq	%r14, %r13
	cmpb	$47, -1(%r12,%r14)
	je	LBB0_8
## %bb.7:
	movb	$47, (%r13)
	incq	%r13
LBB0_8:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	leaq	L_.str.2(%rip), %rsi
	movl	$12, %edx
	movq	%r13, %rdi
	callq	_strncpy
	movb	$0, 12(%r13)
	jmp	LBB0_11
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_strdup
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_err
LBB0_11:
	movq	%r12, %rdi
	callq	_mkstemp
	movl	%eax, (%r15)
	cmpl	$-1, %eax
	jne	LBB0_13
## %bb.12:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_err
	movl	(%r15), %eax
LBB0_13:
	movl	%eax, %edi
	movl	$420, %esi                      ## imm = 0x1A4
	callq	_fchmod
	cmpl	$-1, %eax
	jne	LBB0_15
## %bb.14:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.6(%rip), %rsi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_15:
	movq	%r12, (%r14)
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TMPDIR"

	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
L_.str.1:                               ## @.str.1
	.asciz	"malloc failed"

L_.str.2:                               ## @.str.2
	.asciz	"ecp.XXXXXXXX"

L_.str.3:                               ## @.str.3
	.asciz	"/tmp/ecp.XXXXXXXX"

L_.str.4:                               ## @.str.4
	.asciz	"strdup failed"

L_.str.5:                               ## @.str.5
	.asciz	"mkstemp %s failed"

L_.str.6:                               ## @.str.6
	.asciz	"fchmod %s failed"

	.comm	__TEMPFILE,8,3                  ## @_TEMPFILE
	.comm	__TEMPFILEPATH,4,2              ## @_TEMPFILEPATH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_create_tempfile                ; -- Begin function create_tempfile
	.p2align	2
_create_tempfile:                       ; @create_tempfile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbz	x0, LBB0_16
; %bb.1:
	mov	x20, x1
	cbz	x1, LBB0_16
; %bb.2:
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_9
; %bb.3:
	mov	x22, x0
	ldrb	w8, [x0]
	cbz	w8, LBB0_9
; %bb.4:
	mov	x0, x22
	bl	_strlen
	mov	x23, x0
	add	x0, x0, #14
	bl	_malloc
	mov	x21, x0
	cbnz	x0, LBB0_6
; %bb.5:
Lloh2:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_err
LBB0_6:
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_strncpy
	add	x22, x21, x23
	ldurb	w8, [x22, #-1]
	cmp	w8, #47
	b.eq	LBB0_8
; %bb.7:
	mov	w8, #47
	strb	w8, [x22], #1
LBB0_8:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	mov	w2, #12
	bl	_strncpy
	strb	wzr, [x22, #12]
	b	LBB0_11
LBB0_9:
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_strdup
	mov	x21, x0
	cbnz	x0, LBB0_11
; %bb.10:
Lloh11:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_err
LBB0_11:
	mov	x0, x21
	bl	_mkstemp
	str	w0, [x20]
	cmn	w0, #1
	b.ne	LBB0_13
; %bb.12:
Lloh16:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	str	x21, [sp]
Lloh19:
	adrp	x1, l_.str.5@PAGE
Lloh20:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_err
	ldr	w0, [x20]
LBB0_13:
	mov	w1, #420
	bl	_fchmod
	cmn	w0, #1
	b.ne	LBB0_15
; %bb.14:
Lloh21:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	str	x21, [sp]
Lloh24:
	adrp	x1, l_.str.6@PAGE
Lloh25:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_err
LBB0_15:
	str	x21, [x19]
LBB0_16:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TMPDIR"

	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
l_.str.1:                               ; @.str.1
	.asciz	"malloc failed"

l_.str.2:                               ; @.str.2
	.asciz	"ecp.XXXXXXXX"

l_.str.3:                               ; @.str.3
	.asciz	"/tmp/ecp.XXXXXXXX"

l_.str.4:                               ; @.str.4
	.asciz	"strdup failed"

l_.str.5:                               ; @.str.5
	.asciz	"mkstemp %s failed"

l_.str.6:                               ; @.str.6
	.asciz	"fchmod %s failed"

	.comm	__TEMPFILE,8,3                  ; @_TEMPFILE
	.comm	__TEMPFILEPATH,4,2              ; @_TEMPFILEPATH
.subsections_via_symbols
