LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/help.c
// Function: print_usage_prg
void print_usage_prg() {
  help_opts *opts = HELP_ALLOC_OPTS;
  opts->indent = 1;

  p_header(APPNAME " prg");
  p_indent(1, "Perform PRG bank action such as extraction and replacement");
  p_newline();

  p_header("Usage");
  p_indent(1, APPNAME " prg <action> [ <action-args> ... ]");
  p_newline();

  p_header("Actions");

  static struct help_cols action_cols[] = {
    "extract", "Extract the given PRG bank index to a raw PRG bank",
    "replace", "Replace a PRG bank index with the given PRG bank",
    NULL_COL
  };

  p_cols(opts, action_cols);

  p_newline();

  printf("For additional usage information for the above actions run `%s prg <action> --help`\n", APPNAME);

  p_newline();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x21c0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x2dea(%rip), %rdi      # 0x6397
callq 0x3294
leaq 0x2de6(%rip), %rsi      # 0x639f
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2b73(%rip), %rdi      # 0x6142
callq 0x3294
leaq 0x2dff(%rip), %rsi      # 0x63da
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2e13(%rip), %rdi      # 0x6401
callq 0x3294
leaq 0x7c46(%rip), %rsi      # 0xb240
movq %rbx, %rdi
callq 0x33de
callq 0x32a5
leaq 0x2e5f(%rip), %rdi      # 0x646d
leaq 0x2aed(%rip), %rsi      # 0x6102
xorl %eax, %eax
callq 0x2140
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32a5
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/help.c
// Function: print_usage_prg_extract
void print_usage_prg_extract() {
  help_opts *opts = HELP_ALLOC_OPTS;
  opts->indent = 1;

  static struct help_cols option_cols[] = {
    "--help", "Display this help",
    NULL_COL
  };

  static struct help_cols arg_cols[] = {
    "<rom>", "The path to the source ROM file to extract from",
    "<bank-index>", "The zero-based index of the PRG bank to extract",
    "<outflie>", "The output file.",
    NULL_COL
  };

  p_header(APPNAME " prg extract");
  p_indent(1,
    "Extract a PRG bank to a separate file."
  );
  p_newline();

  p_header("Usage");
  p_indent(1, APPNAME " prg extract <rom> [ <options> ... ] <bank-index> <outfile>");
  p_newline();

  p_header("Arguments");
  p_cols(opts, arg_cols);
  p_newline();

  p_header("Options");
  p_cols(opts, option_cols);
  p_newline();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x21c0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x2f1e(%rip), %rdi      # 0x6563
callq 0x3294
leaq 0x2f22(%rip), %rsi      # 0x6573
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2adb(%rip), %rdi      # 0x6142
callq 0x3294
leaq 0x2f27(%rip), %rsi      # 0x659a
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2f53(%rip), %rdi      # 0x65d9
callq 0x3294
leaq 0x7bfe(%rip), %rsi      # 0xb290
movq %rbx, %rdi
callq 0x33de
callq 0x32a5
leaq 0x2a3a(%rip), %rdi      # 0x60e0
callq 0x3294
leaq 0x7bbe(%rip), %rsi      # 0xb270
movq %rbx, %rdi
callq 0x33de
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32a5
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/help.c
// Function: print_usage_prg_replace
void print_usage_prg_replace() {
  help_opts *opts = HELP_ALLOC_OPTS;
  opts->indent = 1;

  static struct help_cols option_cols[] = {
    "--help", "Display this help",
    "-o | --outfile <path>", "When replacing the bank, write the updated ROM file to this path rather than clobbering the source ROM",
    NULL_COL
  };

  static struct help_cols arg_cols[] = {
    "<rom>", "The path to the source ROM file to extract from",
    "<bank-index>", "The zero-based index of the bank to replace",
    "<prgbank>", "The source PRG bank file; a raw PRG bank",
    NULL_COL
  };

  p_header(APPNAME " prg replace");
  p_indent(1,
      "Replace a PRG bank in a ROM file with the given bank file"
  );
  p_newline();

  p_header("Usage");
  p_indent(1, APPNAME " prg replace <rom> [ <options> ... ] <bank-index> <prgbank>");
  p_newline();

  p_header("Arguments");
  p_cols(opts, arg_cols);
  p_newline();

  p_header("Options");
  p_cols(opts, option_cols);
  p_newline();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x21c0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x2fd2(%rip), %rdi      # 0x66b5
callq 0x3294
leaq 0x2fd6(%rip), %rsi      # 0x66c5
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2a3d(%rip), %rdi      # 0x6142
callq 0x3294
leaq 0x2fee(%rip), %rsi      # 0x66ff
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2eb5(%rip), %rdi      # 0x65d9
callq 0x3294
leaq 0x7bd0(%rip), %rsi      # 0xb300
movq %rbx, %rdi
callq 0x33de
callq 0x32a5
leaq 0x299c(%rip), %rdi      # 0x60e0
callq 0x3294
leaq 0x7b80(%rip), %rsi      # 0xb2d0
movq %rbx, %rdi
callq 0x33de
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32a5
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/help.c
// Function: print_usage_chr
void print_usage_chr() {
  help_opts *opts = HELP_ALLOC_OPTS;
  opts->indent = 1;

  p_header(APPNAME " chr");
  p_indent(1, "Perform CHR bank action such as extraction and replacement");
  p_newline();

  p_header("Usage");
  p_indent(1, APPNAME " chr <action> [ <action-args> ... ]");
  p_newline();

  p_header("Actions");

  static struct help_cols action_cols[] = {
    { "extract", "Extract the given CHR to either a raw CHR bank or a PNG file" },
    { "replace", "Replace a CHR bank with the given PNG or raw CHR bank" },
    NULL_COL
  };

  p_cols(opts, action_cols);

  p_newline();

  printf("For additional usage information for the above actions run `%s chr <action> --help`\n", APPNAME);

  p_newline();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x21c0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x2fbd(%rip), %rdi      # 0x673e
callq 0x3294
leaq 0x2fb9(%rip), %rsi      # 0x6746
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x299f(%rip), %rdi      # 0x6142
callq 0x3294
leaq 0x2fd2(%rip), %rsi      # 0x6781
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2c3f(%rip), %rdi      # 0x6401
callq 0x3294
leaq 0x7b72(%rip), %rsi      # 0xb340
movq %rbx, %rdi
callq 0x33de
callq 0x32a5
leaq 0x3039(%rip), %rdi      # 0x681b
leaq 0x2919(%rip), %rsi      # 0x6102
xorl %eax, %eax
callq 0x2140
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32a5
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/help.c
// Function: print_usage_chr_extract
void print_usage_chr_extract() {
  help_opts *opts = HELP_ALLOC_OPTS;
  opts->indent = 1;

  static struct help_cols option_cols[] = {
    "--help", "Display this help",
    "-f | --format <format>", "Export to the selected format: raw or png",
    "-w | --width <width>", "Applicable only for PNG output: The number of tiles wide the final image should be (default: 16)",
    NULL_COL
  };

  static struct help_cols arg_cols[] = {
    "<rom>", "The path to the source ROM file to extract from",
    "<bank-index>", "The zero-based index of the CHR bank to extract",
    "<outflie>", "The output file",
    NULL_COL
  };

  p_header(APPNAME " chr extract");
  p_indent(1,
      "Extract a CHR bank from a ROM file to either a raw CHR bank file or a PNG bitmap\n"
      "The format is determined by either the file extension of the output file or\n"
      "the value of the -f or --format flag"
  );
  p_newline();

  p_header("Usage");
  p_indent(1, APPNAME " chr extract <rom> [ <options> ... ] <bank-index> <outfile>");
  p_newline();

  p_header("Arguments");
  p_cols(opts, arg_cols);
  p_newline();

  p_header("Options");
  p_cols(opts, option_cols);
  p_newline();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x21c0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x314e(%rip), %rdi      # 0x6967
callq 0x3294
leaq 0x3152(%rip), %rsi      # 0x6977
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2907(%rip), %rdi      # 0x6142
callq 0x3294
leaq 0x31f2(%rip), %rsi      # 0x6a39
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2d7f(%rip), %rdi      # 0x65d9
callq 0x3294
leaq 0x7b4a(%rip), %rsi      # 0xb3b0
movq %rbx, %rdi
callq 0x33de
callq 0x32a5
leaq 0x2866(%rip), %rdi      # 0x60e0
callq 0x3294
leaq 0x7aea(%rip), %rsi      # 0xb370
movq %rbx, %rdi
callq 0x33de
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32a5
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/help.c
// Function: print_usage_chr_replace
void print_usage_chr_replace() {
  help_opts *opts = HELP_ALLOC_OPTS;
  opts->indent = 1;

  static struct help_cols option_cols[] = {
    "--help", "Display this help",
    "-f | --format <format>", "Import from the selected format: raw or png; If not passed, the format will be guessed from the file extension of the sourcefile",
    "-o | --outfile <path>", "When replacing the bank, write the updated ROM file to this path rather than clobbering the source ROM",
    NULL_COL
  };

  static struct help_cols arg_cols[] = {
    "<rom>", "The path to the source ROM file to replace the CHR bank",
    "<bank-index>", "The zero-based index of the bank to replace",
    "<sourcefile>", "The source CHR bank file; either a raw CHR bank or a png bitmap",
    NULL_COL
  };

  p_header(APPNAME " chr replace");
  p_indent(1,
      "Replace a CHR bank in a ROM file with the given bank or png image."
  );
  p_newline();

  p_header("Usage");
  p_indent(1, APPNAME " chr replace <rom> [ <options> ... ] <bank-index> <chrbank>");
  p_newline();

  p_header("Arguments");
  p_cols(opts, arg_cols);
  p_newline();

  p_header("Options");
  p_cols(opts, option_cols);
  p_newline();

  p_header("Notes");
  p_indent(1,
      "When importing a PNG file, the file MUST contain 256 8x8 pixel tiles and\n"
      "be in indexed color mode. Only the colors 0-3 of the file's pallete will\n"
      "be used when importing into the ROM."
  );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x21c0
movq %rax, %r14
movl $0x1, (%rax)
leaq 0x32c6(%rip), %rdi      # 0x6b7e
callq 0x3294
leaq 0x32ca(%rip), %rsi      # 0x6b8e
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2868(%rip), %rdi      # 0x6142
callq 0x3294
leaq 0x32eb(%rip), %rsi      # 0x6bd1
movl %ebx, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2ce0(%rip), %rdi      # 0x65d9
callq 0x3294
leaq 0x7b2b(%rip), %rsi      # 0xb430
movq %r14, %rdi
callq 0x33de
callq 0x32a5
leaq 0x27c7(%rip), %rdi      # 0x60e0
callq 0x3294
leaq 0x7acb(%rip), %rsi      # 0xb3f0
movq %r14, %rdi
callq 0x33de
callq 0x32a5
leaq 0x32d7(%rip), %rdi      # 0x6c10
callq 0x3294
leaq 0x32d1(%rip), %rsi      # 0x6c16
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x32ad
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/help.c
// Function: print_usage_title
void print_usage_title() {
  help_opts *opts = HELP_ALLOC_OPTS;
  opts->indent = 1;

  p_header(APPNAME " title");
  p_indent(1,
      "Perform actions related to the title metadata in an NES ROM such as setting,\n"
      "getting and removing the metadata. Title metadata is stored at the end of\n"
      "the ROM file and is not consistently supported by emulators, however should\n"
      "not affect the playability of the file itself."
  );
  p_newline();

  p_header("Usage");
  p_indent(1, APPNAME " title <action> [ <action-args> ... ]");
  p_newline();

  p_header("Actions");

  static struct help_cols action_cols[] = {
    { "get", "Read the title metadata from the given ROM and output to STDOUT" },
    { "set", "Set the title to the provided string value" },
    { "remove", "Remove the title metadata entirely from the given ROM file" },
    NULL_COL
  };

  p_cols(opts, action_cols);

  p_newline();

  printf("For additional usage information for the above actions run `%s title <action> --help`\n", APPNAME);

  p_newline();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x21c0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x335c(%rip), %rdi      # 0x6ccd
callq 0x3294
leaq 0x335a(%rip), %rsi      # 0x6cd7
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x27af(%rip), %rdi      # 0x6142
callq 0x3294
leaq 0x344a(%rip), %rsi      # 0x6de9
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2a4f(%rip), %rdi      # 0x6401
callq 0x3294
leaq 0x7ab2(%rip), %rsi      # 0xb470
movq %rbx, %rdi
callq 0x33de
callq 0x32a5
leaq 0x34e6(%rip), %rdi      # 0x6eb8
leaq 0x2729(%rip), %rsi      # 0x6102
xorl %eax, %eax
callq 0x2140
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32a5
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/help.c
// Function: print_usage_title_get
void print_usage_title_get() {
  help_opts *opts = HELP_ALLOC_OPTS;
  opts->indent = 1;

  static struct help_cols option_cols[] = {
    "--help", "Display this help",
    NULL_COL
  };

  static struct help_cols arg_cols[] = {
    "<rom>", "The path to the source ROM file to read the title",
    NULL_COL
  };

  p_header(APPNAME " title get");
  p_indent(1,
      "Read the title metadata (if there is any) and output to STDOUT.\n"
      "If there is no title metadata, nothing will be output."
  );
  p_newline();

  p_header("Usage");
  p_indent(1, APPNAME " title get <rom>");
  p_newline();

  p_header("Arguments");
  p_cols(opts, arg_cols);
  p_newline();

  p_header("Options");
  p_cols(opts, option_cols);
  p_newline();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x21c0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x3538(%rip), %rdi      # 0x6f41
callq 0x3294
leaq 0x353a(%rip), %rsi      # 0x6f4f
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2717(%rip), %rdi      # 0x6142
callq 0x3294
leaq 0x358f(%rip), %rsi      # 0x6fc6
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2b8f(%rip), %rdi      # 0x65d9
callq 0x3294
leaq 0x7a7a(%rip), %rsi      # 0xb4d0
movq %rbx, %rdi
callq 0x33de
callq 0x32a5
leaq 0x2676(%rip), %rdi      # 0x60e0
callq 0x3294
leaq 0x7a3a(%rip), %rsi      # 0xb4b0
movq %rbx, %rdi
callq 0x33de
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32a5
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/help.c
// Function: print_usage_title_set
void print_usage_title_set() {
  help_opts *opts = HELP_ALLOC_OPTS;
  opts->indent = 1;

  static struct help_cols option_cols[] = {
    "--help", "Display this help",
    NULL_COL
  };

  static struct help_cols arg_cols[] = {
    "<rom>", "The path to the ROM file to set the title on",
    "<title>", "The new title to set (max: 256 chars)",
    NULL_COL
  };

  p_header(APPNAME " title set");
  p_indent(1,
      "Set the title metadata on the given ROM. Titles can be a maximum of 256 chars.\n"
      "If the title is an empty string, then remove the title entirely."
  );
  p_newline();

  p_header("Usage");
  p_indent(1, APPNAME " title set <rom> <title>");
  p_newline();

  p_header("Arguments");
  p_cols(opts, arg_cols);
  p_newline();

  p_header("Options");
  p_cols(opts, option_cols);
  p_newline();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x21c0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x3586(%rip), %rdi      # 0x702d
callq 0x3294
leaq 0x3588(%rip), %rsi      # 0x703b
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2679(%rip), %rdi      # 0x6142
callq 0x3294
leaq 0x35f6(%rip), %rsi      # 0x70cb
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2af1(%rip), %rdi      # 0x65d9
callq 0x3294
leaq 0x7a1c(%rip), %rsi      # 0xb510
movq %rbx, %rdi
callq 0x33de
callq 0x32a5
leaq 0x25d8(%rip), %rdi      # 0x60e0
callq 0x3294
leaq 0x79dc(%rip), %rsi      # 0xb4f0
movq %rbx, %rdi
callq 0x33de
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32a5
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/help.c
// Function: print_usage_title_remove
void print_usage_title_remove() {
  help_opts *opts = HELP_ALLOC_OPTS;
  opts->indent = 1;

  static struct help_cols option_cols[] = {
    "--help", "Display this help",
    NULL_COL
  };

  static struct help_cols arg_cols[] = {
    "<rom>", "The path to the source ROM file to remove the title",
    NULL_COL
  };

  p_header(APPNAME " title remove");
  p_indent(1,
      "Remove the title metadata from the given ROM file."
  );
  p_newline();

  p_header("Usage");
  p_indent(1, APPNAME " title remove <rom>");
  p_newline();

  p_header("Arguments");
  p_cols(opts, arg_cols);
  p_newline();

  p_header("Options");
  p_cols(opts, option_cols);
  p_newline();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x21c0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x35d6(%rip), %rdi      # 0x711b
callq 0x3294
leaq 0x35db(%rip), %rsi      # 0x712c
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x25db(%rip), %rdi      # 0x6142
callq 0x3294
leaq 0x35ec(%rip), %rsi      # 0x715f
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2a53(%rip), %rdi      # 0x65d9
callq 0x3294
leaq 0x79ce(%rip), %rsi      # 0xb560
movq %rbx, %rdi
callq 0x33de
callq 0x32a5
leaq 0x253a(%rip), %rdi      # 0x60e0
callq 0x3294
leaq 0x798e(%rip), %rsi      # 0xb540
movq %rbx, %rdi
callq 0x33de
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32a5
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/help.c
// Function: print_usage_chr2png
void print_usage_chr2png() {
  help_opts *opts = HELP_ALLOC_OPTS;
  opts->indent = 1;

  static struct help_cols option_cols[] = {
    "--help", "Display this help",
    "-w | --width=<width>", "Set the width (in tiles) of the output PNG",
    "-o | --outdir=<outdir>", "Set the output directory for the output PNG files (default is to output to same directory as source file)",
    NULL_COL
  };

  static struct help_cols arg_cols[] = {
    "<chrfile>", "A raw CHR bank file; possibly exported from a ROM, for example",
    NULL_COL
  };

  p_header("chr2png");
  p_indent(1,
      "Convert stand-alone CHR bank files into indexed 4-color raster PNG files"
  );
  p_newline();

  p_header("Usage");
  p_indent(1, "chr2png [ <options> ... ] <chrfile> [ <chrfile> ... ]");
  p_newline();

  p_header("Arguments");
  p_cols(opts, arg_cols);
  p_newline();

  p_header("Options");
  p_cols(opts, option_cols);
  p_newline();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x21c0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x369d(%rip), %rdi      # 0x7280
callq 0x3294
leaq 0x3699(%rip), %rsi      # 0x7288
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x253d(%rip), %rdi      # 0x6142
callq 0x3294
leaq 0x36c0(%rip), %rsi      # 0x72d1
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x29b5(%rip), %rdi      # 0x65d9
callq 0x3294
leaq 0x7990(%rip), %rsi      # 0xb5c0
movq %rbx, %rdi
callq 0x33de
callq 0x32a5
leaq 0x249c(%rip), %rdi      # 0x60e0
callq 0x3294
leaq 0x7930(%rip), %rsi      # 0xb580
movq %rbx, %rdi
callq 0x33de
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32a5
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/help.c
// Function: print_usage_png2chr
void print_usage_png2chr() {
  help_opts *opts = HELP_ALLOC_OPTS;
  opts->indent = 1;

  static struct help_cols option_cols[] = {
    "--help", "Display this help",
    "-o | --outdir=<outdir>", "Set the output directory for the output PNG files (default is to output to same directory as source file)",
    "-s | --size=<size>", "Set the number of tiles in the target CHR file. This can be an integer value (from 1 up to 512) or 'table' for 256 or 'chr' for 512.",
    NULL_COL
  };

  static struct help_cols arg_cols[] = {
    "<pngfile>", "An indexed color raster PNG file",
    NULL_COL
  };

  p_header("png2chr");
  p_indent(1,
      "Convert raster PNG files into raw CHR banks. Input files must be indexed color mode\n"
      "and only the first 4 colors in the palette will be used"
  );
  p_newline();

  p_header("Usage");
  p_indent(1, "png2chr [ <options> ... ] <pngfile> [ <pngfile> ... ]");
  p_newline();

  p_header("Arguments");
  p_cols(opts, arg_cols);
  p_newline();

  p_header("Options");
  p_cols(opts, option_cols);
  p_newline();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x21c0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x3749(%rip), %rdi      # 0x73ca
callq 0x3294
leaq 0x3745(%rip), %rsi      # 0x73d2
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x249f(%rip), %rdi      # 0x6142
callq 0x3294
leaq 0x37af(%rip), %rsi      # 0x745e
movl %ebp, %edi
callq 0x32ad
callq 0x32a5
leaq 0x2917(%rip), %rdi      # 0x65d9
callq 0x3294
leaq 0x7952(%rip), %rsi      # 0xb620
movq %rbx, %rdi
callq 0x33de
callq 0x32a5
leaq 0x23fe(%rip), %rdi      # 0x60e0
callq 0x3294
leaq 0x78f2(%rip), %rsi      # 0xb5e0
movq %rbx, %rdi
callq 0x33de
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32a5
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/subcommands.c
// Function: is_subcommand
bool is_subcommand(char *subcommand, ...) {
  va_list aliases;

  va_start(aliases, subcommand);

  char *alias = va_arg(aliases, char*);

  while(alias) {
    if (strcmp(alias, subcommand) == 0) {
      va_end(aliases);
      return true;
    }

    alias = va_arg(aliases, char*);
  }

  va_end(aliases);

  return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x3d6b
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
pushq $0x8
popq %r15
pushq $0x8
popq %r12
cmpq $0x28, %r12
ja 0x3db0
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %r13
addq %r13, %r12
addl $0x8, %r15d
movl %r15d, (%rsp)
jmp 0x3dc4
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %r13
leaq 0x8(%r12), %rax
movq %rax, 0x8(%rsp)
movq %r12, %rcx
movq %rax, %r12
movl %r15d, %r15d
movq (%rcx), %r14
testq %r14, %r14
je 0x3df8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21d0
testl %eax, %eax
je 0x3df8
cmpl $0x28, %r15d
ja 0x3dba
leaq (%r15,%r13), %rcx
addq $0x8, %r15
movl %r15d, (%rsp)
jmp 0x3dcd
testq %r14, %r14
setne %al
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/subcommands/prg.c
// Function: subcommand_prg
void subcommand_prg(int argc, char **argv) {
  char *action = *(argv++);

  if (strcmp(action, "extract") == 0) {
    SUBCOMMAND(prg, extract);
  } else if (strcmp(action, "replace") == 0) {
    SUBCOMMAND(prg, replace);
  } else if (strcmp(action, "--help") == 0) {
    print_usage_prg();
    exit(EXIT_SUCCESS);
  } else {
    fprintf(stderr, "Invalid action: %s\n", action);
    exit(EXIT_FAILURE);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movq (%rsi), %rbx
addq $0x8, %r14
leaq 0x2219(%rip), %rsi      # 0x656b
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
je 0x4389
leaq 0x2358(%rip), %rsi      # 0x66bd
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
jne 0x439d
decl %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0x4184
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4533
decl %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0x4014
movq %rax, %rdi
callq 0x43e1
leaq 0x211e(%rip), %rsi      # 0x64c2
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
jne 0x43be
xorl %eax, %eax
callq 0x358f
xorl %edi, %edi
callq 0x2330
movq 0x6c33(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x32b8(%rip), %rsi      # 0x7687
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21f0
pushq $0x1
popq %rdi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/subcommands/prg.c
// Function: subcommand_prg_extract
void subcommand_prg_extract(prg_opts *opts) {
  // now we're ready to write this stuff out.
  FILE *ifile = fopen(opts->romfile_path, "r");
  if (!ifile) {
    fprintf(stderr, "Failed to open file: %s\n", opts->romfile_path);
    exit(EXIT_FAILURE);
  }

  nrt_header *header = NRT_HEADER_ALLOC;
  nrt_header_extract(ifile, header);

  if (! nrt_validate_header(header)) {
    fprintf(stderr, "Rom file does not look valid: %s\n", opts->romfile_path);
    fclose(ifile);
    free(header);
    free(opts);
    exit(EXIT_FAILURE);
  }

  free(header);

  nrt_prgbank *prg = NRT_PRG_ALLOC;
  if (!nrt_extract_prg(ifile, opts->bank_index, prg)) {
    fprintf(stderr, "Failed to read PRG bank %d from %s\n", opts->bank_index, opts->romfile_path);
    fclose(ifile);
    free(prg);
    free(opts);
    exit(EXIT_FAILURE);
  }

  fclose(ifile);

  // ok, now let's write out the PRG
  FILE *ofile = fopen(opts->outfile_path, "w");

  if (!ofile) {
    perror("Failed to open file for writing");
    exit(EXIT_FAILURE);
  }

  if (opts->format == prg_raw_format) {
    // just write out the data to the file.

    fwrite(prg, NRT_PRG_BANK_SIZE, 1, ofile);

    fclose(ofile);
    free(prg);
  }

  free(opts);
  exit(EXIT_SUCCESS);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x2354(%rip), %rsi      # 0x6744
callq 0x22c0
testq %rax, %rax
jne 0x441a
movq 0x6bf7(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x3290(%rip), %rsi      # 0x769b
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21f0
jmp 0x44bf
movq %rax, %r14
pushq $0x10
popq %rdi
callq 0x2240
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x2607
movq %r15, %rdi
callq 0x2632
testb %al, %al
je 0x448c
movq %r15, %rdi
callq 0x2040
movl $0x4000, %edi           # imm = 0x4000
callq 0x2240
movq %rax, %r15
movl 0x404(%rbx), %esi
movq %r14, %rdi
movq %rax, %rdx
callq 0x268c
testl %eax, %eax
jne 0x44c7
movq 0x6b88(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movl 0x404(%rbx), %edx
leaq 0x3256(%rip), %rsi      # 0x76d6
movq %rbx, %rcx
xorl %eax, %eax
callq 0x21f0
jmp 0x44a7
movq 0x6b65(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x3217(%rip), %rsi      # 0x76b4
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21f0
movq %r14, %rdi
callq 0x2100
movq %r15, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
pushq $0x1
popq %rdi
callq 0x2330
movq %r14, %rdi
callq 0x2100
leaq 0x808(%rbx), %rdi
leaq 0x3137(%rip), %rsi      # 0x7614
callq 0x22c0
testq %rax, %rax
jne 0x44f5
leaq 0x320c(%rip), %rdi      # 0x76fa
callq 0x22d0
jmp 0x44bf
cmpl $0x1, 0x400(%rbx)
jne 0x4524
movq %rax, %r14
pushq $0x1
popq %rdx
movl $0x4000, %esi           # imm = 0x4000
movq %r15, %rdi
movq %rax, %rcx
callq 0x2340
movq %r14, %rdi
callq 0x2100
movq %r15, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
xorl %edi, %edi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/subcommands/prg.c
// Function: subcommand_prg_replace
void subcommand_prg_replace(prg_opts *opts) {
  nrt_prgbank *prg_bank = NRT_PRG_ALLOC;

  if (opts->format == prg_raw_format) {
    // it's a raw file, so let's read that in.
    FILE *ifile = fopen(opts->sourcefile_path, "r");
    if (!ifile) {
      perror("Failed to open source file");
      free(prg_bank);
      free(opts);
      exit(EXIT_FAILURE);
    }

    // read in the data.
    if (fread(prg_bank, NRT_PRG_BANK_SIZE, 1, ifile) != 1) {
      perror("Failed to read prg bank from file");
      fclose(ifile);
      free(prg_bank);
      free(opts);
      exit(EXIT_FAILURE);
    }

    fclose(ifile);
  } else {
    fprintf(stderr, "Unsupported format: %d\n", opts->format);
  }

  static char tempfile_path[] = "/tmp/nrt-rom.XXXXXX";

  // ok, let's read in the rom file, and replace the chr
  FILE *romfile = fopen(opts->romfile_path, "r");

  if (!romfile) {
    perror("Failed to open rom file for reading");
    exit(EXIT_FAILURE);
  }

  nrt_rom *rom = nrt_read_rom_from_file(romfile);
  fclose(romfile);

  nrt_prg_listitem *bank_listitem = nrt_prg_listitem_at(rom->prgs, opts->bank_index);
  free(bank_listitem->prg);
  bank_listitem->prg = prg_bank;

  int fd = mkstemp(tempfile_path);
  FILE *tempfile = fdopen(fd, "w");

  nrt_rom_write_to_file(rom, tempfile);

  fclose(tempfile);
  nrt_rom_free(rom);

  rename(tempfile_path, opts->outfile_path);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x4000, %edi           # imm = 0x4000
callq 0x2240
movq %rax, %r14
movl 0x400(%rbx), %edx
cmpl $0x1, %edx
jne 0x4642
leaq 0x408(%rbx), %rdi
leaq 0x21dc(%rip), %rsi      # 0x6744
callq 0x22c0
testq %rax, %rax
je 0x466d
movq %rax, %r15
pushq $0x1
popq %rdx
movl $0x4000, %esi           # imm = 0x4000
movq %r14, %rdi
movq %rax, %rcx
callq 0x20c0
cmpq $0x1, %rax
jne 0x467b
movq %r15, %rdi
callq 0x2100
leaq 0x219f(%rip), %rsi      # 0x6744
movq %rbx, %rdi
callq 0x22c0
testq %rax, %rax
je 0x465f
movq %rax, %r12
movq %rax, %rdi
callq 0x305d
movq %rax, %r15
movq %r12, %rdi
callq 0x2100
movq 0x8(%r15), %rdi
movl 0x404(%rbx), %esi
callq 0x2e59
movq %rax, %r12
movq (%rax), %rdi
callq 0x2040
movq %r14, (%r12)
leaq 0x712f(%rip), %r14      # 0xb720
movq %r14, %rdi
callq 0x2270
leaq 0x3014(%rip), %rsi      # 0x7614
movl %eax, %edi
callq 0x2290
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
callq 0x3156
movq %r12, %rdi
callq 0x2100
movq %r15, %rdi
callq 0x303e
addq $0x808, %rbx            # imm = 0x808
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x22e0
movq 0x69af(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x3104(%rip), %rsi      # 0x7757
xorl %eax, %eax
callq 0x21f0
jmp 0x459e
leaq 0x3109(%rip), %rdi      # 0x776f
callq 0x22d0
jmp 0x469f
leaq 0x30a6(%rip), %rdi      # 0x771a
callq 0x22d0
jmp 0x468f
leaq 0x30b3(%rip), %rdi      # 0x7735
callq 0x22d0
movq %r15, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
pushq $0x1
popq %rdi
callq 0x2330
nop
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/subcommands/chr.c
// Function: filename_to_chr_output_format
chr_output_format filename_to_chr_output_format(char *filename) {
  // figure out the format if it's not passed
  const char *ext = filename_ext(filename);

  if (strcmp(ext, "chr") == 0) {
    return raw_format;
  } else if (strcmp(ext, "png") == 0) {
    return png_format;
  }

  return null_format;
}

// Assembly:
pushq %rbx
callq 0x3218
movq %rax, %rbx
leaq 0x2055(%rip), %rsi      # 0x6742
movq %rax, %rdi
callq 0x21d0
testl %eax, %eax
je 0x4715
leaq 0x21ad(%rip), %rsi      # 0x68ad
movq %rbx, %rdi
callq 0x21d0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addl %eax, %eax
jmp 0x4718
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/subcommands/chr.c
// Function: subcommand_chr
void subcommand_chr(int argc, char **argv) {
  char *action = *(argv++);

  if (strcmp(action, "extract") == 0) {
    SUBCOMMAND(chr, extract);
  } else if (strcmp(action, "replace") == 0) {
    SUBCOMMAND(chr, replace);
  } else if (strcmp(action, "--help") == 0) {
    print_usage_chr();
    exit(EXIT_SUCCESS);
  } else {
    fprintf(stderr, "Invalid action: %s\n", action);
    exit(EXIT_FAILURE);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movq (%rsi), %rbx
addq $0x8, %r14
leaq 0x1abb(%rip), %rsi      # 0x656b
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
je 0x4ae7
leaq 0x1bfa(%rip), %rsi      # 0x66bd
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
jne 0x4afb
decl %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0x48e3
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4cf4
decl %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0x471a
movq %rax, %rdi
callq 0x4b3f
leaq 0x19c0(%rip), %rsi      # 0x64c2
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
jne 0x4b1c
xorl %eax, %eax
callq 0x3763
xorl %edi, %edi
callq 0x2330
movq 0x64d5(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x2b5a(%rip), %rsi      # 0x7687
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21f0
pushq $0x1
popq %rdi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/subcommands/title.c
// Function: subcommand_title_get_parse
title_opts* subcommand_title_get_parse(int argc, char **argv) {
  title_opts *opts = (title_opts*)calloc(1, sizeof(title_opts));

  static struct option longopts[] = {
    { "help", no_argument, NULL, 'h' },
    { NULL, 0, NULL, 0 }
  };

  if (strcmp(argv[0], "--help") == 0) {
    print_usage_title_get();
    exit(EXIT_SUCCESS);
  }

  strcpy(opts->romfile_path, argv[0]); // don't shift the args

  int ch;

  while ((ch = getopt_long(argc, argv, "h", longopts, NULL)) != -1) {
    switch (ch) {
      case 'h':
        print_usage_title_get();
        exit(EXIT_SUCCESS);
        break;

      case 0:
        break;
      default:
        fprintf(stderr, "Invalid argument: -%c\n", ch);
        exit(EXIT_FAILURE);
    }
  }

  argc -= optind;
  argv += optind;

  return opts;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
pushq $0x1
popq %rdi
movl $0x8ff, %esi            # imm = 0x8FF
callq 0x21c0
movq %rax, %r14
movq (%rbx), %r15
leaq 0x147c(%rip), %rsi      # 0x64c2
movq %r15, %rdi
callq 0x21d0
testl %eax, %eax
je 0x5098
movq %r14, %rdi
movq %r15, %rsi
callq 0x20a0
leaq 0x27cd(%rip), %r15      # 0x7831
leaq 0x6855(%rip), %r12      # 0xb8c0
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x2130
testl %eax, %eax
je 0x506b
cmpl $-0x1, %eax
jne 0x5093
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x68, %eax
jne 0x50a6
xorl %eax, %eax
callq 0x39eb
xorl %edi, %edi
callq 0x2330
movq 0x5f4b(%rip), %rcx      # 0xaff8
movq (%rcx), %rdi
leaq 0x2576(%rip), %rsi      # 0x762d
movl %eax, %edx
xorl %eax, %eax
callq 0x21f0
pushq $0x1
popq %rdi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/subcommands/title.c
// Function: subcommand_title_remove_parse
title_opts* subcommand_title_remove_parse(int argc, char **argv) {
  title_opts *opts = (title_opts*)calloc(1, sizeof(title_opts));

  static struct option longopts[] = {
    { "help", no_argument, NULL, 'h' },
    { "outfile", required_argument, NULL, 'o' },
    { NULL, 0, NULL, 0 }
  };

  if (strcmp(argv[0], "--help") == 0) {
    print_usage_title_remove();
    exit(EXIT_SUCCESS);
  }

  strcpy(opts->romfile_path, argv[0]); // don't shift the args

  int ch;

  while ((ch = getopt_long(argc, argv, "o:h", longopts, NULL)) != -1) {
    switch (ch) {
      case 'h':
        print_usage_title_remove();
        exit(EXIT_SUCCESS);
        break;

      case 'o':
        strcpy(opts->outfile_path, optarg);

        break;
      case 0:
        break;
      default:
        fprintf(stderr, "Invalid argument: -%c\n", ch);
        exit(EXIT_FAILURE);
    }
  }

  argc -= optind;
  argv += optind;

  return opts;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
pushq $0x1
popq %rdi
movl $0x8ff, %esi            # imm = 0x8FF
callq 0x21c0
movq %rax, %r14
movq (%rbx), %r15
leaq 0x13d0(%rip), %rsi      # 0x64c2
movq %r15, %rdi
callq 0x21d0
testl %eax, %eax
je 0x5172
movq %r14, %rdi
movq %r15, %rsi
callq 0x20a0
movq %r14, (%rsp)
movq %r14, %r15
addq $0x4ff, %r15            # imm = 0x4FF
leaq 0x2711(%rip), %r12      # 0x782f
leaq 0x67db(%rip), %r13      # 0xb900
movq 0x5ea4(%rip), %r14      # 0xafd0
movl %ebp, %edi
movq %rbx, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x2130
testl %eax, %eax
je 0x512c
cmpl $0x6f, %eax
jne 0x5155
movq (%r14), %rsi
movq %r15, %rdi
callq 0x20a0
jmp 0x512c
cmpl $-0x1, %eax
jne 0x516d
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x68, %eax
jne 0x5180
xorl %eax, %eax
callq 0x3b27
xorl %edi, %edi
callq 0x2330
movq 0x5e71(%rip), %rcx      # 0xaff8
movq (%rcx), %rdi
leaq 0x249c(%rip), %rsi      # 0x762d
movl %eax, %edx
xorl %eax, %eax
callq 0x21f0
pushq $0x1
popq %rdi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/subcommands/title.c
// Function: subcommand_title
void subcommand_title(int argc, char **argv) {
  char *action = *(argv++);

  if (strcmp(action, "set") == 0) {
    SUBCOMMAND(title, set);
  } else if (strcmp(action, "get") == 0) {
    SUBCOMMAND(title, get);
  } else if (strcmp(action, "remove") == 0) {
    SUBCOMMAND(title, remove);
  } else if (strcmp(action, "--help") == 0) {
    print_usage_title();
    exit(EXIT_SUCCESS);
  } else {
    fprintf(stderr, "Invalid action: %s\n", action);
    exit(EXIT_FAILURE);
  }

}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movq (%rsi), %rbx
addq $0x8, %r14
leaq 0x1e7e(%rip), %rsi      # 0x7037
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
je 0x5203
leaq 0x1d7f(%rip), %rsi      # 0x6f4b
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
je 0x521b
leaq 0x1f46(%rip), %rsi      # 0x7125
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
jne 0x522f
decl %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0x50c8
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x53ad
decl %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0x4ecc
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5273
decl %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0x501f
movq %rax, %rdi
callq 0x5337
leaq 0x128c(%rip), %rsi      # 0x64c2
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
jne 0x5250
xorl %eax, %eax
callq 0x3953
xorl %edi, %edi
callq 0x2330
movq 0x5da1(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x2426(%rip), %rsi      # 0x7687
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21f0
pushq $0x1
popq %rdi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/subcommands/title.c
// Function: subcommand_title_set
void subcommand_title_set(title_opts *opts) {
  static char tempfile_path[] = "/tmp/nrt-rom.XXXXXX";

  // ok, let's read in the rom file, and replace the chr
  FILE *romfile = fopen(opts->romfile_path, "r");

  if (!romfile) {
    perror("Failed to open rom file for reading");
    exit(EXIT_FAILURE);
  }

  nrt_rom *rom = nrt_read_rom_from_file(romfile);
  fclose(romfile);

  // first we want to zero out the entire title in our in-memory rom
  // then strcpy() the new title in there
  bzero(rom->title, NRT_TITLE_MAX_LENGTH);
  strcpy(rom->title, opts->title);

  int fd = mkstemp(tempfile_path);
  FILE *tempfile = fdopen(fd, "w");

  nrt_rom_write_to_file(rom, tempfile);

  fclose(tempfile);
  nrt_rom_free(rom);

  rename(tempfile_path, opts->outfile_path);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x14bf(%rip), %rsi      # 0x6744
callq 0x22c0
testq %rax, %rax
je 0x5323
movq %rax, %r15
movq %rax, %rdi
callq 0x305d
movq %rax, %r14
movq %r15, %rdi
callq 0x2100
leaq 0x18(%r14), %r15
movl $0xff, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x2180
leaq 0x400(%rbx), %rsi
movq %r15, %rdi
callq 0x20a0
leaq 0x668e(%rip), %r15      # 0xb960
movq %r15, %rdi
callq 0x2270
leaq 0x2333(%rip), %rsi      # 0x7614
movl %eax, %edi
callq 0x2290
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
callq 0x3156
movq %r12, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x303e
addq $0x4ff, %rbx            # imm = 0x4FF
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x22e0
leaq 0x2445(%rip), %rdi      # 0x776f
callq 0x22d0
pushq $0x1
popq %rdi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/subcommands/title.c
// Function: subcommand_title_get
void subcommand_title_get(title_opts *opts) {
  FILE *romfile = fopen(opts->romfile_path, "r");

  if (!romfile) {
    perror("Failed to open rom file for reading");
    exit(EXIT_FAILURE);
  }

  nrt_rom *rom = nrt_read_rom_from_file(romfile);
  fclose(romfile);

  if (strnlen(rom->title, NRT_TITLE_MAX_LENGTH) == 0) {
    printf("<no-title>\n");
    nrt_rom_free(rom);
    free(opts);
    exit(EXIT_SUCCESS);
  }

  printf("%s\n", rom->title);
  nrt_rom_free(rom);
  free(opts);

  exit(EXIT_SUCCESS);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x13fe(%rip), %rsi      # 0x6744
callq 0x22c0
testq %rax, %rax
jne 0x5364
leaq 0x2418(%rip), %rdi      # 0x776f
callq 0x22d0
pushq $0x1
popq %rdi
callq 0x2330
movq %rax, %r15
movq %rax, %rdi
callq 0x305d
movq %rax, %r14
movq %r15, %rdi
callq 0x2100
cmpb $0x0, 0x18(%r14)
jne 0x538a
leaq 0x24d5(%rip), %rdi      # 0x785d
jmp 0x5391
movq %r14, %rdi
addq $0x18, %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x303e
movq %rbx, %rdi
callq 0x2040
xorl %edi, %edi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/chr2png_main.c
// Function: validate_outdir
void validate_outdir(char *outdir) {
  // first, let's make sure the opts->outdir exists and is a directory before we get started
  // (assuming that it's specified)
  if (outdir[0] != '\0') {
    struct stat *outdir_stat = (struct stat*)malloc(sizeof(struct stat));

    if (stat(outdir, outdir_stat) != 0) {
      free(outdir_stat);
      perror(outdir);
      exit(EXIT_FAILURE);
    }

    if (!(outdir_stat->st_mode & S_IFDIR)) {
      free(outdir_stat);
      fprintf(stderr, "Output directory must be a directory.\n");
      exit(EXIT_FAILURE);
    }

    free(outdir_stat);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, (%rdi)
je 0x5b1d
movq %rdi, %rbx
movl $0x90, %edi
callq 0x2240
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2200
testl %eax, %eax
jne 0x5b25
movl 0x18(%r14), %ebx
movq %r14, %rdi
callq 0x2040
btl $0xe, %ebx
jae 0x5b37
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x22d0
jmp 0x5b53
movq 0x54ba(%rip), %rax      # 0xaff8
movq (%rax), %rcx
leaq 0x1dc2(%rip), %rdi      # 0x790a
pushq $0x26
popq %rsi
pushq $0x1
popq %rdx
callq 0x2340
pushq $0x1
popq %rdi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/chr2png_main.c
// Function: validate_chrfile
void validate_chrfile(char *filepath) {
  struct stat *filestat = (struct stat*)malloc(sizeof(struct stat));

  if (stat(filepath, filestat) != 0) {
    free(filestat);
    perror(filepath);
    exit(EXIT_FAILURE);
  }

  if (!(filestat->st_mode & S_IFREG)) {
    free(filestat);
    fprintf(stderr, "CHR file must be a regular file.\n");
    exit(EXIT_FAILURE);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x90, %edi
callq 0x2240
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2200
testl %eax, %eax
jne 0x5b8d
testb $-0x80, 0x19(%r14)
je 0x5b9f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x22d0
jmp 0x5bc3
movq %r14, %rdi
callq 0x2040
movq 0x544a(%rip), %rax      # 0xaff8
movq (%rax), %rcx
leaq 0x1d79(%rip), %rdi      # 0x7931
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
callq 0x2340
pushq $0x1
popq %rdi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/chr2png_main.c
// Function: chr_tile_count
int chr_tile_count(char *chrfile) {
  struct stat *chrfile_stat = (struct stat*)malloc(sizeof(struct stat));

  if (stat(chrfile, chrfile_stat) != 0) {
    free(chrfile_stat);
    perror(chrfile);
    exit(EXIT_FAILURE);
  }

  int size = chrfile_stat->st_size;
  free(chrfile_stat);

  // the file must be a size that's a multiple of 16 (the size of a tile in CHR memory)
  if (size % NRT_TILE_SIZE != 0) {
    fprintf(stderr, "File is the wrong size. It is %d bytes and must be a multiple of %d.\n", size, NRT_TILE_SIZE);
    exit(EXIT_FAILURE);
  }

  return size / NRT_TILE_SIZE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x90, %edi
callq 0x2240
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2200
testl %eax, %eax
jne 0x5c7f
movl 0x30(%r14), %ebx
movq %r14, %rdi
callq 0x2040
testb $0xf, %bl
jne 0x5c91
sarl $0x4, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x22d0
jmp 0x5cae
movq 0x5360(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x1cb1(%rip), %rsi      # 0x7953
pushq $0x10
popq %rcx
movl %ebx, %edx
xorl %eax, %eax
callq 0x21f0
pushq $0x1
popq %rdi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/openshmem-org[P]openshmem-examples/c/fip.c
// Function: main
int
main(void)
{
    float *f;
    int me;

    shmem_init();
    me = shmem_my_pe();

    f = (float *) shmem_malloc(sizeof(*f));

    *f = PI;
    shmem_barrier_all();

    if (me == 0) {
        shmem_float_p(f, E, 1);
    }

    shmem_barrier_all();

    if (me == 1) {
        printf("PE %d: %f, %s\n",
               me, *f, (fabsf(*f - E) < epsilon) ? "OK" : "FAIL");
    }

    shmem_free(f);

    shmem_finalize();

    return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
callq 0x1090
callq 0x1060
movl %eax, %ebp
pushq $0x4
popq %rdi
callq 0x1070
movq %rax, %rbx
movl $0x40490fdb, (%rax)     # imm = 0x40490FDB
callq 0x1080
testl %ebp, %ebp
jne 0x11e8
movss 0xe27(%rip), %xmm0      # 0x2004
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1040
callq 0x1080
cmpl $0x1, %ebp
jne 0x1237
movss (%rbx), %xmm1
cvtss2sd %xmm1, %xmm0
addss 0xe06(%rip), %xmm1      # 0x2008
andps 0xe07(%rip), %xmm1      # 0x2010
movss 0xdfb(%rip), %xmm2      # 0x200c
ucomiss %xmm1, %xmm2
leaq 0xe14(%rip), %rax       # 0x202f
leaq 0xe10(%rip), %rdx       # 0x2032
cmovaq %rax, %rdx
leaq 0xdf3(%rip), %rdi       # 0x2020
pushq $0x1
popq %rsi
movb $0x1, %al
callq 0x1030
movq %rbx, %rdi
callq 0x10a0
callq 0x1050
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/keithnoguchi[P]pearls-in-action/0x2/squash_main.c
// Function: main
int main(void)
{
#define WORDMAX	100
	char word[WORDMAX], sig[WORDMAX], oldsig[WORDMAX];
	int linenum = 0;

	strcpy(oldsig, "");
	while (scanf("%s %s", sig, word) != EOF) {
		if (strcmp(oldsig, sig)) {
			if (linenum > 0)
				puts("");
			strcpy(oldsig, sig);
		}
		linenum++;
		printf("%s ", word);
	}
	puts("");
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsp, %rbx
movb $0x0, (%rbx)
leaq 0xe6a(%rip), %r14       # 0x2004
leaq 0x70(%rsp), %r15
leaq 0xe0(%rsp), %r12
leaq 0xe5c(%rip), %r13       # 0x200a
xorl %ebp, %ebp
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1070
cmpl $-0x1, %eax
je 0x11fc
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x11eb
testl %ebp, %ebp
je 0x11e0
pushq $0xa
popq %rdi
callq 0x1030
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1040
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1050
decl %ebp
jmp 0x11b0
pushq $0xa
popq %rdi
callq 0x1030
xorl %eax, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hoomanist[P]carrot/cp.c
// Function: main
int
main(int argc, char **argv)
{
	int c;
	FILE *fp;
	FILE *dest;

	fp = fopen(argv[1], "r");
	dest = fopen(argv[2], "w");
	if(fp == NULL) {
                perror("Error in opening file");
        } do {
                c = fgetc(fp);
                if( feof(fp) ) {
                        break ;
                }
                fputc(c, dest);
        } while(1);
        fclose(fp);


}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq 0x8(%rsi), %rdi
leaq 0xe66(%rip), %rsi       # 0x2004
callq 0x1070
movq %rax, %rbx
movq 0x10(%r14), %rdi
leaq 0xe55(%rip), %rsi       # 0x2006
callq 0x1070
movq %rax, %r14
testq %rbx, %rbx
jne 0x11d6
leaq 0xe43(%rip), %rdi       # 0x2008
callq 0x1080
jmp 0x11d6
movl %ebp, %edi
movq %r14, %rsi
callq 0x1050
movq %rbx, %rdi
callq 0x1040
movl %eax, %ebp
movq %rbx, %rdi
callq 0x1060
testl %eax, %eax
je 0x11cc
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq