	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_ftruncate
_check_ftruncate:                       ## @check_ftruncate
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	testl	%ecx, %ecx
	jle	LBB0_25
## %bb.1:
	movq	%rdx, %r15
	movq	%rdi, %rbx
	movl	%ecx, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	callq	_notok_mode
	movq	%rbx, %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edx
	callq	_notok_mode
	movq	%rbx, %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%r13d, %edx
	callq	_notok_mode
	movq	%rbx, %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%r13d, %edx
	callq	_notok_mode
LBB0_24:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	cmpq	%r14, -64(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_25
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%r14,4), %r13d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_open
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %r12d
	movl	%eax, %edi
	leaq	-80(%rbp), %rsi
	callq	_fstat
	movq	%rbx, %rdi
	testq	%rax, %rax
	js	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.5(%rip), %rsi
	movl	%r13d, %edx
	callq	_ok_mode
	movq	-80(%rbp), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	1(%rax), %r15
	movl	%r12d, %edi
	movq	%r15, %rsi
	callq	_ftruncate
	movq	_O_ACCMODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r13d, %ecx
	movq	_O_WRONLY@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	sete	%dl
	movq	_O_RDWR@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %ecx
	sete	%cl
	orb	%dl, %cl
	testq	%rax, %rax
	je	LBB0_7
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.7(%rip), %rsi
	testb	%cl, %cl
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.4(%rip), %rsi
	movl	%r13d, %edx
	callq	_notok_mode
	movq	%rbx, %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edx
	callq	_notok_mode
	movq	%rbx, %rdi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_15
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.6(%rip), %rsi
	testb	%cl, %cl
	je	LBB0_8
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_ok_mode
	movl	%r12d, %edi
	movq	%r15, %rsi
	callq	_ftruncate
	movq	_O_ACCMODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r13d, %ecx
	movq	_O_WRONLY@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	sete	%dl
	movq	_O_RDWR@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %ecx
	sete	%cl
	orb	%dl, %cl
	testq	%rax, %rax
	je	LBB0_13
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.9(%rip), %rsi
	testb	%cl, %cl
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.9(%rip), %rsi
	jmp	LBB0_15
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.6(%rip), %rsi
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %edx
	callq	_notok_mode
	movq	%rbx, %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%r13d, %edx
	callq	_notok_mode
	movq	%rbx, %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%r13d, %edx
	callq	_notok_mode
	movl	%r12d, %edi
	callq	_close
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_24
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.8(%rip), %rsi
	testb	%cl, %cl
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_14
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_ok_mode
	movl	%r12d, %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_ftruncate
	movq	_O_ACCMODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r13d, %ecx
	movq	_O_WRONLY@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	sete	%dl
	movq	_O_RDWR@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %ecx
	sete	%cl
	orb	%dl, %cl
	movq	%rbx, %rdi
	testq	%rax, %rax
	je	LBB0_19
## %bb.21:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.11(%rip), %rsi
	testb	%cl, %cl
	jne	LBB0_20
	jmp	LBB0_22
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.8(%rip), %rsi
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %edx
	callq	_notok_mode
	movq	%rbx, %rdi
	leaq	L_.str.3(%rip), %rsi
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %edx
	callq	_notok_mode
LBB0_23:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, %edi
	callq	_close
	jmp	LBB0_24
LBB0_19:                                ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.10(%rip), %rsi
	testb	%cl, %cl
	je	LBB0_20
LBB0_22:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %edx
	callq	_ok_mode
	jmp	LBB0_23
LBB0_25:
	addq	$40, %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	"open"

L_.str.1:                               ## @.str.1
	.asciz	"truncate1 skipped"

L_.str.2:                               ## @.str.2
	.asciz	"truncate2 skipped"

L_.str.3:                               ## @.str.3
	.asciz	"truncate3 skipped"

L_.str.4:                               ## @.str.4
	.asciz	"fstat"

L_.str.5:                               ## @.str.5
	.asciz	"setup"

	.comm	_O_ACCMODE,4,2                  ## @O_ACCMODE
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_RDWR,4,2                     ## @O_RDWR
L_.str.6:                               ## @.str.6
	.asciz	"truncate1 succeeded"

L_.str.7:                               ## @.str.7
	.asciz	"truncate1 failed"

L_.str.8:                               ## @.str.8
	.asciz	"truncate2 succeeded"

L_.str.9:                               ## @.str.9
	.asciz	"truncate2 failed"

L_.str.10:                              ## @.str.10
	.asciz	"truncate3 succeeded"

L_.str.11:                              ## @.str.11
	.asciz	"truncate3 failed"

	.no_dead_strip	_check_ftruncate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_ftruncate
_check_ftruncate:                       ; @check_ftruncate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	cmp	w3, #1
	b.lt	LBB0_25
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	w23, w3
Lloh0:
	adrp	x24, l_.str.2@PAGE
Lloh1:
	add	x24, x24, l_.str.2@PAGEOFF
Lloh2:
	adrp	x25, l_.str.3@PAGE
Lloh3:
	add	x25, x25, l_.str.3@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_notok_mode
	mov	x0, x21
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_notok_mode
	mov	x0, x21
	mov	x1, x24
	mov	x2, x22
	bl	_notok_mode
	mov	x0, x21
	mov	x1, x25
	mov	x2, x22
	bl	_notok_mode
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x19, x19, #4
	subs	x23, x23, #1
	b.eq	LBB0_25
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x19]
	mov	x0, x20
	mov	x1, x22
	bl	_open
	tbnz	w0, #31, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x26, x0
	add	x1, sp, #8
	bl	_fstat
	tbnz	x0, #63, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
