	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_jpeg_finish_compress           ## -- Begin function jpeg_finish_compress
	.p2align	4, 0x90
_jpeg_finish_compress:                  ## @jpeg_finish_compress
	.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, %r15
	movq	(%rdi), %rdx
	movq	_CSTATE_SCANNING@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	je	LBB0_2
## %bb.1:
	movq	_CSTATE_RAW_OK@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	je	LBB0_2
## %bb.5:
	movq	_CSTATE_WRCOEFS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	je	LBB0_7
## %bb.6:
	movq	_JERR_BAD_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ERREXIT1
	jmp	LBB0_7
LBB0_2:
	movq	8(%r15), %rax
	cmpq	16(%r15), %rax
	jge	LBB0_4
## %bb.3:
	movq	_JERR_TOO_LITTLE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ERREXIT
LBB0_4:
	movq	48(%r15), %rax
	movq	%r15, %rdi
	callq	*(%rax)
LBB0_7:
	movq	48(%r15), %rcx
	cmpl	$0, 16(%rcx)
	je	LBB0_8
LBB0_17:
	movq	40(%r15), %rax
	movq	%r15, %rdi
	callq	*(%rax)
	movq	32(%r15), %rax
	movq	%r15, %rdi
	callq	*(%rax)
	movl	%r15d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_jpeg_abort                     ## TAILCALL
LBB0_8:
	movq	_JERR_CANT_SUSPEND@GOTPCREL(%rip), %r14
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	48(%r15), %rax
	movq	%r15, %rdi
	callq	*(%rax)
	movq	48(%r15), %rcx
	cmpl	$0, 16(%rcx)
	jne	LBB0_17
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movq	%r15, %rdi
	callq	*8(%rcx)
	movq	24(%r15), %rax
	testq	%rax, %rax
	jle	LBB0_16
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=2
	incq	%rbx
	movq	24(%r15), %rax
	cmpq	%rax, %rbx
	jge	LBB0_16
LBB0_11:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	64(%r15), %rcx
	testq	%rcx, %rcx
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	%rbx, (%rcx)
	movq	%rax, 8(%rcx)
	movl	%r15d, %edi
	callq	*16(%rcx)
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=2
	movq	56(%r15), %rax
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	*(%rax)
	testl	%eax, %eax
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=2
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_ERREXIT
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_CSTATE_SCANNING,8,3            ## @CSTATE_SCANNING
	.comm	_CSTATE_RAW_OK,8,3              ## @CSTATE_RAW_OK
	.comm	_JERR_TOO_LITTLE_DATA,4,2       ## @JERR_TOO_LITTLE_DATA
	.comm	_CSTATE_WRCOEFS,8,3             ## @CSTATE_WRCOEFS
	.comm	_JERR_BAD_STATE,4,2             ## @JERR_BAD_STATE
	.comm	_JERR_CANT_SUSPEND,4,2          ## @JERR_CANT_SUSPEND
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_jpeg_finish_compress           ; -- Begin function jpeg_finish_compress
	.p2align	2
_jpeg_finish_compress:                  ; @jpeg_finish_compress
	.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	x19, x0
	ldr	x2, [x0]
Lloh0:
	adrp	x8, _CSTATE_SCANNING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CSTATE_SCANNING@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _CSTATE_RAW_OK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CSTATE_RAW_OK@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x2, x8
	ccmp	x2, x9, #4, ne
	b.ne	LBB0_4
; %bb.1:
	ldp	x8, x9, [x19, #8]
	cmp	x8, x9
	b.ge	LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _JERR_TOO_LITTLE_DATA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _JERR_TOO_LITTLE_DATA@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ERREXIT
LBB0_3:
	ldr	x8, [x19, #48]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	b	LBB0_6
LBB0_4:
Lloh9:
	adrp	x8, _CSTATE_WRCOEFS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CSTATE_WRCOEFS@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x2, x8
	b.eq	LBB0_6
; %bb.5:
Lloh12:
	adrp	x8, _JERR_BAD_STATE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _JERR_BAD_STATE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ERREXIT1
LBB0_6:
	ldr	x8, [x19, #48]
	ldr	w9, [x8, #16]
	cbz	w9, LBB0_8
LBB0_7:
	ldr	x8, [x19, #40]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19, #32]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	x0, 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
	b	_jpeg_abort
LBB0_8:
Lloh15:
	adrp	x20, _JERR_CANT_SUSPEND@GOTPAGE
Lloh16:
	ldr	x20, [x20, _JERR_CANT_SUSPEND@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x19, #48]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19, #48]
	ldr	w9, [x8, #16]
	cbnz	w9, LBB0_7
LBB0_10:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	ldr	x8, [x8, #8]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19, #24]
	cmp	x8, #1
	b.lt	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x21, #0
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=2
	add	x21, x21, #1
	ldr	x8, [x19, #24]
	cmp	x21, x8
	b.ge	LBB0_9
LBB0_13:                                ;   Parent Loop BB0_10 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x19, #64]
	cbz	x9, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=2
	stp	x21, x8, [x9]
	ldr	x8, [x9, #16]
	mov	x0, x19
	blr	x8
LBB0_15:                                ;   in Loop: Header=BB0_13 Depth=2
	ldr	x8, [x19, #56]
	ldr	x8, [x8]
	mov	x0, x19
	mov	w1, #0
	blr	x8
	cbnz	w0, LBB0_12
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=2
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ERREXIT
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_CSTATE_SCANNING,8,3            ; @CSTATE_SCANNING
	.comm	_CSTATE_RAW_OK,8,3              ; @CSTATE_RAW_OK
	.comm	_JERR_TOO_LITTLE_DATA,4,2       ; @JERR_TOO_LITTLE_DATA
	.comm	_CSTATE_WRCOEFS,8,3             ; @CSTATE_WRCOEFS
	.comm	_JERR_BAD_STATE,4,2             ; @JERR_BAD_STATE
	.comm	_JERR_CANT_SUSPEND,4,2          ; @JERR_CANT_SUSPEND
.subsections_via_symbols
