	.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, %r14
	movl	%edi, %ebx
	movq	(%rsi), %rax
	movq	_progname@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	cmpl	$2, %edi
	jg	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_usage
LBB0_2:
	addl	$-2, %ebx
	leaq	16(%r14), %rsi
	movl	%ebx, %edi
	callq	_get_pattern
	movq	8(%r14), %rdi
	movq	_inputname@GOTPCREL(%rip), %r14
	movq	%rdi, (%r14)
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_open
	movq	_inputfd@GOTPCREL(%rip), %r13
	movl	%eax, (%r13)
	cmpl	$-1, %eax
	jne	LBB0_3
## %bb.12:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r15), %rdx
	movq	(%r14), %rcx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	$3, %edi
	callq	_exit
LBB0_3:
	movl	%eax, %edi
	callq	_get_filesize
	movq	_filesize@GOTPCREL(%rip), %r12
	movl	%eax, (%r12)
	movq	_PROT_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_MAP_PRIVATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	(%r13), %r8d
	xorl	%edi, %edi
	movl	%eax, %esi
	xorl	%r9d, %r9d
	callq	_mmap
	movq	_madr@GOTPCREL(%rip), %rbx
	movq	%rax, (%rbx)
	movq	_MAP_FAILED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.13:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	(%r13), %edi
	callq	_close
	movl	$4, %edi
	callq	_exit
LBB0_4:
	xorl	%eax, %eax
	callq	_search_pattern
	movq	(%rbx), %rdi
	movl	(%r12), %esi
	callq	_munmap
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
LBB0_6:
	movl	(%r13), %edi
	callq	_close
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r15), %rdx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	(%r14), %r8
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
LBB0_8:
	movq	_stderr@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_num_matches@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	cmpl	$0, (%r14)
	jne	LBB0_9
## %bb.10:
	movq	_firstloc@GOTPCREL(%rip), %rax
	movl	$-1, (%rax)
	movl	$-1, %esi
	jmp	LBB0_11
LBB0_9:
	movq	_firstloc@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_11:
	leaq	L_.str.5(%rip), %rbx
	movq	%rbx, %rdi
	callq	_printf
	movl	(%r15), %edi
	movq	_firstloc@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_fprintf
	xorl	%edi, %edi
	cmpl	$0, (%r14)
	sete	%dil
	addl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_progname,8,3                   ## @progname
	.comm	_inputname,8,3                  ## @inputname
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_inputfd,4,2                    ## @inputfd
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: cannot open '%s'\n"

	.comm	_filesize,4,2                   ## @filesize
	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_MAP_PRIVATE,4,2                ## @MAP_PRIVATE
	.comm	_madr,8,3                       ## @madr
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
L_.str.1:                               ## @.str.1
	.asciz	"mmap error = %d\n"

	.comm	_errno,4,2                      ## @errno
L_.str.2:                               ## @.str.2
	.asciz	"munmap error = %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"%s: error %d closing '%s'\n"

L_.str.4:                               ## @.str.4
	.asciz	"number of pattern matches = %d\n"

	.comm	_num_matches,4,2                ## @num_matches
	.comm	_firstloc,4,2                   ## @firstloc
L_.str.5:                               ## @.str.5
	.asciz	"%ld\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, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x1
	ldr	x8, [x1]
Lloh0:
	adrp	x21, _progname@GOTPAGE
Lloh1:
	ldr	x21, [x21, _progname@GOTPAGEOFF]
	str	x8, [x21]
	subs	w20, w0, #2
	b.gt	LBB0_2
; %bb.1:
	bl	_usage
LBB0_2:
	add	x1, x19, #16
	mov	x0, x20
	bl	_get_pattern
	ldr	x0, [x19, #8]
Lloh2:
	adrp	x19, _inputname@GOTPAGE
Lloh3:
	ldr	x19, [x19, _inputname@GOTPAGEOFF]
	str	x0, [x19]
Lloh4:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	bl	_open
Lloh7:
	adrp	x20, _inputfd@GOTPAGE
Lloh8:
	ldr	x20, [x20, _inputfd@GOTPAGEOFF]
	str	w0, [x20]
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh9:
	adrp	x8, _stderr@GOTPAGE
Lloh10:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldr	x8, [x21]
	ldr	x9, [x19]
	stp	x8, x9, [sp]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	mov	w0, #3
	bl	_exit
LBB0_4:
	bl	_get_filesize
	mov	x1, x0
Lloh14:
	adrp	x22, _filesize@GOTPAGE
Lloh15:
	ldr	x22, [x22, _filesize@GOTPAGEOFF]
Lloh16:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
	str	w0, [x22]
Lloh18:
	ldr	w2, [x8]
Lloh19:
	adrp	x8, _MAP_PRIVATE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MAP_PRIVATE@GOTPAGEOFF]
