// File: solaldunckel[P]webserv/srcs/HTTP/CGI.cpp
// Function: CGI::setCGIEnv()
bool CGI::setCGIEnv() {
  if (config_.getMethod() == "POST") {
		cgi_env_["CONTENT_TYPE"] = req_headers_["Content-Type"];
		cgi_env_["CONTENT_LENGTH"] = ft::to_string(req_body_.length());
	}
	cgi_env_["GATEWAY_INTERFACE"] = "CGI/1.1";
  cgi_env_["PATH_INFO"] = file_path_;
	cgi_env_["PATH_TRANSLATED"] = file_path_;
  cgi_env_["QUERY_STRING"] = config_.getQuery();
  cgi_env_["REMOTE_ADDR"] = config_.getClient().getAddr();

  if (config_.getAuth() != "off") {
    cgi_env_["AUTH_TYPE"] = "Basic";
    cgi_env_["REMOTE_IDENT"] = config_.getAuth().substr(0, config_.getAuth().find(':'));
    cgi_env_["REMOTE_USER"] = config_.getAuth().substr(0, config_.getAuth().find(':'));
  }

  cgi_env_["REQUEST_METHOD"] = config_.getMethod();
	cgi_env_["REQUEST_URI"] = file_path_;

  cgi_env_["SCRIPT_NAME"] = cgi_path_;
	cgi_env_["SERVER_NAME"] = config_.getHost();
	cgi_env_["SERVER_PROTOCOL"] = config_.getProtocol();
	cgi_env_["SERVER_PORT"] = ft::to_string(config_.getPort());
  cgi_env_["SERVER_SOFTWARE"] = "WEBSERV/1.0";

	if (extension_ == ".php")
		cgi_env_["REDIRECT_STATUS"] = "200";

  for (std::map<std::string, std::string, ft::comp>::iterator it = req_headers_.begin(); it != req_headers_.end(); it++) {
    if (!it->second.empty()) {
      std::string header = "HTTP_" + ft::to_upper(it->first);
      std::replace(header.begin(), header.end(), '-', '_');
      cgi_env_[header] = it->second;
    }
  }

	if (!(env_ = (char **)malloc(sizeof(char *) * (cgi_env_.size() + 1))))
		return false;

	int i = 0;

	for (std::map<std::string, std::string>::iterator it = cgi_env_.begin(); it != cgi_env_.end(); it++) {
		std::string tmp = it->first + "=" + it->second;
		if (!(env_[i] = ft::strdup(tmp.c_str())))
      return false;
		i++;
	}
	env_[i] = NULL;
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x710, %rsp            # imm = 0x710
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x498(%rbp)
movq 0x8(%rax), %rdi
callq 0x13030
movq %rax, %rdi
leaq 0x240b1(%rip), %rsi     # 0x4359e
callq 0x8ff0
testb $0x1, %al
jne 0x1f4fb
jmp 0x1f73d
movq -0x498(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x4a8(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x4a0(%rbp)
callq 0x5960
movq -0x4a0(%rbp), %rdx
leaq 0x240c4(%rip), %rsi     # 0x435ef
leaq -0x30(%rbp), %rdi
callq 0x6be0
jmp 0x1f536
movq -0x4a8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x13940
movq %rax, -0x4b0(%rbp)
jmp 0x1f54f
movq -0x498(%rbp), %rax
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x4c0(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x4b8(%rbp)
callq 0x5960
movq -0x4b8(%rbp), %rdx
leaq 0x2407b(%rip), %rsi     # 0x435fc
leaq -0x68(%rbp), %rdi
callq 0x6be0
jmp 0x1f58c
movq -0x4c0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x20e30
movq %rax, -0x4c8(%rbp)
jmp 0x1f5a5
movq -0x4b0(%rbp), %rsi
movq -0x4c8(%rbp), %rdi
callq 0x5050
jmp 0x1f5ba
leaq -0x68(%rbp), %rdi
callq 0x5aa8
leaq -0x69(%rbp), %rdi
callq 0x55e0
leaq -0x30(%rbp), %rdi
callq 0x5aa8
leaq -0x31(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rdi
addq $0xd8, %rdi
callq 0x5830
movq %rax, %rsi
leaq -0x90(%rbp), %rdi
callq 0x20f10
movq -0x498(%rbp), %rax
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x4d8(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0x5960
movq -0x4d0(%rbp), %rdx
leaq 0x23fd4(%rip), %rsi     # 0x43609
leaq -0xb0(%rbp), %rdi
callq 0x6be0
jmp 0x1f643
movq -0x4d8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x20e30
movq %rax, -0x4e0(%rbp)
jmp 0x1f65f
movq -0x4e0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x56d0
leaq -0xb0(%rbp), %rdi
callq 0x5aa8
leaq -0xb1(%rbp), %rdi
callq 0x55e0
leaq -0x90(%rbp), %rdi
callq 0x5aa8
jmp 0x1f73d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1f6ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1f6e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1f6da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5aa8
leaq -0x69(%rbp), %rdi
callq 0x55e0
leaq -0x30(%rbp), %rdi
callq 0x5aa8
leaq -0x31(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1f720
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x5aa8
leaq -0xb1(%rbp), %rdi
callq 0x55e0
leaq -0x90(%rbp), %rdi
callq 0x5aa8
jmp 0x209bc
movq -0x498(%rbp), %rax
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x4f0(%rbp)
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x4e8(%rbp)
callq 0x5960
movq -0x4e8(%rbp), %rdx
leaq 0x23eae(%rip), %rsi     # 0x43620
leaq -0xd8(%rbp), %rdi
callq 0x6be0
jmp 0x1f780
movq -0x4f0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x20e30
movq %rax, -0x4f8(%rbp)
jmp 0x1f79c
movq -0x4f8(%rbp), %rdi
leaq 0x23e6e(%rip), %rsi     # 0x43618
callq 0x5780
jmp 0x1f7b1
leaq -0xd8(%rbp), %rdi
callq 0x5aa8
leaq -0xd9(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rax
movq %rax, %rcx
addq $0x98, %rcx
movq %rcx, -0x510(%rbp)
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x508(%rbp)
leaq -0x101(%rbp), %rdi
movq %rdi, -0x500(%rbp)
callq 0x5960
movq -0x500(%rbp), %rdx
leaq 0x23e23(%rip), %rsi     # 0x43632
leaq -0x100(%rbp), %rdi
callq 0x6be0
jmp 0x1f81d
movq -0x508(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x20e30
movq %rax, -0x518(%rbp)
jmp 0x1f839
movq -0x510(%rbp), %rsi
movq -0x518(%rbp), %rdi
callq 0x5050
jmp 0x1f84e
leaq -0x100(%rbp), %rdi
callq 0x5aa8
leaq -0x101(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rax
movq %rax, %rcx
addq $0x98, %rcx
movq %rcx, -0x530(%rbp)
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x528(%rbp)
leaq -0x129(%rbp), %rdi
movq %rdi, -0x520(%rbp)
callq 0x5960
movq -0x520(%rbp), %rdx
leaq 0x23d90(%rip), %rsi     # 0x4363c
leaq -0x128(%rbp), %rdi
callq 0x6be0
jmp 0x1f8ba
movq -0x528(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x20e30
movq %rax, -0x538(%rbp)
jmp 0x1f8d6
movq -0x530(%rbp), %rsi
movq -0x538(%rbp), %rdi
callq 0x5050
jmp 0x1f8eb
leaq -0x128(%rbp), %rdi
callq 0x5aa8
leaq -0x129(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x12e00
movq %rax, %rcx
movq -0x498(%rbp), %rax
movq %rcx, -0x550(%rbp)
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x548(%rbp)
leaq -0x151(%rbp), %rdi
movq %rdi, -0x540(%rbp)
callq 0x5960
movq -0x540(%rbp), %rdx
leaq 0x23cfa(%rip), %rsi     # 0x4364c
leaq -0x150(%rbp), %rdi
callq 0x6be0
jmp 0x1f960
movq -0x548(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x20e30
movq %rax, -0x558(%rbp)
jmp 0x1f97c
movq -0x550(%rbp), %rsi
movq -0x558(%rbp), %rdi
callq 0x5050
jmp 0x1f991
leaq -0x150(%rbp), %rdi
callq 0x5aa8
leaq -0x151(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x12e90
movq %rax, %rdi
callq 0x21cd0
movq %rax, %rcx
movq -0x498(%rbp), %rax
movq %rcx, -0x570(%rbp)
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x568(%rbp)
leaq -0x179(%rbp), %rdi
movq %rdi, -0x560(%rbp)
callq 0x5960
movq -0x560(%rbp), %rdx
leaq 0x23c59(%rip), %rsi     # 0x43659
leaq -0x178(%rbp), %rdi
callq 0x6be0
jmp 0x1fa0e
movq -0x568(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x20e30
movq %rax, -0x578(%rbp)
jmp 0x1fa2a
movq -0x570(%rbp), %rsi
movq -0x578(%rbp), %rdi
callq 0x5050
jmp 0x1fa3f
leaq -0x178(%rbp), %rdi
callq 0x5aa8
leaq -0x179(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x12ed0
movq %rax, %rdi
leaq 0x24686(%rip), %rsi     # 0x440f7
callq 0x9360
testb $0x1, %al
jne 0x1fa7f
jmp 0x1fed1
movq -0x498(%rbp), %rax
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x588(%rbp)
leaq -0x1a1(%rbp), %rdi
movq %rdi, -0x580(%rbp)
callq 0x5960
movq -0x580(%rbp), %rdx
leaq 0x23bb7(%rip), %rsi     # 0x4366b
leaq -0x1a0(%rbp), %rdi
callq 0x6be0
jmp 0x1fac2
movq -0x588(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x20e30
movq %rax, -0x590(%rbp)
jmp 0x1fade
movq -0x590(%rbp), %rdi
leaq 0x23b79(%rip), %rsi     # 0x43665
callq 0x5780
jmp 0x1faf3
leaq -0x1a0(%rbp), %rdi
callq 0x5aa8
leaq -0x1a1(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x12ed0
movq %rax, %rcx
movq -0x498(%rbp), %rax
movq %rcx, -0x5b0(%rbp)
movq 0x8(%rax), %rdi
callq 0x12ed0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x5a8(%rbp)
movl $0x3a, %esi
callq 0x5730
movq -0x5b0(%rbp), %rsi
movq -0x5a8(%rbp), %rdx
movq %rax, %rcx
leaq -0x1c8(%rbp), %rdi
callq 0x55a0
movq -0x498(%rbp), %rax
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x5a0(%rbp)
leaq -0x1e9(%rbp), %rdi
movq %rdi, -0x598(%rbp)
callq 0x5960
movq -0x598(%rbp), %rdx
leaq 0x23ad6(%rip), %rsi     # 0x43675
leaq -0x1e8(%rbp), %rdi
callq 0x6be0
jmp 0x1fbad
movq -0x5a0(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x20e30
movq %rax, -0x5b8(%rbp)
jmp 0x1fbc9
movq -0x5b8(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movq %rsi, -0x5e0(%rbp)
callq 0x56d0
leaq -0x1e8(%rbp), %rdi
callq 0x5aa8
leaq -0x1e9(%rbp), %rdi
callq 0x55e0
movq -0x5e0(%rbp), %rdi
callq 0x5aa8
movq -0x498(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x12ed0
movq %rax, %rcx
movq -0x498(%rbp), %rax
movq %rcx, -0x5d8(%rbp)
movq 0x8(%rax), %rdi
callq 0x12ed0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x5d0(%rbp)
movl $0x3a, %esi
callq 0x5730
movq -0x5d8(%rbp), %rsi
movq -0x5d0(%rbp), %rdx
movq %rax, %rcx
leaq -0x210(%rbp), %rdi
callq 0x55a0
movq -0x498(%rbp), %rax
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x5c8(%rbp)
leaq -0x231(%rbp), %rdi
movq %rdi, -0x5c0(%rbp)
callq 0x5960
movq -0x5c0(%rbp), %rdx
leaq 0x239e7(%rip), %rsi     # 0x43682
leaq -0x230(%rbp), %rdi
callq 0x6be0
jmp 0x1fca9
movq -0x5c8(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x20e30
movq %rax, -0x5e8(%rbp)
jmp 0x1fcc5
movq -0x5e8(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x56d0
leaq -0x230(%rbp), %rdi
callq 0x5aa8
leaq -0x231(%rbp), %rdi
callq 0x55e0
leaq -0x210(%rbp), %rdi
callq 0x5aa8
jmp 0x1fed1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1fd27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x5aa8
leaq -0xd9(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1fd5e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x5aa8
leaq -0x101(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1fd95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x5aa8
leaq -0x129(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1fdcc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x5aa8
leaq -0x151(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1fe03
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x5aa8
leaq -0x179(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1fe3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x5aa8
leaq -0x1a1(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1fe71
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x5aa8
leaq -0x1e9(%rbp), %rdi
callq 0x55e0
leaq -0x1c8(%rbp), %rdi
callq 0x5aa8
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1feb4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x5aa8
leaq -0x231(%rbp), %rdi
callq 0x55e0
leaq -0x210(%rbp), %rdi
callq 0x5aa8
jmp 0x209bc
movq -0x498(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x13030
movq %rax, %rcx
movq -0x498(%rbp), %rax
movq %rcx, -0x600(%rbp)
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x5f8(%rbp)
leaq -0x259(%rbp), %rdi
movq %rdi, -0x5f0(%rbp)
callq 0x5960
movq -0x5f0(%rbp), %rdx
leaq 0x2376e(%rip), %rsi     # 0x4368e
leaq -0x258(%rbp), %rdi
callq 0x6be0
jmp 0x1ff2e
movq -0x5f8(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x20e30
movq %rax, -0x608(%rbp)
jmp 0x1ff4a
movq -0x600(%rbp), %rsi
movq -0x608(%rbp), %rdi
callq 0x5050
jmp 0x1ff5f
leaq -0x258(%rbp), %rdi
callq 0x5aa8
leaq -0x259(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rax
movq %rax, %rcx
addq $0x98, %rcx
movq %rcx, -0x620(%rbp)
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x618(%rbp)
leaq -0x281(%rbp), %rdi
movq %rdi, -0x610(%rbp)
callq 0x5960
movq -0x610(%rbp), %rdx
leaq 0x236e0(%rip), %rsi     # 0x4369d
leaq -0x280(%rbp), %rdi
callq 0x6be0
jmp 0x1ffcb
movq -0x618(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x20e30
movq %rax, -0x628(%rbp)
jmp 0x1ffe7
movq -0x620(%rbp), %rsi
movq -0x628(%rbp), %rdi
callq 0x5050
jmp 0x1fffc
leaq -0x280(%rbp), %rdi
callq 0x5aa8
leaq -0x281(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rax
movq %rax, %rcx
addq $0x18, %rcx
movq %rcx, -0x640(%rbp)
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x638(%rbp)
leaq -0x2a9(%rbp), %rdi
movq %rdi, -0x630(%rbp)
callq 0x5960
movq -0x630(%rbp), %rdx
leaq 0x23652(%rip), %rsi     # 0x436a9
leaq -0x2a8(%rbp), %rdi
callq 0x6be0
jmp 0x20065
movq -0x638(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x20e30
movq %rax, -0x648(%rbp)
jmp 0x20081
movq -0x640(%rbp), %rsi
movq -0x648(%rbp), %rdi
callq 0x5050
jmp 0x20096
leaq -0x2a8(%rbp), %rdi
callq 0x5aa8
leaq -0x2a9(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x12e50
movq %rax, %rcx
movq -0x498(%rbp), %rax
movq %rcx, -0x660(%rbp)
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x658(%rbp)
leaq -0x2d1(%rbp), %rdi
movq %rdi, -0x650(%rbp)
callq 0x5960
movq -0x650(%rbp), %rdx
leaq 0x235b8(%rip), %rsi     # 0x436b5
leaq -0x2d0(%rbp), %rdi
callq 0x6be0
jmp 0x2010b
movq -0x658(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x20e30
movq %rax, -0x668(%rbp)
jmp 0x20127
movq -0x660(%rbp), %rsi
movq -0x668(%rbp), %rdi
callq 0x5050
jmp 0x2013c
leaq -0x2d0(%rbp), %rdi
callq 0x5aa8
leaq -0x2d1(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x130a0
movq %rax, %rcx
movq -0x498(%rbp), %rax
movq %rcx, -0x680(%rbp)
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x678(%rbp)
leaq -0x2f9(%rbp), %rdi
movq %rdi, -0x670(%rbp)
callq 0x5960
movq -0x670(%rbp), %rdx
leaq 0x2351e(%rip), %rsi     # 0x436c1
leaq -0x2f8(%rbp), %rdi
callq 0x6be0
jmp 0x201b1
movq -0x678(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x20e30
movq %rax, -0x688(%rbp)
jmp 0x201cd
movq -0x680(%rbp), %rsi
movq -0x688(%rbp), %rdi
callq 0x5050
jmp 0x201e2
leaq -0x2f8(%rbp), %rdi
callq 0x5aa8
leaq -0x2f9(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x12e70
movl (%rax), %esi
leaq -0x320(%rbp), %rdi
callq 0x20fb0
movq -0x498(%rbp), %rax
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x698(%rbp)
leaq -0x341(%rbp), %rdi
movq %rdi, -0x690(%rbp)
callq 0x5960
movq -0x690(%rbp), %rdx
leaq 0x23484(%rip), %rsi     # 0x436d1
leaq -0x340(%rbp), %rdi
callq 0x6be0
jmp 0x2025b
movq -0x698(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0x20e30
movq %rax, -0x6a0(%rbp)
jmp 0x20277
movq -0x6a0(%rbp), %rdi
leaq -0x320(%rbp), %rsi
movq %rsi, -0x6b8(%rbp)
callq 0x56d0
leaq -0x340(%rbp), %rdi
callq 0x5aa8
leaq -0x341(%rbp), %rdi
callq 0x55e0
movq -0x6b8(%rbp), %rdi
callq 0x5aa8
movq -0x498(%rbp), %rax
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x6b0(%rbp)
leaq -0x369(%rbp), %rdi
movq %rdi, -0x6a8(%rbp)
callq 0x5960
movq -0x6a8(%rbp), %rdx
leaq 0x233ff(%rip), %rsi     # 0x436e9
leaq -0x368(%rbp), %rdi
callq 0x6be0
jmp 0x202f8
movq -0x6b0(%rbp), %rdi
leaq -0x368(%rbp), %rsi
callq 0x20e30
movq %rax, -0x6c0(%rbp)
jmp 0x20314
movq -0x6c0(%rbp), %rdi
leaq 0x233bb(%rip), %rsi     # 0x436dd
callq 0x5780
jmp 0x20329
leaq -0x368(%rbp), %rdi
callq 0x5aa8
leaq -0x369(%rbp), %rdi
callq 0x55e0
movq -0x498(%rbp), %rdi
addq $0x58, %rdi
leaq 0x233a6(%rip), %rsi     # 0x436f9
callq 0x8ff0
testb $0x1, %al
jne 0x20361
jmp 0x205b6
movq -0x498(%rbp), %rax
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x6d0(%rbp)
leaq -0x391(%rbp), %rdi
movq %rdi, -0x6c8(%rbp)
callq 0x5960
movq -0x6c8(%rbp), %rdx
leaq 0x2336c(%rip), %rsi     # 0x43702
leaq -0x390(%rbp), %rdi
callq 0x6be0
jmp 0x203a4
movq -0x6d0(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0x20e30
movq %rax, -0x6d8(%rbp)
jmp 0x203c0
movq -0x6d8(%rbp), %rdi
leaq 0x23330(%rip), %rsi     # 0x436fe
callq 0x5780
jmp 0x203d5
leaq -0x390(%rbp), %rdi
callq 0x5aa8
leaq -0x391(%rbp), %rdi
callq 0x55e0
jmp 0x205b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x20418
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x5aa8
leaq -0x259(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2044f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x5aa8
leaq -0x281(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x20486
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x5aa8
leaq -0x2a9(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x204bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x5aa8
leaq -0x2d1(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x204f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0x5aa8
leaq -0x2f9(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2052b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x340(%rbp), %rdi
callq 0x5aa8
leaq -0x341(%rbp), %rdi
callq 0x55e0
leaq -0x320(%rbp), %rdi
callq 0x5aa8
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2056e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x368(%rbp), %rdi
callq 0x5aa8
leaq -0x369(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x205a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x390(%rbp), %rdi
callq 0x5aa8
leaq -0x391(%rbp), %rdi
callq 0x55e0
jmp 0x209bc
movq -0x498(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x13db0
movq %rax, -0x3a0(%rbp)
movq -0x498(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x13e10
movq %rax, -0x3a8(%rbp)
leaq -0x3a0(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x13de0
testb $0x1, %al
jne 0x20600
jmp 0x207b6
leaq -0x3a0(%rbp), %rdi
callq 0x13e40
movq %rax, %rdi
addq $0x20, %rdi
callq 0x5900
testb $0x1, %al
jne 0x2079a
leaq -0x3a0(%rbp), %rdi
callq 0x13e40
movq %rax, %rsi
leaq -0x408(%rbp), %rdi
movq %rdi, -0x6e0(%rbp)
callq 0x5200
movq -0x6e0(%rbp), %rsi
leaq -0x3e8(%rbp), %rdi
callq 0x41450
jmp 0x20657
leaq 0x230b4(%rip), %rsi     # 0x43712
leaq -0x3c8(%rbp), %rdi
leaq -0x3e8(%rbp), %rdx
callq 0x107f0
jmp 0x20673
leaq -0x3e8(%rbp), %rdi
callq 0x5aa8
leaq -0x408(%rbp), %rdi
callq 0x5aa8
leaq -0x3c8(%rbp), %rdi
movq %rdi, -0x6e8(%rbp)
callq 0x5460
movq -0x6e8(%rbp), %rdi
movq %rax, -0x410(%rbp)
callq 0x5300
movq %rax, -0x418(%rbp)
movb $0x2d, -0x419(%rbp)
movb $0x5f, -0x41a(%rbp)
movq -0x410(%rbp), %rdi
movq -0x418(%rbp), %rsi
leaq -0x419(%rbp), %rdx
leaq -0x41a(%rbp), %rcx
callq 0x21050
jmp 0x206e9
leaq -0x3a0(%rbp), %rdi
callq 0x13e40
movq -0x498(%rbp), %rdi
addq $0x20, %rax
movq %rax, -0x6f8(%rbp)
addq $0x198, %rdi            # imm = 0x198
leaq -0x3c8(%rbp), %rsi
callq 0x19050
movq %rax, -0x6f0(%rbp)
jmp 0x20723
movq -0x6f8(%rbp), %rsi
movq -0x6f0(%rbp), %rdi
callq 0x5050
jmp 0x20738
leaq -0x3c8(%rbp), %rdi
callq 0x5aa8
jmp 0x2079a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2076c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x3e8(%rbp), %rdi
callq 0x5aa8
leaq -0x408(%rbp), %rdi
callq 0x5aa8
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x3c8(%rbp), %rdi
callq 0x5aa8
jmp 0x209bc
jmp 0x2079c
leaq -0x3a0(%rbp), %rdi
xorl %esi, %esi
callq 0x13e60
movq %rax, -0x428(%rbp)
jmp 0x205cd
movq -0x498(%rbp), %rdi
addq $0x198, %rdi            # imm = 0x198
callq 0x210c0
movq %rax, %rdi
addq $0x1, %rdi
shlq $0x3, %rdi
callq 0x5750
movq -0x498(%rbp), %rcx
movq %rax, 0x1c8(%rcx)
cmpq $0x0, %rax
jne 0x207f6
movb $0x0, -0x1(%rbp)
jmp 0x209ae
movq -0x498(%rbp), %rdi
movl $0x0, -0x42c(%rbp)
addq $0x198, %rdi            # imm = 0x198
callq 0x210e0
movq %rax, -0x438(%rbp)
movq -0x498(%rbp), %rdi
addq $0x198, %rdi            # imm = 0x198
callq 0x1dc40
movq %rax, -0x440(%rbp)
leaq -0x438(%rbp), %rdi
leaq -0x440(%rbp), %rsi
callq 0x13de0
testb $0x1, %al
jne 0x20850
jmp 0x2098d
leaq -0x438(%rbp), %rdi
movq %rdi, -0x708(%rbp)
callq 0x13e40
movq %rax, %rsi
leaq 0x2305e(%rip), %rdx     # 0x438cb
leaq -0x480(%rbp), %rdi
movq %rdi, -0x700(%rbp)
callq 0x8f70
movq -0x708(%rbp), %rdi
callq 0x13e40
movq -0x700(%rbp), %rsi
movq %rax, %rdx
addq $0x20, %rdx
leaq -0x460(%rbp), %rdi
callq 0x6a30
jmp 0x208a8
leaq -0x480(%rbp), %rdi
callq 0x5aa8
leaq -0x460(%rbp), %rdi
callq 0x51f0
movq %rax, %rdi
callq 0x416d0
movq %rax, -0x710(%rbp)
jmp 0x208d1
movq -0x710(%rbp), %rax
movq -0x498(%rbp), %rcx
movq 0x1c8(%rcx), %rcx
movslq -0x42c(%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
cmpq $0x0, %rax
jne 0x2093e
movb $0x0, -0x1(%rbp)
movl $0x1, -0x484(%rbp)
jmp 0x20957
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x480(%rbp), %rdi
callq 0x5aa8
jmp 0x209bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x460(%rbp), %rdi
callq 0x5aa8
jmp 0x209bc
movl -0x42c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x42c(%rbp)
movl $0x0, -0x484(%rbp)
leaq -0x460(%rbp), %rdi
callq 0x5aa8
movl -0x484(%rbp), %eax
testl %eax, %eax
je 0x20971
jmp 0x2096f
jmp 0x209ae
jmp 0x20973
leaq -0x438(%rbp), %rdi
xorl %esi, %esi
callq 0x13e60
movq %rax, -0x490(%rbp)
jmp 0x2081a
movq -0x498(%rbp), %rax
movq 0x1c8(%rax), %rax
movslq -0x42c(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x710, %rsp            # imm = 0x710
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x5950
nopw %cs:(%rax,%rax)