	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function AddNewEventSource
_AddNewEventSource:                     ## @AddNewEventSource
	.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
	movl	%esi, %r15d
	movl	%edi, %r14d
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %r12d
	movq	_EVENTSOURCE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_szName@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	%r15d, %edi
	callq	_wcslen
	cltq
	movl	4(%rbx,%rax,4), %esi
	movl	%r13d, %edi
	callq	_FIELD_OFFSET
	movl	%r12d, %edi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_HeapAlloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	4(%rbx), %edi
	movl	%r15d, %esi
	callq	_wcscpy
	movl	%r14d, 8(%rbx)
	movl	4(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_DPRINT
	movq	_EventSourceListCs@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_EnterCriticalSection
	movq	_EventSourceListHead@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_InsertTailList
	movq	%r14, %rdi
	callq	_LeaveCriticalSection
LBB0_2:
	xorl	%eax, %eax
	testq	%rbx, %rbx
	setne	%al
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EVENTSOURCE,4,2                ## @EVENTSOURCE
	.comm	_szName,8,3                     ## @szName
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Insert event source: %S\n"

	.comm	_EventSourceListCs,4,2          ## @EventSourceListCs
	.comm	_EventSourceListHead,4,2        ## @EventSourceListHead
	.no_dead_strip	_AddNewEventSource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function AddNewEventSource
_AddNewEventSource:                     ; @AddNewEventSource
	.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
	mov	x19, x0
	bl	_GetProcessHeap
	mov	x21, x0
Lloh0:
	adrp	x8, _EVENTSOURCE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EVENTSOURCE@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
Lloh3:
	adrp	x8, _szName@GOTPAGE
Lloh4:
	ldr	x8, [x8, _szName@GOTPAGEOFF]
Lloh5:
	ldr	x23, [x8]
	mov	x0, x20
	bl	_wcslen
	add	w8, w0, #1
	ldr	w1, [x23, w8, sxtw #2]
	mov	x0, x22
	bl	_FIELD_OFFSET
	mov	x2, x0
	mov	x0, x21
	mov	w1, #0
	bl	_HeapAlloc
	mov	x21, x0
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x21, #4]
	mov	x1, x20
	bl	_wcscpy
	str	w19, [x21, #8]
	ldr	w1, [x21, #4]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINT
Lloh8:
	adrp	x19, _EventSourceListCs@GOTPAGE
Lloh9:
	ldr	x19, [x19, _EventSourceListCs@GOTPAGEOFF]
	mov	x0, x19
	bl	_EnterCriticalSection
Lloh10:
	adrp	x0, _EventSourceListHead@GOTPAGE
Lloh11:
	ldr	x0, [x0, _EventSourceListHead@GOTPAGEOFF]
	mov	x1, x21
	bl	_InsertTailList
	mov	x0, x19
	bl	_LeaveCriticalSection
LBB0_2:
	cmp	x21, #0
	cset	w0, ne
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EVENTSOURCE,4,2                ; @EVENTSOURCE
	.comm	_szName,8,3                     ; @szName
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Insert event source: %S\n"

	.comm	_EventSourceListCs,4,2          ; @EventSourceListCs
	.comm	_EventSourceListHead,4,2        ; @EventSourceListHead
	.no_dead_strip	_AddNewEventSource
.subsections_via_symbols