Lloh21:
	ldr	w3, [x8]
	ldr	w4, [x20]
	mov	w0, #0
	mov	w5, #0
	bl	_mmap
Lloh22:
	adrp	x23, _madr@GOTPAGE
Lloh23:
	ldr	x23, [x23, _madr@GOTPAGEOFF]
	str	x0, [x23]
Lloh24:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.5:
Lloh27:
	adrp	x8, _stderr@GOTPAGE
Lloh28:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
Lloh30:
	adrp	x8, _errno@GOTPAGE
Lloh31:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh33:
	adrp	x1, l_.str.1@PAGE
Lloh34:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	ldr	w0, [x20]
	bl	_close
	mov	w0, #4
	bl	_exit
LBB0_6:
	bl	_search_pattern
	ldr	x0, [x23]
	ldr	w1, [x22]
	bl	_munmap
Lloh35:
	adrp	x22, _stderr@GOTPAGE
Lloh36:
	ldr	x22, [x22, _stderr@GOTPAGEOFF]
Lloh37:
	adrp	x23, _errno@GOTPAGE
Lloh38:
	ldr	x23, [x23, _errno@GOTPAGEOFF]
	cbz	x0, LBB0_8
; %bb.7:
	ldr	w0, [x22]
	ldr	w8, [x23]
	str	x8, [sp]
Lloh39:
	adrp	x1, l_.str.2@PAGE
Lloh40:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fprintf
LBB0_8:
	ldr	w0, [x20]
	bl	_close
	cbz	x0, LBB0_10
; %bb.9:
	ldr	w0, [x22]
	ldr	x8, [x21]
	ldr	x9, [x19]
	ldr	w10, [x23]
	stp	x10, x9, [sp, #8]
	str	x8, [sp]
Lloh41:
	adrp	x1, l_.str.3@PAGE
Lloh42:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fprintf
LBB0_10:
	ldr	w0, [x22]
Lloh43:
	adrp	x20, _num_matches@GOTPAGE
Lloh44:
	ldr	x20, [x20, _num_matches@GOTPAGEOFF]
	ldr	w8, [x20]
	str	x8, [sp]
Lloh45:
	adrp	x1, l_.str.4@PAGE
Lloh46:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_fprintf
	ldr	w8, [x20]
Lloh47:
	adrp	x21, _firstloc@GOTPAGE
Lloh48:
	ldr	x21, [x21, _firstloc@GOTPAGEOFF]
	cbnz	w8, LBB0_12
; %bb.11:
	mov	w1, #-1
	str	w1, [x21]
	b	LBB0_13
LBB0_12:
	ldr	w1, [x21]
LBB0_13:
Lloh49:
	adrp	x19, l_.str.5@PAGE
Lloh50:
	add	x19, x19, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_printf
	ldr	w0, [x22]
	ldr	w8, [x21]
	str	x8, [sp]
	mov	x1, x19
	bl	_fprintf
	ldr	w8, [x20]
	cmp	w8, #0
	cset	w8, eq
	lsl	w0, w8, #1
	bl	_exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpAdd	Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_progname,8,3                   ; @progname
	.comm	_inputname,8,3                  ; @inputname
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_inputfd,4,2                    ; @inputfd
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: cannot open '%s'\n"

	.comm	_filesize,4,2                   ; @filesize
	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_MAP_PRIVATE,4,2                ; @MAP_PRIVATE
	.comm	_madr,8,3                       ; @madr
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
l_.str.1:                               ; @.str.1
	.asciz	"mmap error = %d\n"

	.comm	_errno,4,2                      ; @errno
l_.str.2:                               ; @.str.2
	.asciz	"munmap error = %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"%s: error %d closing '%s'\n"

l_.str.4:                               ; @.str.4
	.asciz	"number of pattern matches = %d\n"

	.comm	_num_matches,4,2                ; @num_matches
	.comm	_firstloc,4,2                   ; @firstloc
l_.str.5:                               ; @.str.5
	.asciz	"%ld\n"

.subsections_via_symbols
