// File: mbourand[P]webserv/srcs/Request.cpp
// Function: is_header_field_finished(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
size_t is_header_field_finished(std::string str)
{
	size_t i = 0;

	while (str.find("\r\n", i) != std::string::npos)
	{
		if (str.find("\r\n", i) == 0)
			return (0);
		if (!str[str.find("\r\n", i) + 2])
			return Logger::print("Header field is not finished", -1, INFO, VERBOSE);
		if (str[str.find("\r\n", i) + 2] != ' ' && str[str.find("\r\n", i) + 2] != '\t')
			return Logger::print("Header field is finished", str.find("\r\n", i) + 2, INFO, VERBOSE);
		i = str.find("\r\n", i) + 2;
	}
	return Logger::print("Header field is not finished", -1, INFO, VERBOSE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0xa8(%rbp)
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0xa8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0xd270(%rip), %rsi      # 0x6dcb0
callq 0x9c60
cmpq $-0x1, %rax
je 0x60c83
movq -0xa8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0xd24f(%rip), %rsi      # 0x6dcb0
callq 0x9c60
cmpq $0x0, %rax
jne 0x60a79
movq $0x0, -0x8(%rbp)
jmp 0x60d29
movq -0xa8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0xd225(%rip), %rsi      # 0x6dcb0
callq 0x9c60
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
addq $0x2, %rsi
callq 0x9c70
cmpb $0x0, (%rax)
jne 0x60b43
leaq -0x39(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x9b10
movq -0xb0(%rbp), %rdx
leaq 0xd101(%rip), %rsi      # 0x6dbcb
leaq -0x38(%rbp), %rdi
callq 0xa780
jmp 0x60ad5
leaq -0x38(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x1cdd0
movl %eax, -0xb4(%rbp)
jmp 0x60aef
movl -0xb4(%rbp), %eax
cltq
movq %rax, -0x8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9c98
leaq -0x39(%rbp), %rdi
callq 0x9700
jmp 0x60d29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x60b35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9c98
leaq -0x39(%rbp), %rdi
callq 0x9700
jmp 0x60d36
movq -0xa8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0xd15b(%rip), %rsi      # 0x6dcb0
callq 0x9c60
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
addq $0x2, %rsi
callq 0x9c70
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0x60c5f
movq -0xa8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0xd125(%rip), %rsi      # 0x6dcb0
callq 0x9c60
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
addq $0x2, %rsi
callq 0x9c70
movsbl (%rax), %eax
cmpl $0x9, %eax
je 0x60c5f
leaq -0x71(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x9b10
movq -0xc0(%rbp), %rdx
leaq 0xd01b(%rip), %rsi      # 0x6dbe8
leaq -0x70(%rbp), %rdi
callq 0xa780
jmp 0x60bd8
movq -0xa8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0xd0c6(%rip), %rsi      # 0x6dcb0
callq 0x9c60
movq %rax, %rsi
addq $0x2, %rsi
leaq -0x70(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x61990
movq %rax, -0xc8(%rbp)
jmp 0x60c0c
movq -0xc8(%rbp), %rax
movq %rax, -0x8(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x9c98
leaq -0x71(%rbp), %rdi
callq 0x9700
jmp 0x60d29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x60c51
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x9c98
leaq -0x71(%rbp), %rdi
callq 0x9700
jmp 0x60d36
movq -0xa8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0xd03f(%rip), %rsi      # 0x6dcb0
callq 0x9c60
addq $0x2, %rax
movq %rax, -0x18(%rbp)
jmp 0x60a2e
leaq -0x99(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x9b10
movq -0xd0(%rbp), %rdx
leaq 0xcf27(%rip), %rsi      # 0x6dbcb
leaq -0x98(%rbp), %rdi
callq 0xa780
jmp 0x60cb2
leaq -0x98(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x1cdd0
movl %eax, -0xd4(%rbp)
jmp 0x60ccf
movl -0xd4(%rbp), %eax
cltq
movq %rax, -0x8(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x9c98
leaq -0x99(%rbp), %rdi
callq 0x9700
jmp 0x60d29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x60d1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x9c98
leaq -0x99(%rbp), %rdi
callq 0x9700
jmp 0x60d36
movq -0x8(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x9af0
nop