	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_mode
_check_mode:                            ## @check_mode
	.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
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -92(%rbp)                 ## 4-byte Spill
	movl	%esi, -96(%rbp)                 ## 4-byte Spill
	movl	%edi, -100(%rbp)                ## 4-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movl	l___const.check_mode.perm+16(%rip), %eax
	movl	%eax, -64(%rbp)
	movaps	l___const.check_mode.perm(%rip), %xmm0
	movaps	%xmm0, -80(%rbp)
	leaq	-60(%rbp), %rdi
	callq	___arraycount
	testq	%rax, %rax
	je	LBB0_16
## %bb.1:
	movq	_path@GOTPCREL(%rip), %rbx
	xorl	%eax, %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	incq	%r14
	leaq	-60(%rbp), %rdi
	callq	___arraycount
	movq	%r14, %rcx
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	cmpq	%rax, %r14
	jae	LBB0_16
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	leaq	-80(%rbp), %rdi
	callq	___arraycount
	testq	%rax, %rax
	je	LBB0_15
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=2
	movl	%ebx, %edi
	callq	_close
	movl	%r13d, %edi
	callq	_close
	movl	-104(%rbp), %edi                ## 4-byte Reload
	callq	_close
	movq	_path@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_unlink
	incq	%r15
	leaq	-80(%rbp), %rdi
	callq	___arraycount
	cmpq	%rax, %r15
	jae	LBB0_15
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movslq	(%rbx), %rdi
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	orl	-60(%rbp,%rax,4), %esi
	movl	-80(%rbp,%r15,4), %edx
	xorl	%eax, %eax
	callq	_open
	movl	%eax, %r13d
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_open
	movl	%eax, %ebx
	movl	%r13d, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_ATF_REQUIRE
	movl	%ebx, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_ATF_REQUIRE
	cmpl	$0, -100(%rbp)                  ## 4-byte Folded Reload
	movl	%ebx, -104(%rbp)                ## 4-byte Spill
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%r13d, %edi
	callq	_dup
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	cmpl	$0, -96(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%r13d, %edi
	movl	%ebx, %esi
	callq	_dup2
	jmp	LBB0_11
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=2
	cmpl	$0, -92(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=2
	movq	_O_CLOEXEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r13d, %edi
	movl	%ebx, %esi
	callq	_dup3
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=2
	movl	%eax, %ebx
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=2
	movl	%ebx, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_ATF_REQUIRE
	leaq	-120(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	leaq	-112(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_fstat
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_ATF_REQUIRE
	movl	%r13d, %edi
	movq	%r12, %rsi
	callq	_fstat
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_ATF_REQUIRE
	movq	-120(%rbp), %rax
	cmpq	-112(%rbp), %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=2
	leaq	L_.str.1(%rip), %rdi
	callq	_atf_tc_fail
	jmp	LBB0_14
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=2
	movl	$-1, %ebx
	jmp	LBB0_12
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_18
## %bb.17:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.section	__TEXT,__const
	.p2align	4                               ## @__const.check_mode.perm
l___const.check_mode.perm:
	.long	448                             ## 0x1c0
	.long	256                             ## 0x100
	.long	384                             ## 0x180
	.long	292                             ## 0x124
	.long	438                             ## 0x1b6

	.comm	_path,4,2                       ## @path
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/etc/passwd"

	.comm	_O_CLOEXEC,4,2                  ## @O_CLOEXEC
L_.str.1:                               ## @.str.1
	.asciz	"invalid mode"

	.no_dead_strip	_check_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_mode
_check_mode:                            ; @check_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	stp	w2, w1, [sp, #8]                ; 8-byte Folded Spill
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #72]
Lloh3:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _O_WRONLY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_WRONLY@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #60]
Lloh9:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [sp, #68]
Lloh12:
	adrp	x8, l___const.check_mode.perm@PAGE
Lloh13:
	add	x8, x8, l___const.check_mode.perm@PAGEOFF
	ldr	q0, [x8]
	str	q0, [sp, #32]
	ldr	w8, [x8, #16]
	str	w8, [sp, #48]
	add	x0, sp, #60
	bl	___arraycount
	cbz	x0, LBB0_16
; %bb.1:
	mov	x19, #0
	add	x23, sp, #32
Lloh14:
	adrp	x20, _path@GOTPAGE
Lloh15:
	ldr	x20, [x20, _path@GOTPAGEOFF]
Lloh16:
	adrp	x27, _O_CREAT@GOTPAGE
Lloh17:
	ldr	x27, [x27, _O_CREAT@GOTPAGEOFF]
Lloh18:
	adrp	x22, l_.str@PAGE
Lloh19:
	add	x22, x22, l_.str@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x19, x19, #1
	add	x0, sp, #60
	bl	___arraycount
	cmp	x19, x0
	b.hs	LBB0_16
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	add	x0, sp, #32
	bl	___arraycount
	cbz	x0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x28, #0
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x26
	bl	_close
	mov	x0, x24
	bl	_close
	mov	x0, x25
	bl	_close
	ldr	w0, [x20]
	bl	_unlink
	add	x28, x28, #1
	add	x0, sp, #32
	bl	___arraycount
	cmp	x28, x0
	b.hs	LBB0_2
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldrsw	x0, [x20]
	add	x8, sp, #60
	ldr	w8, [x8, x19, lsl #2]
	ldr	w9, [x27]
	orr	w1, w9, w8
	ldr	w8, [x23, x28, lsl #2]
	str	x8, [sp]
	bl	_open
	mov	x24, x0
Lloh20:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh21:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_open
	mov	x25, x0
	mvn	w8, w24
	lsr	w0, w8, #31
	bl	_ATF_REQUIRE
	mvn	w8, w25
	lsr	w0, w8, #31
	bl	_ATF_REQUIRE
	cbz	w21, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x24
	bl	_dup
	b	LBB0_12
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=2
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x24
	mov	x1, x25
	bl	_dup2
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	cbz	w8, LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=2
Lloh23:
	adrp	x8, _O_CLOEXEC@GOTPAGE
Lloh24:
	ldr	x8, [x8, _O_CLOEXEC@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x24
	mov	x1, x25
	bl	_dup3
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x26, x0
LBB0_13:                                ;   in Loop: Header=BB0_6 Depth=2
	mvn	w8, w26
	lsr	w0, w8, #31
	bl	_ATF_REQUIRE
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	add	x1, sp, #24
	mov	x0, x26
	bl	_fstat
	cmp	x0, #0
	cset	w0, eq
	bl	_ATF_REQUIRE
	add	x1, sp, #16
	mov	x0, x24
	bl	_fstat
	cmp	x0, #0
	cset	w0, eq
	bl	_ATF_REQUIRE
	ldp	x9, x8, [sp, #16]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.14:                               ;   in Loop: Header=BB0_6 Depth=2
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_atf_tc_fail
	b	LBB0_5
LBB0_15:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	w26, #-1
	b	LBB0_13
LBB0_16:
	ldr	x8, [sp, #72]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.17:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.section	__TEXT,__const
	.p2align	2                               ; @__const.check_mode.perm
l___const.check_mode.perm:
	.long	448                             ; 0x1c0
	.long	256                             ; 0x100
	.long	384                             ; 0x180
	.long	292                             ; 0x124
	.long	438                             ; 0x1b6

	.comm	_path,4,2                       ; @path
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/etc/passwd"

	.comm	_O_CLOEXEC,4,2                  ; @O_CLOEXEC
l_.str.1:                               ; @.str.1
	.asciz	"invalid mode"

	.no_dead_strip	_check_mode
.subsections_via_symbols
