// File: 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
subq $0x230, %rsp            # imm = 0x230
movq %rsi, -0x160(%rbp)
movq %rdi, -0x1a8(%rbp)
movq %rdi, %rax
movq %rax, -0x1a0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x2070
movq -0x160(%rbp), %rdi
cltq
movq %rax, -0x198(%rbp)
callq 0x4230
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
movq %rcx, -0x180(%rbp)
mulq %rcx
movq -0x198(%rbp), %rax
movq %rdx, %rcx
shrq %rcx
xorl %edx, %edx
movq %rdx, -0x168(%rbp)
divq %rcx
movl %edx, %eax
incl %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x18c(%rbp)
callq 0x2070
movq -0x160(%rbp), %rdi
cltq
movq %rax, -0x188(%rbp)
callq 0x4230
movl -0x18c(%rbp), %ecx
movq -0x180(%rbp), %rdx
mulq %rdx
movq -0x188(%rbp), %rax
movq %rdx, %rsi
movq -0x168(%rbp), %rdx
shrq %rsi
divq %rsi
movl %ecx, %eax
movl %edx, %ecx
leal 0x1(%rax,%rcx), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x174(%rbp)
callq 0x2070
movq -0x160(%rbp), %rdi
cltq
movq %rax, -0x170(%rbp)
callq 0x4230
movq -0x180(%rbp), %rdx
movl -0x174(%rbp), %ecx
movq -0x160(%rbp), %rdi
mulq %rdx
movq -0x170(%rbp), %rax
movq %rdx, %rsi
movq -0x168(%rbp), %rdx
shrq %rsi
divq %rsi
movl %ecx, %eax
movl %edx, %ecx
leal 0x1(%rax,%rcx), %eax
movl %eax, -0x1c(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x4310
movq -0x160(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x4310
movq -0x160(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movslq -0x1c(%rbp), %rsi
callq 0x4310
movq -0x160(%rbp), %rsi
movl (%rax), %eax
movl %eax, -0x28(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x44f0
movq -0x148(%rbp), %rdi
movl -0x20(%rbp), %eax
movl %eax, -0x154(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x4310
movl -0x154(%rbp), %ecx
movq -0x148(%rbp), %rdi
movl %ecx, (%rax)
movl -0x28(%rbp), %eax
movl %eax, -0x150(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x4310
movl -0x150(%rbp), %ecx
movq -0x148(%rbp), %rdi
movl %ecx, (%rax)
movl -0x24(%rbp), %eax
movl %eax, -0x14c(%rbp)
movslq -0x1c(%rbp), %rsi
callq 0x4310
movl -0x14c(%rbp), %ecx
movq -0x148(%rbp), %rsi
movl %ecx, (%rax)
leaq -0x58(%rbp), %rdi
callq 0x44f0
jmp 0x2cde
leaq -0x58(%rbp), %rdi
callq 0x2450
movl %eax, -0x1ac(%rbp)
jmp 0x2cef
movq -0x160(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x44f0
jmp 0x2d01
leaq -0x80(%rbp), %rdi
callq 0x2450
movl %eax, -0x1b0(%rbp)
jmp 0x2d12
leaq -0x80(%rbp), %rdi
callq 0x43d0
leaq -0x58(%rbp), %rdi
callq 0x43d0
movl -0x1b0(%rbp), %ecx
movl -0x1ac(%rbp), %eax
cmpl %ecx, %eax
jae 0x2d8a
movq -0x160(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x45e0
jmp 0x2d46
jmp 0x2d8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3263
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2d7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x43d0
leaq -0x58(%rbp), %rdi
callq 0x43d0
jmp 0x3263
movl -0x28(%rbp), %eax
movl %eax, -0x1c4(%rbp)
movslq -0x14(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
callq 0x4310
movl -0x1c4(%rbp), %ecx
movq -0x1b8(%rbp), %rdi
movl %ecx, (%rax)
movl -0x24(%rbp), %eax
movl %eax, -0x1c0(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x4310
movl -0x1c0(%rbp), %ecx
movq -0x1b8(%rbp), %rdi
movl %ecx, (%rax)
movl -0x20(%rbp), %eax
movl %eax, -0x1bc(%rbp)
movslq -0x1c(%rbp), %rsi
callq 0x4310
movl -0x1bc(%rbp), %ecx
movq -0x1b8(%rbp), %rsi
movl %ecx, (%rax)
leaq -0x98(%rbp), %rdi
callq 0x44f0
jmp 0x2e06
leaq -0x98(%rbp), %rdi
callq 0x2450
movl %eax, -0x1c8(%rbp)
jmp 0x2e1a
movq -0x160(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x44f0
jmp 0x2e2f
leaq -0xb0(%rbp), %rdi
callq 0x2450
movl %eax, -0x1cc(%rbp)
jmp 0x2e43
leaq -0xb0(%rbp), %rdi
callq 0x43d0
leaq -0x98(%rbp), %rdi
callq 0x43d0
movl -0x1cc(%rbp), %ecx
movl -0x1c8(%rbp), %eax
cmpl %ecx, %eax
jae 0x2eb6
movq -0x160(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x45e0
jmp 0x2e7d
jmp 0x2eb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2ea5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x43d0
leaq -0x98(%rbp), %rdi
callq 0x43d0
jmp 0x3263
movl -0x24(%rbp), %eax
movl %eax, -0x1e4(%rbp)
movslq -0x14(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
callq 0x4310
movl -0x1e4(%rbp), %ecx
movq -0x1d8(%rbp), %rdi
movl %ecx, (%rax)
movl -0x20(%rbp), %eax
movl %eax, -0x1e0(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x4310
movl -0x1e0(%rbp), %ecx
movq -0x1d8(%rbp), %rdi
movl %ecx, (%rax)
movl -0x28(%rbp), %eax
movl %eax, -0x1dc(%rbp)
movslq -0x1c(%rbp), %rsi
callq 0x4310
movl -0x1dc(%rbp), %ecx
movq -0x1d8(%rbp), %rsi
movl %ecx, (%rax)
leaq -0xc8(%rbp), %rdi
callq 0x44f0
jmp 0x2f32
leaq -0xc8(%rbp), %rdi
callq 0x2450
movl %eax, -0x1e8(%rbp)
jmp 0x2f46
movq -0x160(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x44f0
jmp 0x2f5b
leaq -0xe0(%rbp), %rdi
callq 0x2450
movl %eax, -0x1ec(%rbp)
jmp 0x2f6f
leaq -0xe0(%rbp), %rdi
callq 0x43d0
leaq -0xc8(%rbp), %rdi
callq 0x43d0
movl -0x1ec(%rbp), %ecx
movl -0x1e8(%rbp), %eax
cmpl %ecx, %eax
jae 0x2fe2
movq -0x160(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x45e0
jmp 0x2fa9
jmp 0x2fe2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2fd1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x43d0
leaq -0xc8(%rbp), %rdi
callq 0x43d0
jmp 0x3263
movl -0x28(%rbp), %eax
movl %eax, -0x204(%rbp)
movslq -0x14(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x4310
movl -0x204(%rbp), %ecx
movq -0x1f8(%rbp), %rdi
movl %ecx, (%rax)
movl -0x20(%rbp), %eax
movl %eax, -0x200(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x4310
movl -0x200(%rbp), %ecx
movq -0x1f8(%rbp), %rdi
movl %ecx, (%rax)
movl -0x24(%rbp), %eax
movl %eax, -0x1fc(%rbp)
movslq -0x1c(%rbp), %rsi
callq 0x4310
movl -0x1fc(%rbp), %ecx
movq -0x1f8(%rbp), %rsi
movl %ecx, (%rax)
leaq -0xf8(%rbp), %rdi
callq 0x44f0
jmp 0x305e
leaq -0xf8(%rbp), %rdi
callq 0x2450
movl %eax, -0x208(%rbp)
jmp 0x3072
movq -0x160(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x44f0
jmp 0x3087
leaq -0x110(%rbp), %rdi
callq 0x2450
movl %eax, -0x20c(%rbp)
jmp 0x309b
leaq -0x110(%rbp), %rdi
callq 0x43d0
leaq -0xf8(%rbp), %rdi
callq 0x43d0
movl -0x20c(%rbp), %ecx
movl -0x208(%rbp), %eax
cmpl %ecx, %eax
jae 0x310e
movq -0x160(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x45e0
jmp 0x30d5
jmp 0x310e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x30fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x43d0
leaq -0xf8(%rbp), %rdi
callq 0x43d0
jmp 0x3263
movl -0x28(%rbp), %eax
movl %eax, -0x224(%rbp)
movslq -0x14(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x4310
movl -0x224(%rbp), %ecx
movq -0x218(%rbp), %rdi
movl %ecx, (%rax)
movl -0x24(%rbp), %eax
movl %eax, -0x220(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x4310
movl -0x220(%rbp), %ecx
movq -0x218(%rbp), %rdi
movl %ecx, (%rax)
movl -0x20(%rbp), %eax
movl %eax, -0x21c(%rbp)
movslq -0x1c(%rbp), %rsi
callq 0x4310
movl -0x21c(%rbp), %ecx
movq -0x218(%rbp), %rsi
movl %ecx, (%rax)
leaq -0x128(%rbp), %rdi
callq 0x44f0
jmp 0x318a
leaq -0x128(%rbp), %rdi
callq 0x2450
movl %eax, -0x228(%rbp)
jmp 0x319e
movq -0x160(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x44f0
jmp 0x31b3
leaq -0x140(%rbp), %rdi
callq 0x2450
movl %eax, -0x22c(%rbp)
jmp 0x31c7
leaq -0x140(%rbp), %rdi
callq 0x43d0
leaq -0x128(%rbp), %rdi
callq 0x43d0
movl -0x22c(%rbp), %ecx
movl -0x228(%rbp), %eax
cmpl %ecx, %eax
jae 0x3237
movq -0x160(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x45e0
jmp 0x3201
jmp 0x3237
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3229
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x43d0
leaq -0x128(%rbp), %rdi
callq 0x43d0
jmp 0x3263
movq -0x160(%rbp), %rsi
movq -0x1a8(%rbp), %rdi
callq 0x44c0
leaq -0x40(%rbp), %rdi
callq 0x43d0
movq -0x1a0(%rbp), %rax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x43d0
movq -0x60(%rbp), %rdi
callq 0x21c0
nopw %cs:(%rax,%rax)