	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_openfile                       ## -- Begin function openfile
	.p2align	4, 0x90
_openfile:                              ## @openfile
	.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
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_1
## %bb.6:
	movq	%rbx, %rdi
	callq	_file_is_tmp
	movl	%eax, %r12d
	xorl	%r13d, %r13d
	testl	%eax, %eax
	je	LBB0_7
## %bb.10:
	cmpb	$119, (%r15)
	jne	LBB0_12
## %bb.11:
	movq	_S_IWGRP@GOTPCREL(%rip), %rax
	movq	_S_IWOTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_S_IRGRP@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_S_IROTH@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	callq	_umask
	movl	%eax, %r13d
LBB0_12:
	movq	_compress_program@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_7
## %bb.13:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_strlen
	subl	$-128, %eax
	movslq	%eax, %r13
	movq	%r13, %rdi
	callq	_sort_malloc
	movq	%rax, %r12
	movq	_stdout@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_fflush
	movb	(%r15), %al
	cmpb	$119, %al
	je	LBB0_17
## %bb.14:
	cmpb	$114, %al
	jne	LBB0_18
## %bb.15:
	decq	%r13
	movq	(%r14), %r8
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rcx
	callq	_snprintf
	jmp	LBB0_19
LBB0_7:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_fopen
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	movl	$2, %edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_err
LBB0_9:
	testl	%r12d, %r12d
	je	LBB0_24
## %bb.22:
	cmpb	$119, (%r15)
	je	LBB0_23
	jmp	LBB0_24
LBB0_1:
	testq	%r15, %r15
	je	LBB0_4
## %bb.2:
	cmpb	$114, (%r15)
	jne	LBB0_4
## %bb.3:
	movq	_stdin@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_24
LBB0_4:
	movq	_stdout@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_24
LBB0_17:
	decq	%r13
	movq	(%r14), %rcx
	leaq	L_.str.2(%rip), %rdx
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%rbx, %r8
	callq	_snprintf
	jmp	LBB0_19
LBB0_18:
	movl	$7, %edi
	callq	_getstr
	leaq	L_.str.3(%rip), %rsi
	movl	$2, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_err
LBB0_19:
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_popen
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_21
## %bb.20:
	movl	$2, %edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_err
LBB0_21:
	movq	%r12, %rdi
	callq	_sort_free
	cmpb	$119, (%r15)
	jne	LBB0_24
LBB0_23:
	movl	%r13d, %edi
	callq	_umask
LBB0_24:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-"

	.comm	_stdin,8,3                      ## @stdin
	.comm	_stdout,8,3                     ## @stdout
	.comm	_S_IWGRP,4,2                    ## @S_IWGRP
	.comm	_S_IWOTH,4,2                    ## @S_IWOTH
	.comm	_S_IRGRP,4,2                    ## @S_IRGRP
	.comm	_S_IROTH,4,2                    ## @S_IROTH
	.comm	_compress_program,8,3           ## @compress_program
L_.str.1:                               ## @.str.1
	.asciz	"cat %s | %s -d"

L_.str.2:                               ## @.str.2
	.asciz	"%s > %s"

L_.str.3:                               ## @.str.3
	.asciz	"%s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_openfile                       ; -- Begin function openfile
	.p2align	2
_openfile:                              ; @openfile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_4
; %bb.1:
	mov	x0, x21
	bl	_file_is_tmp
	mov	x22, x0
	cbz	w0, LBB0_8
; %bb.2:
	ldrb	w8, [x19]
	cmp	w8, #119
	b.ne	LBB0_9
; %bb.3:
Lloh2:
	adrp	x8, _S_IWGRP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _S_IWGRP@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _S_IWOTH@GOTPAGE
