	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_kernel_binary
_write_kernel_binary:                   ## @write_kernel_binary
	.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
	testq	%rcx, %rcx
	je	LBB0_1
## %bb.2:
	movq	%rcx, %r13
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rdx
	leaq	-44(%rbp), %rdi
	callq	_hc_fopen
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	leaq	-44(%rbp), %rdi
	callq	_hc_lockfile
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.6:
	movl	$1, %ebx
	leaq	-44(%rbp), %r14
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movq	%r14, %rcx
	callq	_hc_fwrite
	movq	%r14, %rdi
	callq	_hc_fflush
	movq	%r14, %rdi
	callq	_hc_fclose
	jmp	LBB0_7
LBB0_1:
	movl	$1, %ebx
	jmp	LBB0_7
LBB0_4:
	leaq	-44(%rbp), %rdi
	callq	_hc_fclose
LBB0_5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movq	%r15, %rdx
	movl	%eax, %ecx
	callq	_event_log_error
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wb"

L_.str.1:                               ## @.str.1
	.asciz	"%s: %s"

	.comm	_errno,4,2                      ## @errno
	.no_dead_strip	_write_kernel_binary
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_kernel_binary
_write_kernel_binary:                   ; @write_kernel_binary
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	cbz	x3, LBB0_4
; %bb.1:
	mov	x21, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	add	x0, sp, #12
	bl	_hc_fopen
	cbz	w0, LBB0_6
; %bb.2:
	add	x0, sp, #12
	bl	_hc_lockfile
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.3:
	mov	w19, #1
	add	x3, sp, #12
	mov	x0, x22
	mov	w1, #1
	mov	x2, x21
	bl	_hc_fwrite
	add	x0, sp, #12
	bl	_hc_fflush
	add	x0, sp, #12
	bl	_hc_fclose
	b	LBB0_7
LBB0_4:
	mov	w19, #1
	b	LBB0_7
LBB0_5:
	add	x0, sp, #12
	bl	_hc_fclose
LBB0_6:
Lloh2:
	adrp	x8, _errno@GOTPAGE
Lloh3:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_strerror
	mov	x3, x0
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_event_log_error
	mov	w19, #0
LBB0_7:
	mov	x0, x19
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wb"

l_.str.1:                               ; @.str.1
	.asciz	"%s: %s"

	.comm	_errno,4,2                      ; @errno
	.no_dead_strip	_write_kernel_binary
.subsections_via_symbols
