	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sys_write                      ## -- Begin function sys_write
	.p2align	4, 0x90
_sys_write:                             ## @sys_write
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %ebx
	movl	%edi, %r15d
	leal	1(%r14), %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r12
	movl	%ebx, %edi
	movq	%rax, %rsi
	movl	%r14d, %edx
	callq	_user_read
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	__EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_3:
	movq	__ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_10
LBB0_4:
	movslq	%r14d, %rax
	movb	$0, (%r12,%rax)
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	movq	%r12, %rdx
	movl	%r14d, %ecx
	callq	_STRACE
	movl	%r15d, %edi
	callq	_f_get
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	(%rax), %rcx
	movq	(%rcx), %rcx
	testq	%rcx, %rcx
	je	LBB0_7
## %bb.6:
	movq	%rax, %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	*%rcx
	movl	%eax, %ebx
	jmp	LBB0_9
LBB0_7:
	movq	__EBADF@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %ebx
LBB0_9:
	movq	%r12, %rdi
	callq	_free
LBB0_10:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	__ENOMEM,4,2                    ## @_ENOMEM
	.comm	__EFAULT,4,2                    ## @_EFAULT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write(%d, \"%.100s\", %d)"

	.comm	__EBADF,4,2                     ## @_EBADF
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sys_write                      ; -- Begin function sys_write
	.p2align	2
_sys_write:                             ; @sys_write
	.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
	mov	x20, x2
	mov	x22, x1
	mov	x21, x0
	add	w0, w2, #1
	bl	_malloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	mov	x0, x22
	mov	x1, x19
	mov	x2, x20
	bl	_user_read
	cbz	x0, LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, __EFAULT@GOTPAGE
Lloh1:
	ldr	x8, [x8, __EFAULT@GOTPAGEOFF]
	b	LBB0_8
LBB0_3:
Lloh2:
	adrp	x8, __ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, __ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w20, [x8]
	b	LBB0_10
LBB0_4:
	strb	wzr, [x19, w20, sxtw]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x19
	mov	x3, x20
	bl	_STRACE
	mov	x0, x21
	bl	_f_get
	cbz	x0, LBB0_7
; %bb.5:
	ldr	x8, [x0]
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:
	mov	x1, x19
	mov	x2, x20
	blr	x8
	mov	x20, x0
	b	LBB0_9
LBB0_7:
Lloh7:
	adrp	x8, __EBADF@GOTPAGE
Lloh8:
	ldr	x8, [x8, __EBADF@GOTPAGEOFF]
LBB0_8:
	ldr	w20, [x8]
LBB0_9:
	mov	x0, x19
	bl	_free
LBB0_10:
	mov	x0, x20
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	__ENOMEM,4,2                    ; @_ENOMEM
	.comm	__EFAULT,4,2                    ; @_EFAULT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write(%d, \"%.100s\", %d)"

	.comm	__EBADF,4,2                     ; @_EBADF
.subsections_via_symbols
