	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ScmCreateNewServiceRecord      ## -- Begin function ScmCreateNewServiceRecord
	.p2align	4, 0x90
_ScmCreateNewServiceRecord:             ## @ScmCreateNewServiceRecord
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	%edi, %r12d
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	callq	_DPRINT
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %ebx
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_SERVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_szServiceName@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movl	%r12d, %edi
	callq	_wcslen
	cltq
	movl	4(%r15,%rax,4), %esi
	movl	%r13d, %edi
	callq	_FIELD_OFFSET
	movl	%ebx, %edi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_HeapAlloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	movl	88(%rbx), %edi
	movl	%r12d, %esi
	callq	_wcscpy
	movl	88(%rbx), %eax
	movl	%eax, 80(%rbx)
	movl	%eax, 84(%rbx)
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, 72(%rbx)
	movq	_ResumeCount@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	leal	1(%rcx), %edx
	movl	%edx, (%rax)
	movq	%rcx, 64(%rbx)
	movq	%rbx, %rsi
	addq	$56, %rsi
	movq	_ServiceListHead@GOTPCREL(%rip), %rdi
	callq	_InsertTailList
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, 48(%rbx)
	movq	_SERVICE_STOPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	$0, 32(%rbx)
	movq	_SERVICE_DISABLED@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jne	LBB0_3
## %bb.4:
	movq	_ERROR_SERVICE_DISABLED@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_1:
	movq	_ERROR_NOT_ENOUGH_MEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_3:
	movq	_ERROR_SERVICE_NEVER_STARTED@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rbx)
	movq	_SERVICE_DRIVER@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	andq	(%rax), %rdx
	movl	$2000, %eax                     ## imm = 0x7D0
	cmovnel	%ecx, %eax
	movl	%eax, (%rbx)
	movq	_ERROR_SUCCESS@GOTPCREL(%rip), %rax
LBB0_6:
	movq	(%rax), %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Service: '%S'\n"

	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_SERVICE,4,2                    ## @SERVICE
	.comm	_szServiceName,8,3              ## @szServiceName
	.comm	_ERROR_NOT_ENOUGH_MEMORY,8,3    ## @ERROR_NOT_ENOUGH_MEMORY
	.comm	_ResumeCount,4,2                ## @ResumeCount
	.comm	_ServiceListHead,4,2            ## @ServiceListHead
	.comm	_SERVICE_STOPPED,4,2            ## @SERVICE_STOPPED
	.comm	_SERVICE_DISABLED,8,3           ## @SERVICE_DISABLED
	.comm	_ERROR_SERVICE_DISABLED,4,2     ## @ERROR_SERVICE_DISABLED
	.comm	_ERROR_SERVICE_NEVER_STARTED,4,2 ## @ERROR_SERVICE_NEVER_STARTED
	.comm	_SERVICE_DRIVER,8,3             ## @SERVICE_DRIVER
	.comm	_ERROR_SUCCESS,8,3              ## @ERROR_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ScmCreateNewServiceRecord      ; -- Begin function ScmCreateNewServiceRecord
	.p2align	2
_ScmCreateNewServiceRecord:             ; @ScmCreateNewServiceRecord
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x19, x2
	mov	x23, x1
	mov	x22, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_DPRINT
	bl	_GetProcessHeap
	mov	x21, x0
Lloh2:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh4:
	ldr	w24, [x8]
Lloh5:
	adrp	x8, _SERVICE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SERVICE@GOTPAGEOFF]
Lloh7:
	ldr	w25, [x8]
Lloh8:
	adrp	x8, _szServiceName@GOTPAGE
Lloh9:
	ldr	x8, [x8, _szServiceName@GOTPAGEOFF]
Lloh10:
	ldr	x26, [x8]
	mov	x0, x22
	bl	_wcslen
	add	w8, w0, #1
	ldr	w1, [x26, w8, sxtw #2]
	mov	x0, x25
	bl	_FIELD_OFFSET
	mov	x2, x0
	mov	x0, x21
	mov	x1, x24
	bl	_HeapAlloc
	cbz	x0, LBB0_2
; %bb.1:
	mov	x21, x0
	str	x0, [x23]
	ldr	w0, [x0, #88]
	mov	x1, x22
	bl	_wcscpy
	ldr	w8, [x21, #88]
	stp	w8, w8, [x21, #80]
Lloh11:
	adrp	x8, _ResumeCount@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ResumeCount@GOTPAGEOFF]
	ldrsw	x9, [x8]
	add	w10, w9, #1
	str	w10, [x8]
	stp	x9, x20, [x21, #64]
	add	x1, x21, #56
Lloh13:
	adrp	x0, _ServiceListHead@GOTPAGE
Lloh14:
	ldr	x0, [x0, _ServiceListHead@GOTPAGEOFF]
	bl	_InsertTailList
	str	x19, [x21, #48]
Lloh15:
	adrp	x8, _SERVICE_STOPPED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SERVICE_STOPPED@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x21, #40]
	str	xzr, [x21, #32]
Lloh18:
	adrp	x8, _SERVICE_DISABLED@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SERVICE_DISABLED@GOTPAGEOFF]
Lloh20:
	adrp	x9, _ERROR_SERVICE_DISABLED@GOTPAGE
Lloh21:
	ldr	x9, [x9, _ERROR_SERVICE_DISABLED@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
Lloh23:
	adrp	x10, _ERROR_SERVICE_NEVER_STARTED@GOTPAGE
Lloh24:
	ldr	x10, [x10, _ERROR_SERVICE_NEVER_STARTED@GOTPAGEOFF]
	cmp	x8, x20
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	str	w8, [x21, #24]
	stp	xzr, xzr, [x21, #8]
Lloh25:
	adrp	x8, _SERVICE_DRIVER@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SERVICE_DRIVER@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	tst	x8, x19
	mov	w8, #2000
	csel	w8, w8, wzr, eq
	str	w8, [x21]
Lloh28:
	adrp	x8, _ERROR_SUCCESS@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ERROR_SUCCESS@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
Lloh30:
	adrp	x8, _ERROR_NOT_ENOUGH_MEMORY@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ERROR_NOT_ENOUGH_MEMORY@GOTPAGEOFF]
LBB0_3:
	ldr	x0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh22
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Service: '%S'\n"

	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_SERVICE,4,2                    ; @SERVICE
	.comm	_szServiceName,8,3              ; @szServiceName
	.comm	_ERROR_NOT_ENOUGH_MEMORY,8,3    ; @ERROR_NOT_ENOUGH_MEMORY
	.comm	_ResumeCount,4,2                ; @ResumeCount
	.comm	_ServiceListHead,4,2            ; @ServiceListHead
	.comm	_SERVICE_STOPPED,4,2            ; @SERVICE_STOPPED
	.comm	_SERVICE_DISABLED,8,3           ; @SERVICE_DISABLED
	.comm	_ERROR_SERVICE_DISABLED,4,2     ; @ERROR_SERVICE_DISABLED
	.comm	_ERROR_SERVICE_NEVER_STARTED,4,2 ; @ERROR_SERVICE_NEVER_STARTED
	.comm	_SERVICE_DRIVER,8,3             ; @SERVICE_DRIVER
	.comm	_ERROR_SUCCESS,8,3              ; @ERROR_SUCCESS
.subsections_via_symbols
