	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function random_write_entropy
_random_write_entropy:                  ## @random_write_entropy
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_RANDOM_ENTROPY_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movq	_random_entropy_file@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	je	LBB0_9
## %bb.1:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_random_get_bytes
	testq	%rax, %rax
	js	LBB0_9
## %bb.2:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r14
	movq	_own_pool_ready@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	cmpl	$255, %eax
	movl	$255, %ecx
	cmovll	%eax, %ecx
	movb	%cl, -49(%rbp)
	leaq	-49(%rbp), %rdi
	movl	$1, %esi
	movl	$1, %edx
	movq	%r14, %rcx
	callq	_fwrite
	cmpl	$1, %eax
	jne	LBB0_7
## %bb.5:
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	movq	%r14, %rcx
	callq	_fwrite
	cmpl	$1, %eax
	jne	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	callq	_fclose
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12), %edx
	movl	(%rbx), %ecx
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_wpa_printf
	jmp	LBB0_9
LBB0_7:
	movq	%r14, %rdi
	callq	_fclose
	movq	_MSG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12), %edx
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_8
LBB0_3:
	movq	_MSG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
LBB0_8:
	xorl	%eax, %eax
	callq	_wpa_printf
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RANDOM_ENTROPY_SIZE,4,2        ## @RANDOM_ENTROPY_SIZE
	.comm	_random_entropy_file,4,2        ## @random_entropy_file
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wb"

	.comm	_MSG_ERROR,4,2                  ## @MSG_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"random: Could not open entropy file %s for writing"

	.comm	_own_pool_ready,4,2             ## @own_pool_ready
L_.str.2:                               ## @.str.2
	.asciz	"random: Could not write entropy data to %s"

	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
L_.str.3:                               ## @.str.3
	.asciz	"random: Updated entropy file %s (own_pool_ready=%u)"

	.no_dead_strip	_random_write_entropy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function random_write_entropy
_random_write_entropy:                  ; @random_write_entropy
	.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
	sub	sp, sp, #16
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x22, _RANDOM_ENTROPY_SIZE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _RANDOM_ENTROPY_SIZE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x9, x1
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x1, #15
	and	x9, x9, #0x1fffffff0
	sub	x19, x8, x9
	mov	sp, x19
Lloh7:
	adrp	x21, _random_entropy_file@GOTPAGE
Lloh8:
	ldr	x21, [x21, _random_entropy_file@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w8, LBB0_9
; %bb.1:
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_random_get_bytes
	tbnz	x0, #63, LBB0_9
; %bb.2:
	ldr	w0, [x21]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_7
; %bb.3:
	mov	x20, x0
Lloh11:
	adrp	x23, _own_pool_ready@GOTPAGE
Lloh12:
	ldr	x23, [x23, _own_pool_ready@GOTPAGEOFF]
	ldr	w8, [x23]
	mov	w9, #255
	cmp	w8, #255
	csel	w8, w8, w9, lt
	sturb	w8, [x29, #-57]
	sub	x0, x29, #57
	mov	w1, #1
	mov	w2, #1
	mov	x3, x20
	bl	_fwrite
	cmp	w0, #1
	b.ne	LBB0_6
; %bb.4:
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #1
	mov	x3, x20
	bl	_fwrite
	cmp	w0, #1
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_fclose
Lloh13:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ldr	w2, [x21]
	ldr	w8, [x23]
	str	x8, [sp, #-16]!
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_wpa_printf
	add	sp, sp, #16
	b	LBB0_9
LBB0_6:
	mov	x0, x20
	bl	_fclose
Lloh18:
	adrp	x8, _MSG_ERROR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MSG_ERROR@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldr	w2, [x21]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh23:
	adrp	x8, _MSG_ERROR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MSG_ERROR@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	ldr	w2, [x21]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_8:
	bl	_wpa_printf
LBB0_9:
	ldur	x8, [x29, #-56]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	sub	sp, x29, #48
	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
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_RANDOM_ENTROPY_SIZE,4,2        ; @RANDOM_ENTROPY_SIZE
	.comm	_random_entropy_file,4,2        ; @random_entropy_file
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wb"

	.comm	_MSG_ERROR,4,2                  ; @MSG_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"random: Could not open entropy file %s for writing"

	.comm	_own_pool_ready,4,2             ; @own_pool_ready
l_.str.2:                               ; @.str.2
	.asciz	"random: Could not write entropy data to %s"

	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
l_.str.3:                               ; @.str.3
	.asciz	"random: Updated entropy file %s (own_pool_ready=%u)"

	.no_dead_strip	_random_write_entropy
.subsections_via_symbols
