	.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	$1064, %rsp                     ## imm = 0x428
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movl	%edi, %r13d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_stdin@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_stdout@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -1080(%rbp)               ## 8-byte Spill
	movq	_IMAGETAG_CRC_START@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	leaq	L_.str(%rip), %r14
	xorl	%eax, %eax
	movq	%rax, -1096(%rbp)               ## 8-byte Spill
	xorl	%eax, %eax
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movq	%rax, -1088(%rbp)               ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r13d, %edi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_getopt
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=2
	cmpl	$111, %eax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=2
	cmpl	$105, %eax
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=2
	xorl	%eax, %eax
	callq	_usage
	jmp	LBB0_2
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=2
	movq	_optarg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -1096(%rbp)               ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_optarg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_1
LBB0_8:
	movq	_optind@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%r13d, %eax
	jne	LBB0_10
## %bb.9:
	cmpl	$1, %eax
	jne	LBB0_11
LBB0_10:
	cltq
	movq	_stderr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	(%rbx,%rax,8), %rdx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	xorl	%eax, %eax
	callq	_usage
LBB0_11:
	movq	-1088(%rbp), %rbx               ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_14
## %bb.12:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_fopen
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_14
## %bb.13:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_fprintf
	xorl	%eax, %eax
	callq	_usage
LBB0_14:
	movq	-1096(%rbp), %rbx               ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.15:
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	callq	_fopen
	movq	%rax, %rcx
	movq	%rax, -1080(%rbp)               ## 8-byte Spill
	testq	%rax, %rax
	jne	LBB0_17
## %bb.16:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	movq	%rax, -1080(%rbp)               ## 8-byte Spill
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_fprintf
	xorl	%eax, %eax
	callq	_usage
LBB0_17:
	movl	$1, %r14d
	leaq	-1072(%rbp), %r13
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_18 Depth=1
	movl	%r12d, %edi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_crc32
	movl	%eax, %r12d
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	movq	-1080(%rbp), %rcx               ## 8-byte Reload
	callq	_fwrite
	testl	%eax, %eax
	je	LBB0_27
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$1024, %edx                     ## imm = 0x400
	movq	%r15, %rcx
	callq	_fread
	testq	%rax, %rax
	je	LBB0_28
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	%rax, %rbx
	cmpq	$1023, %rax                     ## imm = 0x3FF
	ja	LBB0_23
## %bb.20:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	%r15, %rdi
	callq	_ferror
	testq	%rax, %rax
	jne	LBB0_21
LBB0_23:                                ##   in Loop: Header=BB0_18 Depth=1
	testl	%r14d, %r14d
	je	LBB0_26
## %bb.24:                              ##   in Loop: Header=BB0_18 Depth=1
	cmpq	$256, %rbx                      ## imm = 0x100
	jb	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	%r13, %rdi
	callq	_fix_header
	xorl	%r14d, %r14d
	jmp	LBB0_26
LBB0_28:
	movq	%r15, %rdi
	callq	_ferror
	testq	%rax, %rax
	je	LBB0_29
LBB0_21:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_22
LBB0_29:
	movq	-1080(%rbp), %rdi               ## 8-byte Reload
	callq	_fflush
	testq	%rax, %rax
	je	LBB0_30
LBB0_27:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.7(%rip), %rsi
LBB0_22:
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
LBB0_31:
	movl	(%rax), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_33
## %bb.32:
	addq	$1064, %rsp                     ## imm = 0x428
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_30:
	movq	%r15, %rdi
	callq	_fclose
	movq	-1080(%rbp), %rdi               ## 8-byte Reload
	callq	_fclose
	movq	_EXIT_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_31
LBB0_33:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_stdin,8,3                      ## @stdin
	.comm	_stdout,8,3                     ## @stdout
	.comm	_IMAGETAG_CRC_START,4,2         ## @IMAGETAG_CRC_START
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i:o:h"

	.comm	_optarg,8,3                     ## @optarg
	.comm	_optind,4,2                     ## @optind
	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"illegal arg \"%s\"\n"

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

L_.str.3:                               ## @.str.3
	.asciz	"can not open \"%s\" for reading\n"

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

L_.str.5:                               ## @.str.5
	.asciz	"can not open \"%s\" for writing\n"

L_.str.6:                               ## @.str.6
	.asciz	"fread error\n"

	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
L_.str.7:                               ## @.str.7
	.asciz	"fwrite error\n"

	.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
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	sp, sp, #1040
	mov	x24, x1
	mov	x25, x0
	mov	x22, #0
	mov	x23, #0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _stdin@GOTPAGE
Lloh4:
	ldr	x9, [x9, _stdin@GOTPAGEOFF]
	stur	x8, [x29, #-88]
Lloh5:
	ldr	x19, [x9]
Lloh6:
	adrp	x8, _stdout@GOTPAGE
Lloh7:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh8:
	adrp	x9, _IMAGETAG_CRC_START@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IMAGETAG_CRC_START@GOTPAGEOFF]
Lloh10:
	ldr	x20, [x8]
Lloh11:
	ldr	w21, [x9]
Lloh12:
	adrp	x26, l_.str@PAGE
Lloh13:
	add	x26, x26, l_.str@PAGEOFF
