// File: /workspace/github_cpp_makefile_star2_O1/t0mm4rx[P]piscine_cpp/day01/ex07/main.cpp
// Function: main
int main(int argc, char **argv)
{
	if (argc != 4)
	{
		std::cout << "Error ! Usage: ./replace <file> <find> <replace>" << std::endl;
		return (2);
	}
	if (!strlen(argv[2]) || !strlen(argv[3]))
	{
		std::cout << "Error: strings shouldn't be empty" << std::endl;
		return (2);
	}
	return (find_and_replace(argv[1], std::string(argv[1]) + std::string(".replace"), argv[2], argv[3]));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
cmpl $0x4, %edi
jne 0x267e
movq %rsi, %rbx
movq 0x10(%rsi), %rax
cmpb $0x0, (%rax)
je 0x2693
movq 0x18(%rbx), %rax
cmpb $0x0, (%rax)
je 0x2693
movq 0x8(%rbx), %rsi
leaq 0xb0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2912
movq 0x8(%rbx), %rsi
leaq 0x50(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x2912
leaq 0x40(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xa82(%rip), %rsi       # 0x309e
leaq 0xa83(%rip), %rdx       # 0x30a6
leaq 0x30(%rsp), %rdi
callq 0x2950
leaq 0x60(%rsp), %r15
movq -0x10(%r15), %rcx
movq -0x8(%r15), %r8
movq 0x38(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r15, %rcx
je 0x2652
movq 0x60(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x266d
movl $0xf, %esi
cmpq %r14, 0x30(%rsp)
je 0x2668
movq 0x40(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x26e9
movq 0x30(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x2060
jmp 0x26f7
movq 0x2953(%rip), %rbx      # 0x4fd8
leaq 0x9bf(%rip), %rsi       # 0x304b
movl $0x30, %edx
jmp 0x26a6
movq 0x293e(%rip), %rbx      # 0x4fd8
leaq 0x9db(%rip), %rsi       # 0x307c
movl $0x21, %edx
movq %rbx, %rdi
callq 0x2110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2090
movl $0x2, %ebx
movl %ebx, %eax
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2100
leaq 0x20(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x271b
movq %rsi, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x2721
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x10(%rbx), %rsi
leaq 0x90(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x2912
movq 0x18(%rbx), %rsi
leaq 0x70(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x2912
leaq 0xb0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x90(%rsp), %rdx
leaq 0x70(%rsp), %rcx
callq 0x22dc
movl %eax, %ebx
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27a9
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x20f0
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27ca
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x20f0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27e5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x20f0
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x27fc
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x20f0
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0x2813
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x20f0
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x26da
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x20f0
jmp 0x26da
movq %rax, %rbx
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2866
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x20f0
jmp 0x2866
movq %rax, %rbx
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x288c
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x20f0
jmp 0x288c
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28ac
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x20f0
jmp 0x28ac
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x28c8
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x20f0
jmp 0x28c8
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28e8
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x20f0
jmp 0x28e8
movq %rax, %rbx
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2909
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x20f0
movq %rbx, %rdi
callq 0x2170
nop