	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dd_close
_dd_close:                              ## @dd_close
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_cfunc@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_def@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_def_close
	jmp	LBB0_6
LBB0_2:
	movq	_block@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_block_close
	jmp	LBB0_6
LBB0_4:
	movq	_unblock@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	callq	_unblock_close
LBB0_6:
	movq	_ddflags@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	movq	_C_OSYNC@GOTPCREL(%rip), %rdx
	movq	_out@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	testl	%eax, (%rdx)
	je	LBB0_15
## %bb.7:
	testq	%rcx, %rcx
	je	LBB0_15
## %bb.8:
	movq	8(%rbx), %rdx
	subq	%rcx, %rdx
	jle	LBB0_16
## %bb.9:
	movq	_C_FILL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.10:
	movl	36(%rbx), %edi
	movq	_fill_char@GOTPCREL(%rip), %rax
	movsbl	(%rax), %esi
	jmp	LBB0_14
LBB0_11:
	movq	_C_BLOCK@GOTPCREL(%rip), %rcx
	movq	_C_UNBLOCK@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rcx), %esi
	movl	36(%rbx), %edi
	testl	%eax, %esi
	je	LBB0_13
## %bb.12:
	movl	$32, %esi
	jmp	LBB0_14
LBB0_13:
	xorl	%esi, %esi
LBB0_14:
	callq	_memset
	movq	8(%rbx), %rcx
	movq	%rcx, (%rbx)
LBB0_15:
	movq	_pending@GOTPCREL(%rip), %rax
	orq	(%rax), %rcx
	je	LBB0_17
LBB0_16:
	movl	$1, %edi
	callq	_dd_out
LBB0_17:
	movq	16(%rbx), %rsi
	testq	%rsi, %rsi
	jle	LBB0_21
## %bb.18:
	movq	_ISTRUNC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 24(%rbx)
	je	LBB0_21
## %bb.19:
	movl	32(%rbx), %edi
	callq	_ftruncate
	cmpl	$-1, %eax
	jne	LBB0_21
