	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	cmpl	$4, %edi
	jne	LBB0_9
## %bb.1:
	movq	16(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_10
## %bb.2:
	movq	%rax, %rbx
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	%rbx, %rdi
	callq	_ftell
	movl	%eax, %r14d
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movl	%r14d, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.3:
	movq	%rax, %r12
	movq	%rax, %rdi
	movl	$1, %esi
	movl	%r14d, %edx
	movq	%rbx, %rcx
	callq	_fread
	movq	%rbx, %rdi
	callq	_fclose
	movq	8(%r15), %rdi
	callq	_atoi
	testq	%rax, %rax
	je	LBB0_12
## %bb.4:
	movl	%r14d, %esi
	shll	$4, %esi
	movl	%esi, -44(%rbp)
	movq	_MEM_LIMIT@GOTPCREL(%rip), %rax
	movl	$4, %r13d
	cmpl	(%rax), %esi
	jg	LBB0_21
## %bb.5:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_realloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%rax, %rbx
	movq	%rax, %rdi
	leaq	-44(%rbp), %rsi
	movq	%r12, %rdx
	movl	%r14d, %ecx
	callq	_uncompress
	movq	_Z_BUF_ERROR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	-44(%rbp), %esi
	shll	$4, %esi
	movl	%esi, -44(%rbp)
	movq	_MEM_LIMIT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jle	LBB0_6
	jmp	LBB0_21
LBB0_9:
	movq	(%r15), %rsi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	$1, %r13d
	jmp	LBB0_21
LBB0_10:
	movl	$2, %r13d
	jmp	LBB0_21
LBB0_11:
	movl	$3, %r13d
	jmp	LBB0_21
LBB0_12:
	movl	%r14d, %edi
	addl	$1024, %edi                     ## imm = 0x400
	movl	%edi, -44(%rbp)
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.13:
	movq	%rax, %rbx
	movq	_Z_BEST_COMPRESSION@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	-44(%rbp), %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	movl	%r14d, %ecx
	callq	_compress2
LBB0_14:
	movl	%eax, %r13d
	movq	_Z_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_17
## %bb.15:
	movq	24(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_20
## %bb.16:
	movq	%rax, %r15
	movl	-44(%rbp), %edx
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%rax, %rcx
	callq	_fwrite
	movq	%r15, %rdi
	callq	_fclose
LBB0_17:
	movl	-44(%rbp), %ecx
	leaq	L_.str.3(%rip), %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_21
LBB0_19:
	movl	$5, %r13d
LBB0_21:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movl	$6, %r13d
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"usage: %s <0|1> <infile> <outfile>\n"

L_.str.1:                               ## @.str.1
	.asciz	"rb"

	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_MEM_LIMIT,4,2                  ## @MEM_LIMIT
	.comm	_Z_BUF_ERROR,4,2                ## @Z_BUF_ERROR
	.comm	_Z_BEST_COMPRESSION,4,2         ## @Z_BEST_COMPRESSION
	.comm	_Z_OK,4,2                       ## @Z_OK
L_.str.2:                               ## @.str.2
	.asciz	"wb"

L_.str.3:                               ## @.str.3
	.asciz	"result %i, size %i -> %i\n"

.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:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x1
	cmp	w0, #4
	b.ne	LBB0_6
; %bb.1:
	ldr	x0, [x19, #16]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_7
; %bb.2:
	mov	x21, x0
Lloh2:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_fseek
	mov	x0, x21
	bl	_ftell
	mov	x20, x0
Lloh5:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w1, #0
	bl	_fseek
	mov	x0, x20
	bl	_malloc
	cbz	x0, LBB0_8
; %bb.3:
	mov	x22, x0
	mov	w1, #1
	mov	x2, x20
	mov	x3, x21
	bl	_fread
	mov	x0, x21
	bl	_fclose
	ldr	x0, [x19, #8]
	bl	_atoi
	cbz	x0, LBB0_9
; %bb.4:
	lsl	w1, w20, #4
	str	w1, [sp, #28]
Lloh8:
	adrp	x24, _MEM_LIMIT@GOTPAGE
Lloh9:
	ldr	x24, [x24, _MEM_LIMIT@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w1, w8
	b.le	LBB0_15
; %bb.5:
	mov	w21, #4
	b	LBB0_20
LBB0_6:
	ldr	x8, [x19]
	str	x8, [sp]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	mov	w21, #1
	b	LBB0_20
LBB0_7:
	mov	w21, #2
	b	LBB0_20
LBB0_8:
	mov	w21, #3
	b	LBB0_20
LBB0_9:
	add	w0, w20, #1024
	str	w0, [sp, #28]
	bl	_malloc
	cbz	x0, LBB0_19
; %bb.10:
	mov	x23, x0
Lloh12:
	adrp	x8, _Z_BEST_COMPRESSION@GOTPAGE
Lloh13:
	ldr	x8, [x8, _Z_BEST_COMPRESSION@GOTPAGEOFF]
Lloh14:
	ldr	w4, [x8]
	add	x1, sp, #28
	mov	x2, x22
	mov	x3, x20
	bl	_compress2
LBB0_11:
	mov	x21, x0
Lloh15:
	adrp	x8, _Z_OK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _Z_OK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_14
; %bb.12:
	ldr	x0, [x19, #24]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_21
; %bb.13:
	mov	x19, x0
	ldr	w2, [sp, #28]
	mov	x0, x23
	mov	w1, #1
	mov	x3, x19
	bl	_fwrite
	mov	x0, x19
	bl	_fclose
LBB0_14:
	ldr	w8, [sp, #28]
	stp	x20, x8, [sp, #8]
	str	x21, [sp]
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
	b	LBB0_20
LBB0_15:
	mov	x23, #0
Lloh22:
	adrp	x25, _Z_BUF_ERROR@GOTPAGE
Lloh23:
	ldr	x25, [x25, _Z_BUF_ERROR@GOTPAGEOFF]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_realloc
	cbz	x0, LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x23, x0
	add	x1, sp, #28
	mov	x2, x22
	mov	x3, x20
	bl	_uncompress
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_11
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	w8, [sp, #28]
	lsl	w1, w8, #4
	str	w1, [sp, #28]
	ldr	w8, [x24]
	mov	w21, #4
	cmp	w1, w8
	b.le	LBB0_16
	b	LBB0_20
LBB0_19:
	mov	w21, #5
LBB0_20:
	mov	x0, x21
	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
	add	sp, sp, #112
	ret
LBB0_21:
	mov	w21, #6
	b	LBB0_20
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"usage: %s <0|1> <infile> <outfile>\n"

l_.str.1:                               ; @.str.1
	.asciz	"rb"

	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_MEM_LIMIT,4,2                  ; @MEM_LIMIT
	.comm	_Z_BUF_ERROR,4,2                ; @Z_BUF_ERROR
	.comm	_Z_BEST_COMPRESSION,4,2         ; @Z_BEST_COMPRESSION
	.comm	_Z_OK,4,2                       ; @Z_OK
l_.str.2:                               ; @.str.2
	.asciz	"wb"

l_.str.3:                               ; @.str.3
	.asciz	"result %i, size %i -> %i\n"

.subsections_via_symbols
