// File: wekan[P]sps/sps.cxx
// Function: remote_execution(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
int remote_execution(std::string & host, std::string & exec_cmd)
{
	int result = EXIT_FAILURE;
	char temp[] = "/tmp/exec-XXXXXX";
	int fd = mkstemp(temp);

	if (fd > -1)
	{
		write(fd, exec_cmd.c_str(), exec_cmd.length());
		close(fd);
		std::string cmd = std::string("") + "ssh -T " + SSH_OPTS + " root@" + host + " 'bash --login' < " + temp;
		result = system(cmd.c_str());
		unlink(temp);
		return exit_status(result);
	}
	else
	{
		return EX_TEMPFAIL; // 75
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x1, -0x1c(%rbp)
movq 0x497f(%rip), %rax      # 0x8220
movq %rax, -0x30(%rbp)
movq 0x497c(%rip), %rax      # 0x8228
movq %rax, -0x28(%rbp)
movb 0x497a(%rip), %al       # 0x8230
movb %al, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x30a0
movl %eax, -0x34(%rbp)
cmpl $-0x1, -0x34(%rbp)
jle 0x3b6b
movl -0x34(%rbp), %eax
movl %eax, -0x144(%rbp)
movq -0x18(%rbp), %rdi
callq 0x30f0
movq %rax, -0x140(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3330
movl -0x144(%rbp), %edi
movq -0x140(%rbp), %rsi
movq %rax, %rdx
callq 0x30b0
movl -0x34(%rbp), %edi
callq 0x3410
leaq -0x119(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x33a0
movq -0x138(%rbp), %rdx
leaq 0x480d(%rip), %rsi      # 0x813c
leaq -0x118(%rbp), %rdi
callq 0x4a80
jmp 0x393d
leaq 0x47f9(%rip), %rdx      # 0x813d
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x4e60
jmp 0x3959
leaq 0x88e0(%rip), %rdx      # 0xc240
leaq -0xd8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x4eb0
jmp 0x3975
leaq 0x47f9(%rip), %rdx      # 0x8175
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x4e60
jmp 0x3991
movq -0x10(%rbp), %rdx
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x4eb0
jmp 0x39aa
leaq 0x4794(%rip), %rdx      # 0x8145
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4e60
jmp 0x39c3
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x4e60
jmp 0x39d6
leaq -0x78(%rbp), %rdi
callq 0x3438
leaq -0x98(%rbp), %rdi
callq 0x3438
leaq -0xb8(%rbp), %rdi
callq 0x3438
leaq -0xd8(%rbp), %rdi
callq 0x3438
leaq -0xf8(%rbp), %rdi
callq 0x3438
leaq -0x118(%rbp), %rdi
callq 0x3438
leaq -0x119(%rbp), %rdi
callq 0x32a0
leaq -0x58(%rbp), %rdi
callq 0x30f0
movq %rax, %rdi
callq 0x3210
movl %eax, -0x148(%rbp)
jmp 0x3a40
movl -0x148(%rbp), %eax
movl %eax, -0x1c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3150
movl -0x1c(%rbp), %edi
callq 0x3620
movl %eax, -0x4(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3438
jmp 0x3b72
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x3b40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x3b34
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x3b28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x3b1c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x3b10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x3b04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3438
leaq -0x98(%rbp), %rdi
callq 0x3438
leaq -0xb8(%rbp), %rdi
callq 0x3438
leaq -0xd8(%rbp), %rdi
callq 0x3438
leaq -0xf8(%rbp), %rdi
callq 0x3438
leaq -0x118(%rbp), %rdi
callq 0x3438
leaq -0x119(%rbp), %rdi
callq 0x32a0
jmp 0x3b7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3438
jmp 0x3b7e
movl $0x4b, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x128(%rbp), %rdi
callq 0x3390
nopw (%rax,%rax)