	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_close                          ## -- Begin function close
	.p2align	4, 0x90
_close:                                 ## @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	%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	_SOPEN_MAX@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jbe	LBB0_2
## %bb.1:
	movq	_files@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movslq	%edi, %rax
	leaq	(%rax,%rax,4), %r13
	leaq	(%r12,%r13,8), %r15
	cmpl	$0, (%r15)
	je	LBB0_2
## %bb.4:
	movq	32(%r12,%r13,8), %rdi
	callq	_free
	movq	$0, 32(%r12,%r13,8)
	movl	(%r15), %eax
	movq	_F_RAW@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_2:
	movq	_EBADF@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_3
LBB0_6:
	movq	24(%r12,%r13,8), %rcx
	movl	$0, %ebx
	testq	%rcx, %rcx
	je	LBB0_8
## %bb.7:
	movq	%r15, %rdi
	callq	*(%rcx)
	movl	%eax, %ebx
	movl	(%r15), %eax
LBB0_8:
	movq	_F_NODEV@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_11
## %bb.9:
	movq	16(%r12,%r13,8), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	%r15, %rdi
	callq	*(%rax)
	movl	%eax, %r14d
LBB0_11:
	cmpq	$0, 8(%r12,%r13,8)
	je	LBB0_13
## %bb.12:
	movq	%r15, %rdi
	callq	_devclose
LBB0_13:
	movl	$0, (%r15)
	testl	%ebx, %ebx
	jne	LBB0_3
## %bb.14:
	movl	%r14d, %ebx
	testl	%r14d, %r14d
	je	LBB0_15
LBB0_3:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movl	$-1, %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	xorl	%eax, %eax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_files,8,3                      ## @files
	.comm	_SOPEN_MAX,4,2                  ## @SOPEN_MAX
	.comm	_EBADF,4,2                      ## @EBADF
	.comm	_errno,4,2                      ## @errno
	.comm	_F_RAW,4,2                      ## @F_RAW
	.comm	_F_NODEV,4,2                    ## @F_NODEV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_close                          ; -- Begin function close
	.p2align	2
_close:                                 ; @close
	.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
                                        ; kill: def $w0 killed $w0 def $x0
Lloh0:
	adrp	x8, _SOPEN_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SOPEN_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.ls	LBB0_4
; %bb.1:
Lloh3:
	adrp	x8, _files@GOTPAGE
Lloh4:
	ldr	x8, [x8, _files@GOTPAGEOFF]
Lloh5:
	ldr	x22, [x8]
	mov	w8, #40
	smaddl	x19, w0, w8, x22
	ldr	w8, [x19]
	cbz	w8, LBB0_4
; %bb.2:
	sxtw	x23, w0
	mov	w8, #40
	madd	x20, x23, x8, x22
	ldr	x0, [x20, #32]
	bl	_free
	str	xzr, [x20, #32]
	ldr	w8, [x19]
Lloh6:
	adrp	x9, _F_RAW@GOTPAGE
Lloh7:
	ldr	x9, [x9, _F_RAW@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
LBB0_3:
	mov	w20, #0
	b	LBB0_7
LBB0_4:
Lloh9:
	adrp	x8, _EBADF@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EBADF@GOTPAGEOFF]
Lloh11:
	ldr	w20, [x8]
	b	LBB0_15
LBB0_5:
	mov	w9, #40
	madd	x9, x23, x9, x22
	ldr	x9, [x9, #24]
	cbz	x9, LBB0_3
; %bb.6:
	ldr	x8, [x9]
	mov	x0, x19
	blr	x8
	mov	x20, x0
	ldr	w8, [x19]
LBB0_7:
Lloh12:
	adrp	x9, _F_NODEV@GOTPAGE
Lloh13:
	ldr	x9, [x9, _F_NODEV@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
LBB0_8:
	mov	w21, #0
	b	LBB0_11
LBB0_9:
	mov	w8, #40
	madd	x8, x23, x8, x22
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_8
; %bb.10:
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	x21, x0
LBB0_11:
	mov	w8, #40
	madd	x8, x23, x8, x22
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_13
; %bb.12:
	mov	x0, x19
	bl	_devclose
LBB0_13:
	str	wzr, [x19]
	cbnz	w20, LBB0_15
; %bb.14:
	mov	x20, x21
	cbz	w21, LBB0_17
LBB0_15:
Lloh15:
	adrp	x8, _errno@GOTPAGE
Lloh16:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh17:
	str	w20, [x8]
	mov	w0, #-1
LBB0_16:
	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_17:
	mov	w0, #0
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_files,8,3                      ; @files
	.comm	_SOPEN_MAX,4,2                  ; @SOPEN_MAX
	.comm	_EBADF,4,2                      ; @EBADF
	.comm	_errno,4,2                      ; @errno
	.comm	_F_RAW,4,2                      ; @F_RAW
	.comm	_F_NODEV,4,2                    ; @F_NODEV
.subsections_via_symbols
