	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function test_atomic_uint32
_test_atomic_uint32:                    ## @test_atomic_uint32
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	leaq	-40(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_pg_atomic_init_u32
	movq	%r14, %rdi
	callq	_pg_atomic_read_u32
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_EXPECT_EQ_U32
	movq	%r14, %rdi
	movl	$3, %esi
	callq	_pg_atomic_write_u32
	movq	%r14, %rdi
	callq	_pg_atomic_read_u32
	movl	%eax, %edi
	movl	$3, %esi
	callq	_EXPECT_EQ_U32
	movq	%r14, %rdi
	callq	_pg_atomic_read_u32
                                        ## kill: def $eax killed $eax def $rax
	leal	-2(%rax), %esi
	movq	%r14, %rdi
	callq	_pg_atomic_fetch_add_u32
	movl	%eax, %edi
	movl	$3, %esi
	callq	_EXPECT_EQ_U32
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_pg_atomic_fetch_sub_u32
	movl	%eax, %edi
	movl	$4, %esi
	callq	_EXPECT_EQ_U32
	movq	%r14, %rdi
	movl	$3, %esi
	callq	_pg_atomic_sub_fetch_u32
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_EXPECT_EQ_U32
	movq	%r14, %rdi
	movl	$10, %esi
	callq	_pg_atomic_add_fetch_u32
	movl	%eax, %edi
	movl	$10, %esi
	callq	_EXPECT_EQ_U32
	movq	%r14, %rdi
	movl	$5, %esi
	callq	_pg_atomic_exchange_u32
	movl	%eax, %edi
	movl	$10, %esi
	callq	_EXPECT_EQ_U32
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_pg_atomic_exchange_u32
	movl	%eax, %edi
	movl	$5, %esi
	callq	_EXPECT_EQ_U32
	movq	_INT_MAX@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_pg_atomic_fetch_add_u32
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_EXPECT_EQ_U32
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_pg_atomic_fetch_add_u32
	movl	(%r15), %esi
	movl	%eax, %edi
	callq	_EXPECT_EQ_U32
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_pg_atomic_fetch_add_u32
	movq	_PG_INT16_MAX@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_pg_atomic_fetch_add_u32
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_EXPECT_EQ_U32
	movl	(%rbx), %esi
	incl	%esi
	movq	%r14, %rdi
	callq	_pg_atomic_fetch_add_u32
	movl	(%rbx), %esi
	movl	%eax, %edi
	callq	_EXPECT_EQ_U32
	movq	_PG_INT16_MIN@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_pg_atomic_fetch_add_u32
	movl	(%rbx), %ecx
	leal	(%rcx,%rcx), %esi
	incl	%esi
	movl	%eax, %edi
	callq	_EXPECT_EQ_U32
	movl	(%r12), %esi
	decl	%esi
	movq	%r14, %rdi
	callq	_pg_atomic_fetch_add_u32
	movl	(%rbx), %esi
	movl	%eax, %edi
	callq	_EXPECT_EQ_U32
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_pg_atomic_fetch_add_u32
	movq	%r14, %rdi
	callq	_pg_atomic_read_u32
	movq	_UINT_MAX@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	%eax, %edi
	callq	_EXPECT_EQ_U32
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_pg_atomic_fetch_sub_u32
	movl	(%rbx), %esi
	movl	%eax, %edi
	callq	_EXPECT_EQ_U32
	movq	%r14, %rdi
	callq	_pg_atomic_read_u32
	movl	(%r15), %esi
	incl	%esi
	movl	%eax, %edi
	callq	_EXPECT_EQ_U32
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_pg_atomic_sub_fetch_u32
	movl	%eax, %edi
	movl	$1, %esi
	callq	_EXPECT_EQ_U32
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_pg_atomic_sub_fetch_u32
	movl	$10, -36(%rbp)
	leaq	-36(%rbp), %r15
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	_pg_atomic_compare_exchange_u32
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_EXPECT_TRUE
	movl	$1000, %ebx                     ## imm = 0x3E8
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, -36(%rbp)
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	_pg_atomic_compare_exchange_u32
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	decl	%ebx
	jne	LBB0_1
## %bb.3:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_4:
	leaq	-40(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_pg_atomic_read_u32
	movl	%eax, %edi
	movl	$1, %esi
	callq	_EXPECT_EQ_U32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_pg_atomic_write_u32
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_pg_atomic_fetch_or_u32
	notl	%eax
	andl	$1, %eax
	movl	%eax, %edi
	callq	_EXPECT_TRUE
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_pg_atomic_fetch_or_u32
	andl	$1, %eax
	movl	%eax, %edi
	callq	_EXPECT_TRUE
	movq	%rbx, %rdi
	callq	_pg_atomic_read_u32
	movl	%eax, %edi
	movl	$3, %esi
	callq	_EXPECT_EQ_U32
	movq	%rbx, %rdi
	movl	$-3, %esi
	callq	_pg_atomic_fetch_and_u32
	andl	$3, %eax
	movl	%eax, %edi
	movl	$3, %esi
	callq	_EXPECT_EQ_U32
	movq	%rbx, %rdi
	movl	$-2, %esi
	callq	_pg_atomic_fetch_and_u32
	movl	%eax, %edi
	movl	$1, %esi
	callq	_EXPECT_EQ_U32
	movq	%rbx, %rdi
	movl	$-1, %esi
	callq	_pg_atomic_fetch_and_u32
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_EXPECT_EQ_U32
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_PG_INT16_MAX,4,2               ## @PG_INT16_MAX
	.comm	_PG_INT16_MIN,4,2               ## @PG_INT16_MIN
	.comm	_UINT_MAX,4,2                   ## @UINT_MAX
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"atomic_compare_exchange_u32() never succeeded"

	.no_dead_strip	_test_atomic_uint32
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function test_atomic_uint32
_test_atomic_uint32:                    ; @test_atomic_uint32
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	add	x0, sp, #12
	mov	w1, #0
	bl	_pg_atomic_init_u32
	add	x0, sp, #12
	bl	_pg_atomic_read_u32
	mov	w1, #0
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	mov	w1, #3
	bl	_pg_atomic_write_u32
	add	x0, sp, #12
	bl	_pg_atomic_read_u32
	mov	w1, #3
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	bl	_pg_atomic_read_u32
	sub	w1, w0, #2
	add	x0, sp, #12
	bl	_pg_atomic_fetch_add_u32
	mov	w1, #3
	bl	_EXPECT_EQ_U32
	mov	w19, #1
	add	x0, sp, #12
	mov	w1, #1
	bl	_pg_atomic_fetch_sub_u32
	mov	w1, #4
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	mov	w1, #3
	bl	_pg_atomic_sub_fetch_u32
	mov	w1, #0
	bl	_EXPECT_EQ_U32
	mov	w20, #10
	add	x0, sp, #12
	mov	w1, #10
	bl	_pg_atomic_add_fetch_u32
	mov	w1, #10
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	mov	w1, #5
	bl	_pg_atomic_exchange_u32
	mov	w1, #10
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	mov	w1, #0
	bl	_pg_atomic_exchange_u32
	mov	w1, #5
	bl	_EXPECT_EQ_U32
Lloh0:
	adrp	x21, _INT_MAX@GOTPAGE
Lloh1:
	ldr	x21, [x21, _INT_MAX@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x0, sp, #12
	bl	_pg_atomic_fetch_add_u32
	mov	w1, #0
	bl	_EXPECT_EQ_U32
	ldr	w1, [x21]
	add	x0, sp, #12
	bl	_pg_atomic_fetch_add_u32
	ldr	w1, [x21]
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	mov	w1, #2
	bl	_pg_atomic_fetch_add_u32
Lloh2:
	adrp	x22, _PG_INT16_MAX@GOTPAGE
Lloh3:
	ldr	x22, [x22, _PG_INT16_MAX@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x0, sp, #12
	bl	_pg_atomic_fetch_add_u32
	mov	w1, #0
	bl	_EXPECT_EQ_U32
	ldr	w8, [x22]
	add	w1, w8, #1
	add	x0, sp, #12
	bl	_pg_atomic_fetch_add_u32
	ldr	w1, [x22]
	bl	_EXPECT_EQ_U32
Lloh4:
	adrp	x23, _PG_INT16_MIN@GOTPAGE
Lloh5:
	ldr	x23, [x23, _PG_INT16_MIN@GOTPAGEOFF]
	ldr	w1, [x23]
	add	x0, sp, #12
	bl	_pg_atomic_fetch_add_u32
	ldr	w8, [x22]
	bfi	w19, w8, #1, #31
	mov	x1, x19
	bl	_EXPECT_EQ_U32
	ldr	w8, [x23]
	sub	w1, w8, #1
	add	x0, sp, #12
	bl	_pg_atomic_fetch_add_u32
	ldr	w1, [x22]
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	mov	w1, #1
	bl	_pg_atomic_fetch_add_u32
	add	x0, sp, #12
	bl	_pg_atomic_read_u32
Lloh6:
	adrp	x19, _UINT_MAX@GOTPAGE
Lloh7:
	ldr	x19, [x19, _UINT_MAX@GOTPAGEOFF]
	ldr	w1, [x19]
	bl	_EXPECT_EQ_U32
	ldr	w1, [x21]
	add	x0, sp, #12
	bl	_pg_atomic_fetch_sub_u32
	ldr	w1, [x19]
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	bl	_pg_atomic_read_u32
	ldr	w8, [x21]
	add	w1, w8, #1
	bl	_EXPECT_EQ_U32
	ldr	w1, [x21]
	add	x0, sp, #12
	bl	_pg_atomic_sub_fetch_u32
	mov	w1, #1
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	mov	w1, #1
	bl	_pg_atomic_sub_fetch_u32
	str	w20, [sp, #8]
	add	x0, sp, #12
	add	x1, sp, #8
	mov	w2, #1
	bl	_pg_atomic_compare_exchange_u32
	cmp	w0, #0
	cset	w0, eq
	bl	_EXPECT_TRUE
	mov	w19, #1000
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	str	wzr, [sp, #8]
	add	x0, sp, #12
	add	x1, sp, #8
	mov	w2, #1
	bl	_pg_atomic_compare_exchange_u32
	cbz	w0, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	subs	w19, w19, #1
	b.ne	LBB0_1
; %bb.3:
Lloh8:
	adrp	x8, _ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_4:
	add	x0, sp, #12
	bl	_pg_atomic_read_u32
	mov	w1, #1
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	mov	w1, #0
	bl	_pg_atomic_write_u32
	add	x0, sp, #12
	mov	w1, #1
	bl	_pg_atomic_fetch_or_u32
	mvn	w8, w0
	and	w0, w8, #0x1
	bl	_EXPECT_TRUE
	add	x0, sp, #12
	mov	w1, #2
	bl	_pg_atomic_fetch_or_u32
	and	w0, w0, #0x1
	bl	_EXPECT_TRUE
	add	x0, sp, #12
	bl	_pg_atomic_read_u32
	mov	w1, #3
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	mov	w1, #-3
	bl	_pg_atomic_fetch_and_u32
	and	w0, w0, #0x3
	mov	w1, #3
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	mov	w1, #-2
	bl	_pg_atomic_fetch_and_u32
	mov	w1, #1
	bl	_EXPECT_EQ_U32
	add	x0, sp, #12
	mov	w1, #-1
	bl	_pg_atomic_fetch_and_u32
	mov	w1, #0
	bl	_EXPECT_EQ_U32
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_PG_INT16_MAX,4,2               ; @PG_INT16_MAX
	.comm	_PG_INT16_MIN,4,2               ; @PG_INT16_MIN
	.comm	_UINT_MAX,4,2                   ; @UINT_MAX
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"atomic_compare_exchange_u32() never succeeded"

	.no_dead_strip	_test_atomic_uint32
.subsections_via_symbols
