	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_readpng_init                   ## -- Begin function readpng_init
	.p2align	4, 0x90
_readpng_init:                          ## @readpng_init
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_saved_infile@GOTPCREL(%rip), %rax
	movq	%rdi, (%rax)
	leaq	_readpng_init.ppmline(%rip), %rdi
	movl	$256, %esi                      ## imm = 0x100
	movq	%rbx, %rdx
	callq	_fgets
	cmpb	$80, _readpng_init.ppmline(%rip)
	jne	LBB0_2
## %bb.1:
	cmpb	$54, _readpng_init.ppmline+1(%rip)
	jne	LBB0_2
## %bb.3:
	movq	_color_type@GOTPCREL(%rip), %rax
	movl	$2, (%rax)
	movq	_channels@GOTPCREL(%rip), %rax
	movl	$3, (%rax)
	leaq	_readpng_init.ppmline(%rip), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$256, %esi                      ## imm = 0x100
	movq	%rbx, %rdx
	callq	_fgets
	cmpb	$35, _readpng_init.ppmline(%rip)
	je	LBB0_4
## %bb.5:
	leaq	_readpng_init.ppmline(%rip), %r12
	leaq	L_.str.1(%rip), %rsi
	movq	_width@GOTPCREL(%rip), %r13
	movq	_height@GOTPCREL(%rip), %rcx
	movq	%r12, %rdi
	movq	%r13, %rdx
	xorl	%eax, %eax
	callq	_sscanf
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$256, %esi                      ## imm = 0x100
	movq	%rbx, %rdx
	callq	_fgets
	cmpb	$35, _readpng_init.ppmline(%rip)
	je	LBB0_6
## %bb.7:
	leaq	_readpng_init.ppmline(%rip), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	leaq	-44(%rbp), %rdx
	xorl	%eax, %eax
	callq	_sscanf
	movl	-44(%rbp), %edx
	cmpl	$255, %edx
	jne	LBB0_8
## %bb.9:
	movq	_bit_depth@GOTPCREL(%rip), %rax
	movl	$8, (%rax)
	movl	(%r13), %eax
	movl	%eax, (%r15)
	movq	_height@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	jmp	LBB0_10
LBB0_2:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	$1, %ebx
	jmp	LBB0_10
LBB0_8:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	$2, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_readpng_init.ppmline,256,4 ## @readpng_init.ppmline
	.comm	_saved_infile,8,3               ## @saved_infile
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ERROR:  not a PPM file\n"

	.comm	_color_type,4,2                 ## @color_type
	.comm	_channels,4,2                   ## @channels
L_.str.1:                               ## @.str.1
	.asciz	"%lu %lu"

	.comm	_width,4,2                      ## @width
	.comm	_height,4,2                     ## @height
L_.str.2:                               ## @.str.2
	.asciz	"%d"

L_.str.3:                               ## @.str.3
	.asciz	"ERROR:  maxval = %d\n"

	.comm	_bit_depth,4,2                  ## @bit_depth
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_readpng_init                   ; -- Begin function readpng_init
	.p2align	2
_readpng_init:                          ; @readpng_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _saved_infile@GOTPAGE
Lloh1:
	ldr	x8, [x8, _saved_infile@GOTPAGEOFF]
Lloh2:
	str	x0, [x8]
Lloh3:
	adrp	x22, _readpng_init.ppmline@PAGE
Lloh4:
	add	x22, x22, _readpng_init.ppmline@PAGEOFF
	mov	x0, x22
	mov	w1, #256
	mov	x2, x21
	bl	_fgets
	ldrb	w8, [x22]
	cmp	w8, #80
	b.ne	LBB0_8
; %bb.1:
	ldrb	w8, [x22, #1]
	cmp	w8, #54
	b.ne	LBB0_8
; %bb.2:
Lloh5:
	adrp	x8, _color_type@GOTPAGE
Lloh6:
	ldr	x8, [x8, _color_type@GOTPAGEOFF]
	mov	w9, #2
Lloh7:
	str	w9, [x8]
Lloh8:
	adrp	x8, _channels@GOTPAGE
Lloh9:
	ldr	x8, [x8, _channels@GOTPAGEOFF]
	mov	w9, #3
Lloh10:
	str	w9, [x8]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	w1, #256
	mov	x2, x21
	bl	_fgets
	ldrb	w8, [x22]
	cmp	w8, #35
	b.eq	LBB0_3
; %bb.4:
Lloh11:
	adrp	x24, _height@GOTPAGE
Lloh12:
	ldr	x24, [x24, _height@GOTPAGEOFF]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	str	x24, [sp]
Lloh15:
	adrp	x23, _width@GOTPAGE
Lloh16:
	ldr	x23, [x23, _width@GOTPAGEOFF]
	mov	x0, x22
	mov	x2, x23
	bl	_sscanf
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	w1, #256
	mov	x2, x21
	bl	_fgets
	ldrb	w8, [x22]
	cmp	w8, #35
	b.eq	LBB0_5
; %bb.6:
Lloh17:
	adrp	x0, _readpng_init.ppmline@PAGE
Lloh18:
	add	x0, x0, _readpng_init.ppmline@PAGEOFF
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x2, sp, #12
	bl	_sscanf
	ldr	w8, [sp, #12]
	cmp	w8, #255
	b.ne	LBB0_9
; %bb.7:
	mov	w0, #0
Lloh21:
	adrp	x8, _bit_depth@GOTPAGE
Lloh22:
	ldr	x8, [x8, _bit_depth@GOTPAGEOFF]
	mov	w9, #8
Lloh23:
	str	w9, [x8]
	ldr	w8, [x23]
	str	w8, [x20]
	ldr	w8, [x24]
	str	w8, [x19]
	b	LBB0_10
LBB0_8:
Lloh24:
	adrp	x8, _stderr@GOTPAGE
Lloh25:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
Lloh27:
	adrp	x1, l_.str@PAGE
Lloh28:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	mov	w0, #1
	b	LBB0_10
LBB0_9:
Lloh29:
	adrp	x9, _stderr@GOTPAGE
Lloh30:
	ldr	x9, [x9, _stderr@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x9]
	str	x8, [sp]
Lloh32:
	adrp	x1, l_.str.3@PAGE
Lloh33:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fprintf
	mov	w0, #2
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_readpng_init.ppmline,256,0 ; @readpng_init.ppmline
	.comm	_saved_infile,8,3               ; @saved_infile
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ERROR:  not a PPM file\n"

	.comm	_color_type,4,2                 ; @color_type
	.comm	_channels,4,2                   ; @channels
l_.str.1:                               ; @.str.1
	.asciz	"%lu %lu"

	.comm	_width,4,2                      ; @width
	.comm	_height,4,2                     ; @height
l_.str.2:                               ; @.str.2
	.asciz	"%d"

l_.str.3:                               ; @.str.3
	.asciz	"ERROR:  maxval = %d\n"

	.comm	_bit_depth,4,2                  ; @bit_depth
.subsections_via_symbols