Lloh14:
	adrp	x27, _optarg@GOTPAGE
Lloh15:
	ldr	x27, [x27, _optarg@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	mov	x1, x24
	mov	x2, x26
	bl	_getopt
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w0, #111
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w0, #105
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_usage
	b	LBB0_1
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x22, [x27]
	b	LBB0_1
LBB0_6:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x23, [x27]
	b	LBB0_1
LBB0_7:
Lloh16:
	adrp	x8, _optind@GOTPAGE
Lloh17:
	ldr	x8, [x8, _optind@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w8, w25
	ccmp	w8, #1, #4, eq
	b.ne	LBB0_9
; %bb.8:
	sxtw	x8, w8
Lloh19:
	adrp	x9, _stderr@GOTPAGE
Lloh20:
	ldr	x9, [x9, _stderr@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x9]
	ldr	x8, [x24, x8, lsl #3]
	str	x8, [sp]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	bl	_usage
LBB0_9:
	cbz	x23, LBB0_12
; %bb.10:
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x23
	bl	_fopen
	mov	x19, x0
	cbnz	x0, LBB0_12
; %bb.11:
Lloh26:
	adrp	x8, _stderr@GOTPAGE
Lloh27:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	str	x23, [sp]
Lloh29:
	adrp	x1, l_.str.3@PAGE
Lloh30:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fprintf
	bl	_usage
LBB0_12:
	cbz	x22, LBB0_15
; %bb.13:
Lloh31:
	adrp	x1, l_.str.4@PAGE
Lloh32:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x22
	bl	_fopen
	mov	x20, x0
	cbnz	x0, LBB0_15
; %bb.14:
Lloh33:
	adrp	x8, _stderr@GOTPAGE
Lloh34:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
	str	x22, [sp]
Lloh36:
	adrp	x1, l_.str.5@PAGE
Lloh37:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_fprintf
	bl	_usage
LBB0_15:
	mov	w23, #1
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	add	x1, sp, #8
	mov	x0, x21
	mov	x2, x22
	bl	_crc32
	mov	x21, x0
	add	x0, sp, #8
	mov	x1, x22
	mov	w2, #1
	mov	x3, x20
	bl	_fwrite
	cbz	w0, LBB0_26
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	mov	w1, #1
	mov	w2, #1024
	mov	x3, x19
	bl	_fread
	cbz	x0, LBB0_23
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	x22, x0
	cmp	x0, #1023
	b.hi	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	x0, x19
	bl	_ferror
	cbnz	x0, LBB0_24
LBB0_20:                                ;   in Loop: Header=BB0_17 Depth=1
	cbz	w23, LBB0_16
; %bb.21:                               ;   in Loop: Header=BB0_17 Depth=1
	cmp	x22, #256
	b.lo	LBB0_16
; %bb.22:                               ;   in Loop: Header=BB0_17 Depth=1
	add	x0, sp, #8
	bl	_fix_header
	mov	w23, #0
	b	LBB0_16
LBB0_23:
	mov	x0, x19
	bl	_ferror
	cbz	x0, LBB0_25
LBB0_24:
Lloh38:
	adrp	x8, _stderr@GOTPAGE
Lloh39:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh40:
	ldr	w0, [x8]
Lloh41:
	adrp	x1, l_.str.6@PAGE
Lloh42:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_27
LBB0_25:
	mov	x0, x20
	bl	_fflush
	cbz	x0, LBB0_30
LBB0_26:
Lloh43:
	adrp	x8, _stderr@GOTPAGE
Lloh44:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh45:
	ldr	w0, [x8]
Lloh46:
	adrp	x1, l_.str.7@PAGE
Lloh47:
	add	x1, x1, l_.str.7@PAGEOFF
LBB0_27:
	bl	_fprintf
Lloh48:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh49:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
LBB0_28:
	ldr	w0, [x8]
	ldur	x8, [x29, #-88]
Lloh50:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh51:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh52:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_31
; %bb.29:
	add	sp, sp, #1040
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_30:
	mov	x0, x19
	bl	_fclose
	mov	x0, x20
	bl	_fclose
Lloh53:
	adrp	x8, _EXIT_SUCCESS@GOTPAGE
Lloh54:
	ldr	x8, [x8, _EXIT_SUCCESS@GOTPAGEOFF]
	b	LBB0_28
LBB0_31:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_stdin,8,3                      ; @stdin
	.comm	_stdout,8,3                     ; @stdout
	.comm	_IMAGETAG_CRC_START,4,2         ; @IMAGETAG_CRC_START
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i:o:h"

	.comm	_optarg,8,3                     ; @optarg
	.comm	_optind,4,2                     ; @optind
	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"illegal arg \"%s\"\n"

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

l_.str.3:                               ; @.str.3
	.asciz	"can not open \"%s\" for reading\n"

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

l_.str.5:                               ; @.str.5
	.asciz	"can not open \"%s\" for writing\n"

l_.str.6:                               ; @.str.6
	.asciz	"fread error\n"

	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
l_.str.7:                               ; @.str.7
	.asciz	"fwrite error\n"

	.comm	_EXIT_SUCCESS,4,2               ; @EXIT_SUCCESS
.subsections_via_symbols
