	.file	"147848.c"
	.intel_syntax noprefix
	.text
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	matched
	.align 4
	.type	matched, @object
	.size	matched, 4
matched:
	.zero	4
	.globl	off
	.type	off, @object
	.size	off, 1
off:
	.zero	1
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	string
	.align 8
	.type	string, @object
	.size	string, 8
string:
	.zero	8
	.globl	string_len
	.align 4
	.type	string_len, @object
	.size	string_len, 4
string_len:
	.zero	4
	.globl	filename
	.align 8
	.type	filename, @object
	.size	filename, 8
filename:
	.zero	8
	.globl	fp
	.align 8
	.type	fp, @object
	.size	fp, 8
fp:
	.zero	8
	.section	.rodata
.LC0:
	.string	"16"
.LC1:
	.string	" 8"
	.align 8
.LC2:
	.string	"%s-bit string found in file %s, pos 0x%x, offset by 0x%x\n"
	.text
	.globl	match_string
	.type	match_string, @function
match_string:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 24
	.cfi_offset 3, -24
	mov	eax, edi
	mov	BYTE PTR -20[rbp], al
	mov	rax, QWORD PTR string[rip]
	movzx	eax, BYTE PTR [rax]
	mov	edx, eax
	mov	eax, DWORD PTR c[rip]
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	BYTE PTR off[rip], al
	mov	DWORD PTR matched[rip], 1
	mov	DWORD PTR i[rip], 1
	jmp	.L2
.L6:
	cmp	BYTE PTR -20[rbp], 0
	je	.L3
	mov	rax, QWORD PTR fp[rip]
	mov	rdi, rax
	call	fgetc@PLT
.L3:
	mov	rdx, QWORD PTR string[rip]
	mov	eax, DWORD PTR i[rip]
	cdqe
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	mov	ebx, eax
	mov	rax, QWORD PTR fp[rip]
	mov	rdi, rax
	call	fgetc@PLT
	sub	ebx, eax
	mov	edx, ebx
	movzx	eax, BYTE PTR off[rip]
	cmp	dl, al
	jne	.L14
	mov	eax, DWORD PTR matched[rip]
	add	eax, 1
	mov	DWORD PTR matched[rip], eax
	mov	eax, DWORD PTR i[rip]
	add	eax, 1
	mov	DWORD PTR i[rip], eax
.L2:
	mov	edx, DWORD PTR i[rip]
	mov	eax, DWORD PTR string_len[rip]
	cmp	edx, eax
	jl	.L6
	jmp	.L5
.L14:
	nop
.L5:
	mov	edx, DWORD PTR matched[rip]
	mov	eax, DWORD PTR string_len[rip]
	cmp	edx, eax
	jne	.L7
	movzx	eax, BYTE PTR off[rip]
	movzx	ebx, al
	mov	rax, QWORD PTR fp[rip]
	mov	rdi, rax
	call	ftell@PLT
	mov	edx, DWORD PTR i[rip]
	movsx	rdx, edx
	sub	rax, rdx
	mov	rcx, rax
	mov	rdx, QWORD PTR filename[rip]
	cmp	BYTE PTR -20[rbp], 0
	je	.L8
	lea	rax, .LC0[rip]
	jmp	.L9
.L8:
	lea	rax, .LC1[rip]
.L9:
	mov	r8d, ebx
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR i[rip]
	sub	eax, 1
	mov	DWORD PTR i[rip], eax
.L7:
	mov	rax, QWORD PTR fp[rip]
	mov	rdi, rax
	call	feof@PLT
	test	eax, eax
	je	.L10
	mov	eax, -1
	jmp	.L1
.L10:
	mov	eax, DWORD PTR i[rip]
	neg	eax
	cmp	BYTE PTR -20[rbp], 0
	je	.L12
	mov	edx, 2
	jmp	.L13
.L12:
	mov	edx, 1
.L13:
	imul	eax, edx
	movsx	rcx, eax
	mov	rax, QWORD PTR fp[rip]
	mov	edx, 1
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
.L1:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	match_string, .-match_string
	.section	.rodata
.LC3:
	.string	"v"
	.align 8
