	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cloudabi32_thread_setregs      ## -- Begin function cloudabi32_thread_setregs
	.p2align	4, 0x90
_cloudabi32_thread_setregs:             ## @cloudabi32_thread_setregs
	.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	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	16(%rsi), %edi
	callq	_TO_PTR
	movl	%eax, -56(%rbp)
	movq	8(%rbx), %rax
	addq	$-12, %rax
	movq	%rax, -64(%rbp)
	movl	4(%rbx), %edi
	callq	_TO_PTR
	leaq	-64(%rbp), %rcx
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_cpu_set_upcall
	movl	%r15d, -44(%rbp)
	movl	8(%r14), %eax
	movl	%eax, -40(%rbp)
	movl	(%rbx), %eax
	movl	%eax, -36(%rbp)
	movq	(%r14), %rax
	movq	(%rax), %rbx
	leaq	-44(%rbp), %rdi
	movq	%rbx, %rsi
	movl	$12, %edx
	callq	_copyout
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_cpu_set_user_tls
LBB0_2:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_4
## %bb.3:
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cloudabi32_thread_setregs      ; -- Begin function cloudabi32_thread_setregs
	.p2align	2
_cloudabi32_thread_setregs:             ; @cloudabi32_thread_setregs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldr	w0, [x1, #16]
	bl	_TO_PTR
	str	w0, [sp, #16]
	ldr	x8, [x21, #8]
	sub	x8, x8, #12
	str	x8, [sp, #8]
	ldr	w0, [x21, #4]
	bl	_TO_PTR
	mov	x1, x0
	add	x3, sp, #8
	mov	x0, x19
	mov	x2, #0
	bl	_cpu_set_upcall
	ldr	w8, [x19, #8]
	stp	w20, w8, [sp, #28]
	ldr	w8, [x21]
	str	w8, [sp, #36]
	ldr	x8, [x19]
	ldr	x20, [x8]
	add	x0, sp, #28
	mov	x1, x20
	mov	w2, #12
	bl	_copyout
	cbnz	w0, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_cpu_set_user_tls
LBB0_2:
	ldr	x8, [sp, #40]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.3:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_4:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
