	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_w32_first_thread               ## -- Begin function w32_first_thread
	.p2align	4, 0x90
_w32_first_thread:                      ## @w32_first_thread
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	movl	$12, -40(%rbp)
	movq	_TH32CS_SNAPTHREAD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_CreateToolhelp32Snapshot
	movq	%rax, %rbx
	movq	_INVALID_HANDLE_VALUE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_3:
	leaq	-40(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_Thread32First
	testl	%eax, %eax
	je	LBB0_12
## %bb.4:
	leaq	-40(%rbp), %r15
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r14d, -36(%rbp)
	je	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_Thread32Next
	testq	%rax, %rax
	jne	LBB0_5
	jmp	LBB0_10
LBB0_12:
	movq	%rbx, %rdi
	callq	_CloseHandle
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	xorl	%eax, %eax
	callq	_eprintf
	movl	$-1, %r14d
	jmp	LBB0_11
LBB0_6:
	movq	_THREAD_ALL_ACCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-32(%rbp), %edx
	xorl	%esi, %esi
	callq	_w32_OpenThread
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rbx, %rdi
	callq	_CloseHandle
	movl	-32(%rbp), %r14d
	jmp	LBB0_11
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	callq	_r_sys_perror
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_eprintf
	movq	%rbx, %rdi
	callq	_CloseHandle
LBB0_11:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TH32CS_SNAPTHREAD,4,2          ## @TH32CS_SNAPTHREAD
	.comm	_INVALID_HANDLE_VALUE,8,3       ## @INVALID_HANDLE_VALUE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"w32_thread_list: invalid handle\n"

L_.str.1:                               ## @.str.1
	.asciz	"w32_thread_list: no thread first\n"

	.comm	_THREAD_ALL_ACCESS,4,2          ## @THREAD_ALL_ACCESS
L_.str.2:                               ## @.str.2
	.asciz	"w32_first_thread/OpenThread"

L_.str.3:                               ## @.str.3
	.asciz	"Could not find an active thread for pid %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_w32_first_thread               ; -- Begin function w32_first_thread
	.p2align	2
_w32_first_thread:                      ; @w32_first_thread
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
	mov	w8, #12
	str	w8, [sp, #16]
Lloh0:
	adrp	x8, _TH32CS_SNAPTHREAD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TH32CS_SNAPTHREAD@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_CreateToolhelp32Snapshot
Lloh3:
	adrp	x8, _INVALID_HANDLE_VALUE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INVALID_HANDLE_VALUE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_6
LBB0_2:
	mov	x20, x0
	add	x1, sp, #16
	bl	_Thread32First
	cbz	w0, LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [sp, #20]
	cmp	w8, w19
	b.eq	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x1, sp, #16
	mov	x0, x20
	bl	_Thread32Next
	cbnz	x0, LBB0_3
	b	LBB0_10
LBB0_5:
	mov	x0, x20
	bl	_CloseHandle
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_6:
	bl	_eprintf
	mov	w19, #-1
	b	LBB0_11
LBB0_7:
Lloh10:
	adrp	x8, _THREAD_ALL_ACCESS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _THREAD_ALL_ACCESS@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ldr	w2, [sp, #24]
	mov	w1, #0
	bl	_w32_OpenThread
	cbz	x0, LBB0_9
; %bb.8:
	mov	x0, x20
	bl	_CloseHandle
	ldr	w19, [sp, #24]
	b	LBB0_11
LBB0_9:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_r_sys_perror
LBB0_10:
	str	x19, [sp]
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_eprintf
	mov	x0, x20
	bl	_CloseHandle
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_TH32CS_SNAPTHREAD,4,2          ; @TH32CS_SNAPTHREAD
	.comm	_INVALID_HANDLE_VALUE,8,3       ; @INVALID_HANDLE_VALUE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"w32_thread_list: invalid handle\n"

l_.str.1:                               ; @.str.1
	.asciz	"w32_thread_list: no thread first\n"

	.comm	_THREAD_ALL_ACCESS,4,2          ; @THREAD_ALL_ACCESS
l_.str.2:                               ; @.str.2
	.asciz	"w32_first_thread/OpenThread"

l_.str.3:                               ; @.str.3
	.asciz	"Could not find an active thread for pid %d\n"

.subsections_via_symbols
