	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_load_prga                      ## -- Begin function load_prga
	.p2align	4, 0x90
_load_prga:                             ## @load_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
	movq	(%rdi), %rdi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_open
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.1:
	movl	%eax, %r14d
	movl	16(%rbx), %esi
	movl	%eax, %edi
	movl	$3, %edx
	callq	_read
	cmpl	$3, %eax
	jne	LBB0_2
## %bb.5:
	movl	12(%rbx), %esi
	movl	%r14d, %edi
	movl	$4, %edx
	callq	_read
	movl	%eax, %r15d
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_7:
	movl	%r15d, 8(%rbx)
	movq	(%rbx), %rdx
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_printf
	movl	%r14d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_close                          ## TAILCALL
LBB0_8:
	movl	$0, 8(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_4:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read()"

L_.str.2:                               ## @.str.2
	.asciz	"Loaded %d PRGA from %s\n"

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

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_load_prga                      ; -- Begin function load_prga
	.p2align	2
_load_prga:                             ; @load_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
	ldr	x0, [x0]
Lloh0:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_open
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.1:
	mov	x20, x0
	ldr	w1, [x19, #16]
	mov	w2, #3
	bl	_read
	cmp	w0, #3
	b.ne	LBB0_6
; %bb.2:
	ldr	w1, [x19, #12]
	mov	x0, x20
	mov	w2, #4
	bl	_read
	mov	x21, x0
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_4:
	str	w21, [x19, #8]
	ldr	x8, [x19]
	stp	x21, x8, [sp]
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf
	mov	x0, x20
	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
	b	_close
LBB0_5:
	str	wzr, [x19, #8]
	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_6:
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_8:
Lloh9:
	adrp	x0, l_str@PAGE
Lloh10:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read()"

l_.str.2:                               ; @.str.2
	.asciz	"Loaded %d PRGA from %s\n"

l_str:                                  ; @str
	.asciz	"Short read"

.subsections_via_symbols
