	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_save_prga                      ## -- Begin function save_prga
	.p2align	4, 0x90
_save_prga:                             ## @save_prga
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	12(%rdi), %edi
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	$420, %edx                      ## imm = 0x1A4
	callq	_open
	movl	%eax, %r14d
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	movl	8(%rbx), %esi
	movl	%r14d, %edi
	movl	$3, %edx
	callq	_write
	cmpl	$3, %eax
	jne	LBB0_3
## %bb.6:
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	movl	%r14d, %edi
	callq	_write
	movl	%eax, %r15d
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_8:
	movl	(%rbx), %edx
	cmpl	%edx, %r15d
	jne	LBB0_9
## %bb.10:
	movl	%r14d, %edi
	callq	_close
	movl	(%rbx), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_printf                         ## TAILCALL
LBB0_3:
	cmpl	$-1, %eax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_5:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	$1, %edi
	callq	_exit
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_printf
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"open()"

L_.str.1:                               ## @.str.1
	.asciz	"write()"

L_.str.3:                               ## @.str.3
	.asciz	"Wrote %d/%d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Got %d bytes of PRGA\n"

L_str:                                  ## @str
	.asciz	"Short write"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_save_prga                      ; -- Begin function save_prga
	.p2align	2
_save_prga:                             ; @save_prga
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _O_WRONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
	ldr	w0, [x0, #12]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	w2, #420
	bl	_open
	mov	x20, x0
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	ldr	w1, [x19, #8]
	mov	x0, x20
	mov	w2, #3
	bl	_write
	cmp	w0, #3
	b.ne	LBB0_7
; %bb.3:
	ldp	w2, w1, [x19]
	mov	x0, x20
	bl	_write
	mov	x21, x0
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.4:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_5:
	ldr	w8, [x19]
	cmp	w21, w8
	b.ne	LBB0_10
; %bb.6:
	mov	x0, x20
	bl	_close
	ldr	w8, [x19]
	str	x8, [sp]
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
	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
LBB0_7:
	cmn	w0, #1
	b.ne	LBB0_9
; %bb.8:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_9:
Lloh14:
	adrp	x0, l_str@PAGE
Lloh15:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w0, #1
	bl	_exit
LBB0_10:
	stp	x21, x8, [sp]
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open()"

l_.str.1:                               ; @.str.1
	.asciz	"write()"

l_.str.3:                               ; @.str.3
	.asciz	"Wrote %d/%d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Got %d bytes of PRGA\n"

l_str:                                  ; @str
	.asciz	"Short write"

.subsections_via_symbols
