	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_image_header
_write_image_header:                    ## @write_image_header
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %r12
	movl	(%r12), %eax
	leal	-128(%rax), %ecx
	cmpl	$5, %ecx
	ja	LBB0_4
## %bb.1:
	movq	%rdi, %r13
	movq	8(%rdi), %r8
	movb	$1, %sil
	xorl	%r9d, %r9d
	movl	$1, %edi
	movl	$2, %ebx
	movl	$8, %r15d
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	xorl	%edx, %edx
	jmpq	*%rcx
LBB0_3:
	xorl	%ecx, %ecx
	cmpl	$130, %eax
	sete	%cl
	movl	$4, %edi
	subl	%ecx, %edi
	movl	$32768, %edx                    ## imm = 0x8000
	movl	$3, %ebx
	movl	$16, %r15d
	movb	$1, %r9b
	xorl	%esi, %esi
	jmp	LBB0_7
LBB0_2:
	xorl	%ecx, %ecx
	cmpl	$131, %eax
	sete	%cl
	movl	$4, %edi
	subl	%ecx, %edi
	xorl	%r9d, %r9d
	movl	$3, %ebx
	xorl	%edx, %edx
	xorl	%esi, %esi
	jmp	LBB0_7
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_24
## %bb.5:
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_6:
	movl	$32768, %edx                    ## imm = 0x8000
	movl	$16, %r15d
	movb	$1, %r9b
	movb	$1, %sil
LBB0_7:
	movl	%edi, -140(%rbp)                ## 4-byte Spill
	movl	%esi, -136(%rbp)                ## 4-byte Spill
	movl	%edx, -144(%rbp)                ## 4-byte Spill
	movl	%r9d, -148(%rbp)                ## 4-byte Spill
	movq	%r8, -160(%rbp)                 ## 8-byte Spill
	cmpq	$0, (%r8)
	je	LBB0_9
## %bb.8:
	leaq	L_.str(%rip), %rsi
	leaq	-128(%rbp), %rdi
	movl	$10, %edx
	callq	_memcpy
	leaq	-118(%rbp), %rdi
	movl	$32, %esi
	movl	$70, %edx
	callq	_memset
	movb	$84, -99(%rbp)
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str.1(%rip), %rsi
	leaq	-128(%rbp), %rdi
	movl	$20, %edx
	callq	_memcpy
	leaq	-108(%rbp), %rdi
	movl	$32, %esi
	movl	$60, %edx
	callq	_memset
LBB0_10:
	movl	(%r13), %edi
	leaq	-128(%rbp), %rsi
	movl	$80, %edx
	callq	_avio_write
	movl	$1, -132(%rbp)
	leaq	L_.str.2(%rip), %rsi
	leaq	-132(%rbp), %r14
	movq	%r13, %rdi
	movl	%r15d, %edx
	movq	%r14, %rcx
	callq	_write_keyword_value
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdi
	movl	%ebx, %edx
	movq	%r14, %rcx
	callq	_write_keyword_value
	movl	4(%r12), %edx
	leaq	L_.str.4(%rip), %rsi
	movq	%r13, %rdi
	movq	%r14, %rcx
	callq	_write_keyword_value
	movl	8(%r12), %edx
	leaq	L_.str.5(%rip), %rsi
	movq	%r13, %rdi
	movq	%r14, %rcx
	callq	_write_keyword_value
	movl	-136(%rbp), %ebx                ## 4-byte Reload
	testb	%bl, %bl
	jne	LBB0_12
## %bb.11:
	leaq	L_.str.6(%rip), %rsi
	leaq	-132(%rbp), %rcx
	movq	%r13, %rdi
	movl	-140(%rbp), %edx                ## 4-byte Reload
	callq	_write_keyword_value
LBB0_12:
	movq	-160(%rbp), %rax                ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.14:
	movq	$0, (%rax)
	jmp	LBB0_15
LBB0_13:
	leaq	L_.str.7(%rip), %rsi
	leaq	-132(%rbp), %r14
	movq	%r13, %rdi
	xorl	%edx, %edx
	movq	%r14, %rcx
	callq	_write_keyword_value
	leaq	L_.str.8(%rip), %rsi
	movq	%r13, %rdi
	movl	$1, %edx
	movq	%r14, %rcx
	movl	-136(%rbp), %ebx                ## 4-byte Reload
	callq	_write_keyword_value
LBB0_15:
	cmpb	$0, -148(%rbp)                  ## 1-byte Folded Reload
	movl	-144(%rbp), %edx                ## 4-byte Reload
	je	LBB0_17
## %bb.16:
	leaq	L_.str.9(%rip), %rsi
	leaq	-132(%rbp), %rcx
	movq	%r13, %rdi
	callq	_write_keyword_value
LBB0_17:
	testb	%bl, %bl
	jne	LBB0_19
