// File: /workspace/github_c_makefile_star2_O0/stickyPiston[P]ti-basic-compiler/src/main.c
// Function: main
int main(int argc, char *argv[]) {
  for (int i = 1; i < argc; i++) {
    if (strcmp(argv[i], "-o") == 0) {
      outputFile = argv[++i];
    } else if (strcmp(argv[i], "-i") == 0) {
      ignoreWhitespace = true;
    } else if (strcmp(argv[i], "-d") == 0) {
      disassembleMode = true;
    } else if (strcmp(argv[i], "-n") == 0) {
      strncpy(programName, argv[++i], 8);
    } else if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) {
      openHelp(argv[0]);
      return 0;
    } else if (strcmp(argv[i], "-l") == 0 || strcmp(argv[i], "--lang") == 0) {
      i++;
      if (strcmp(argv[i], "SE") == 0 || strcmp(argv[i], "se") == 0) lang = LANG_SE;
      if (strcmp(argv[i], "EN") == 0 || strcmp(argv[i], "en") == 0) lang = LANG_EN;
      if (strcmp(argv[i], "NL") == 0 || strcmp(argv[i], "nl") == 0) lang = LANG_NL;
    } else {
      if (argv[i][0] == '-') {
        printf("Unknown flag: %s\n", argv[i]);
        return 1;
      } else {
        inputFile = argv[i];
      }
    }
  }

  if (outputFile == NULL) outputFile = "out.8xp";
  if (inputFile == NULL) { openHelp(argv[0]); return 0;}
  if (*programName == 0) strcpy(programName, "PROG");

  if (disassembleMode) {
    disassemble();
  } else {
    compile();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0xe51f
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xd78(%rip), %rsi       # 0xf004
callq 0xe0d0
cmpl $0x0, %eax
jne 0xe2b6
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xb957(%rip)      # 0x19c08
jmp 0xe50f
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xd3e(%rip), %rsi       # 0xf007
callq 0xe0d0
cmpl $0x0, %eax
jne 0xe2df
movb $0x1, 0xb936(%rip)      # 0x19c10
jmp 0xe50d
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xd18(%rip), %rsi       # 0xf00a
callq 0xe0d0
cmpl $0x0, %eax
jne 0xe308
movb $0x1, 0xb90e(%rip)      # 0x19c11
jmp 0xe50b
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xcf2(%rip), %rsi       # 0xf00d
callq 0xe0d0
cmpl $0x0, %eax
jne 0xe34f
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xb8b8(%rip), %rdi      # 0x19bf8
movl $0x8, %edx
callq 0xe040
jmp 0xe509
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xcae(%rip), %rsi       # 0xf010
callq 0xe0d0
cmpl $0x0, %eax
je 0xe389
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc94(%rip), %rsi       # 0xf013
callq 0xe0d0
cmpl $0x0, %eax
jne 0xe3a1
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xe5a0
movl $0x0, -0x4(%rbp)
jmp 0xe58e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc66(%rip), %rsi       # 0xf01a
callq 0xe0d0
cmpl $0x0, %eax
je 0xe3df
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc4c(%rip), %rsi       # 0xf01d
callq 0xe0d0
cmpl $0x0, %eax
jne 0xe4b6
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc29(%rip), %rsi       # 0xf024
callq 0xe0d0
cmpl $0x0, %eax
je 0xe422
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xdc7(%rip), %rsi       # 0xf1df
callq 0xe0d0
cmpl $0x0, %eax
jne 0xe42c
movl $0x2, 0xb7bc(%rip)      # 0x19be8
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1c9d(%rip), %rsi      # 0x100dc
callq 0xe0d0
cmpl $0x0, %eax
je 0xe466
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xeb0(%rip), %rsi       # 0xf30c
callq 0xe0d0
cmpl $0x0, %eax
jne 0xe470
movl $0x0, 0xb778(%rip)      # 0x19be8
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xba4(%rip), %rsi       # 0xf027
callq 0xe0d0
cmpl $0x0, %eax
je 0xe4aa
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xb8a(%rip), %rsi       # 0xf02a
callq 0xe0d0
cmpl $0x0, %eax
jne 0xe4b4
movl $0x1, 0xb734(%rip)      # 0x19be8
jmp 0xe505
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0xe4f0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xb50(%rip), %rdi       # 0xf02d
movb $0x0, %al
callq 0xe0b0
movl $0x1, -0x4(%rbp)
jmp 0xe58e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xb6ed(%rip)      # 0x19bf0
jmp 0xe505
jmp 0xe507
jmp 0xe509
jmp 0xe50b
jmp 0xe50d
jmp 0xe50f
jmp 0xe511
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xe26d
cmpq $0x0, 0xb6e1(%rip)      # 0x19c08
jne 0xe537
leaq 0xb0f(%rip), %rax       # 0xf03f
movq %rax, 0xb6d1(%rip)      # 0x19c08
cmpq $0x0, 0xb6b1(%rip)      # 0x19bf0
jne 0xe556
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xe5a0
movl $0x0, -0x4(%rbp)
jmp 0xe58e
movsbl 0xb69b(%rip), %eax      # 0x19bf8
cmpl $0x0, %eax
jne 0xe575
leaq 0xb68f(%rip), %rdi      # 0x19bf8
leaq 0xad7(%rip), %rsi       # 0xf047
callq 0xe060
testb $0x1, 0xb695(%rip)      # 0x19c11
je 0xe587
movb $0x0, %al
callq 0xed30
jmp 0xe58e
movb $0x0, %al
callq 0xe6f0
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)