// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/buildvm.c
// Function: main
int main(int argc, char **argv)
{
  BuildCtx ctx_;
  BuildCtx *ctx = &ctx_;
  int status, binmode;

  if (sizeof(void *) != 4*LJ_32+8*LJ_64) {
    fprintf(stderr,"Error: pointer size mismatch in cross-build.\n");
    fprintf(stderr,"Try: make HOST_CC=\"gcc -m32\" CROSS=...\n\n");
    return 1;
  }

  UNUSED(argc);
  parseargs(ctx, argv);

  if ((status = build_code(ctx))) {
    fprintf(stderr,"Error: DASM error %08x\n", status);
    return 1;
  }

  switch (ctx->mode) {
  case BUILD_peobj:
  case BUILD_raw:
    binmode = 1;
    break;
  default:
    binmode = 0;
    break;
  }

  if (ctx->outname[0] == '-' && ctx->outname[1] == '\0') {
    ctx->fp = stdout;
#if defined(_WIN32)
    if (binmode)
      _setmode(_fileno(stdout), _O_BINARY);  /* Yuck. */
#endif
  } else if (!(ctx->fp = fopen(ctx->outname, binmode ? "wb" : "w"))) {
    fprintf(stderr, "Error: cannot open output file '%s': %s\n",
	    ctx->outname, strerror(errno));
    exit(1);
  }

  switch (ctx->mode) {
  case BUILD_elfasm:
  case BUILD_coffasm:
  case BUILD_machasm:
    emit_asm(ctx);
    emit_asm_debug(ctx);
    break;
  case BUILD_peobj:
    emit_peobj(ctx);
    break;
  case BUILD_raw:
    emit_raw(ctx);
    break;
  case BUILD_bcdef:
    emit_bcdef(ctx);
    emit_lib(ctx);
    break;
  case BUILD_vmdef:
    emit_vmdef(ctx);
    emit_lib(ctx);
    break;
  case BUILD_ffdef:
  case BUILD_libdef:
  case BUILD_recdef:
    emit_lib(ctx);
    break;
  case BUILD_folddef:
    emit_fold(ctx);
    break;
  default:
    break;
  }

  fflush(ctx->fp);
  if (ferror(ctx->fp)) {
    fprintf(stderr, "Error: cannot write to output file: %s\n",
	    strerror(errno));
    exit(1);
  }
  fclose(ctx->fp);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa48, %rsp            # imm = 0xA48
movq %rsi, %rbx
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
leaq 0xbcb7(%rip), %rax      # 0x12445
movq %rax, 0x18(%rsp)
movq 0x8(%rsi), %rax
movl $0x1, %ebp
testq %rax, %rax
je 0x686a
leaq 0xfe54(%rip), %r15      # 0x16600
cmpb $0x2d, (%rax)
jne 0x686a
movzbl 0x1(%rax), %ecx
cmpl $0x6e, %ecx
jg 0x680b
cmpl $0x6d, %ecx
jne 0x6851
cmpb $0x0, 0x2(%rax)
jne 0x7237
incl %ebp
movslq %ebp, %rax
movq (%rbx,%rax,8), %r14
testq %r14, %r14
je 0x7237
movq %r15, %r13
xorl %r12d, %r12d
movq (%r13), %rsi
movq %r14, %rdi
callq 0x5100
testl %eax, %eax
je 0x6837
incq %r12
addq $0x8, %r13
cmpq $0xb, %r12
jne 0x67e9
jmp 0x7237
cmpl $0x6f, %ecx
jne 0x7237
cmpb $0x0, 0x2(%rax)
jne 0x7237
incl %ebp
movslq %ebp, %rax
movq (%rbx,%rax,8), %rax
testq %rax, %rax
je 0x7237
movq %rax, 0x18(%rsp)
jmp 0x683c
movl %r12d, 0x8(%rsp)
movslq %ebp, %rax
incl %ebp
movq 0x8(%rbx,%rax,8), %rax
testq %rax, %rax
jne 0x67ac
jmp 0x686a
testl %ecx, %ecx
je 0x686a
cmpl $0x2d, %ecx
jne 0x7237
cmpb $0x0, 0x2(%rax)
jne 0x7237
incl %ebp
movslq %ebp, %rax
leaq (%rbx,%rax,8), %rax
movq %rax, 0x20(%rsp)
cmpl $-0x1, 0x8(%rsp)
je 0x7237
movq %rsp, %rbx
movl $0xa3, 0x3c(%rbx)
movl $0x518, %edi            # imm = 0x518
callq 0x5140
movq %rax, 0x50(%rbx)
xorl %ebp, %ebp
movl $0x518, %edx            # imm = 0x518
movq %rax, %rdi
xorl %esi, %esi
callq 0x50c0
movl %ebp, 0x44(%rbx)
leaq 0xfdac(%rip), %r12      # 0x16660
movq %r12, 0x78(%rbx)
movl $0x128, %edi            # imm = 0x128
callq 0x5140
movq %rax, 0x60(%rbx)
movl %ebp, 0x48(%rbx)
leaq 0x10840(%rip), %rdi     # 0x17110
movl $0x94, %edx
movl $0xff, %esi
callq 0x50c0
leaq 0x9d69(%rip), %rax      # 0x1064f
movq %rax, 0x80(%rbx)
leaq 0x9d68(%rip), %rax      # 0x1065c
movq %rax, 0x88(%rbx)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x579c
movq 0x50(%rbx), %rsi
movl 0x3c(%rbx), %edx
movq %rbx, %rdi
callq 0x58a2
leaq 0x59b2(%rip), %rsi      # 0xc2d0
movq %rbx, %rdi
callq 0x5970
movq %rbx, %rdi
callq 0x7394
movl $0x5d, 0x38(%rbx)
movq (%rbx), %rax
cmpl %ebp, 0x4c(%rax)
jne 0x6967
movq 0x10(%rax), %rdx
movl $0x1, %ecx
cmpl $0x0, (%rdx,%rcx,4)
jg 0x695e
movl $0x0, (%rdx,%rcx,4)
incq %rcx
cmpq $0xa, %rcx
jne 0x6946
jmp 0x6967
addl $0x21000000, %ecx       # imm = 0x21000000
movl %ecx, 0x4c(%rax)
leaq 0x30(%rsp), %rsi
movq %rsp, %rdi
callq 0x5f72
testl %eax, %eax
jne 0x699b
movq %rsp, %rbx
movq 0x30(%rbx), %rdi
callq 0x5140
movq %rax, 0x28(%rbx)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x620f
testl %eax, %eax
je 0x6b3a
movl %eax, %ebx
testl %ebx, %ebx
jne 0x71c0
movl 0x8(%rsp), %eax
addl $-0x3, %eax
cmpl $0x2, %eax
leaq 0x9916(%rip), %rax      # 0x102cc
leaq 0xa419(%rip), %rsi      # 0x10dd6
cmovbq %rax, %rsi
movq 0x18(%rsp), %rdi
cmpb $0x2d, (%rdi)
jne 0x69d5
cmpb $0x0, 0x1(%rdi)
je 0x6b26
callq 0x5170
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x7249
movl 0x8(%rsp), %eax
cmpq $0xa, %rax
ja 0x7169
leaq 0x5727(%rip), %rcx      # 0xc124
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x96cc
movl 0x8(%rbx), %eax
cmpl $0x2, %eax
je 0x6ccd
testl %eax, %eax
jne 0x7169
movq 0x10(%rsp), %rcx
movq 0x50(%rsp), %rax
movl 0x4f8(%rax), %ebx
subl 0x28(%rsp), %ebx
leaq 0xa446(%rip), %rdi      # 0x10e86
movl $0x24, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rcx
leaq 0xa450(%rip), %rdi      # 0x10eab
movl $0xd2, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rdi
leaq 0xa508(%rip), %rsi      # 0x10f7e
movl %ebx, %edx
movl $0x50, %ecx
xorl %eax, %eax
callq 0x5120
movq 0x10(%rsp), %rdi
movl 0x30(%rsp), %edx
subl %ebx, %edx
leaq 0xa5d1(%rip), %rsi      # 0x11067
xorl %eax, %eax
callq 0x5120
movq 0x10(%rsp), %rcx
leaq 0xa693(%rip), %rdi      # 0x1113c
movl $0x22, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rcx
leaq 0xa69b(%rip), %rdi      # 0x1115f
movl $0x10d, %esi            # imm = 0x10D
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rdi
leaq 0xa78e(%rip), %rsi      # 0x1126d
movl %ebx, %edx
movl $0x50, %ecx
xorl %eax, %eax
callq 0x5120
movq 0x10(%rsp), %rcx
leaq 0xa874(%rip), %rdi      # 0x1136d
movl $0xe3, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rdi
movl 0x30(%rsp), %edx
subl %ebx, %edx
leaq 0xa937(%rip), %rsi      # 0x11451
xorl %eax, %eax
callq 0x5120
jmp 0x7169
movq 0x104a3(%rip), %rax     # 0x16fd0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x69e8
leaq 0xaf0d(%rip), %rsi      # 0x11a4e
leaq 0x9b18(%rip), %rdx      # 0x10660
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x7253
movq %rax, 0x70(%rbx)
movslq 0x38(%rbx), %r14
movl 0x3c(%rbx), %eax
addl %r14d, %eax
incl %eax
movslq %eax, %rdi
shlq $0x4, %rdi
callq 0x5140
movq %rax, 0x58(%rbx)
movl $0x0, 0x40(%rbx)
leaq (,%r14,4), %rdi
callq 0x5140
movq %rax, 0x68(%rbx)
testq %r14, %r14
jle 0x6c2d
leaq 0xef25(%rip), %r13      # 0x15ac0
xorl %r14d, %r14d
xorl %r15d, %r15d
movq (%rsp), %rax
cmpq 0x28(%rax), %r14
jae 0x6bda
movq 0x20(%rax), %rcx
movl (%rcx,%r14), %ecx
testl %ecx, %ecx
js 0x6bc1
sete %al
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x6bd6
negl %ecx
movl %ecx, %edx
shrl $0x18, %edx
leaq (%rdx,%rdx,4), %rdx
movq 0x50(%rax,%rdx,8), %rax
movl (%rax,%rcx,4), %ebp
xorl %eax, %eax
testb %al, %al
je 0x6bdf
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
testl %ebp, %ebp
js 0x6c03
movq 0x68(%rsp), %rax
movl %ebp, (%rax,%r14)
movq (%r13), %rcx
movq %rsp, %rdi
movl %ebp, %esi
leaq 0x9a74(%rip), %rdx      # 0x10670
callq 0x9659
jmp 0x6c0c
movl %r15d, %ebx
orl $0x22000000, %ebx       # imm = 0x22000000
testl %ebp, %ebp
js 0x699d
incq %r15
movslq 0x38(%rsp), %rax
addq $0x4, %r14
addq $0x8, %r13
cmpq %rax, %r15
jl 0x6ba1
cmpl $0x0, 0x3c(%rsp)
jle 0x6ca3
movl $0xfffffffe, %r13d      # imm = 0xFFFFFFFE
xorl %ebp, %ebp
leaq 0x9a50(%rip), %rbx      # 0x10693
movq %rsp, %r14
movq (%r12), %r15
movq %r15, %rdi
callq 0x50a0
movq 0x50(%rsp), %rcx
movq (%rcx,%rbp,8), %rsi
testq %rsi, %rsi
je 0x723c
cmpl $0x2, %eax
jl 0x6c80
leal (%rax,%r13), %ecx
cmpb $0x5f, (%r15,%rcx)
jne 0x6c80
addl %r13d, %eax
incl %eax
cmpb $0x5a, (%r15,%rax)
je 0x6c92
subl 0x28(%rsp), %esi
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x9659
incq %rbp
movslq 0x3c(%rsp), %rax
addq $0x8, %r12
cmpq %rax, %rbp
jl 0x6c46
movq %rsp, %rbx
movl 0x30(%rbx), %esi
leaq 0xad9e(%rip), %rcx      # 0x11a4e
movq %rbx, %rdi
movq %rcx, %rdx
callq 0x9659
decl 0x40(%rbx)
movq %rbx, %rdi
callq 0x5847
xorl %ebx, %ebx
jmp 0x699d
movq 0x10(%rsp), %rcx
leaq 0xa864(%rip), %rdi      # 0x1153d
movl $0x4c, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rcx
leaq 0xa896(%rip), %rdi      # 0x1158a
movl $0x11c, %esi            # imm = 0x11C
movl $0x1, %edx
callq 0x51b0
cmpl $0x0, 0x40(%rsp)
jle 0x71e1
leaq 0xa992(%rip), %r14      # 0x116a7
xorl %ebp, %ebp
xorl %r12d, %r12d
xorl %ebx, %ebx
movq 0x58(%rsp), %rax
movl 0x18(%rax,%rbp), %r15d
subl 0x8(%rax,%rbp), %r15d
je 0x6d78
movq (%rax,%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x5100
testl %eax, %eax
je 0x6d75
movq 0x10(%rsp), %rdi
leaq 0xa96b(%rip), %rsi      # 0x116b7
movq %r13, %rdx
movl %r12d, %ecx
movl %r12d, %r8d
movl %r12d, %r9d
xorl %eax, %eax
pushq %r12
pushq $0x50
pushq %r15
pushq %r13
pushq %r12
pushq %r12
pushq %r12
pushq %r12
callq 0x5120
addq $0x40, %rsp
jmp 0x6d78
movl %r15d, %ebx
incq %r12
movslq 0x40(%rsp), %rax
addq $0x10, %rbp
cmpq %rax, %r12
jl 0x6d1c
jmp 0x71e3
movq 0x10(%rsp), %rcx
leaq 0xac89(%rip), %rdi      # 0x11a23
movl $0x2b, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rcx
leaq 0xac9a(%rip), %rdi      # 0x11a4f
movl $0xd, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rcx
leaq 0xac8d(%rip), %rdi      # 0x11a5d
movl $0xb, %esi
movl $0x1, %edx
callq 0x51b0
leaq 0xecda(%rip), %r14      # 0x15ac0
leaq 0xac7c(%rip), %rbx      # 0x11a69
xorl %r15d, %r15d
movq (%r15,%r14), %rdx
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5120
addq $0x8, %r15
cmpq $0x2e8, %r15            # imm = 0x2E8
jne 0x6df0
movq 0x10(%rsp), %rcx
leaq 0xac52(%rip), %rdi      # 0x11a6e
movl $0x3, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rcx
leaq 0xac3b(%rip), %rdi      # 0x11a72
movl $0xb, %esi
movl $0x1, %edx
callq 0x51b0
leaq 0xef63(%rip), %r14      # 0x15db0
leaq 0xac15(%rip), %rbx      # 0x11a69
xorl %r15d, %r15d
movq (%r15,%r14), %rdx
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5120
addq $0x8, %r15
cmpq $0x2f0, %r15            # imm = 0x2F0
jne 0x6e57
movq 0x10(%rsp), %rcx
leaq 0xabeb(%rip), %rdi      # 0x11a6e
movl $0x3, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rcx
leaq 0xabe0(%rip), %rdi      # 0x11a7e
movl $0xe, %esi
movl $0x1, %edx
callq 0x51b0
leaq 0xf2cc(%rip), %r15      # 0x16180
leaq 0x9f0(%rsp), %rbx
leaq 0xabca(%rip), %r14      # 0x11a8d
xorl %r12d, %r12d
movq (%r15,%r12,8), %rax
movb (%rax), %dl
movq %rbx, %rcx
testb %dl, %dl
je 0x6efc
incq %rax
movq %rbx, %rcx
leal -0x41(%rdx), %esi
leal 0x20(%rdx), %edi
cmpb $0x1a, %sil
movzbl %dl, %edx
movzbl %dil, %esi
cmovael %edx, %esi
movb %sil, (%rcx)
incq %rcx
movb (%rax), %dl
incq %rax
testb %dl, %dl
jne 0x6ed9
movq 0x10(%rsp), %rdi
movb $0x0, (%rcx)
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x5120
incq %r12
cmpq $0xd, %r12
jne 0x6ec6
movq 0x10(%rsp), %rcx
leaq 0xab6e(%rip), %rdi      # 0x11a94
movl $0x3, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rcx
leaq 0xab57(%rip), %rdi      # 0x11a98
movl $0x10, %esi
movl $0x1, %edx
callq 0x51b0
leaq 0xf299(%rip), %r15      # 0x161f0
leaq 0x9f0(%rsp), %rbx
leaq 0xab27(%rip), %r14      # 0x11a8d
xorl %r12d, %r12d
movq (%r15,%r12,8), %rax
movb (%rax), %dl
movq %rbx, %rcx
testb %dl, %dl
je 0x6f9f
incq %rax
movq %rbx, %rcx
leal -0x41(%rdx), %esi
leal 0x20(%rdx), %edi
cmpb $0x1a, %sil
movzbl %dl, %edx
movzbl %dil, %esi
cmovael %edx, %esi
movb %sil, (%rcx)
incq %rcx
movb (%rax), %dl
incq %rax
testb %dl, %dl
jne 0x6f7c
movb $0x0, (%rcx)
movq %rbx, %rdi
movl $0x5f, %esi
callq 0x50b0
testq %rax, %rax
je 0x6fb7
movb $0x2e, (%rax)
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x5120
incq %r12
cmpq $0x11, %r12
jne 0x6f69
movq 0x10(%rsp), %rcx
leaq 0xaab6(%rip), %rdi      # 0x11a94
movl $0x3, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rcx
leaq 0xaab0(%rip), %rdi      # 0x11aa9
movl $0xf, %esi
movl $0x1, %edx
callq 0x51b0
leaq 0xf271(%rip), %r14      # 0x16280
leaq 0xaaa3(%rip), %rbx      # 0x11ab9
xorl %r15d, %r15d
movq (%r15,%r14), %rdx
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5120
addq $0x8, %r15
cmpq $0x240, %r15            # imm = 0x240
jne 0x7019
movq 0x10(%rsp), %rcx
leaq 0xaa4f(%rip), %rdi      # 0x11a94
movl $0x3, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rcx
leaq 0xaa60(%rip), %rdi      # 0x11ac0
movl $0x11, %esi
movl $0x1, %edx
callq 0x51b0
leaq 0xfb0a(%rip), %r14      # 0x16b80
leaq 0xaa3c(%rip), %rbx      # 0x11ab9
xorl %r15d, %r15d
movq (%r15,%r14), %rdx
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5120
addq $0x8, %r15
cmpq $0x118, %r15            # imm = 0x118
jne 0x7080
movq %rsp, %rbx
movq 0x10(%rbx), %rcx
leaq 0xa9e6(%rip), %rdi      # 0x11a94
movl $0x3, %esi
movl $0x1, %edx
callq 0x51b0
movq %rbx, %rdi
jmp 0x7164
movq %rsp, %rdi
callq 0xae3c
jmp 0x7169
movq 0x10(%rsp), %rcx
leaq 0xa8eb(%rip), %rdi      # 0x119c9
movl $0x2e, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rcx
leaq 0xa8ff(%rip), %rdi      # 0x119f8
movl $0x2a, %esi
movl $0x1, %edx
callq 0x51b0
cmpl $0x0, 0x38(%rsp)
jle 0x7161
leaq 0xb2b9(%rip), %rbx      # 0x123cf
leaq 0xafe5(%rip), %r14      # 0x12102
xorl %r15d, %r15d
testq %r15, %r15
je 0x713c
movq 0x10(%rsp), %rcx
movl $0x2, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x51b0
movq 0x10(%rsp), %rdi
movq 0x68(%rsp), %rax
movl (%rax,%r15,4), %edx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5120
incq %r15
movslq 0x38(%rsp), %rax
cmpq %rax, %r15
jl 0x7120
movq %rsp, %rdi
callq 0xa1bc
movq 0x10(%rsp), %rdi
callq 0x5150
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x5070
testl %eax, %eax
jne 0x7244
movq %rbx, %rdi
callq 0x5090
xorl %eax, %eax
addq $0xa48, %rsp            # imm = 0xA48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rdi
movq 0x28(%rdi), %rsi
movq 0x30(%rdi), %rdx
callq 0x6747
jmp 0x7169
movq %rsp, %rdi
callq 0x9b38
jmp 0x7169
movq 0xfe31(%rip), %rax      # 0x16ff8
movq (%rax), %rdi
leaq 0x90e3(%rip), %rsi      # 0x102b4
movl %ebx, %edx
xorl %eax, %eax
callq 0x5120
movl $0x1, %eax
jmp 0x7192
xorl %ebx, %ebx
testl %ebx, %ebx
je 0x7217
movq 0x10(%rsp), %rcx
leaq 0xa5cd(%rip), %rdi      # 0x117c0
movl $0xe8, %esi
movl $0x1, %edx
callq 0x51b0
movq 0x10(%rsp), %rdi
leaq 0xa69b(%rip), %rsi      # 0x118a9
movl %ebx, %edx
xorl %eax, %eax
callq 0x5120
movq 0x10(%rsp), %rcx
leaq 0xa78b(%rip), %rdi      # 0x119ae
movl $0x1a, %esi
movl $0x1, %edx
callq 0x51b0
jmp 0x7169
callq 0x72d2
movq %r15, %rdi
callq 0x52b7
callq 0x5284
leaq 0x18(%rsp), %rdi
callq 0x5248