	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function service_clean
_service_clean:                         ## @service_clean
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r14d
	movl	%edi, %r12d
	movq	_STDERR_FILENO@GOTPCREL(%rip), %rbx
	xorl	%edi, %edi
	cmpl	%r12d, (%rbx)
	setl	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpl	%r14d, (%rbx)
	setl	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpl	%r14d, %r12d
	setne	%dil
	callq	_assert
	movq	_CASPER_SERVICE_STDIO@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_stdnull
LBB0_2:
	movq	_CASPER_SERVICE_FD@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_3
## %bb.8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	cmpl	%r12d, %r14d
	movl	%r12d, %r15d
	cmovgl	%r14d, %r15d
	cmovll	%r14d, %r12d
	movl	(%rbx), %ebx
	incl	%ebx
	cmpl	%r15d, %ebx
	jl	LBB0_4
LBB0_7:
	incl	%r15d
	movl	%r15d, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_closefrom                      ## TAILCALL
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	cmpl	%ebx, %r15d
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%ebx, %r12d
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %edi
	callq	_close
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_STDERR_FILENO,4,2              ## @STDERR_FILENO
	.comm	_CASPER_SERVICE_STDIO,4,2       ## @CASPER_SERVICE_STDIO
	.comm	_CASPER_SERVICE_FD,4,2          ## @CASPER_SERVICE_FD
	.no_dead_strip	_service_clean
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function service_clean
_service_clean:                         ; @service_clean
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _STDERR_FILENO@GOTPAGE
Lloh1:
	ldr	x22, [x22, _STDERR_FILENO@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, w0
	cset	w0, lt
	bl	_assert
	ldr	w8, [x22]
	cmp	w8, w19
	cset	w0, lt
	bl	_assert
	cmp	w20, w19
	cset	w0, ne
	bl	_assert
Lloh2:
	adrp	x8, _CASPER_SERVICE_STDIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CASPER_SERVICE_STDIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w21
	b.ne	LBB0_2
; %bb.1:
	bl	_stdnull
LBB0_2:
Lloh5:
	adrp	x8, _CASPER_SERVICE_FD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CASPER_SERVICE_FD@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_4
; %bb.3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
	cmp	w19, w20
	csel	w21, w19, w20, gt
	csel	w20, w19, w20, lt
	ldr	w8, [x22]
	add	w19, w8, #1
	cmp	w19, w21
	b.lt	LBB0_7
LBB0_5:
	add	w0, w21, #1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_closefrom
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	w19, w19, #1
	cmp	w21, w19
	b.eq	LBB0_5
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w20, w19
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	bl	_close
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_STDERR_FILENO,4,2              ; @STDERR_FILENO
	.comm	_CASPER_SERVICE_STDIO,4,2       ; @CASPER_SERVICE_STDIO
	.comm	_CASPER_SERVICE_FD,4,2          ; @CASPER_SERVICE_FD
	.no_dead_strip	_service_clean
.subsections_via_symbols
