	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_w32_reg_read                   ## -- Begin function w32_reg_read
	.p2align	4, 0x90
_w32_reg_read:                          ## @w32_reg_read
	.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
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r12
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movq	(%rdi), %rsi
	movq	16(%rdi), %r14
	callq	___is_thread_alive
	movl	%eax, %r15d
	movq	(%rbx), %rdx
	cmpq	%rdx, (%r14)
	jne	LBB0_3
## %bb.1:
	movq	8(%r14), %r13
	testq	%r13, %r13
	je	LBB0_3
## %bb.2:
	movq	_INVALID_HANDLE_VALUE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	jne	LBB0_10
LBB0_3:
	movq	_THREAD_SUSPEND_RESUME@GOTPCREL(%rip), %rax
	movq	_THREAD_GET_CONTEXT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movl	8(%rbx), %ecx
	movq	_R_SYS_BITS_64@GOTPCREL(%rip), %rsi
	xorl	%eax, %eax
	cmpl	(%rsi), %ecx
	jne	LBB0_5
## %bb.4:
	movq	_THREAD_QUERY_INFORMATION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_5:
	orl	%eax, %edi
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_w32_OpenThread
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_8
## %bb.6:
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rdi
	callq	_r_sys_perror
LBB0_8:
	testq	%r13, %r13
	je	LBB0_9
LBB0_10:
	testl	%r15d, %r15d
	je	LBB0_13
## %bb.11:
	movl	8(%rbx), %esi
	movq	%r13, %rdi
	callq	___suspend_thread
	cmpl	$-1, %eax
	je	LBB0_12
LBB0_13:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	8(%rbx), %ecx
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	___get_thread_context
	movl	%eax, %r14d
	cmpl	$-2, -48(%rbp)                  ## 4-byte Folded Reload
	jg	LBB0_15
## %bb.14:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	___printwincontext
LBB0_15:
	testl	%r15d, %r15d
	je	LBB0_17
## %bb.16:
	movl	8(%rbx), %esi
	movq	%r13, %rdi
	callq	___resume_thread
	xorl	%ecx, %ecx
	cmpl	$-1, %eax
	cmovel	%ecx, %r14d
LBB0_17:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	8(%rax), %r13
	jne	LBB0_18
	jmp	LBB0_19
LBB0_9:
	xorl	%r14d, %r14d
	jmp	LBB0_19
LBB0_12:
	xorl	%r14d, %r14d
LBB0_18:
	movq	%r13, %rdi
	callq	_CloseHandle
LBB0_19:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INVALID_HANDLE_VALUE,8,3       ## @INVALID_HANDLE_VALUE
	.comm	_THREAD_SUSPEND_RESUME,4,2      ## @THREAD_SUSPEND_RESUME
	.comm	_THREAD_GET_CONTEXT,4,2         ## @THREAD_GET_CONTEXT
	.comm	_R_SYS_BITS_64,4,2              ## @R_SYS_BITS_64
	.comm	_THREAD_QUERY_INFORMATION,4,2   ## @THREAD_QUERY_INFORMATION
	.comm	_FALSE,4,2                      ## @FALSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"w32_reg_read/OpenThread"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_w32_reg_read                   ; -- Begin function w32_reg_read
	.p2align	2
_w32_reg_read:                          ; @w32_reg_read
	.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	x24, x3
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
	ldr	x25, [x0, #16]
	ldr	x1, [x0]
	bl	___is_thread_alive
	mov	x22, x0
	ldr	x8, [x25]
	ldr	x2, [x19]
	cmp	x8, x2
	b.ne	LBB0_2
; %bb.1:
	ldr	x21, [x25, #8]
Lloh0:
	adrp	x8, _INVALID_HANDLE_VALUE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INVALID_HANDLE_VALUE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x21, #0
	ccmp	x21, x8, #4, ne
	b.ne	LBB0_5
LBB0_2:
Lloh3:
	adrp	x8, _THREAD_SUSPEND_RESUME@GOTPAGE
Lloh4:
	ldr	x8, [x8, _THREAD_SUSPEND_RESUME@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _THREAD_GET_CONTEXT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _THREAD_GET_CONTEXT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19, #8]
Lloh9:
	adrp	x10, _R_SYS_BITS_64@GOTPAGE
Lloh10:
	ldr	x10, [x10, _R_SYS_BITS_64@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
Lloh12:
	adrp	x11, _THREAD_QUERY_INFORMATION@GOTPAGE
Lloh13:
	ldr	x11, [x11, _THREAD_QUERY_INFORMATION@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	cmp	w9, w10
	csel	w9, w11, wzr, eq
	orr	w0, w8, w9
Lloh15:
	adrp	x8, _FALSE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_w32_OpenThread
	mov	x21, x0
	cmp	x0, #0
	ccmp	w22, #0, #4, eq
	b.eq	LBB0_4
; %bb.3:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_r_sys_perror
LBB0_4:
	cbz	x21, LBB0_12
LBB0_5:
	cbz	w22, LBB0_7
; %bb.6:
	ldr	w1, [x19, #8]
	mov	x0, x21
	bl	___suspend_thread
	cmn	w0, #1
	b.eq	LBB0_13
LBB0_7:
	ldr	w3, [x19, #8]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x24
	bl	___get_thread_context
	mov	x24, x0
	cmn	w23, #2
	b.gt	LBB0_9
; %bb.8:
	mov	x0, x21
	mov	x1, x20
	bl	___printwincontext
LBB0_9:
	cbz	w22, LBB0_11
; %bb.10:
	ldr	w1, [x19, #8]
	mov	x0, x21
	bl	___resume_thread
	cmn	w0, #1
	csel	w24, wzr, w24, eq
LBB0_11:
	ldr	x8, [x25, #8]
	cmp	x21, x8
	b.ne	LBB0_14
	b	LBB0_15
LBB0_12:
	mov	w24, #0
	b	LBB0_15
LBB0_13:
	mov	w24, #0
LBB0_14:
	mov	x0, x21
	bl	_CloseHandle
LBB0_15:
	mov	x0, x24
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_INVALID_HANDLE_VALUE,8,3       ; @INVALID_HANDLE_VALUE
	.comm	_THREAD_SUSPEND_RESUME,4,2      ; @THREAD_SUSPEND_RESUME
	.comm	_THREAD_GET_CONTEXT,4,2         ; @THREAD_GET_CONTEXT
	.comm	_R_SYS_BITS_64,4,2              ; @R_SYS_BITS_64
	.comm	_THREAD_QUERY_INFORMATION,4,2   ; @THREAD_QUERY_INFORMATION
	.comm	_FALSE,4,2                      ; @FALSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"w32_reg_read/OpenThread"

.subsections_via_symbols
