	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_w32_reg_write                  ## -- Begin function w32_reg_write
	.p2align	4, 0x90
_w32_reg_write:                         ## @w32_reg_write
	.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	%ecx, %r14d
	movq	%rdx, %r15
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movq	_THREAD_SUSPEND_RESUME@GOTPCREL(%rip), %rax
	movq	_THREAD_SET_CONTEXT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_R_SYS_BITS_64@GOTPCREL(%rip), %rcx
	movl	(%rbx), %esi
	movl	4(%rbx), %edx
	xorl	%eax, %eax
	cmpl	(%rcx), %esi
	jne	LBB0_2
## %bb.1:
	movq	_THREAD_QUERY_INFORMATION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_2:
	orl	%eax, %edi
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_w32_OpenThread
	testl	%eax, %eax
	je	LBB0_10
## %bb.3:
	movl	%eax, %r12d
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	4(%rbx), %esi
	movq	%rbx, %rdi
	callq	___is_thread_alive
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	(%rbx), %esi
	movl	%r12d, %edi
	callq	___suspend_thread
	cmpl	$-1, %eax
	je	LBB0_11
LBB0_5:
	movq	_R_REG_TYPE_DRX@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	___transfer_drx
LBB0_7:
	movl	(%rbx), %ecx
	movl	%r12d, %edi
	movq	%r15, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	___set_thread_context
	movl	%eax, %r15d
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.8:
	movl	(%rbx), %esi
	movl	%r12d, %edi
	callq	___resume_thread
	xorl	%ecx, %ecx
	cmpl	$-1, %eax
	cmovel	%ecx, %r15d
LBB0_9:
	movl	%r12d, %edi
	callq	_CloseHandle
	jmp	LBB0_13
LBB0_10:
	leaq	L_.str(%rip), %rdi
	callq	_r_sys_perror
	jmp	LBB0_12
LBB0_11:
	movl	%r12d, %edi
	callq	_CloseHandle
LBB0_12:
	xorl	%r15d, %r15d
LBB0_13:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_THREAD_SUSPEND_RESUME,4,2      ## @THREAD_SUSPEND_RESUME
	.comm	_THREAD_SET_CONTEXT,4,2         ## @THREAD_SET_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_write/OpenThread"

	.comm	_R_REG_TYPE_DRX,4,2             ## @R_REG_TYPE_DRX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_w32_reg_write                  ; -- Begin function w32_reg_write
	.p2align	2
_w32_reg_write:                         ; @w32_reg_write
	.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	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _THREAD_SUSPEND_RESUME@GOTPAGE
Lloh1:
	ldr	x8, [x8, _THREAD_SUSPEND_RESUME@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _THREAD_SET_CONTEXT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _THREAD_SET_CONTEXT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _R_SYS_BITS_64@GOTPAGE
Lloh7:
	ldr	x9, [x9, _R_SYS_BITS_64@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _THREAD_QUERY_INFORMATION@GOTPAGE
Lloh10:
	ldr	x10, [x10, _THREAD_QUERY_INFORMATION@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	ldp	w11, w2, [x0]
	cmp	w11, w9
	csel	w9, w10, wzr, eq
	orr	w0, w8, w9
Lloh12:
	adrp	x8, _FALSE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_w32_OpenThread
	cbz	w0, LBB0_8
; %bb.1:
	mov	x20, x0
	ldr	w1, [x19, #4]
	mov	x0, x19
	bl	___is_thread_alive
	mov	x24, x0
	cbz	w0, LBB0_3
; %bb.2:
	ldr	w1, [x19]
	mov	x0, x20
	bl	___suspend_thread
	cmn	w0, #1
	b.eq	LBB0_9
LBB0_3:
Lloh15:
	adrp	x8, _R_REG_TYPE_DRX@GOTPAGE
Lloh16:
	ldr	x8, [x8, _R_REG_TYPE_DRX@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w8, w23
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x19
	mov	x1, x22
	bl	___transfer_drx
LBB0_5:
	ldr	w3, [x19]
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	bl	___set_thread_context
	mov	x21, x0
	cbz	w24, LBB0_7
; %bb.6:
	ldr	w1, [x19]
	mov	x0, x20
	bl	___resume_thread
	cmn	w0, #1
	csel	w21, wzr, w21, eq
LBB0_7:
	mov	x0, x20
	bl	_CloseHandle
	b	LBB0_11
LBB0_8:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_r_sys_perror
	b	LBB0_10
LBB0_9:
	mov	x0, x20
	bl	_CloseHandle
LBB0_10:
	mov	w21, #0
LBB0_11:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_THREAD_SUSPEND_RESUME,4,2      ; @THREAD_SUSPEND_RESUME
	.comm	_THREAD_SET_CONTEXT,4,2         ; @THREAD_SET_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_write/OpenThread"

	.comm	_R_REG_TYPE_DRX,4,2             ; @R_REG_TYPE_DRX
.subsections_via_symbols
