	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_RAND_write_file                ## -- Begin function RAND_write_file
	.p2align	4, 0x90
_RAND_write_file:                       ## @RAND_write_file
	.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	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_RAND_BUF_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	leaq	-56(%rbp), %rsi
	movq	%r15, %rdi
	callq	_stat
	testq	%rax, %rax
	js	LBB0_3
## %bb.1:
	movl	-56(%rbp), %edi
	callq	_S_ISREG
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_RAND_priv_bytes
	movl	$-1, %ebx
	cmpl	$1, %eax
	jne	LBB0_7
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_openssl_fopen
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r12
	movq	%r15, %rdi
	movl	$384, %esi                      ## imm = 0x180
	callq	_chmod
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r12, %rcx
	callq	_fwrite
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_fclose
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_OPENSSL_cleanse
	jmp	LBB0_7
LBB0_2:
	movq	_RAND_F_RAND_WRITE_FILE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_RAND_R_NOT_A_REGULAR_FILE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_RANDerr
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	movq	%r15, %rdx
	callq	_ERR_add_error_data
	movl	$-1, %ebx
	jmp	LBB0_7
LBB0_5:
	movq	_RAND_F_RAND_WRITE_FILE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_RAND_R_CANNOT_OPEN_FILE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_RANDerr
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	movq	%r15, %rdx
	callq	_ERR_add_error_data
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RAND_BUF_SIZE,4,2              ## @RAND_BUF_SIZE
	.comm	_RAND_F_RAND_WRITE_FILE,4,2     ## @RAND_F_RAND_WRITE_FILE
	.comm	_RAND_R_NOT_A_REGULAR_FILE,4,2  ## @RAND_R_NOT_A_REGULAR_FILE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Filename="

L_.str.1:                               ## @.str.1
	.asciz	"wb"

	.comm	_RAND_R_CANNOT_OPEN_FILE,4,2    ## @RAND_R_CANNOT_OPEN_FILE
	.comm	_O_BINARY,4,2                   ## @O_BINARY
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_RAND_write_file                ; -- Begin function RAND_write_file
	.p2align	2
_RAND_write_file:                       ; @RAND_write_file
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x22, _RAND_BUF_SIZE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _RAND_BUF_SIZE@GOTPAGEOFF]
	ldr	w21, [x22]
	mov	x9, x21
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x21, #15
	and	x9, x9, #0x1fffffff0
	sub	x20, x8, x9
	mov	sp, x20
	sub	x1, x29, #48
	bl	_stat
	tbnz	x0, #63, LBB0_2
; %bb.1:
	ldur	w0, [x29, #-48]
	bl	_S_ISREG
	cbz	w0, LBB0_5
LBB0_2:
	mov	x0, x20
	mov	x1, x21
	bl	_RAND_priv_bytes
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.3:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_openssl_fopen
	cbz	x0, LBB0_6
; %bb.4:
	mov	x21, x0
	mov	x0, x19
	mov	w1, #384
	bl	_chmod
	ldr	w2, [x22]
	mov	x0, x20
	mov	w1, #1
	mov	x3, x21
	bl	_fwrite
	mov	x19, x0
	mov	x0, x21
	bl	_fclose
	ldr	w1, [x22]
	mov	x0, x20
	bl	_OPENSSL_cleanse
	b	LBB0_9
LBB0_5:
Lloh9:
	adrp	x8, _RAND_F_RAND_WRITE_FILE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RAND_F_RAND_WRITE_FILE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x8, _RAND_R_NOT_A_REGULAR_FILE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RAND_R_NOT_A_REGULAR_FILE@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh14:
	adrp	x8, _RAND_F_RAND_WRITE_FILE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RAND_F_RAND_WRITE_FILE@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x8, _RAND_R_CANNOT_OPEN_FILE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _RAND_R_CANNOT_OPEN_FILE@GOTPAGEOFF]
LBB0_7:
	ldr	w1, [x8]
	bl	_RANDerr
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	mov	x2, x19
	bl	_ERR_add_error_data
LBB0_8:
	mov	w19, #-1
LBB0_9:
	ldur	x8, [x29, #-40]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x19
	sub	sp, x29, #32
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_RAND_BUF_SIZE,4,2              ; @RAND_BUF_SIZE
	.comm	_RAND_F_RAND_WRITE_FILE,4,2     ; @RAND_F_RAND_WRITE_FILE
	.comm	_RAND_R_NOT_A_REGULAR_FILE,4,2  ; @RAND_R_NOT_A_REGULAR_FILE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Filename="

l_.str.1:                               ; @.str.1
	.asciz	"wb"

	.comm	_RAND_R_CANNOT_OPEN_FILE,4,2    ; @RAND_R_CANNOT_OPEN_FILE
	.comm	_O_BINARY,4,2                   ; @O_BINARY
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
.subsections_via_symbols
