	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setup_dir                      ## -- Begin function setup_dir
	.p2align	4, 0x90
_setup_dir:                             ## @setup_dir
	.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
	movl	%r8d, %r14d
	movl	%ecx, %r12d
	movl	%edx, %r13d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcpy
	movq	%rbx, %rdi
	callq	_mkdtemp
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movl	$-1, %edi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_2:
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%r12d, %edx
	callq	_chown
	testq	%rax, %rax
	jns	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	movl	$-1, %edi
	movq	%r15, %rdx
	movq	%rbx, %rcx
	movl	%r13d, %r8d
	movl	%r12d, %r9d
	xorl	%eax, %eax
	callq	_err
LBB0_4:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_chmod
	testq	%rax, %rax
	js	LBB0_6
## %bb.5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	L_.str.3(%rip), %rsi
	movl	$-1, %edi
	movq	%r15, %rdx
	movq	%rbx, %rcx
	movl	%r14d, %r8d
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_err                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/tmp/priv.XXXXXXXXXXX"

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

L_.str.2:                               ## @.str.2
	.asciz	"test %s: chown(%s, %d, %d)"

L_.str.3:                               ## @.str.3
	.asciz	"test %s: chmod(%s, 0%o)"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setup_dir                      ; -- Begin function setup_dir
	.p2align	2
_setup_dir:                             ; @setup_dir
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x4
	mov	x23, x3
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_strcpy
	mov	x0, x21
	bl	_mkdtemp
	cbnz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #-1
	mov	x2, x19
	bl	_err
LBB0_2:
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_chown
	tbz	x0, #63, LBB0_4
; %bb.3:
	stp	x22, x23, [sp, #8]
	str	x21, [sp]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #-1
	mov	x2, x19
	bl	_err
LBB0_4:
	mov	x0, x21
	mov	x1, x20
	bl	_chmod
	tbz	x0, #63, LBB0_6
; %bb.5:
	stp	x21, x20, [sp]
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #-1
	mov	x2, x19
	bl	_err
LBB0_6:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/tmp/priv.XXXXXXXXXXX"

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

l_.str.2:                               ; @.str.2
	.asciz	"test %s: chown(%s, %d, %d)"

l_.str.3:                               ; @.str.3
	.asciz	"test %s: chmod(%s, 0%o)"

.subsections_via_symbols
