	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	cmpl	$5, %edi
	jne	LBB0_1
## %bb.2:
	movq	16(%rbx), %rdi
	callq	_atoi
	movl	%eax, %r15d
	movq	24(%rbx), %rdi
	callq	_atoi
	movl	%eax, %r12d
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_fopen
	movq	%rax, %rbx
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	%rbx, %rdi
	callq	_ftell
	movq	%rax, %r14
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_fseek
	leal	1(%r14), %edi
	callq	_malloc
	movq	%rax, %r13
	movq	%rax, %rdi
	movq	%r14, %rsi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	_fread
	movq	%rbx, %rdi
	callq	_fclose
	movb	$0, (%r13,%r14)
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	leal	1(%r15), %ecx
	movl	%r12d, -56(%rbp)                ## 4-byte Spill
	movl	%r12d, %r15d
	imull	%ecx, %r15d
	leal	(,%r15,4), %eax
	cltq
	cmpq	%rax, %r14
	jge	LBB0_4
## %bb.3:
	leaq	L_str(%rip), %rdi
	callq	_puts
	jmp	LBB0_11
LBB0_1:
	movq	(%rbx), %rsi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_11
LBB0_4:
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	shll	$3, %r15d
	movl	%r15d, %edi
	callq	_malloc
	movq	%rax, %rbx
	movq	%rax, %rdi
	movq	%r13, %rsi
	movl	%r15d, %edx
	callq	_memcpy
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	32(%rax), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_fopen
	movq	%rax, %r15
	leaq	L_.str.4(%rip), %rsi
	movq	%rax, %rdi
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movl	%r14d, %edx
	movl	-56(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %ecx
	callq	_fprintf
	testl	%r12d, %r12d
	jle	LBB0_10
## %bb.5:
	movslq	-60(%rbp), %rcx                 ## 4-byte Folded Reload
	movl	%r12d, %edx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movl	%r14d, %r12d
	addq	$4, %rbx
	shlq	$3, %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	incq	%r13
	addq	-56(%rbp), %rbx                 ## 8-byte Folded Reload
	cmpq	-48(%rbp), %r13                 ## 8-byte Folded Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_10
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	testl	%r14d, %r14d
	jle	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	-4(%rbx,%r14,8), %eax
	movl	(%rbx,%r14,8), %edi
	imull	%eax, %eax
	imull	%edi, %edi
	addl	%eax, %edi
	callq	_sqrt
	movl	%eax, %edi
	callq	_floor
	movzbl	%al, %edi
	movq	%r15, %rsi
	callq	_fputc
	incq	%r14
	cmpq	%r14, %r12
	jne	LBB0_8
	jmp	LBB0_9
LBB0_10:
	movq	%r15, %rdi
	callq	_fclose
LBB0_11:
	xorl	%eax, %eax
	addq	$40, %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	"usage: %s data.imv mbx mby out.pgm\n"

L_.str.1:                               ## @.str.1
	.asciz	"rb"

	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.3:                               ## @.str.3
	.asciz	"w"

L_.str.4:                               ## @.str.4
	.asciz	"P5\n%d %d\n255\n"

L_str:                                  ## @str
	.asciz	"File to short!"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	cmp	w0, #5
	b.ne	LBB0_3
; %bb.1:
	ldr	x0, [x21, #16]
	bl	_atoi
	mov	x19, x0
	ldr	x0, [x21, #24]
	bl	_atoi
	mov	x20, x0
	ldr	x0, [x21, #8]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fopen
	mov	x23, 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, x23
	bl	_ftell
	mov	x24, x0
Lloh5:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x23
	mov	w1, #0
	bl	_fseek
	add	w0, w24, #1
	bl	_malloc
	mov	x22, x0
	mov	x1, x24
	mov	w2, #1
	mov	x3, x23
	bl	_fread
	mov	x0, x23
	bl	_fclose
	strb	wzr, [x22, x24]
	add	w25, w19, #1
	mul	w8, w20, w25
	lsl	w9, w8, #2
	cmp	x24, w9, sxtw
	b.ge	LBB0_4
; %bb.2:
Lloh8:
	adrp	x0, l_str@PAGE
Lloh9:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	b	LBB0_11
LBB0_3:
	ldr	x8, [x21]
	str	x8, [sp]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	b	LBB0_11
LBB0_4:
	lsl	w24, w8, #3
	mov	x0, x24
	bl	_malloc
	mov	x23, x0
	mov	x1, x22
	mov	x2, x24
	bl	_memcpy
	ldr	x0, [x21, #32]
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fopen
	mov	x21, x0
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x19
	mov	x3, x20
	bl	_fprintf
	cmp	w20, #1
	b.lt	LBB0_10
; %bb.5:
	mov	x22, #0
	mov	w20, w20
	add	x23, x23, #4
	sbfiz	x24, x25, #3, #32
	mov	w25, w19
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x22, x22, #1
	add	x23, x23, x24
	cmp	x22, x20
	b.eq	LBB0_10
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	cmp	w19, #1
	b.lt	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x26, x25
	mov	x27, x23
LBB0_9:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	w8, w9, [x27, #-4]
	mul	w8, w8, w8
	madd	w0, w9, w9, w8
	bl	_sqrt
	bl	_floor
	mov	x1, x21
	bl	_fputc
	add	x27, x27, #8
	subs	x26, x26, #1
	b.ne	LBB0_9
	b	LBB0_6
LBB0_10:
	mov	x0, x21
	bl	_fclose
LBB0_11:
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"usage: %s data.imv mbx mby out.pgm\n"

l_.str.1:                               ; @.str.1
	.asciz	"rb"

	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.3:                               ; @.str.3
	.asciz	"w"

l_.str.4:                               ; @.str.4
	.asciz	"P5\n%d %d\n255\n"

l_str:                                  ; @str
	.asciz	"File to short!"

.subsections_via_symbols
