// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/zopfli_bin.c
// Function: main
int main(int argc, char* argv[]) {
  ZopfliOptions options;
  ZopfliFormat output_type = ZOPFLI_FORMAT_GZIP;
  const char* filename = 0;
  int output_to_stdout = 0;
  int i;

  ZopfliInitOptions(&options);

  for (i = 1; i < argc; i++) {
    if (StringsEqual(argv[i], "-v")) options.verbose = 1;
    else if (StringsEqual(argv[i], "-c")) output_to_stdout = 1;
    else if (StringsEqual(argv[i], "--deflate")) {
      output_type = ZOPFLI_FORMAT_DEFLATE;
    }
    else if (StringsEqual(argv[i], "--zlib")) output_type = ZOPFLI_FORMAT_ZLIB;
    else if (StringsEqual(argv[i], "--gzip")) output_type = ZOPFLI_FORMAT_GZIP;
    else if (StringsEqual(argv[i], "--i5")) options.numiterations = 5;
    else if (StringsEqual(argv[i], "--i10")) options.numiterations = 10;
    else if (StringsEqual(argv[i], "--i15")) options.numiterations = 15;
    else if (StringsEqual(argv[i], "--i25")) options.numiterations = 25;
    else if (StringsEqual(argv[i], "--i50")) options.numiterations = 50;
    else if (StringsEqual(argv[i], "--i100")) options.numiterations = 100;
    else if (StringsEqual(argv[i], "--i250")) options.numiterations = 250;
    else if (StringsEqual(argv[i], "--i500")) options.numiterations = 500;
    else if (StringsEqual(argv[i], "--i1000")) options.numiterations = 1000;
    else if (StringsEqual(argv[i], "-h")) {
      fprintf(stderr, "Usage: zopfli [OPTION]... FILE\n"
          "  -h    gives this help\n"
          "  -c    write the result on standard output, instead of disk"
          " filename + '.gz'\n"
          "  -v    verbose mode\n"
          "  --gzip  output to gzip format (default)\n"
          "  --deflate  output to deflate format instead of gzip\n"
          "  --zlib  output to zlib format instead of gzip\n");
      fprintf(stderr, "  --i5  less compression, but faster\n"
          "  --i10  less compression, but faster\n"
          "  --i15  default compression, 15 iterations\n"
          "  --i25  more compression, but slower\n"
          "  --i50  more compression, but slower\n"
          "  --i100  more compression, but slower\n"
          "  --i250  more compression, but slower\n"
          "  --i500  more compression, but slower\n"
          "  --i1000  more compression, but slower\n");
      return 0;
    }
  }

  for (i = 1; i < argc; i++) {
    if (argv[i][0] != '-') {
      char* outfilename;
      filename = argv[i];
      if (output_to_stdout) {
        outfilename = 0;
      } else if (output_type == ZOPFLI_FORMAT_GZIP) {
        outfilename = AddStrings(filename, ".gz");
      } else if (output_type == ZOPFLI_FORMAT_ZLIB) {
        outfilename = AddStrings(filename, ".zlib");
      } else {
        assert(output_type == ZOPFLI_FORMAT_DEFLATE);
        outfilename = AddStrings(filename, ".deflate");
      }
      if (options.verbose && outfilename) {
        fprintf(stderr, "Saving to: %s\n", outfilename);
      }
      CompressFile(&options, output_type, filename, outfilename);
      free(outfilename);
    }
  }

  if (!filename) {
    fprintf(stderr,
            "Please provide filename\nFor help, type: %s -h\n", argv[0]);
  }

  return 0;
}

