	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mkstemp                        ## -- Begin function mkstemp
	.p2align	4, 0x90
_mkstemp:                               ## @mkstemp
	.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
	movq	%rdi, %r12
	callq	_strlen
	leaq	1(%rax), %rdi
	callq	_alloca
	movq	%rax, %r14
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_assert
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_strcpy
	movl	$-5, %ebx
	movq	_O_EXCL@GOTPCREL(%rip), %r13
	movq	_O_RDWR@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_strcpy
	movq	%r12, %rdi
	callq	_mktemp
	movl	(%r13), %esi
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	orl	(%r15), %esi
	movq	%r12, %rdi
	movl	$384, %edx                      ## imm = 0x180
	callq	_open
	cmpl	$-1, %eax
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	1(%rbx), %ecx
	testl	%ebx, %ebx
	movl	%ecx, %ebx
	jne	LBB0_1
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_EXCL,4,2                     ## @O_EXCL
	.comm	_O_RDWR,4,2                     ## @O_RDWR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mkstemp                        ; -- Begin function mkstemp
	.p2align	2
_mkstemp:                               ; @mkstemp
	.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
	mov	x19, x0
	bl	_strlen
	add	x0, x0, #1
	bl	_alloca
	mov	x20, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	mov	x0, x20
	mov	x1, x19
	bl	_strcpy
	mov	x0, x19
	mov	x1, x20
	bl	_strcpy
	mov	x0, x19
	bl	_mktemp
Lloh0:
	adrp	x21, _O_CREAT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _O_CREAT@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh2:
	adrp	x22, _O_EXCL@GOTPAGE
Lloh3:
	ldr	x22, [x22, _O_EXCL@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w8, w9, w8
Lloh4:
	adrp	x23, _O_RDWR@GOTPAGE
Lloh5:
	ldr	x23, [x23, _O_RDWR@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w1, w8, w9
	mov	x0, x19
	mov	w2, #384
	bl	_open
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_strcpy
	mov	x0, x19
	bl	_mktemp
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	ldr	w9, [x23]
	orr	w1, w8, w9
	mov	x0, x19
	mov	w2, #384
	bl	_open
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	bl	_strcpy
	mov	x0, x19
	bl	_mktemp
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	ldr	w9, [x23]
	orr	w1, w8, w9
	mov	x0, x19
	mov	w2, #384
	bl	_open
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.3:
	mov	x0, x19
	mov	x1, x20
	bl	_strcpy
	mov	x0, x19
	bl	_mktemp
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	ldr	w9, [x23]
	orr	w1, w8, w9
	mov	x0, x19
	mov	w2, #384
	bl	_open
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x19
	mov	x1, x20
	bl	_strcpy
	mov	x0, x19
	bl	_mktemp
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	ldr	w9, [x23]
	orr	w1, w8, w9
	mov	x0, x19
	mov	w2, #384
	bl	_open
	cmn	w0, #1
	b.eq	LBB0_6
LBB0_5:
	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_6:
	mov	x0, x19
	mov	x1, x20
	bl	_strcpy
	mov	x0, x19
	bl	_mktemp
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	ldr	w9, [x23]
	orr	w1, w8, w9
	mov	x0, x19
	mov	w2, #384
	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
	b	_open
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_EXCL,4,2                     ; @O_EXCL
	.comm	_O_RDWR,4,2                     ; @O_RDWR
.subsections_via_symbols
