	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bch_get_congested              ## -- Begin function bch_get_congested
	.p2align	4, 0x90
_bch_get_congested:                     ## @bch_get_congested
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	cmpl	$0, 12(%rdi)
	jne	LBB0_2
## %bb.1:
	cmpl	$0, 8(%rbx)
	je	LBB0_7
LBB0_2:
	xorl	%eax, %eax
	callq	_local_clock_us
                                        ## kill: def $eax killed $eax def $rax
	subl	(%rbx), %eax
	cmpl	$-1023, %eax                    ## imm = 0xFC01
	jl	LBB0_7
## %bb.3:
	leal	1023(%rax), %r14d
	testl	%eax, %eax
	cmovnsl	%eax, %r14d
	sarl	$10, %r14d
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_atomic_read
	movq	%rax, %rbx
	addl	%r14d, %ebx
	js	LBB0_4
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_4:
	movq	_CONGESTED_MAX@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	testl	%ebx, %ebx
	jle	LBB0_6
## %bb.5:
	movl	%ebx, %edi
	movl	$6, %esi
	callq	_fract_exp_two
	movl	%eax, %ebx
LBB0_6:
	xorl	%eax, %eax
	callq	_get_random_u32
	movl	%eax, %edi
	callq	_hweight32
	subl	%eax, %ebx
	cmpl	$2, %ebx
	movl	$1, %eax
	cmovgel	%ebx, %eax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_CONGESTED_MAX,8,3              ## @CONGESTED_MAX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bch_get_congested              ; -- Begin function bch_get_congested
	.p2align	2
_bch_get_congested:                     ; @bch_get_congested
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0, #12]
	cbnz	w8, LBB0_2
; %bb.1:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_4
LBB0_2:
	bl	_local_clock_us
	ldr	w8, [x19]
	sub	w8, w0, w8
	cmn	w8, #1023
	b.lt	LBB0_4
; %bb.3:
	add	w9, w8, #1023
	cmp	w8, #0
	csel	w20, w9, w8, lt
	add	x0, x19, #4
	bl	_atomic_read
	adds	w8, w0, w20, asr #10
	b.mi	LBB0_6
LBB0_4:
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh0:
	adrp	x9, _CONGESTED_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CONGESTED_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w19, w8, w9
	cmp	w19, #1
	b.lt	LBB0_8
; %bb.7:
	mov	x0, x19
	mov	w1, #6
	bl	_fract_exp_two
	mov	x19, x0
LBB0_8:
	bl	_get_random_u32
	bl	_hweight32
	sub	w8, w19, w0
	cmp	w8, #1
	csinc	w0, w8, wzr, gt
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CONGESTED_MAX,8,3              ; @CONGESTED_MAX
.subsections_via_symbols
