	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_IDAT                 ## -- Begin function png_write_IDAT
	.p2align	4, 0x90
_png_write_IDAT:                        ## @png_write_IDAT
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_png_debug
	movq	_PNG_HAVE_IDAT@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, (%rbx)
	jne	LBB0_15
## %bb.1:
	movq	8(%rbx), %rax
	movq	_PNG_COMPRESSION_TYPE_BASE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.2:
	movl	(%r15), %eax
	movl	%eax, %ecx
	andl	$15, %ecx
	cmpl	$8, %ecx
	jne	LBB0_14
## %bb.3:
	movl	%eax, %ecx
	andl	$240, %ecx
	cmpl	$112, %ecx
	ja	LBB0_14
## %bb.4:
	cmpl	$2, %r14d
	jl	LBB0_15
## %bb.5:
	movl	16(%rbx), %ecx
	cmpl	$16383, %ecx                    ## imm = 0x3FFF
	jg	LBB0_15
## %bb.6:
	movl	20(%rbx), %edx
	cmpl	$16383, %edx                    ## imm = 0x3FFF
	jg	LBB0_15
## %bb.7:
	imull	24(%rbx), %edx
	imull	28(%rbx), %edx
	addl	$15, %edx
	sarl	$3, %edx
	imull	%ecx, %edx
	movl	%eax, %ecx
	shrl	$4, %ecx
	movl	$128, %esi
	shll	%cl, %esi
	cmpl	%esi, %edx
	ja	LBB0_12
## %bb.8:
	cmpl	$256, %esi                      ## imm = 0x100
	jb	LBB0_12
## %bb.9:
	movl	%esi, %edi
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	decl	%ecx
	shrl	%edi
	cmpl	%edi, %edx
	ja	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$511, %esi                      ## imm = 0x1FF
	movl	%edi, %esi
	ja	LBB0_10
LBB0_12:
	shll	$4, %ecx
	orl	$8, %ecx
	cmpl	%ecx, %eax
	je	LBB0_15
## %bb.13:
	movl	%ecx, (%r15)
	movl	$224, %eax
	andl	4(%r15), %eax
	shll	$8, %ecx
	orl	%eax, %ecx
	imulq	$138547333, %rcx, %rdx          ## imm = 0x8421085
	shrq	$32, %rdx
	movl	%ecx, %esi
	subl	%edx, %esi
	shrl	%esi
	addl	%edx, %esi
	shrl	$4, %esi
	movl	%esi, %edx
	shll	$5, %edx
	subl	%edx, %esi
	addl	%ecx, %esi
	orl	%eax, %esi
	xorl	$31, %esi
	movl	%esi, 4(%r15)
	jmp	LBB0_15
LBB0_14:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_png_error
LBB0_15:
	movq	_png_IDAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	movl	%r14d, %ecx
	callq	_png_write_chunk
	movl	(%r12), %eax
	orl	%eax, (%rbx)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_write_IDAT\n"

	.comm	_PNG_HAVE_IDAT,4,2              ## @PNG_HAVE_IDAT
	.comm	_PNG_COMPRESSION_TYPE_BASE,8,3  ## @PNG_COMPRESSION_TYPE_BASE
L_.str.1:                               ## @.str.1
	.asciz	"Invalid zlib compression method or flags in IDAT"

	.comm	_png_IDAT,4,2                   ## @png_IDAT
	.comm	_PNG_IDAT,4,2                   ## @PNG_IDAT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_IDAT                 ; -- Begin function png_write_IDAT
	.p2align	2
_png_write_IDAT:                        ; @png_write_IDAT
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_png_debug
	ldr	w8, [x19]
Lloh2:
	adrp	x22, _PNG_HAVE_IDAT@GOTPAGE
Lloh3:
	ldr	x22, [x22, _PNG_HAVE_IDAT@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_14
; %bb.1:
	ldr	x8, [x19, #8]
Lloh4:
	adrp	x9, _PNG_COMPRESSION_TYPE_BASE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _PNG_COMPRESSION_TYPE_BASE@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.2:
	ldr	w8, [x21]
	and	w9, w8, #0xf
	cmp	w9, #8
	b.ne	LBB0_13
; %bb.3:
	and	w9, w8, #0xf0
	cmp	w9, #112
	b.hi	LBB0_13
; %bb.4:
	cmp	w20, #2
	b.lt	LBB0_14
; %bb.5:
	ldr	w9, [x19, #16]
	cmp	w9, #4, lsl #12                 ; =16384
	b.ge	LBB0_14
; %bb.6:
	ldr	w10, [x19, #20]
	cmp	w10, #4, lsl #12                ; =16384
	b.ge	LBB0_14
; %bb.7:
	ldp	w11, w12, [x19, #24]
	mul	w10, w11, w10
	orr	w11, wzr, #0xf
	madd	w10, w10, w12, w11
	asr	w10, w10, #3
	mul	w10, w10, w9
	lsr	w9, w8, #4
	mov	w11, #128
	lsl	w11, w11, w9
	cmp	w10, w11
	b.hi	LBB0_11
; %bb.8:
	cmp	w11, #256
	b.lo	LBB0_11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	sub	w9, w9, #1
	lsr	w12, w11, #1
	cmp	w10, w12
	b.hi	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w11, #511
	mov	x11, x12
	b.hi	LBB0_9
LBB0_11:
	mov	w10, #8
	bfi	w10, w9, #4, #28
	cmp	w8, w10
	b.eq	LBB0_14
; %bb.12:
	ldr	w8, [x21, #4]
	and	w8, w8, #0xe0
	mov	x9, x8
	bfi	w9, w10, #8, #24
	mov	w11, #4229
	movk	w11, #2114, lsl #16
	umull	x11, w9, w11
	lsr	x11, x11, #32
	sub	w12, w9, w11
	add	w11, w11, w12, lsr #1
	lsr	w11, w11, #4
	sub	w11, w11, w11, lsl #5
	add	w9, w9, w11
	orr	w8, w9, w8
	eor	w8, w8, #0x1f
	stp	w10, w8, [x21]
	b	LBB0_14
LBB0_13:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_14:
Lloh9:
	adrp	x8, _png_IDAT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _png_IDAT@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	mov	x3, x20
	bl	_png_write_chunk
	ldr	w8, [x22]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_write_IDAT\n"

	.comm	_PNG_HAVE_IDAT,4,2              ; @PNG_HAVE_IDAT
	.comm	_PNG_COMPRESSION_TYPE_BASE,8,3  ; @PNG_COMPRESSION_TYPE_BASE
l_.str.1:                               ; @.str.1
	.asciz	"Invalid zlib compression method or flags in IDAT"

	.comm	_png_IDAT,4,2                   ; @png_IDAT
	.comm	_PNG_IDAT,4,2                   ; @PNG_IDAT
.subsections_via_symbols
