	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	(%rsi), %rax
	movq	_progname@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	cmpl	$3, %edi
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_usage
LBB0_2:
	movq	8(%r14), %rdi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%eax, %eax
	callq	_open
	movl	%eax, %r15d
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r14), %rdx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_err
LBB0_4:
	leaq	-56(%rbp), %rsi
	movl	%r15d, %edi
	callq	_fstat
	cmpl	$-1, %eax
	jne	LBB0_6
## %bb.5:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r14), %rdx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_err
LBB0_6:
	movq	_DHP_HEADER_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	-56(%rbp), %r12
	leaq	(%r12,%r13), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_malloc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_err
	movq	_DHP_HEADER_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
LBB0_8:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r13, %rdx
	callq	_memset
	movabsq	$442381631586, %rax             ## imm = 0x6700000062
	movq	%rax, (%rbx)
	movl	$110, 8(%rbx)
	movl	$177, 44(%rbx)
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%ecx, %eax
	shrl	$24, %eax
	movl	%eax, 48(%rbx)
	movl	%ecx, %eax
	shrl	$16, %eax
	movzbl	%al, %eax
	movl	%eax, 52(%rbx)
	movzbl	%ch, %eax
	movl	%eax, 56(%rbx)
	movzbl	%cl, %eax
	movq	%rcx, %r13
	movl	%eax, 60(%rbx)
	movq	_DHP_HEADER_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rbx,%rax,4), %rsi
	movl	%r15d, %edi
	movq	%r12, %rdx
	callq	_read
	movl	%r15d, %edi
	callq	_close
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_buffalo_crc
	movl	%eax, %ecx
	movzbl	%ah, %edx
	movzbl	%al, %esi
	shrl	$24, %eax
	movl	%eax, 64(%rbx)
	shrl	$16, %ecx
	movzbl	%cl, %eax
	movl	%eax, 68(%rbx)
	movl	%edx, 72(%rbx)
	movl	%esi, 76(%rbx)
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	16(%r14), %rdi
	movq	_O_TRUNC@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	$420, %edx                      ## imm = 0x1A4
	xorl	%eax, %eax
	callq	_open
	movl	%eax, %r15d
	cmpl	$-1, %eax
	jne	LBB0_10
## %bb.9:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	16(%r14), %rdx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_err
LBB0_10:
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_write
	movl	%r15d, %edi
	callq	_close
	movq	%rbx, %rdi
	callq	_free
	movq	_EXIT_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_progname,8,3                   ## @progname
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

	.comm	_DHP_HEADER_SIZE,8,3            ## @DHP_HEADER_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"malloc"

	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
	.comm	_EXIT_SUCCESS,4,2               ## @EXIT_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function main
lCPI0_0:
	.long	98                              ; 0x62
	.long	103                             ; 0x67
lCPI0_1:
	.long	4294967280                      ; 0xfffffff0
	.long	4294967288                      ; 0xfffffff8
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	d9, d8, [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 b8, -88
	.cfi_offset b9, -96
	mov	x19, x1
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _progname@GOTPAGE
Lloh1:
	ldr	x9, [x9, _progname@GOTPAGEOFF]
Lloh2:
	str	x8, [x9]
	cmp	w0, #3
	b.eq	LBB0_2
; %bb.1:
	bl	_usage
LBB0_2:
	ldr	x0, [x19, #8]
Lloh3:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_open
	mov	x22, x0
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
	str	x8, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_err
LBB0_4:
	add	x1, sp, #8
	mov	x0, x22
	bl	_fstat
	cmn	w0, #1
	b.ne	LBB0_6
; %bb.5:
Lloh11:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
	str	x8, [sp]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_err
LBB0_6:
Lloh16:
	adrp	x25, _DHP_HEADER_SIZE@GOTPAGE
Lloh17:
	ldr	x25, [x25, _DHP_HEADER_SIZE@GOTPAGEOFF]
	ldr	x24, [x25]
	ldr	x23, [sp, #8]
	add	x21, x23, x24
	mov	x0, x21
	bl	_malloc
	mov	x20, x0
	cbnz	x0, LBB0_8
; %bb.7:
Lloh18:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_err
	ldr	x24, [x25]
LBB0_8:
	mov	x0, x20
	mov	w1, #0
	mov	x2, x24
	bl	_memset
Lloh23:
	adrp	x8, lCPI0_0@PAGE
Lloh24:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x20]
	mov	w8, #110
	str	w8, [x20, #8]
	mov	w8, #177
	ubfx	x9, x21, #24, #8
	stp	w8, w9, [x20, #44]
	dup.2s	v0, w21
Lloh25:
	adrp	x8, lCPI0_1@PAGE
Lloh26:
	ldr	d8, [x8, lCPI0_1@PAGEOFF]
	ushl.2s	v0, v0, v8
	movi	d9, #0x0000ff000000ff
	and.8b	v0, v0, v9
	stur	d0, [x20, #52]
	and	w8, w21, #0xff
	str	w8, [x20, #60]
	ldr	x8, [x25]
	add	x1, x20, x8, lsl #2
	mov	x0, x22
	mov	x2, x23
	bl	_read
	mov	x0, x22
	bl	_close
	mov	x0, x20
	mov	x1, x21
	bl	_buffalo_crc
	lsr	w8, w0, #24
	dup.2s	v0, w0
	str	w8, [x20, #64]
	ushl.2s	v0, v0, v8
	and.8b	v0, v0, v9
	stur	d0, [x20, #68]
	and	w8, w0, #0xff
	str	w8, [x20, #76]
	ldr	x0, [x19, #16]
Lloh27:
	adrp	x8, _O_WRONLY@GOTPAGE
Lloh28:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh31:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh33:
	adrp	x9, _O_TRUNC@GOTPAGE
Lloh34:
	ldr	x9, [x9, _O_TRUNC@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	w8, #420
	str	x8, [sp]
	bl	_open
	mov	x22, x0
	cmn	w0, #1
	b.ne	LBB0_10
; %bb.9:
Lloh36:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
	ldr	x8, [x19, #16]
	str	x8, [sp]
Lloh39:
	adrp	x1, l_.str@PAGE
Lloh40:
	add	x1, x1, l_.str@PAGEOFF
	bl	_err
LBB0_10:
	mov	x0, x22
	mov	x1, x20
	mov	x2, x21
	bl	_write
	mov	x0, x22
	bl	_close
	mov	x0, x20
	bl	_free
Lloh41:
	adrp	x8, _EXIT_SUCCESS@GOTPAGE
Lloh42:
	ldr	x8, [x8, _EXIT_SUCCESS@GOTPAGEOFF]
Lloh43:
	ldr	w0, [x8]
	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	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdr	Lloh25, Lloh26
	.loh AdrpLdr	Lloh23, Lloh24
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_progname,8,3                   ; @progname
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.comm	_DHP_HEADER_SIZE,8,3            ; @DHP_HEADER_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"malloc"

	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
	.comm	_EXIT_SUCCESS,4,2               ; @EXIT_SUCCESS
.subsections_via_symbols