Lloh6:
	ldr	x9, [x9, _S_IWOTH@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _S_IRGRP@GOTPAGE
Lloh9:
	ldr	x9, [x9, _S_IRGRP@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh11:
	adrp	x9, _S_IROTH@GOTPAGE
Lloh12:
	ldr	x9, [x9, _S_IROTH@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w0, w8, w9
	bl	_umask
	mov	x20, x0
	b	LBB0_10
LBB0_4:
	cbz	x19, LBB0_7
; %bb.5:
	ldrb	w8, [x19]
	cmp	w8, #114
	b.ne	LBB0_7
; %bb.6:
Lloh14:
	adrp	x8, _stdin@GOTPAGE
Lloh15:
	ldr	x8, [x8, _stdin@GOTPAGEOFF]
Lloh16:
	ldr	x21, [x8]
	b	LBB0_24
LBB0_7:
Lloh17:
	adrp	x8, _stdout@GOTPAGE
Lloh18:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh19:
	ldr	x21, [x8]
	b	LBB0_24
LBB0_8:
	mov	w20, #0
	b	LBB0_14
LBB0_9:
	mov	w20, #0
LBB0_10:
Lloh20:
	adrp	x24, _compress_program@GOTPAGE
Lloh21:
	ldr	x24, [x24, _compress_program@GOTPAGEOFF]
	ldr	x8, [x24]
	cbz	x8, LBB0_14
; %bb.11:
	mov	x0, x21
	bl	_strlen
	add	w8, w0, #128
	sxtw	x23, w8
	mov	x0, x23
	bl	_sort_malloc
	mov	x22, x0
Lloh22:
	adrp	x8, _stdout@GOTPAGE
Lloh23:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh24:
	ldr	x0, [x8]
	bl	_fflush
	ldrb	w8, [x19]
	cmp	w8, #119
	b.eq	LBB0_17
; %bb.12:
	cmp	w8, #114
	b.ne	LBB0_18
; %bb.13:
	sub	x1, x23, #1
	ldr	x4, [x24]
Lloh25:
	adrp	x2, l_.str.1@PAGE
Lloh26:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x3, x21
	bl	_snprintf
	b	LBB0_19
LBB0_14:
	mov	x0, x21
	mov	x1, x19
	bl	_fopen
	mov	x21, x0
	cbnz	x0, LBB0_16
; %bb.15:
	mov	w0, #2
	mov	x1, #0
	bl	_err
LBB0_16:
	cbnz	w22, LBB0_22
	b	LBB0_24
LBB0_17:
	sub	x1, x23, #1
	ldr	x3, [x24]
Lloh27:
	adrp	x2, l_.str.2@PAGE
Lloh28:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x22
	mov	x4, x21
	bl	_snprintf
	b	LBB0_19
LBB0_18:
	mov	w0, #7
	bl	_getstr
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh29:
	adrp	x1, l_.str.3@PAGE
Lloh30:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #2
	bl	_err
LBB0_19:
	mov	x0, x22
	mov	x1, x19
	bl	_popen
	mov	x21, x0
	cbnz	x0, LBB0_21
; %bb.20:
	mov	w0, #2
	mov	x1, #0
	bl	_err
LBB0_21:
	mov	x0, x22
	bl	_sort_free
LBB0_22:
	ldrb	w8, [x19]
	cmp	w8, #119
	b.ne	LBB0_24
; %bb.23:
	mov	x0, x20
	bl	_umask
LBB0_24:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-"

	.comm	_stdin,8,3                      ; @stdin
	.comm	_stdout,8,3                     ; @stdout
	.comm	_S_IWGRP,4,2                    ; @S_IWGRP
	.comm	_S_IWOTH,4,2                    ; @S_IWOTH
	.comm	_S_IRGRP,4,2                    ; @S_IRGRP
	.comm	_S_IROTH,4,2                    ; @S_IROTH
	.comm	_compress_program,8,3           ; @compress_program
l_.str.1:                               ; @.str.1
	.asciz	"cat %s | %s -d"

l_.str.2:                               ; @.str.2
	.asciz	"%s > %s"

l_.str.3:                               ; @.str.3
	.asciz	"%s"

.subsections_via_symbols
