	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function swapfunc
_swapfunc:                              ## @swapfunc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	xorl	%eax, %eax
	callq	__lwp_getprivate
	movq	_ntls@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printf
	movq	_alter_tlsbase@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movl	(%rbx), %edi
	movq	_val1@GOTPCREL(%rip), %rsi
	cmoveq	_val2@GOTPCREL(%rip), %rsi
	leaq	L_str(%rip), %rax
	leaq	L_str.3(%rip), %rbx
	cmoveq	%rax, %rbx
	callq	_ATF_REQUIRE_EQ
	movq	%rbx, %rdi
	callq	_puts
	movq	_nctx@GOTPCREL(%rip), %rdi
	movq	_octx@GOTPCREL(%rip), %rsi
	callq	_swapcontext
	movl	%eax, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_ATF_REQUIRE                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ntls,4,2                       ## @ntls
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"after swapcontext TLS pointer = %p\n"

	.comm	_alter_tlsbase,8,3              ## @alter_tlsbase
	.comm	_val1,4,2                       ## @val1
	.comm	_val2,4,2                       ## @val2
	.comm	_nctx,4,2                       ## @nctx
	.comm	_octx,4,2                       ## @octx
L_str:                                  ## @str
	.asciz	"TLS pointer left untouched by swapcontext()"

L_str.3:                                ## @str.3
	.asciz	"TLS pointer modified by swapcontext()"

	.no_dead_strip	_swapfunc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function swapfunc
_swapfunc:                              ; @swapfunc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	__lwp_getprivate
                                        ; kill: def $w0 killed $w0 def $x0
Lloh0:
	adrp	x19, _ntls@GOTPAGE
Lloh1:
	ldr	x19, [x19, _ntls@GOTPAGEOFF]
	str	w0, [x19]
	str	x0, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
Lloh4:
	adrp	x8, _alter_tlsbase@GOTPAGE
Lloh5:
	ldr	x8, [x8, _alter_tlsbase@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	ldr	w0, [x19]
Lloh7:
	adrp	x9, _val1@GOTPAGE
Lloh8:
	ldr	x9, [x9, _val1@GOTPAGEOFF]
Lloh9:
	adrp	x10, _val2@GOTPAGE
Lloh10:
	ldr	x10, [x10, _val2@GOTPAGEOFF]
	cmp	x8, #0
	csel	x1, x10, x9, eq
Lloh11:
	adrp	x8, l_str.3@PAGE
Lloh12:
	add	x8, x8, l_str.3@PAGEOFF
Lloh13:
	adrp	x9, l_str@PAGE
Lloh14:
	add	x9, x9, l_str@PAGEOFF
	csel	x19, x9, x8, eq
	bl	_ATF_REQUIRE_EQ
	mov	x0, x19
	bl	_puts
Lloh15:
	adrp	x0, _nctx@GOTPAGE
Lloh16:
	ldr	x0, [x0, _nctx@GOTPAGEOFF]
Lloh17:
	adrp	x1, _octx@GOTPAGE
Lloh18:
	ldr	x1, [x1, _octx@GOTPAGEOFF]
	bl	_swapcontext
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_ATF_REQUIRE
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_ntls,4,2                       ; @ntls
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"after swapcontext TLS pointer = %p\n"

	.comm	_alter_tlsbase,8,3              ; @alter_tlsbase
	.comm	_val1,4,2                       ; @val1
	.comm	_val2,4,2                       ; @val2
	.comm	_nctx,4,2                       ; @nctx
	.comm	_octx,4,2                       ; @octx
l_str:                                  ; @str
	.asciz	"TLS pointer left untouched by swapcontext()"

l_str.3:                                ; @str.3
	.asciz	"TLS pointer modified by swapcontext()"

	.no_dead_strip	_swapfunc
.subsections_via_symbols
