	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ScmRemoveServiceImage          ## -- Begin function ScmRemoveServiceImage
	.p2align	4, 0x90
_ScmRemoveServiceImage:                 ## @ScmRemoveServiceImage
	.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	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_DPRINT1
	leaq	32(%rbx), %rdi
	callq	_RemoveEntryList
	movq	(%rbx), %rdi
	movq	_INVALID_HANDLE_VALUE@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rdi
	je	LBB0_2
## %bb.1:
	callq	_CloseHandle
	movq	(%r14), %rdi
LBB0_2:
	movq	8(%rbx), %rax
	cmpq	%rdi, %rax
	je	LBB0_4
## %bb.3:
	movq	%rax, %rdi
	callq	_CloseHandle
LBB0_4:
	cmpq	$0, 24(%rbx)
	je	LBB0_6
## %bb.5:
	movq	16(%rbx), %rdi
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ScmEnableBackupRestorePrivileges
	movq	16(%rbx), %rdi
	movq	24(%rbx), %rsi
	callq	_UnloadUserProfile
	movq	16(%rbx), %rdi
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ScmEnableBackupRestorePrivileges
LBB0_6:
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	callq	_CloseHandle
LBB0_8:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_HeapFree                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ScmRemoveServiceImage() called\n"

	.comm	_INVALID_HANDLE_VALUE,8,3       ## @INVALID_HANDLE_VALUE
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_FALSE,4,2                      ## @FALSE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ScmRemoveServiceImage          ; -- Begin function ScmRemoveServiceImage
	.p2align	2
_ScmRemoveServiceImage:                 ; @ScmRemoveServiceImage
	.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	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINT1
	add	x0, x19, #32
	bl	_RemoveEntryList
	ldr	x0, [x19]
Lloh2:
	adrp	x20, _INVALID_HANDLE_VALUE@GOTPAGE
Lloh3:
	ldr	x20, [x20, _INVALID_HANDLE_VALUE@GOTPAGEOFF]
	ldr	x8, [x20]
	cmp	x0, x8
	b.eq	LBB0_2
; %bb.1:
	bl	_CloseHandle
	ldr	x0, [x20]
LBB0_2:
	ldr	x8, [x19, #8]
	cmp	x8, x0
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x8
	bl	_CloseHandle
LBB0_4:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	x0, [x19, #16]
Lloh4:
	adrp	x8, _TRUE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	bl	_ScmEnableBackupRestorePrivileges
	ldp	x0, x1, [x19, #16]
	bl	_UnloadUserProfile
	ldr	x0, [x19, #16]
Lloh7:
	adrp	x8, _FALSE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_ScmEnableBackupRestorePrivileges
LBB0_6:
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_8
; %bb.7:
	bl	_CloseHandle
LBB0_8:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_HeapFree
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ScmRemoveServiceImage() called\n"

	.comm	_INVALID_HANDLE_VALUE,8,3       ; @INVALID_HANDLE_VALUE
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_FALSE,4,2                      ; @FALSE
.subsections_via_symbols