// Assembly:
subq $0x48, %rsp
movl $0x0, 0x44(%rsp)
movl %edi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movl $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
leaq 0x24(%rsp), %rdi
callq 0xc410
movl $0x1, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x40(%rsp), %eax
jge 0xbf0e
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x320d(%rip), %rsi      # 0xee50
callq 0xc080
cmpb $0x0, %al
je 0xbc59
movl $0x1, 0x24(%rsp)
jmp 0xbefc
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x31e5(%rip), %rsi      # 0xee53
callq 0xc080
cmpb $0x0, %al
je 0xbc84
movl $0x1, 0x14(%rsp)
jmp 0xbefa
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x31bd(%rip), %rsi      # 0xee56
callq 0xc080
cmpb $0x0, %al
je 0xbcaf
movl $0x2, 0x20(%rsp)
jmp 0xbef8
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x319c(%rip), %rsi      # 0xee60
callq 0xc080
cmpb $0x0, %al
je 0xbcda
movl $0x1, 0x20(%rsp)
jmp 0xbef6
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x3178(%rip), %rsi      # 0xee67
callq 0xc080
cmpb $0x0, %al
je 0xbd05
movl $0x0, 0x20(%rsp)
jmp 0xbef4
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x3154(%rip), %rsi      # 0xee6e
callq 0xc080
cmpb $0x0, %al
je 0xbd30
movl $0x5, 0x28(%rsp)
jmp 0xbef2
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x312e(%rip), %rsi      # 0xee73
callq 0xc080
cmpb $0x0, %al
je 0xbd5b
movl $0xa, 0x28(%rsp)
jmp 0xbef0
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x3109(%rip), %rsi      # 0xee79
callq 0xc080
cmpb $0x0, %al
je 0xbd86
movl $0xf, 0x28(%rsp)
jmp 0xbeee
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x30e4(%rip), %rsi      # 0xee7f
callq 0xc080
cmpb $0x0, %al
je 0xbdb1
movl $0x19, 0x28(%rsp)
jmp 0xbeec
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x30bf(%rip), %rsi      # 0xee85
callq 0xc080
cmpb $0x0, %al
je 0xbddc
movl $0x32, 0x28(%rsp)
jmp 0xbeea
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x309a(%rip), %rsi      # 0xee8b
callq 0xc080
cmpb $0x0, %al
je 0xbe07
movl $0x64, 0x28(%rsp)
jmp 0xbee8
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x3076(%rip), %rsi      # 0xee92
callq 0xc080
cmpb $0x0, %al
je 0xbe32
movl $0xfa, 0x28(%rsp)
jmp 0xbee6
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x3052(%rip), %rsi      # 0xee99
callq 0xc080
cmpb $0x0, %al
je 0xbe5d
movl $0x1f4, 0x28(%rsp)      # imm = 0x1F4
jmp 0xbee4
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x302e(%rip), %rsi      # 0xeea0
callq 0xc080
cmpb $0x0, %al
je 0xbe85
movl $0x3e8, 0x28(%rsp)      # imm = 0x3E8
jmp 0xbee2
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x300e(%rip), %rsi      # 0xeea8
callq 0xc080
cmpb $0x0, %al
je 0xbee0
movq 0x614e(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0x2ff7(%rip), %rsi      # 0xeeab
movb $0x0, %al
callq 0x10f0
movq 0x6136(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0x310a(%rip), %rsi      # 0xefd6
movb $0x0, %al
callq 0x10f0
movl $0x0, 0x44(%rsp)
jmp 0xc076
jmp 0xbee2
jmp 0xbee4
jmp 0xbee6
jmp 0xbee8
jmp 0xbeea
jmp 0xbeec
jmp 0xbeee
jmp 0xbef0
jmp 0xbef2
jmp 0xbef4
jmp 0xbef6
jmp 0xbef8
jmp 0xbefa
jmp 0xbefc
jmp 0xbefe
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0xbc20
movl $0x1, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x40(%rsp), %eax
jge 0xc046
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0xc034
movq 0x38(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x14(%rsp)
je 0xbf66
movq $0x0, 0x8(%rsp)
jmp 0xbfe6
cmpl $0x0, 0x20(%rsp)
jne 0xbf85
movq 0x18(%rsp), %rdi
leaq 0x31be(%rip), %rsi      # 0xf137
callq 0xc0b0
movq %rax, 0x8(%rsp)
jmp 0xbfe4
cmpl $0x1, 0x20(%rsp)
jne 0xbfa4
movq 0x18(%rsp), %rdi
leaq 0x31a3(%rip), %rsi      # 0xf13b
callq 0xc0b0
movq %rax, 0x8(%rsp)
jmp 0xbfe2
cmpl $0x2, 0x20(%rsp)
jne 0xbfad
jmp 0xbfcc
leaq 0x318d(%rip), %rdi      # 0xf141
leaq 0x31ab(%rip), %rsi      # 0xf166
movl $0xbb, %edx
leaq 0x31ac(%rip), %rcx      # 0xf173
callq 0x10b0
movq 0x18(%rsp), %rdi
leaq 0x31b2(%rip), %rsi      # 0xf18a
callq 0xc0b0
movq %rax, 0x8(%rsp)
jmp 0xbfe4
jmp 0xbfe6
cmpl $0x0, 0x24(%rsp)
je 0xc012
cmpq $0x0, 0x8(%rsp)
je 0xc012
movq 0x5ffc(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x8(%rsp), %rdx
leaq 0x3188(%rip), %rsi      # 0xf193
movb $0x0, %al
callq 0x10f0
movl 0x20(%rsp), %esi
movq 0x18(%rsp), %rdx
movq 0x8(%rsp), %rcx
leaq 0x24(%rsp), %rdi
callq 0xc140
movq 0x8(%rsp), %rdi
callq 0x1030
jmp 0xc036
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0xbf16
cmpq $0x0, 0x18(%rsp)
jne 0xc06e
movq 0x5fa3(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x38(%rsp), %rax
movq (%rax), %rdx
leaq 0x313b(%rip), %rsi      # 0xf1a2
movb $0x0, %al
callq 0x10f0
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nop