Lloh8:
	adrp	x1, l_.str.5@PAGE
Lloh9:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x2, x22
	bl	_ok_mode
	ldr	x28, [sp, #8]
	add	x27, x28, #1
	mov	x0, x26
	mov	x1, x27
	bl	_ftruncate
Lloh10:
	adrp	x8, _O_ACCMODE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _O_ACCMODE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	and	w8, w8, w22
Lloh13:
	adrp	x9, _O_WRONLY@GOTPAGE
Lloh14:
	ldr	x9, [x9, _O_WRONLY@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	cmp	w8, w9
Lloh16:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh17:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	ccmp	w8, w9, #4, ne
	cset	w8, eq
	cbz	x0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh19:
	adrp	x1, l_.str.7@PAGE
Lloh20:
	add	x1, x1, l_.str.7@PAGEOFF
	cbz	w8, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
Lloh21:
	adrp	x1, l_.str.7@PAGE
Lloh22:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_15
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x22
	bl	_notok_mode
	mov	x0, x21
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_15
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh27:
	adrp	x1, l_.str.6@PAGE
Lloh28:
	add	x1, x1, l_.str.6@PAGEOFF
	tbz	w8, #0, LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	mov	x2, x22
	bl	_ok_mode
	mov	x0, x26
	mov	x1, x27
	bl	_ftruncate
Lloh29:
	adrp	x8, _O_ACCMODE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _O_ACCMODE@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	and	w8, w8, w22
Lloh32:
	adrp	x9, _O_WRONLY@GOTPAGE
Lloh33:
	ldr	x9, [x9, _O_WRONLY@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	cmp	w8, w9
Lloh35:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh36:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	ccmp	w8, w9, #4, ne
	cset	w8, eq
	cbz	x0, LBB0_19
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
Lloh38:
	adrp	x1, l_.str.9@PAGE
Lloh39:
	add	x1, x1, l_.str.9@PAGEOFF
	cbz	w8, LBB0_20
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
Lloh40:
	adrp	x1, l_.str.9@PAGE
Lloh41:
	add	x1, x1, l_.str.9@PAGEOFF
	b	LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
Lloh42:
	adrp	x1, l_.str.6@PAGE
Lloh43:
	add	x1, x1, l_.str.6@PAGEOFF
LBB0_15:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x2, x22
	bl	_notok_mode
	mov	x0, x21
	mov	x1, x24
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x2, x22
	bl	_notok_mode
	mov	x0, x21
	mov	x1, x25
LBB0_17:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x2, x22
	bl	_notok_mode
LBB0_18:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x26
	bl	_close
	b	LBB0_3
LBB0_19:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh44:
	adrp	x1, l_.str.8@PAGE
Lloh45:
	add	x1, x1, l_.str.8@PAGEOFF
	tbz	w8, #0, LBB0_22
LBB0_20:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	mov	x2, x22
	bl	_ok_mode
	mov	x0, x26
	mov	x1, x28
	bl	_ftruncate
Lloh46:
	adrp	x8, _O_ACCMODE@GOTPAGE
Lloh47:
	ldr	x8, [x8, _O_ACCMODE@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	and	w8, w8, w22
Lloh49:
	adrp	x9, _O_WRONLY@GOTPAGE
Lloh50:
	ldr	x9, [x9, _O_WRONLY@GOTPAGEOFF]
Lloh51:
	ldr	w9, [x9]
	cmp	w8, w9
Lloh52:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh53:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh54:
	ldr	w9, [x9]
	ccmp	w8, w9, #4, ne
	cset	w8, eq
	cbz	x0, LBB0_23
; %bb.21:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
Lloh55:
	adrp	x1, l_.str.11@PAGE
Lloh56:
	add	x1, x1, l_.str.11@PAGEOFF
	cbnz	w8, LBB0_17
	b	LBB0_24
LBB0_22:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
Lloh57:
	adrp	x1, l_.str.8@PAGE
Lloh58:
	add	x1, x1, l_.str.8@PAGEOFF
	b	LBB0_16
LBB0_23:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
Lloh59:
	adrp	x1, l_.str.10@PAGE
Lloh60:
	add	x1, x1, l_.str.10@PAGEOFF
	cbz	w8, LBB0_17
LBB0_24:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x2, x22
	bl	_ok_mode
	b	LBB0_18
LBB0_25:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpAdd	Lloh55, Lloh56
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpAdd	Lloh59, Lloh60
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open"

l_.str.1:                               ; @.str.1
	.asciz	"truncate1 skipped"

l_.str.2:                               ; @.str.2
	.asciz	"truncate2 skipped"

l_.str.3:                               ; @.str.3
	.asciz	"truncate3 skipped"

l_.str.4:                               ; @.str.4
	.asciz	"fstat"

l_.str.5:                               ; @.str.5
	.asciz	"setup"

	.comm	_O_ACCMODE,4,2                  ; @O_ACCMODE
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_RDWR,4,2                     ; @O_RDWR
l_.str.6:                               ; @.str.6
	.asciz	"truncate1 succeeded"

l_.str.7:                               ; @.str.7
	.asciz	"truncate1 failed"

l_.str.8:                               ; @.str.8
	.asciz	"truncate2 succeeded"

l_.str.9:                               ; @.str.9
	.asciz	"truncate2 failed"

l_.str.10:                              ; @.str.10
	.asciz	"truncate3 succeeded"

l_.str.11:                              ; @.str.11
	.asciz	"truncate3 failed"

	.no_dead_strip	_check_ftruncate
.subsections_via_symbols