## %bb.20:
	movl	28(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_21:
	movl	(%r14), %eax
	movq	_C_FSYNC@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_24
## %bb.22:
	movl	32(%rbx), %edi
	callq	_fsync
	cmpl	$-1, %eax
	jne	LBB0_28
## %bb.23:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_27
LBB0_24:
	movq	_C_FDATASYNC@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_28
## %bb.25:
	movl	32(%rbx), %edi
	callq	_fdatasync
	cmpl	$-1, %eax
	je	LBB0_26
LBB0_28:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_26:
	leaq	L_.str.2(%rip), %rsi
LBB0_27:
	movl	28(%rbx), %edx
	movl	$1, %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_err                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_cfunc,8,3                      ## @cfunc
	.comm	_def,8,3                        ## @def
	.comm	_block,8,3                      ## @block
	.comm	_unblock,8,3                    ## @unblock
	.comm	_ddflags,4,2                    ## @ddflags
	.comm	_C_OSYNC,4,2                    ## @C_OSYNC
	.comm	_out,40,3                       ## @out
	.comm	_C_FILL,4,2                     ## @C_FILL
	.comm	_fill_char,1,0                  ## @fill_char
	.comm	_C_BLOCK,4,2                    ## @C_BLOCK
	.comm	_C_UNBLOCK,4,2                  ## @C_UNBLOCK
	.comm	_pending,8,3                    ## @pending
	.comm	_ISTRUNC,4,2                    ## @ISTRUNC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"truncating %s"

	.comm	_C_FSYNC,4,2                    ## @C_FSYNC
L_.str.1:                               ## @.str.1
	.asciz	"fsyncing %s"

	.comm	_C_FDATASYNC,4,2                ## @C_FDATASYNC
L_.str.2:                               ## @.str.2
	.asciz	"fdatasyncing %s"

	.no_dead_strip	_dd_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dd_close
_dd_close:                              ; @dd_close
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _cfunc@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cfunc@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _def@GOTPAGE
Lloh4:
	ldr	x9, [x9, _def@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	bl	_def_close
	b	LBB0_6
LBB0_2:
Lloh6:
	adrp	x9, _block@GOTPAGE
Lloh7:
	ldr	x9, [x9, _block@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	bl	_block_close
	b	LBB0_6
LBB0_4:
Lloh9:
	adrp	x9, _unblock@GOTPAGE
Lloh10:
	ldr	x9, [x9, _unblock@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	bl	_unblock_close
LBB0_6:
Lloh12:
	adrp	x20, _ddflags@GOTPAGE
Lloh13:
	ldr	x20, [x20, _ddflags@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh14:
	adrp	x9, _C_OSYNC@GOTPAGE
Lloh15:
	ldr	x9, [x9, _C_OSYNC@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	and	w10, w9, w8
Lloh17:
	adrp	x19, _out@GOTPAGE
Lloh18:
	ldr	x19, [x19, _out@GOTPAGEOFF]
	ldr	x9, [x19]
	cmp	w10, #0
	ccmp	x9, #0, #4, ne
	b.eq	LBB0_14
; %bb.7:
	ldr	x10, [x19, #8]
	subs	x2, x10, x9
	b.le	LBB0_15
; %bb.8:
Lloh19:
	adrp	x9, _C_FILL@GOTPAGE
Lloh20:
	ldr	x9, [x9, _C_FILL@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
	ldr	w0, [x19, #36]
Lloh22:
	adrp	x8, _fill_char@GOTPAGE
Lloh23:
	ldr	x8, [x8, _fill_char@GOTPAGEOFF]
Lloh24:
	ldrsb	w1, [x8]
	b	LBB0_13
LBB0_10:
Lloh25:
	adrp	x9, _C_BLOCK@GOTPAGE
Lloh26:
	ldr	x9, [x9, _C_BLOCK@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
Lloh28:
	adrp	x10, _C_UNBLOCK@GOTPAGE
Lloh29:
	ldr	x10, [x10, _C_UNBLOCK@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	orr	w9, w10, w9
	ldr	w0, [x19, #36]
	and	w8, w9, w8
	cbz	w8, LBB0_12
; %bb.11:
	mov	w1, #32
	b	LBB0_13
LBB0_12:
	mov	w1, #0
LBB0_13:
	bl	_memset
	ldr	x9, [x19, #8]
	str	x9, [x19]
LBB0_14:
Lloh31:
	adrp	x8, _pending@GOTPAGE
Lloh32:
	ldr	x8, [x8, _pending@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
	orr	x8, x9, x8
	cbz	x8, LBB0_16
LBB0_15:
	mov	w0, #1
	bl	_dd_out
LBB0_16:
	ldr	x1, [x19, #16]
	cmp	x1, #1
	b.lt	LBB0_20
; %bb.17:
	ldr	w8, [x19, #24]
Lloh34:
	adrp	x9, _ISTRUNC@GOTPAGE
Lloh35:
	ldr	x9, [x9, _ISTRUNC@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.18:
	ldr	w0, [x19, #32]
	bl	_ftruncate
	cmn	w0, #1
	b.ne	LBB0_20
; %bb.19:
	ldr	w2, [x19, #28]
Lloh37:
	adrp	x1, l_.str@PAGE
Lloh38:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_20:
	ldr	w8, [x20]
Lloh39:
	adrp	x9, _C_FSYNC@GOTPAGE
Lloh40:
	ldr	x9, [x9, _C_FSYNC@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_23
; %bb.21:
	ldr	w0, [x19, #32]
	bl	_fsync
	cmn	w0, #1
	b.ne	LBB0_25
; %bb.22:
Lloh42:
	adrp	x1, l_.str.1@PAGE
Lloh43:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_27
LBB0_23:
Lloh44:
	adrp	x9, _C_FDATASYNC@GOTPAGE
Lloh45:
	ldr	x9, [x9, _C_FDATASYNC@GOTPAGEOFF]
Lloh46:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_25
; %bb.24:
	ldr	w0, [x19, #32]
	bl	_fdatasync
	cmn	w0, #1
	b.eq	LBB0_26
LBB0_25:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_26:
Lloh47:
	adrp	x1, l_.str.2@PAGE
Lloh48:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_27:
	ldr	w2, [x19, #28]
	mov	w0, #1
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_err
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_cfunc,8,3                      ; @cfunc
	.comm	_def,8,3                        ; @def
	.comm	_block,8,3                      ; @block
	.comm	_unblock,8,3                    ; @unblock
	.comm	_ddflags,4,2                    ; @ddflags
	.comm	_C_OSYNC,4,2                    ; @C_OSYNC
	.comm	_out,40,3                       ; @out
	.comm	_C_FILL,4,2                     ; @C_FILL
	.comm	_fill_char,1,0                  ; @fill_char
	.comm	_C_BLOCK,4,2                    ; @C_BLOCK
	.comm	_C_UNBLOCK,4,2                  ; @C_UNBLOCK
	.comm	_pending,8,3                    ; @pending
	.comm	_ISTRUNC,4,2                    ; @ISTRUNC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"truncating %s"

	.comm	_C_FSYNC,4,2                    ; @C_FSYNC
l_.str.1:                               ; @.str.1
	.asciz	"fsyncing %s"

	.comm	_C_FDATASYNC,4,2                ; @C_FDATASYNC
l_.str.2:                               ; @.str.2
	.asciz	"fdatasyncing %s"

	.no_dead_strip	_dd_close
.subsections_via_symbols
