	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_entropy
_read_entropy:                          ## @read_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	_O_RDONLY@GOTPCREL(%rip), %r12
	movq	_O_CLOEXEC@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	orl	(%r12), %esi
	leaq	L_.str(%rip), %rdi
	callq	_open
	movl	%eax, %ebx
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.1:
	movl	(%r13), %esi
	orl	(%r12), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_open
	movl	%eax, %ebx
	cmpl	$-1, %eax
	je	LBB0_2
LBB0_4:
	testq	%r14, %r14
	je	LBB0_11
## %bb.5:
	movq	_errno@GOTPCREL(%rip), %r12
	movq	_EINTR@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_read
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r13), %rcx
	cmpq	%rcx, (%r12)
	je	LBB0_6
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	%eax, %eax
	leaq	(%r15,%rax,4), %r15
	subq	%rax, %r14
	jne	LBB0_6
LBB0_11:
	movl	%ebx, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_close                          ## TAILCALL
LBB0_9:
	callq	_read_entropy.cold.2
	jmp	LBB0_3
LBB0_2:
	callq	_read_entropy.cold.1
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function read_entropy.cold.1
_read_entropy.cold.1:                   ## @read_entropy.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str.2(%rip), %rdi
	callq	_perror
	xorl	%eax, %eax
	callq	_abort
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function read_entropy.cold.2
_read_entropy.cold.2:                   ## @read_entropy.cold.2
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str.3(%rip), %rdi
	callq	_perror
	xorl	%eax, %eax
	callq	_abort
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/urandom"

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_CLOEXEC,4,2                  ## @O_CLOEXEC
L_.str.1:                               ## @.str.1
	.asciz	"/dev/random"

L_.str.2:                               ## @.str.2
	.asciz	"ptls_minicrypto_random_bytes: could not open neither /dev/random or /dev/urandom"

	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
L_.str.3:                               ## @.str.3
	.asciz	"ptls_minicrypto_random_bytes"

	.no_dead_strip	_read_entropy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_entropy
_read_entropy:                          ; @read_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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x22, [x22, _O_RDONLY@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh2:
	adrp	x23, _O_CLOEXEC@GOTPAGE
Lloh3:
	ldr	x23, [x23, _O_CLOEXEC@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w1, w9, w8
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_open
	mov	x21, x0
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x22]
	ldr	w9, [x23]
	orr	w1, w9, w8
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_open
	mov	x21, x0
	cmn	w0, #1
	b.eq	LBB0_10
LBB0_2:
	cbz	x19, LBB0_8
; %bb.3:
Lloh8:
	adrp	x22, _errno@GOTPAGE
Lloh9:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
Lloh10:
	adrp	x23, _EINTR@GOTPAGE
Lloh11:
	ldr	x23, [x23, _EINTR@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_read
	cmn	w0, #1
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x22]
	ldr	x9, [x23]
	cmp	x8, x9
	b.eq	LBB0_4
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	tbnz	w0, #31, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x20, x20, w0, uxtw #2
	subs	x19, x19, w0, uxtw
	b.ne	LBB0_4
LBB0_8:
	mov	x0, x21
	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
	b	_close
LBB0_9:
	bl	_read_entropy.cold.2
LBB0_10:
	bl	_read_entropy.cold.1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function read_entropy.cold.1
_read_entropy.cold.1:                   ; @read_entropy.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_perror
	bl	_abort
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function read_entropy.cold.2
_read_entropy.cold.2:                   ; @read_entropy.cold.2
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_perror
	bl	_abort
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/urandom"

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_CLOEXEC,4,2                  ; @O_CLOEXEC
l_.str.1:                               ; @.str.1
	.asciz	"/dev/random"

l_.str.2:                               ; @.str.2
	.asciz	"ptls_minicrypto_random_bytes: could not open neither /dev/random or /dev/urandom"

	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
l_.str.3:                               ; @.str.3
	.asciz	"ptls_minicrypto_random_bytes"

	.no_dead_strip	_read_entropy
.subsections_via_symbols
