	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rclose                         ## -- Begin function rclose
	.p2align	4, 0x90
_rclose:                                ## @rclose
	.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
	movl	%edi, %r14d
	movq	_idm@GOTPCREL(%rip), %rdi
	movl	%r14d, %esi
	callq	_idm_lookup
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.3:
	movq	_rs_connected@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_5
## %bb.4:
	movq	_SHUT_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_rshutdown
	jmp	LBB0_8
LBB0_1:
	movq	_EBADF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_7:
	movq	%rbx, %rdi
	callq	_ds_shutdown
	jmp	LBB0_8
LBB0_5:
	movq	_RS_OPT_SVC_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 12(%rbx)
	je	LBB0_8
## %bb.6:
	movq	_RS_SVC_REM_KEEPALIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_tcp_svc@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_rs_notify_svc
LBB0_8:
	movq	%rbx, %rdi
	callq	_rs_free
	xorl	%eax, %eax
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_idm,4,2                        ## @idm
	.comm	_EBADF,4,2                      ## @EBADF
	.comm	_SOCK_STREAM,8,3                ## @SOCK_STREAM
	.comm	_rs_connected,4,2               ## @rs_connected
	.comm	_SHUT_RDWR,4,2                  ## @SHUT_RDWR
	.comm	_RS_OPT_SVC_ACTIVE,4,2          ## @RS_OPT_SVC_ACTIVE
	.comm	_tcp_svc,4,2                    ## @tcp_svc
	.comm	_RS_SVC_REM_KEEPALIVE,4,2       ## @RS_SVC_REM_KEEPALIVE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rclose                         ; -- Begin function rclose
	.p2align	2
_rclose:                                ; @rclose
	.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
	mov	x20, x0
Lloh0:
	adrp	x0, _idm@GOTPAGE
Lloh1:
	ldr	x0, [x0, _idm@GOTPAGEOFF]
	mov	x1, x20
	bl	_idm_lookup
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
Lloh2:
	adrp	x9, _SOCK_STREAM@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SOCK_STREAM@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
	ldr	w8, [x19, #8]
Lloh5:
	adrp	x9, _rs_connected@GOTPAGE
Lloh6:
	ldr	x9, [x9, _rs_connected@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.3:
Lloh8:
	adrp	x8, _SHUT_RDWR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SHUT_RDWR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rshutdown
	b	LBB0_8
LBB0_4:
Lloh11:
	adrp	x8, _EBADF@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EBADF@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_5:
	mov	x0, x19
	bl	_ds_shutdown
	b	LBB0_8
LBB0_6:
	ldr	w8, [x19, #12]
Lloh14:
	adrp	x9, _RS_OPT_SVC_ACTIVE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _RS_OPT_SVC_ACTIVE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
Lloh17:
	adrp	x8, _RS_SVC_REM_KEEPALIVE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _RS_SVC_REM_KEEPALIVE@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
Lloh20:
	adrp	x0, _tcp_svc@GOTPAGE
Lloh21:
	ldr	x0, [x0, _tcp_svc@GOTPAGEOFF]
	mov	x1, x19
	bl	_rs_notify_svc
LBB0_8:
	mov	x0, x19
	bl	_rs_free
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_idm,4,2                        ; @idm
	.comm	_EBADF,4,2                      ; @EBADF
	.comm	_SOCK_STREAM,8,3                ; @SOCK_STREAM
	.comm	_rs_connected,4,2               ; @rs_connected
	.comm	_SHUT_RDWR,4,2                  ; @SHUT_RDWR
	.comm	_RS_OPT_SVC_ACTIVE,4,2          ; @RS_OPT_SVC_ACTIVE
	.comm	_tcp_svc,4,2                    ; @tcp_svc
	.comm	_RS_SVC_REM_KEEPALIVE,4,2       ; @RS_SVC_REM_KEEPALIVE
.subsections_via_symbols
