	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ScmCreateManagerHandle
_ScmCreateManagerHandle:                ## @ScmCreateManagerHandle
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	_SERVICES_ACTIVE_DATABASEW@GOTPCREL(%rip), %r15
	testq	%rdi, %rdi
	jne	LBB0_2
## %bb.1:
	movq	(%r15), %rbx
LBB0_2:
	movq	_SERVICES_FAILED_DATABASEW@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	__wcsicmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	(%r15), %rsi
	movq	%rbx, %rdi
	callq	__wcsicmp
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	callq	_DPRINT
	movq	_ERROR_INVALID_NAME@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_3:
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	callq	_DPRINT
	movq	_ERROR_DATABASE_DOES_NOT_EXIST@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_6:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_MANAGER_HANDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_DatabaseName@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	%rbx, %rdi
	callq	_wcslen
	cltq
	movl	4(%r15,%rax,4), %esi
	movl	%r13d, %edi
	callq	_FIELD_OFFSET
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_HeapAlloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r15
	movq	_MANAGER_TAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movl	(%r15), %edi
	movq	%rbx, %rsi
	callq	_wcscpy
	movq	%r15, (%r14)
	movq	_ERROR_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_ERROR_NOT_ENOUGH_MEMORY@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SERVICES_ACTIVE_DATABASEW,8,3  ## @SERVICES_ACTIVE_DATABASEW
	.comm	_SERVICES_FAILED_DATABASEW,8,3  ## @SERVICES_FAILED_DATABASEW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Database %S, does not exist\n"

	.comm	_ERROR_DATABASE_DOES_NOT_EXIST,4,2 ## @ERROR_DATABASE_DOES_NOT_EXIST
L_.str.1:                               ## @.str.1
	.asciz	"Invalid Database name %S.\n"

	.comm	_ERROR_INVALID_NAME,4,2         ## @ERROR_INVALID_NAME
	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_MANAGER_HANDLE,4,2             ## @MANAGER_HANDLE
	.comm	_DatabaseName,8,3               ## @DatabaseName
	.comm	_ERROR_NOT_ENOUGH_MEMORY,4,2    ## @ERROR_NOT_ENOUGH_MEMORY
	.comm	_MANAGER_TAG,4,2                ## @MANAGER_TAG
	.comm	_ERROR_SUCCESS,4,2              ## @ERROR_SUCCESS
	.no_dead_strip	_ScmCreateManagerHandle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ScmCreateManagerHandle
_ScmCreateManagerHandle:                ; @ScmCreateManagerHandle
	.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
	mov	x20, x1
Lloh0:
	adrp	x21, _SERVICES_ACTIVE_DATABASEW@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SERVICES_ACTIVE_DATABASEW@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x0, #0
	csel	x19, x8, x0, eq
Lloh2:
	adrp	x8, _SERVICES_FAILED_DATABASEW@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SERVICES_FAILED_DATABASEW@GOTPAGEOFF]
Lloh4:
	ldr	x1, [x8]
	mov	x0, x19
	bl	__wcsicmp
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x1, [x21]
	mov	x0, x19
	bl	__wcsicmp
	cbz	x0, LBB0_4
; %bb.2:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_DPRINT
Lloh7:
	adrp	x8, _ERROR_INVALID_NAME@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ERROR_INVALID_NAME@GOTPAGEOFF]
	b	LBB0_7
LBB0_3:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_DPRINT
Lloh11:
	adrp	x8, _ERROR_DATABASE_DOES_NOT_EXIST@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ERROR_DATABASE_DOES_NOT_EXIST@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
	bl	_GetProcessHeap
	mov	x21, x0
Lloh13:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh15:
	ldr	w22, [x8]
Lloh16:
	adrp	x8, _MANAGER_HANDLE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MANAGER_HANDLE@GOTPAGEOFF]
Lloh18:
	ldr	w23, [x8]
Lloh19:
	adrp	x8, _DatabaseName@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DatabaseName@GOTPAGEOFF]
Lloh21:
	ldr	x24, [x8]
	mov	x0, x19
	bl	_wcslen
	add	w8, w0, #1
	ldr	w1, [x24, w8, sxtw #2]
	mov	x0, x23
	bl	_FIELD_OFFSET
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_HeapAlloc
	cbz	x0, LBB0_6
; %bb.5:
	mov	x21, x0
Lloh22:
	adrp	x8, _MANAGER_TAG@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MANAGER_TAG@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x0, #4]
	ldr	w0, [x0]
	mov	x1, x19
	bl	_wcscpy
	str	x21, [x20]
Lloh25:
	adrp	x8, _ERROR_SUCCESS@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ERROR_SUCCESS@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh27:
	adrp	x8, _ERROR_NOT_ENOUGH_MEMORY@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ERROR_NOT_ENOUGH_MEMORY@GOTPAGEOFF]
LBB0_7:
	ldr	w0, [x8]
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_SERVICES_ACTIVE_DATABASEW,8,3  ; @SERVICES_ACTIVE_DATABASEW
	.comm	_SERVICES_FAILED_DATABASEW,8,3  ; @SERVICES_FAILED_DATABASEW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Database %S, does not exist\n"

	.comm	_ERROR_DATABASE_DOES_NOT_EXIST,4,2 ; @ERROR_DATABASE_DOES_NOT_EXIST
l_.str.1:                               ; @.str.1
	.asciz	"Invalid Database name %S.\n"

	.comm	_ERROR_INVALID_NAME,4,2         ; @ERROR_INVALID_NAME
	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_MANAGER_HANDLE,4,2             ; @MANAGER_HANDLE
	.comm	_DatabaseName,8,3               ; @DatabaseName
	.comm	_ERROR_NOT_ENOUGH_MEMORY,4,2    ; @ERROR_NOT_ENOUGH_MEMORY
	.comm	_MANAGER_TAG,4,2                ; @MANAGER_TAG
	.comm	_ERROR_SUCCESS,4,2              ; @ERROR_SUCCESS
	.no_dead_strip	_ScmCreateManagerHandle
.subsections_via_symbols
