// File: mniip[P]sandbox/main.cpp
// Function: TracedThread::should_replace_stat(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, stat&, int, int)
bool should_replace_stat(std::string path, struct stat &st, int at, int flags)
	{
		if(path.compare(0, strlen("http:/"), "http:/") == 0 && path.compare(0, strlen("http://"), "http://") != 0)
			path = "http://" + path.substr(strlen("http:/"));
		else if(path.compare(0, strlen("https:/"), "https:/") == 0 && path.compare(0, strlen("https://"), "https://") != 0)
			path = "https://" + path.substr(strlen("https:/"));
		for(std::vector<std::string>::const_iterator i = conf_http.begin(), end = conf_http.end(); i != end; i++)
			if(path.compare(0, i->size(), *i) == 0)
			{
				st.st_dev = 0;
				st.st_ino = 0;
				st.st_mode = 0755 | S_IFREG;
				st.st_nlink = 1;
				st.st_uid = 0;
				st.st_gid = 0;
				st.st_rdev = 0;
				st.st_size = 0;
				st.st_blksize = 0;
				st.st_blocks = 0;

				clock_gettime(CLOCK_REALTIME, &st.st_mtim);
				st.st_atim = st.st_ctim = st.st_mtim;

				return true;
			}
		return false;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rsi, -0xf0(%rbp)
movq %rdi, %rax
movq -0xf0(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
movq %rax, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
xorl %eax, %eax
movl %eax, %esi
movl $0x6, %edx
leaq 0xb70e(%rip), %rcx      # 0x1c1b4
callq 0x56a0
cmpl $0x0, %eax
jne 0x10b52
movq -0xe8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x7, %edx
leaq 0xb6f0(%rip), %rcx      # 0x1c1bb
callq 0x56a0
cmpl $0x0, %eax
je 0x10b52
movq -0xe8(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
movl $0x6, %edx
movq $-0x1, %rcx
callq 0x5510
movq -0xf8(%rbp), %rdx
leaq 0xb6b5(%rip), %rsi      # 0x1c1bb
leaq -0x48(%rbp), %rdi
callq 0x10fb0
jmp 0x10b11
movq -0xe8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x55f0
leaq -0x48(%rbp), %rdi
callq 0x59b8
leaq -0x68(%rbp), %rdi
callq 0x59b8
jmp 0x10c2a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x59b8
jmp 0x10dbf
movq -0xe8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x7, %edx
leaq 0xb65a(%rip), %rcx      # 0x1c1c3
callq 0x56a0
cmpl $0x0, %eax
jne 0x10c28
movq -0xe8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x8, %edx
leaq 0xb63d(%rip), %rcx      # 0x1c1cb
callq 0x56a0
cmpl $0x0, %eax
je 0x10c28
movq -0xe8(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x100(%rbp)
movl $0x7, %edx
movq $-0x1, %rcx
callq 0x5510
movq -0x100(%rbp), %rdx
leaq 0xb5fb(%rip), %rsi      # 0x1c1cb
leaq -0x98(%rbp), %rdi
callq 0x10fb0
jmp 0x10bde
movq -0xe8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x55f0
leaq -0x98(%rbp), %rdi
callq 0x59b8
leaq -0xb8(%rbp), %rdi
callq 0x59b8
jmp 0x10c28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x59b8
jmp 0x10dbf
jmp 0x10c2a
leaq 0x16a37(%rip), %rdi     # 0x27668
callq 0x7020
movq %rax, -0xc8(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x7050
leaq 0x16a11(%rip), %rdi     # 0x27668
callq 0x7090
movq %rax, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x7050
leaq -0xc0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x70c0
testb $0x1, %al
jne 0x10c92
jmp 0x10dad
leaq -0xc0(%rbp), %rdi
callq 0x7100
movq %rax, %rdi
callq 0x5330
movq %rax, -0x108(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x10ea0
movq -0xe8(%rbp), %rdi
movq -0x108(%rbp), %rdx
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x5680
cmpl $0x0, %eax
jne 0x10d91
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movl $0x81ed, 0x18(%rax)     # imm = 0x81ED
movq -0x20(%rbp), %rax
movq $0x1, 0x10(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x20(%rbp), %rsi
addq $0x58, %rsi
xorl %edi, %edi
callq 0x5490
movq -0x20(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x58(%rax), %rdx
movq %rdx, 0x68(%rcx)
movq 0x60(%rax), %rax
movq %rax, 0x70(%rcx)
movq -0x20(%rbp), %rax
movq 0x68(%rcx), %rdx
movq %rdx, 0x48(%rax)
movq 0x70(%rcx), %rcx
movq %rcx, 0x50(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x10db1
jmp 0x10d93
leaq -0xc0(%rbp), %rdi
xorl %esi, %esi
callq 0x7120
movq %rax, -0xe0(%rbp)
jmp 0x10c76
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x58f0
nopl (%rax,%rax)