	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_img                       ## -- Begin function read_img
	.p2align	4, 0x90
_read_img:                              ## @read_img
	.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
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	%rax, %r14
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	%r14, %rdi
	callq	_ftell
	movq	_IMG_SIZE@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	jne	LBB0_5
## %bb.7:
	movq	%r14, %rdi
	callq	_rewind
	movl	(%r15), %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, %rbx
	movl	(%r15), %edx
	movq	%rax, %rdi
	movl	$1, %esi
	movq	%r14, %rcx
	callq	_fread
	cmpl	(%r15), %eax
	jne	LBB0_10
## %bb.11:
	movq	%r14, %rdi
	callq	_fclose
	movq	%rbx, %rax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	callq	_read_img.cold.1
	jmp	LBB0_2
LBB0_8:
	movq	%r14, %rdi
	callq	_read_img.cold.2
LBB0_2:
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_5:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_app_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_6
LBB0_10:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_app_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str.2(%rip), %rsi
LBB0_6:
	callq	_fprintf
	movq	%r14, %rdi
	callq	_fclose
	movl	$-1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function read_img.cold.1
_read_img.cold.1:                       ## @read_img.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_app_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_perror
	pushq	$-1
	popq	%rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function read_img.cold.2
_read_img.cold.2:                       ## @read_img.cold.2
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_app_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_perror
	movq	%rbx, %rdi
	callq	_fclose
	pushq	$-1
	popq	%rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rb"

	.comm	_app_name,8,3                   ## @app_name
	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_IMG_SIZE,4,2                   ## @IMG_SIZE
	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"%s: image file has wrong size\n"

L_.str.2:                               ## @.str.2
	.asciz	"%s: can't read image file\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_img                       ; -- Begin function read_img
	.p2align	2
_read_img:                              ; @read_img
	.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
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
Lloh2:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_fseek
	mov	x0, x19
	bl	_ftell
Lloh5:
	adrp	x21, _IMG_SIZE@GOTPAGE
Lloh6:
	ldr	x21, [x21, _IMG_SIZE@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_6
; %bb.2:
	mov	x0, x19
	bl	_rewind
	ldr	w0, [x21]
	bl	_malloc
	cbz	x0, LBB0_7
; %bb.3:
	mov	x20, x0
	ldr	w2, [x21]
	mov	w1, #1
	mov	x3, x19
	bl	_fread
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_8
; %bb.4:
	mov	x0, x19
	bl	_fclose
	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
LBB0_5:
	bl	_read_img.cold.1
LBB0_6:
Lloh7:
	adrp	x8, _stderr@GOTPAGE
Lloh8:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x8, _app_name@GOTPAGE
Lloh11:
	ldr	x8, [x8, _app_name@GOTPAGEOFF]
Lloh12:
	ldr	x2, [x8]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_7:
	mov	x0, x19
	bl	_read_img.cold.2
LBB0_8:
Lloh15:
	adrp	x8, _stderr@GOTPAGE
Lloh16:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
Lloh18:
	adrp	x8, _app_name@GOTPAGE
Lloh19:
	ldr	x8, [x8, _app_name@GOTPAGEOFF]
Lloh20:
	ldr	x2, [x8]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	bl	_fprintf
	mov	x0, x19
	bl	_fclose
	mov	w0, #-1
	bl	_exit
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function read_img.cold.1
_read_img.cold.1:                       ; @read_img.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh23:
	adrp	x8, _app_name@GOTPAGE
Lloh24:
	ldr	x8, [x8, _app_name@GOTPAGEOFF]
Lloh25:
	ldr	x0, [x8]
	bl	_perror
	mov	w0, #-1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function read_img.cold.2
_read_img.cold.2:                       ; @read_img.cold.2
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh26:
	adrp	x8, _app_name@GOTPAGE
Lloh27:
	ldr	x8, [x8, _app_name@GOTPAGEOFF]
Lloh28:
	ldr	x0, [x8]
	bl	_perror
	mov	x0, x19
	bl	_fclose
	mov	w0, #-1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rb"

	.comm	_app_name,8,3                   ; @app_name
	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_IMG_SIZE,4,2                   ; @IMG_SIZE
	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"%s: image file has wrong size\n"

l_.str.2:                               ; @.str.2
	.asciz	"%s: can't read image file\n"

.subsections_via_symbols
