// File: /workspace/github_cpp_makefile_star2_O2/Marcos30004347[P]JSS-with-VNS/main.cpp
// Function: opt_3(std::vector<unsigned int, std::allocator<unsigned int>>)
solution opt_3(solution s) {
	int i = 1 + rand() % (s.size() / 3);
	int j = i + 1 + rand() % (s.size() / 3);
	int k = j + 1 + rand() % (s.size() / 3);

  unsigned tmp0 = s[i];
  unsigned tmp1 = s[j];
  unsigned tmp2 = s[k];

  solution tmp = s;

  tmp[i] = tmp0;
  tmp[j] = tmp2;
  tmp[k] = tmp1;
  if(total_cost(tmp) < total_cost(s)) {
    s = tmp;
  }

  tmp[i] = tmp2;
  tmp[j] = tmp1;
  tmp[k] = tmp0;
  if(total_cost(tmp) < total_cost(s)) {
    s = tmp;
  }

  tmp[i] = tmp1;
  tmp[j] = tmp0;
  tmp[k] = tmp2;
  if(total_cost(tmp) < total_cost(s)) {
    s = tmp;
  }

  tmp[i] = tmp2;
  tmp[j] = tmp0;
  tmp[k] = tmp1;
  if(total_cost(tmp) < total_cost(s)) {
    s = tmp;
  }

  tmp[i] = tmp2;
  tmp[j] = tmp1;
  tmp[k] = tmp0;
  if(total_cost(tmp) < total_cost(s)) {
    s = tmp;
  }

  return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %r14
movq %rdi, -0x60(%rbp)
callq 0x1060
movslq %eax, %rcx
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x2, %rax
pushq $0x3
popq %rbx
xorl %edx, %edx
divq %rbx
movq %rax, %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
movq %rdx, %r15
callq 0x1060
movslq %eax, %rcx
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x2, %rax
xorl %edx, %edx
divq %rbx
movq %rax, %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
leaq (%r15,%rdx), %r12
addq $0x2, %r12
callq 0x1060
movslq %eax, %rcx
movq (%r14), %rdi
movq 0x8(%r14), %rax
movq %r14, %rsi
movq %r14, -0x68(%rbp)
subq %rdi, %rax
sarq $0x2, %rax
xorl %edx, %edx
divq %rbx
movq %rax, %r8
movq %rcx, %rax
xorl %edx, %edx
divq %r8
leal (%r12,%rdx), %eax
incl %eax
shlq $0x20, %r15
movabsq $0x100000000, %r14      # imm = 0x100000000
addq %r15, %r14
movq %r14, %r13
sarq $0x1e, %r13
movl (%rdi,%r13), %ecx
movl %ecx, -0x30(%rbp)
movslq %r12d, %r15
movl (%rdi,%r15,4), %ecx
movl %ecx, -0x2c(%rbp)
movslq %eax, %rbx
movl (%rdi,%rbx,4), %r12d
leaq -0x58(%rbp), %rdi
callq 0x24f4
leaq -0x58(%rbp), %rsi
movq (%rsi), %rax
movl -0x30(%rbp), %ecx
movl %ecx, (%rax,%r13)
movq -0x68(%rbp), %r13
movq %r15, -0x40(%rbp)
movl %r12d, (%rax,%r15,4)
movq %rbx, -0x38(%rbp)
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax,%rbx,4)
movl %r12d, %ebx
leaq -0x158(%rbp), %rdi
callq 0x24f4
leaq -0x158(%rbp), %rdi
callq 0x13e0
movl %eax, %r15d
leaq -0x140(%rbp), %rdi
movq %r13, %rsi
callq 0x24f4
leaq -0x140(%rbp), %rdi
callq 0x13e0
movl %eax, %r12d
leaq -0x140(%rbp), %rdi
callq 0x2722
leaq -0x158(%rbp), %rdi
callq 0x2722
cmpl %r12d, %r15d
jae 0x1849
leaq -0x58(%rbp), %rsi
movq %r13, %rdi
callq 0x254c
sarq $0x20, %r14
leaq -0x58(%rbp), %rsi
movq (%rsi), %rax
movl %ebx, (%rax,%r14,4)
movq -0x40(%rbp), %rcx
movl -0x2c(%rbp), %edx
movl %edx, (%rax,%rcx,4)
movl -0x30(%rbp), %ecx
movq -0x38(%rbp), %rdx
movl %ecx, (%rax,%rdx,4)
leaq -0x128(%rbp), %rdi
callq 0x24f4
leaq -0x128(%rbp), %rdi
callq 0x13e0
movl %eax, %r15d
leaq -0x110(%rbp), %rdi
movq %r13, %rsi
callq 0x24f4
leaq -0x110(%rbp), %rdi
callq 0x13e0
movl %eax, %r12d
leaq -0x110(%rbp), %rdi
callq 0x2722
leaq -0x128(%rbp), %rdi
callq 0x2722
cmpl %r12d, %r15d
jae 0x18ce
leaq -0x58(%rbp), %rsi
movq %r13, %rdi
callq 0x254c
leaq -0x58(%rbp), %rsi
movq (%rsi), %rax
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax,%r14,4)
movl -0x30(%rbp), %ecx
movq -0x40(%rbp), %rdx
movl %ecx, (%rax,%rdx,4)
movq -0x38(%rbp), %rcx
movl %ebx, (%rax,%rcx,4)
leaq -0xf8(%rbp), %rdi
callq 0x24f4
leaq -0xf8(%rbp), %rdi
callq 0x13e0
movl %eax, %r15d
leaq -0xe0(%rbp), %rdi
movq %r13, %rsi
callq 0x24f4
leaq -0xe0(%rbp), %rdi
callq 0x13e0
movl %eax, %r12d
leaq -0xe0(%rbp), %rdi
callq 0x2722
leaq -0xf8(%rbp), %rdi
callq 0x2722
cmpl %r12d, %r15d
jae 0x194f
leaq -0x58(%rbp), %rsi
movq %r13, %rdi
callq 0x254c
leaq -0x58(%rbp), %rsi
movq (%rsi), %rax
movl %ebx, (%rax,%r14,4)
movl -0x30(%rbp), %ecx
movq -0x40(%rbp), %rdx
movl %ecx, (%rax,%rdx,4)
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %edx
movl %edx, (%rax,%rcx,4)
leaq -0xc8(%rbp), %rdi
callq 0x24f4
leaq -0xc8(%rbp), %rdi
callq 0x13e0
movl %eax, %r15d
leaq -0xb0(%rbp), %rdi
movq %r13, %rsi
callq 0x24f4
leaq -0xb0(%rbp), %rdi
callq 0x13e0
movl %eax, %r12d
leaq -0xb0(%rbp), %rdi
callq 0x2722
leaq -0xc8(%rbp), %rdi
callq 0x2722
cmpl %r12d, %r15d
jae 0x19d0
leaq -0x58(%rbp), %rsi
movq %r13, %rdi
callq 0x254c
leaq -0x58(%rbp), %rsi
movq (%rsi), %rax
movl %ebx, (%rax,%r14,4)
movq -0x40(%rbp), %rcx
movl -0x2c(%rbp), %edx
movl %edx, (%rax,%rcx,4)
movl -0x30(%rbp), %ecx
movq -0x38(%rbp), %rdx
movl %ecx, (%rax,%rdx,4)
leaq -0x98(%rbp), %rdi
callq 0x24f4
leaq -0x98(%rbp), %rdi
callq 0x13e0
movl %eax, %r15d
leaq -0x80(%rbp), %rdi
movq %r13, %rsi
callq 0x24f4
leaq -0x80(%rbp), %rdi
callq 0x13e0
movl %eax, %r12d
leaq -0x80(%rbp), %rdi
callq 0x2722
leaq -0x98(%rbp), %rdi
callq 0x2722
cmpl %r12d, %r15d
jae 0x1a48
leaq -0x58(%rbp), %rsi
movq %r13, %rdi
callq 0x254c
movq (%r13), %rax
movq -0x60(%rbp), %rbx
movq %rax, (%rbx)
movq 0x8(%r13), %rax
movq %rax, 0x8(%rbx)
movq 0x10(%r13), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
andq $0x0, 0x10(%r13)
leaq -0x58(%rbp), %rdi
callq 0x2722
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x2722
jmp 0x1ae3
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x2722
jmp 0x1aef
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x2722
jmp 0x1afb
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x2722
jmp 0x1b07
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
callq 0x2722
jmp 0x1b13
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
jmp 0x1b1a
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
jmp 0x1b1a
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
jmp 0x1b1a
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
jmp 0x1b1a
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x2722
jmp 0x1b24
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x2722
movq %rbx, %rdi
callq 0x11b0