	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_random_work                    ## -- Begin function random_work
	.p2align	4, 0x90
_random_work:                           ## @random_work
	.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
	movq	_qtotal@GOTPCREL(%rip), %r15
	movq	_qsize@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	cmpl	%eax, (%r15)
	jge	LBB0_5
## %bb.1:
	movl	%edi, %ebx
	testl	%edi, %edi
	jle	LBB0_5
## %bb.2:
	movq	_buffer@GOTPCREL(%rip), %r13
	movq	_qright@GOTPCREL(%rip), %r12
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_B@GOTPCREL(%rip), %rdi
	callq	_bbs_next_random_byte
	movq	(%r13), %rcx
	movq	(%r12), %rdx
	movl	%eax, (%rcx,%rdx,4)
	incq	%rdx
	movq	_qsize@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rdx
	cmoveq	%r14, %rdx
	movq	%rdx, (%r12)
	movl	(%r15), %ecx
	incl	%ecx
	movl	%ecx, (%r15)
	decl	%eax
	cmpl	%eax, %ecx
	jge	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leal	-1(%rbx), %eax
	cmpl	$1, %ebx
	movl	%eax, %ebx
	ja	LBB0_3
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_qtotal,4,2                     ## @qtotal
	.comm	_qsize,4,2                      ## @qsize
	.comm	_B,4,2                          ## @B
	.comm	_buffer,8,3                     ## @buffer
	.comm	_qright,8,3                     ## @qright
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_random_work                    ; -- Begin function random_work
	.p2align	2
_random_work:                           ; @random_work
	.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
Lloh0:
	adrp	x21, _qtotal@GOTPAGE
Lloh1:
	ldr	x21, [x21, _qtotal@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh2:
	adrp	x22, _qsize@GOTPAGE
Lloh3:
	ldr	x22, [x22, _qsize@GOTPAGEOFF]
	ldr	w9, [x22]
	sub	w9, w9, #1
	cmp	w8, w9
	ccmp	w0, #1, #8, lt
	b.lt	LBB0_3
; %bb.1:
	mov	x19, x0
Lloh4:
	adrp	x20, _B@GOTPAGE
Lloh5:
	ldr	x20, [x20, _B@GOTPAGEOFF]
Lloh6:
	adrp	x23, _buffer@GOTPAGE
Lloh7:
	ldr	x23, [x23, _buffer@GOTPAGEOFF]
Lloh8:
	adrp	x24, _qright@GOTPAGE
Lloh9:
	ldr	x24, [x24, _qright@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_bbs_next_random_byte
	ldr	x8, [x23]
	ldr	x9, [x24]
	str	w0, [x8, x9, lsl #2]
	add	x8, x9, #1
	ldrsw	x10, [x22]
	cmp	x8, x10
	csinc	x8, xzr, x9, eq
	str	x8, [x24]
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
	sub	w9, w10, #1
	cmp	w8, w9
	ccmp	w19, #1, #0, lt
	sub	w19, w19, #1
	b.hi	LBB0_2
LBB0_3:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_qtotal,4,2                     ; @qtotal
	.comm	_qsize,4,2                      ; @qsize
	.comm	_B,4,2                          ; @B
	.comm	_buffer,8,3                     ; @buffer
	.comm	_qright,8,3                     ; @qright
.subsections_via_symbols
