// File: kaityo256[P]cps/cps.cpp
// Function: loadfile(int, char**)
int loadfile(int argc, char **argv) {
  int rank, procs;
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  MPI_Comm_size(MPI_COMM_WORLD, &procs);
  if (rank != 0) {
    return 1;
  }
  if (argc < 2) {
    std::cout << "Usage: cps commandlist" << std::endl;
    return 0;
  }
  std::string filename = argv[1];
  std::ifstream ifs(filename);
  if (ifs.fail()) {
    std::cerr << "Could not open " << filename << std::endl;
    return 0;
  }
  std::string line;
  while (getline(ifs, line)) {
    if (line.length() > 0 && line[0] == '#') {
      continue;
    }
    command_list.push_back(line);
  }
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x116a7(%rip), %rdi     # 0x1afa0
leaq -0x14(%rbp), %rsi
callq 0x88d0
movq 0x11697(%rip), %rdi     # 0x1afa0
leaq -0x18(%rbp), %rsi
callq 0x8700
cmpl $0x0, -0x14(%rbp)
je 0x9924
movl $0x1, -0x4(%rbp)
jmp 0x9b8b
cmpl $0x2, -0x8(%rbp)
jge 0x9958
movq 0x1168f(%rip), %rdi     # 0x1afc0
leaq 0x97d8(%rip), %rsi      # 0x13110
callq 0x85f0
movq %rax, %rdi
movq 0x11651(%rip), %rsi     # 0x1af98
callq 0x8620
movl $0x0, -0x4(%rbp)
jmp 0x9b8b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x290(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x8b50
movq -0x290(%rbp), %rsi
movq -0x288(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x8850
jmp 0x9990
leaq -0x39(%rbp), %rdi
callq 0x8680
leaq -0x258(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movl $0x8, %edx
callq 0x8a20
jmp 0x99b0
movq -0x258(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x258(%rbp,%rax), %rdi
callq 0x8030
movb %al, -0x291(%rbp)
jmp 0x99d0
movb -0x291(%rbp), %al
testb $0x1, %al
jne 0x99df
jmp 0x9a7b
movq 0x1160a(%rip), %rdi     # 0x1aff0
leaq 0x973a(%rip), %rsi      # 0x13127
callq 0x85f0
movq %rax, -0x2a0(%rbp)
jmp 0x99fb
movq -0x2a0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x8560
movq %rax, -0x2a8(%rbp)
jmp 0x9a14
movq -0x2a8(%rbp), %rdi
movq 0x11576(%rip), %rsi     # 0x1af98
callq 0x8620
jmp 0x9a29
movl $0x0, -0x4(%rbp)
movl $0x1, -0x25c(%rbp)
jmp 0x9b5d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x8680
jmp 0x9b97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x9b80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x9b74
leaq -0x280(%rbp), %rdi
callq 0x8880
leaq -0x258(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x80f0
movq %rax, -0x2b0(%rbp)
jmp 0x9aa3
movq -0x2b0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x8780
movb %al, -0x2b1(%rbp)
jmp 0x9ac1
movb -0x2b1(%rbp), %al
testb $0x1, %al
jne 0x9acd
jmp 0x9b40
leaq -0x280(%rbp), %rdi
callq 0x8980
cmpq $0x0, %rax
jbe 0x9b26
xorl %eax, %eax
movl %eax, %esi
leaq -0x280(%rbp), %rdi
callq 0x8c90
movq %rax, -0x2c0(%rbp)
jmp 0x9af8
movq -0x2c0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x9b26
jmp 0x9a87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x8380
jmp 0x9b74
leaq 0x11b4b(%rip), %rdi     # 0x1b678
leaq -0x280(%rbp), %rsi
callq 0xaa40
jmp 0x9b3b
jmp 0x9a87
movl $0x1, -0x4(%rbp)
movl $0x1, -0x25c(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x8380
leaq -0x258(%rbp), %rdi
callq 0x8160
leaq -0x38(%rbp), %rdi
callq 0x8380
jmp 0x9b8b
leaq -0x258(%rbp), %rdi
callq 0x8160
leaq -0x38(%rbp), %rdi
callq 0x8380
jmp 0x9b97
movl -0x4(%rbp), %eax
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x8b40