## %bb.18:
	leaq	L_.str.10(%rip), %rsi
	leaq	-128(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$20, %edx
	callq	_memcpy
	leaq	-108(%rbp), %rdi
	movl	$32, %esi
	movl	$60, %edx
	callq	_memset
	movl	(%r13), %edi
	movq	%rbx, %rsi
	movl	$80, %edx
	callq	_avio_write
	incl	-132(%rbp)
LBB0_19:
	leaq	L_.str.11(%rip), %rsi
	leaq	-128(%rbp), %r14
	movq	%r14, %rdi
	movl	$3, %edx
	callq	_memcpy
	leaq	-125(%rbp), %rdi
	movl	$32, %esi
	movl	$77, %edx
	callq	_memset
	movl	(%r13), %edi
	movq	%r14, %rsi
	movl	$80, %edx
	callq	_avio_write
	movl	-132(%rbp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, -132(%rbp)
	movl	%eax, %ecx
	addl	$36, %ecx
	movslq	%ecx, %rcx
	imulq	$954437177, %rcx, %rcx          ## imm = 0x38E38E39
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$35, %rcx
	addl	%edx, %ecx
	shll	$2, %ecx
	leal	(%rcx,%rcx,8), %ecx
	negl	%ecx
	leal	(%rax,%rcx), %r15d
	addl	$36, %r15d
	movq	%r14, %rdi
	movl	$32, %esi
	movl	$80, %edx
	callq	_memset
	cmpl	$34, %r15d
	jg	LBB0_22
## %bb.20:
	movl	$36, %ebx
	subl	%r15d, %ebx
	leaq	-128(%rbp), %r14
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	movq	%r14, %rsi
	movl	$80, %edx
	callq	_avio_write
	decl	%ebx
	cmpl	$1, %ebx
	ja	LBB0_21
LBB0_22:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_24
## %bb.23:
	xorl	%eax, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	callq	___stack_chk_fail
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
LJTI0_0:
	.long	L0_0_set_7
	.long	L0_0_set_6
	.long	L0_0_set_3
	.long	L0_0_set_2
	.long	L0_0_set_3
	.long	L0_0_set_2
	.end_data_region
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SIMPLE  = "

L_.str.1:                               ## @.str.1
	.asciz	"XTENSION= 'IMAGE   '"

L_.str.2:                               ## @.str.2
	.asciz	"BITPIX"

L_.str.3:                               ## @.str.3
	.asciz	"NAXIS"

L_.str.4:                               ## @.str.4
	.asciz	"NAXIS1"

L_.str.5:                               ## @.str.5
	.asciz	"NAXIS2"

L_.str.6:                               ## @.str.6
	.asciz	"NAXIS3"

L_.str.7:                               ## @.str.7
	.asciz	"PCOUNT"

L_.str.8:                               ## @.str.8
	.asciz	"GCOUNT"

L_.str.9:                               ## @.str.9
	.asciz	"BZERO"

L_.str.10:                              ## @.str.10
	.asciz	"CTYPE3  = 'RGB     '"

L_.str.11:                              ## @.str.11
	.asciz	"END"

	.no_dead_strip	_write_image_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_image_header
_write_image_header:                    ; @write_image_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #88]
	ldr	x8, [x0, #16]
	ldr	x8, [x8]
	ldr	x27, [x8]
	ldr	w8, [x27]
	sub	w9, w8, #128
	cmp	w9, #5
	b.hi	LBB0_6
; %bb.1:
	mov	x19, x0
	mov	w24, #0
	mov	w20, #0
	ldr	x26, [x0, #8]
	mov	w21, #1
	mov	w22, #2
	mov	w23, #8
Lloh3:
	adrp	x10, lJTI0_0@PAGE
Lloh4:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_2
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	mov	w25, #1
	br	x11
LBB0_2:
	mov	w25, #0
	cmp	w8, #130
	mov	w22, #3
	cinc	w21, w22, ne
	mov	w20, #32768
	mov	w23, #16
	mov	w24, #1
	ldr	x8, [x26]
	cbnz	x8, LBB0_5
	b	LBB0_9
LBB0_3:
	mov	w24, #0
	mov	w20, #0
	mov	w25, #0
	cmp	w8, #131
	mov	w22, #3
	cinc	w21, w22, ne
	mov	w23, #8
LBB0_4:
	ldr	x8, [x26]
	cbz	x8, LBB0_9
LBB0_5:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	add	x28, sp, #8
	add	x0, sp, #8
	mov	w2, #10
	bl	_memcpy
	add	x0, x28, #10
	mov	w1, #32
	mov	w2, #70
	bl	_memset
	mov	w8, #84
	strb	w8, [sp, #37]
	b	LBB0_10
LBB0_6:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	ldr	x8, [sp, #88]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_23
; %bb.7:
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	b	_AVERROR
LBB0_8:
	mov	w20, #32768
	mov	w24, #1
	mov	w22, #2
	mov	w23, #16
	mov	w21, #1
	mov	w25, #1
	ldr	x8, [x26]
	cbnz	x8, LBB0_5
LBB0_9:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x28, sp, #8
	add	x0, sp, #8
	mov	w2, #20
	bl	_memcpy
	add	x0, x28, #20
	mov	w1, #32
	mov	w2, #60
	bl	_memset
LBB0_10:
	ldr	w0, [x19]
	add	x1, sp, #8
	mov	w2, #80
	bl	_avio_write
	mov	w8, #1
	str	w8, [sp, #4]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x3, sp, #4
	mov	x0, x19
	mov	x2, x23
	bl	_write_keyword_value
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x3, sp, #4
	mov	x0, x19
	mov	x2, x22
	bl	_write_keyword_value
	ldr	w2, [x27, #4]
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
	add	x3, sp, #4
	mov	x0, x19
	bl	_write_keyword_value
	ldr	w2, [x27, #8]
Lloh21:
	adrp	x1, l_.str.5@PAGE
Lloh22:
	add	x1, x1, l_.str.5@PAGEOFF
	add	x3, sp, #4
	mov	x0, x19
	bl	_write_keyword_value
	tbnz	w25, #0, LBB0_12
; %bb.11:
Lloh23:
	adrp	x1, l_.str.6@PAGE
Lloh24:
	add	x1, x1, l_.str.6@PAGEOFF
	add	x3, sp, #4
	mov	x0, x19
	mov	x2, x21
	bl	_write_keyword_value
LBB0_12:
	ldr	x8, [x26]
	cbz	x8, LBB0_22
; %bb.13:
	str	xzr, [x26]
	cbz	w24, LBB0_15
LBB0_14:
Lloh25:
	adrp	x1, l_.str.9@PAGE
Lloh26:
	add	x1, x1, l_.str.9@PAGEOFF
	add	x3, sp, #4
	mov	x0, x19
	mov	x2, x20
	bl	_write_keyword_value
LBB0_15:
	tbnz	w25, #0, LBB0_17
; %bb.16:
Lloh27:
	adrp	x1, l_.str.10@PAGE
Lloh28:
	add	x1, x1, l_.str.10@PAGEOFF
	add	x20, sp, #8
	add	x0, sp, #8
	mov	w2, #20
	bl	_memcpy
	add	x0, x20, #20
	mov	w1, #32
	mov	w2, #60
	bl	_memset
	ldr	w0, [x19]
	add	x1, sp, #8
	mov	w2, #80
	bl	_avio_write
	ldr	w8, [sp, #4]
	add	w8, w8, #1
	str	w8, [sp, #4]
LBB0_17:
Lloh29:
	adrp	x1, l_.str.11@PAGE
Lloh30:
	add	x1, x1, l_.str.11@PAGEOFF
	add	x20, sp, #8
	add	x0, sp, #8
	mov	w2, #3
	bl	_memcpy
	add	x0, x20, #3
	mov	w1, #32
	mov	w2, #77
	bl	_memset
	ldr	w0, [x19]
	add	x1, sp, #8
	mov	w2, #80
	bl	_avio_write
	ldr	w8, [sp, #4]
	add	w9, w8, #1
	str	w9, [sp, #4]
	add	w8, w8, #36
	mov	w9, #36409
	movk	w9, #14563, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	asr	x9, x9, #35
	add	w9, w9, w10
	mov	w20, #36
	msub	w21, w9, w20, w8
	add	x0, sp, #8
	mov	w1, #32
	mov	w2, #80
	bl	_memset
	cmp	w21, #34
	b.gt	LBB0_20
; %bb.18:
	sub	w20, w20, w21
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	add	x1, sp, #8
	mov	w2, #80
	bl	_avio_write
	sub	w20, w20, #1
	cmp	w20, #1
	b.hi	LBB0_19
LBB0_20:
	ldr	x8, [sp, #88]
Lloh31:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh32:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh33:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_23
; %bb.21:
	mov	w0, #0
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_22:
Lloh34:
	adrp	x1, l_.str.7@PAGE
Lloh35:
	add	x1, x1, l_.str.7@PAGEOFF
	add	x3, sp, #4
	mov	x0, x19
	mov	w2, #0
	bl	_write_keyword_value
Lloh36:
	adrp	x1, l_.str.8@PAGE
Lloh37:
	add	x1, x1, l_.str.8@PAGEOFF
	add	x3, sp, #4
	mov	x0, x19
	mov	w2, #1
	bl	_write_keyword_value
	cbnz	w24, LBB0_14
	b	LBB0_15
LBB0_23:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SIMPLE  = "

l_.str.1:                               ; @.str.1
	.asciz	"XTENSION= 'IMAGE   '"

l_.str.2:                               ; @.str.2
	.asciz	"BITPIX"

l_.str.3:                               ; @.str.3
	.asciz	"NAXIS"

l_.str.4:                               ; @.str.4
	.asciz	"NAXIS1"

l_.str.5:                               ; @.str.5
	.asciz	"NAXIS2"

l_.str.6:                               ; @.str.6
	.asciz	"NAXIS3"

l_.str.7:                               ; @.str.7
	.asciz	"PCOUNT"

l_.str.8:                               ; @.str.8
	.asciz	"GCOUNT"

l_.str.9:                               ; @.str.9
	.asciz	"BZERO"

l_.str.10:                              ; @.str.10
	.asciz	"CTYPE3  = 'RGB     '"

l_.str.11:                              ; @.str.11
	.asciz	"END"

	.no_dead_strip	_write_image_header
.subsections_via_symbols