.LC4:
	.string	"Usage: ./relative_search (-v) string file [...]"
.LC5:
	.string	"Looking for string %s in %s\n"
.LC6:
	.string	"rb"
.LC7:
	.string	"ERROR: Cannot open file\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	BYTE PTR -5[rbp], 0
	jmp	.L16
.L17:
	mov	eax, DWORD PTR c[rip]
	cmp	eax, 118
	jne	.L16
	mov	BYTE PTR -5[rbp], 1
	nop
.L16:
	mov	rcx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -20[rbp]
	lea	rdx, .LC3[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	getopt@PLT
	mov	DWORD PTR c[rip], eax
	mov	eax, DWORD PTR c[rip]
	cmp	eax, -1
	jne	.L17
	mov	edx, DWORD PTR optind[rip]
	mov	eax, DWORD PTR -20[rbp]
	sub	eax, edx
	cmp	eax, 1
	jg	.L18
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L19
.L18:
	mov	eax, DWORD PTR optind[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR string[rip], rax
	mov	rax, QWORD PTR string[rip]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR string_len[rip], eax
	mov	eax, DWORD PTR optind[rip]
	add	eax, 1
	mov	DWORD PTR -4[rbp], eax
	jmp	.L20
.L25:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR filename[rip], rax
	cmp	BYTE PTR -5[rbp], 0
	je	.L21
	mov	rdx, QWORD PTR filename[rip]
	mov	rax, QWORD PTR string[rip]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
.L21:
	mov	rax, QWORD PTR filename[rip]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR fp[rip], rax
	mov	rax, QWORD PTR fp[rip]
	test	rax, rax
	jne	.L23
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L19
.L24:
	mov	edi, 0
	call	match_string
	mov	edi, 1
	call	match_string
.L23:
	mov	rax, QWORD PTR fp[rip]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR c[rip], eax
	mov	eax, DWORD PTR c[rip]
	cmp	eax, -1
	jne	.L24
	add	DWORD PTR -4[rbp], 1
.L20:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L25
	mov	eax, 0
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"147848.c"
	.text
	.comm	i,4,4
	.comm	matched,4,4
	.comm	off,1,1
	.comm	c,4,4
	.comm	string,4,4
	.comm	string_len,4,4
	.comm	filename,4,4
	.comm	fp,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"16\000"
	.align	2
.LC1:
	.ascii	" 8\000"
	.align	2
.LC2:
	.ascii	"%s-bit string found in file %s, pos 0x%x, offset by"
	.ascii	" 0x%x\012\000"
	.text
	.align	2
	.global	match_string
	.syntax unified
	.arm
	.fpu softvfp
	.type	match_string, %function
match_string:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #16
	mov	r3, r0
	strb	r3, [fp, #-13]
	ldr	r3, .L15
	ldr	r3, [r3]
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, .L15+4
	ldr	r3, [r3]
	and	r3, r3, #255
	sub	r3, r2, r3
	and	r2, r3, #255
	ldr	r3, .L15+8
	strb	r2, [r3]
	ldr	r3, .L15+12
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, .L15+16
	mov	r2, #1
	str	r2, [r3]
	b	.L2
.L6:
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L3
	ldr	r3, .L15+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	fgetc
.L3:
	ldr	r3, .L15
	ldr	r3, [r3]
	ldr	r2, .L15+16
	ldr	r2, [r2]
	add	r3, r3, r2
	ldrb	r4, [r3]	@ zero_extendqisi2
	ldr	r3, .L15+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	fgetc
	mov	r3, r0
	and	r3, r3, #255
	sub	r3, r4, r3
	and	r2, r3, #255
	ldr	r3, .L15+8
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r2, r3
	bne	.L14
	ldr	r3, .L15+12
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L15+12
	str	r3, [r2]
	ldr	r3, .L15+16
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L15+16
	str	r3, [r2]
.L2:
	ldr	r3, .L15+16
	ldr	r2, [r3]
	ldr	r3, .L15+24
	ldr	r3, [r3]
	cmp	r2, r3
	blt	.L6
	b	.L5
.L14:
	nop
.L5:
	ldr	r3, .L15+12
	ldr	r2, [r3]
	ldr	r3, .L15+24
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L7
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L8
	ldr	r4, .L15+28
	b	.L9
.L8:
	ldr	r4, .L15+32
.L9:
	ldr	r3, .L15+36
	ldr	r5, [r3]
	ldr	r3, .L15+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	ftell
	mov	r2, r0
	ldr	r3, .L15+16
	ldr	r3, [r3]
	sub	r3, r2, r3
	ldr	r2, .L15+8
	ldrb	r2, [r2]	@ zero_extendqisi2
	str	r2, [sp]
	mov	r2, r5
	mov	r1, r4
	ldr	r0, .L15+40
	bl	printf
	ldr	r3, .L15+16
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L15+16
	str	r3, [r2]
.L7:
	ldr	r3, .L15+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	mvn	r3, #0
	b	.L1
.L10:
	ldr	r3, .L15+20
	ldr	r0, [r3]
	ldr	r3, .L15+16
	ldr	r3, [r3]
	rsb	r2, r3, #0
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L12
	mov	r3, #2
	b	.L13
.L12:
	mov	r3, #1
.L13:
	mul	r3, r2, r3
	mov	r2, #1
	mov	r1, r3
	bl	fseek
.L1:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L16:
	.align	2
.L15:
	.word	string
	.word	c
	.word	off
	.word	matched
	.word	i
	.word	fp
	.word	string_len
	.word	.LC0
	.word	.LC1
	.word	filename
	.word	.LC2
	.size	match_string, .-match_string
	.section	.rodata
	.align	2
.LC3:
	.ascii	"v\000"
	.align	2
.LC4:
	.ascii	"Usage: ./relative_search (-v) string file [...]\000"
	.align	2
.LC5:
	.ascii	"Looking for string %s in %s\012\000"
	.align	2
.LC6:
	.ascii	"rb\000"
	.align	2
.LC7:
	.ascii	"ERROR: Cannot open file\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r3, #0
	strb	r3, [fp, #-9]
	b	.L18
.L19:
	ldr	r3, .L28
	ldr	r3, [r3]
	cmp	r3, #118
	bne	.L18
	mov	r3, #1
	strb	r3, [fp, #-9]
	nop
.L18:
	ldr	r2, .L28+4
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	getopt
	mov	r3, r0
	ldr	r2, .L28
	str	r3, [r2]
	ldr	r3, .L28
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L19
	ldr	r3, .L28+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	sub	r3, r2, r3
	cmp	r3, #1
	bgt	.L20
	ldr	r0, .L28+12
	bl	puts
	mov	r3, #1
	b	.L21
.L20:
	ldr	r3, .L28+8
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, .L28+16
	str	r3, [r2]
	ldr	r3, .L28+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L28+20
	str	r2, [r3]
	ldr	r3, .L28+8
	ldr	r3, [r3]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	b	.L22
.L27:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, .L28+24
	str	r3, [r2]
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L23
	ldr	r3, .L28+16
	ldr	r3, [r3]
	ldr	r2, .L28+24
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, .L28+28
	bl	printf
.L23:
	ldr	r3, .L28+24
	ldr	r3, [r3]
	ldr	r1, .L28+32
	mov	r0, r3
	bl	fopen
	mov	r3, r0
	ldr	r2, .L28+36
	str	r3, [r2]
	ldr	r3, .L28+36
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L25
	ldr	r3, .L28+40
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L28+44
	bl	fwrite
	mov	r3, #1
	b	.L21
.L26:
	mov	r0, #0
	bl	match_string
	mov	r0, #1
	bl	match_string
.L25:
	ldr	r3, .L28+36
	ldr	r3, [r3]
	mov	r0, r3
	bl	fgetc
	mov	r3, r0
	ldr	r2, .L28
	str	r3, [r2]
	ldr	r3, .L28
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L26
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L22:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L27
	mov	r3, #0
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	c
	.word	.LC3
	.word	optind
	.word	.LC4
	.word	string
	.word	string_len
	.word	filename
	.word	.LC5
	.word	.LC6
	.word	fp
	.word	stderr
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
