	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tmpfile                        ## -- Begin function tmpfile
	.p2align	4, 0x90
_tmpfile:                               ## @tmpfile
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_issetugid
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	testq	%rbx, %rbx
	jne	LBB0_4
LBB0_3:
	movq	__PATH_TMP@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_4:
	movq	%rbx, %rdi
	callq	_strlen
	cltq
	cmpb	$47, -1(%rax,%rbx)
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.3(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str.4(%rip), %r8
	leaq	L_.str.1(%rip), %rsi
	leaq	-40(%rbp), %rdi
	movq	%rbx, %rdx
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_asprintf
	cmpq	$0, -40(%rbp)
	je	LBB0_5
## %bb.6:
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_sigfillset
	movq	_SIG_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rsi
	callq	___libc_sigprocmask
	movq	-40(%rbp), %rdi
	callq	_mkstemp
	movq	-40(%rbp), %rdi
	cmpl	$-1, %eax
	je	LBB0_9
## %bb.7:
	movl	%eax, %r14d
	callq	_unlink
	movq	-40(%rbp), %rdi
	callq	_free
	movq	_SIG_SETMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-28(%rbp), %rsi
	xorl	%edx, %edx
	callq	___libc_sigprocmask
	leaq	L_.str.5(%rip), %rsi
	movl	%r14d, %edi
	callq	_fdopen
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_10
## %bb.8:
	movq	_errno@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movl	%r14d, %edi
	callq	__close
	movl	%ebx, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	movq	%rax, %rbx
	testq	%rbx, %rbx
	je	LBB0_3
	jmp	LBB0_4
LBB0_5:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_9:
	callq	_free
	movq	_SIG_SETMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%ebx, %ebx
	leaq	-28(%rbp), %rsi
	xorl	%edx, %edx
	callq	___libc_sigprocmask
LBB0_10:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TMPDIR"

	.comm	__PATH_TMP,8,3                  ## @_PATH_TMP
L_.str.1:                               ## @.str.1
	.asciz	"%s%s%s"

L_.str.2:                               ## @.str.2
	.space	1

L_.str.3:                               ## @.str.3
	.asciz	"/"

L_.str.4:                               ## @.str.4
	.asciz	"tmp.XXXXXX"

	.comm	_SIG_BLOCK,4,2                  ## @SIG_BLOCK
	.comm	_SIG_SETMASK,4,2                ## @SIG_SETMASK
L_.str.5:                               ## @.str.5
	.asciz	"w+"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tmpfile                        ; -- Begin function tmpfile
	.p2align	2
_tmpfile:                               ; @tmpfile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	bl	_issetugid
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, #0
	b	LBB0_3
LBB0_2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
LBB0_3:
Lloh2:
	adrp	x8, __PATH_TMP@GOTPAGE
Lloh3:
	ldr	x8, [x8, __PATH_TMP@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, #0
	csel	x19, x8, x0, eq
	mov	x0, x19
	bl	_strlen
	add	x8, x19, w0, sxtw
	ldurb	w8, [x8, #-1]
Lloh5:
	adrp	x9, l_.str.3@PAGE
Lloh6:
	add	x9, x9, l_.str.3@PAGEOFF
Lloh7:
	adrp	x10, l_.str.2@PAGE
Lloh8:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	w8, #47
	csel	x3, x10, x9, eq
Lloh9:
	adrp	x4, l_.str.4@PAGE
Lloh10:
	add	x4, x4, l_.str.4@PAGEOFF
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, sp
	mov	x2, x19
                                        ; kill: def $w4 killed $w4 killed $x4
	bl	_asprintf
	ldr	x8, [sp]
	cbz	x8, LBB0_8
; %bb.4:
	add	x0, sp, #12
	bl	_sigfillset
Lloh13:
	adrp	x8, _SIG_BLOCK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SIG_BLOCK@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	add	x1, sp, #12
	add	x2, sp, #8
	bl	___libc_sigprocmask
	ldr	x0, [sp]
	bl	_mkstemp
	mov	x19, x0
	ldr	x0, [sp]
	cmn	w19, #1
	b.eq	LBB0_7
; %bb.5:
	bl	_unlink
	ldr	x0, [sp]
	bl	_free
Lloh16:
	adrp	x8, _SIG_SETMASK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SIG_SETMASK@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	add	x1, sp, #8
	mov	x2, #0
	bl	___libc_sigprocmask
Lloh19:
	adrp	x1, l_.str.5@PAGE
Lloh20:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_fdopen
	cbnz	x0, LBB0_9
; %bb.6:
Lloh21:
	adrp	x20, _errno@GOTPAGE
Lloh22:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	ldr	w21, [x20]
	mov	x0, x19
	bl	__close
	mov	x0, #0
	str	w21, [x20]
	b	LBB0_9
LBB0_7:
	bl	_free
Lloh23:
	adrp	x8, _SIG_SETMASK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SIG_SETMASK@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	add	x1, sp, #8
	mov	x2, #0
	bl	___libc_sigprocmask
LBB0_8:
	mov	x0, #0
LBB0_9:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TMPDIR"

	.comm	__PATH_TMP,8,3                  ; @_PATH_TMP
l_.str.1:                               ; @.str.1
	.asciz	"%s%s%s"

l_.str.2:                               ; @.str.2
	.space	1

l_.str.3:                               ; @.str.3
	.asciz	"/"

l_.str.4:                               ; @.str.4
	.asciz	"tmp.XXXXXX"

	.comm	_SIG_BLOCK,4,2                  ; @SIG_BLOCK
	.comm	_SIG_SETMASK,4,2                ; @SIG_SETMASK
l_.str.5:                               ; @.str.5
	.asciz	"w+"

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