	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_QueryService                   ## -- Begin function QueryService
	.p2align	4, 0x90
_QueryService:                          ## @QueryService
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	$0, -40(%rbp)
	movq	_SC_MANAGER_CONNECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_OpenSCManager
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	_SERVICE_QUERY_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_OpenService
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:
	movq	%rax, %r14
	movq	_SC_STATUS_PROCESS_INFO@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-40(%rbp), %r8
	movq	%rax, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_QueryServiceStatusEx
	testq	%rax, %rax
	jne	LBB0_8
## %bb.4:
	xorl	%eax, %eax
	callq	_GetLastError
	movq	_ERROR_INSUFFICIENT_BUFFER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.5:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	-40(%rbp), %rdx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	%rax, %rbx
	movl	(%r12), %esi
	movq	-40(%rbp), %rcx
	leaq	-40(%rbp), %r8
	movq	%r14, %rdi
	movq	%rax, %rdx
	callq	_QueryServiceStatusEx
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:
	movq	%r14, %rdi
	callq	_CloseServiceHandle
	movq	%r15, %rdi
	callq	_CloseServiceHandle
	jmp	LBB0_13
LBB0_1:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_ReportLastError
	jmp	LBB0_13
LBB0_8:
	xorl	%eax, %eax
	callq	_ReportLastError
LBB0_11:
	movq	%r14, %rdi
	callq	_CloseServiceHandle
	jmp	LBB0_12
LBB0_9:
	xorl	%eax, %eax
	callq	_ReportLastError
LBB0_12:
	movq	%r15, %rdi
	callq	_CloseServiceHandle
	xorl	%ebx, %ebx
LBB0_13:
	movq	%rbx, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	xorl	%eax, %eax
	callq	_ReportLastError
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_HeapFree
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_SC_MANAGER_CONNECT,4,2         ## @SC_MANAGER_CONNECT
	.comm	_SERVICE_QUERY_STATUS,4,2       ## @SERVICE_QUERY_STATUS
	.comm	_SC_STATUS_PROCESS_INFO,4,2     ## @SC_STATUS_PROCESS_INFO
	.comm	_ERROR_INSUFFICIENT_BUFFER,8,3  ## @ERROR_INSUFFICIENT_BUFFER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_QueryService                   ; -- Begin function QueryService
	.p2align	2
_QueryService:                          ; @QueryService
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x0
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _SC_MANAGER_CONNECT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SC_MANAGER_CONNECT@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, #0
	mov	x1, #0
	bl	_OpenSCManager
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _SERVICE_QUERY_STATUS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SERVICE_QUERY_STATUS@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x1, x20
	bl	_OpenService
	cbz	x0, LBB0_10
; %bb.2:
	mov	x20, x0
Lloh6:
	adrp	x22, _SC_STATUS_PROCESS_INFO@GOTPAGE
Lloh7:
	ldr	x22, [x22, _SC_STATUS_PROCESS_INFO@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x4, sp, #8
	mov	x2, #0
	mov	x3, #0
	bl	_QueryServiceStatusEx
	cbnz	x0, LBB0_8
; %bb.3:
	bl	_GetLastError
Lloh8:
	adrp	x8, _ERROR_INSUFFICIENT_BUFFER@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ERROR_INSUFFICIENT_BUFFER@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.4:
	bl	_GetProcessHeap
	ldr	x2, [sp, #8]
	mov	w1, #0
	bl	_HeapAlloc
	cbz	x0, LBB0_8
; %bb.5:
	mov	x21, x0
	ldr	w1, [x22]
	ldr	x3, [sp, #8]
	add	x4, sp, #8
	mov	x0, x20
	mov	x2, x21
	bl	_QueryServiceStatusEx
	cbz	x0, LBB0_14
; %bb.6:
	mov	x0, x20
	bl	_CloseServiceHandle
	mov	x0, x19
	bl	_CloseServiceHandle
	b	LBB0_13
LBB0_7:
	bl	_ReportLastError
	b	LBB0_12
LBB0_8:
	bl	_ReportLastError
LBB0_9:
	mov	x0, x20
	bl	_CloseServiceHandle
	b	LBB0_11
LBB0_10:
	bl	_ReportLastError
LBB0_11:
	mov	x0, x19
	bl	_CloseServiceHandle
LBB0_12:
	mov	x21, #0
LBB0_13:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_14:
	bl	_ReportLastError
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x21
	bl	_HeapFree
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_SC_MANAGER_CONNECT,4,2         ; @SC_MANAGER_CONNECT
	.comm	_SERVICE_QUERY_STATUS,4,2       ; @SERVICE_QUERY_STATUS
	.comm	_SC_STATUS_PROCESS_INFO,4,2     ; @SC_STATUS_PROCESS_INFO
	.comm	_ERROR_INSUFFICIENT_BUFFER,8,3  ; @ERROR_INSUFFICIENT_BUFFER
.subsections_via_symbols
