// File: /workspace/github_c_makefile_star2_O0/zenkj[P]luajit-arm64/src/./../dynasm/dasm_x86.h
// Function: dasm_encode
int dasm_encode(Dst_DECL, void *buffer)
{
  dasm_State *D = Dst_REF;
  unsigned char *base = (unsigned char *)buffer;
  unsigned char *cp = base;
  int secnum;

  /* Encode all code sections. No support for data sections (yet). */
  for (secnum = 0; secnum < D->maxsection; secnum++) {
    dasm_Section *sec = D->sections + secnum;
    int *b = sec->buf;
    int *endb = sec->rbuf + sec->pos;

    while (b != endb) {
      dasm_ActList p = D->actionlist + *b++;
      unsigned char *mark = NULL;
      while (1) {
	int action = *p++;
	int n = (action >= DASM_DISP && action <= DASM_ALIGN) ? *b++ : 0;
	switch (action) {
	case DASM_DISP: if (!mark) mark = cp; {
	  unsigned char *mm = mark;
	  if (*p != DASM_IMM_DB && *p != DASM_IMM_WB) mark = NULL;
	  if (n == 0) { int mrm = mm[-1]&7; if (mrm == 4) mrm = mm[0]&7;
	    if (mrm != 5) { mm[-1] -= 0x80; break; } }
	  if (((n+128) & -256) != 0) goto wd; else mm[-1] -= 0x40;
	}
	case DASM_IMM_S: case DASM_IMM_B: wb: dasmb(n); break;
	case DASM_IMM_DB: if (((n+128)&-256) == 0) {
	    db: if (!mark) mark = cp; mark[-2] += 2; mark = NULL; goto wb;
	  } else mark = NULL;
	case DASM_IMM_D: wd: dasmd(n); break;
	case DASM_IMM_WB: if (((n+128)&-256) == 0) goto db; else mark = NULL;
	case DASM_IMM_W: dasmw(n); break;
	case DASM_VREG: { int t = *p++; if (t >= 2) n<<=3; cp[-1] |= n; break; }
	case DASM_REL_LG: p++; if (n >= 0) goto rel_pc;
	  b++; n = (int)(ptrdiff_t)D->globals[-n];
	case DASM_REL_A: rel_a: n -= (int)(ptrdiff_t)(cp+4); goto wd; /* !x64 */
	case DASM_REL_PC: rel_pc: {
	  int shrink = *b++;
	  int *pb = DASM_POS2PTR(D, n); if (*pb < 0) { n = pb[1]; goto rel_a; }
	  n = *pb - ((int)(cp-base) + 4-shrink);
	  if (shrink == 0) goto wd;
	  if (shrink == 4) { cp--; cp[-1] = *cp-0x10; } else cp[-1] = 0xeb;
	  goto wb;
	}
	case DASM_IMM_LG:
	  p++; if (n < 0) { n = (int)(ptrdiff_t)D->globals[-n]; goto wd; }
	case DASM_IMM_PC: {
	  int *pb = DASM_POS2PTR(D, n);
	  n = *pb < 0 ? pb[1] : (*pb + (int)(ptrdiff_t)base);
	  goto wd;
	}
	case DASM_LABEL_LG: {
	  int idx = *p++;
	  if (idx >= 10)
	    D->globals[idx] = (void *)(base + (*p == DASM_SETLABEL ? *b : n));
	  break;
	}
	case DASM_LABEL_PC: case DASM_SETLABEL: break;
	case DASM_SPACE: { int fill = *p++; while (n--) *cp++ = fill; break; }
	case DASM_ALIGN:
	  n = *p++;
	  while (((cp-base) & n)) *cp++ = 0x90; /* nop */
	  break;
	case DASM_EXTERN: n = DASM_EXTERN(Dst, cp, p[1], *p); p += 2; goto wd;
	case DASM_MARK: mark = cp; break;
	case DASM_ESC: action = *p++;
	default: *cp++ = action; break;
	case DASM_SECTION: case DASM_STOP: goto stop;
	}
      }
      stop: (void)0;
    }
  }

  if (base + D->codesize != cp)  /* Check for phase errors. */
    return DASM_S_PHASE;
  return DASM_S_OK;
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xb8(%rsp)
movq %rsi, 0xb0(%rsp)
movq 0xb8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0xa8(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x98(%rsp)
movl $0x0, 0x94(%rsp)
movl 0x94(%rsp), %eax
movq 0xa8(%rsp), %rcx
cmpl 0x48(%rcx), %eax
jge 0x71d6
movq 0xa8(%rsp), %rax
addq $0x50, %rax
movslq 0x94(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x80(%rsp)
movq 0x88(%rsp), %rax
movq (%rax), %rax
movq 0x88(%rsp), %rcx
movslq 0x18(%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x78(%rsp)
movq 0x80(%rsp), %rax
cmpq 0x78(%rsp), %rax
je 0x71be
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x80(%rsp), %rcx
movq %rcx, %rdx
addq $0x4, %rdx
movq %rdx, 0x80(%rsp)
movslq (%rcx), %rcx
addq %rcx, %rax
movq %rax, 0x70(%rsp)
movq $0x0, 0x68(%rsp)
movq 0x70(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x70(%rsp)
movzbl (%rax), %eax
movl %eax, 0x64(%rsp)
cmpl $0xe9, 0x64(%rsp)
jl 0x6b5c
cmpl $0xfa, 0x64(%rsp)
jg 0x6b5c
movq 0x80(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x80(%rsp)
movl (%rax), %eax
movl %eax, 0x2c(%rsp)
jmp 0x6b64
xorl %eax, %eax
movl %eax, 0x2c(%rsp)
jmp 0x6b64
movl 0x2c(%rsp), %eax
movl %eax, 0x60(%rsp)
movl 0x64(%rsp), %eax
addl $0xffffff17, %eax       # imm = 0xFFFFFF17
movl %eax, %ecx
movq %rcx, 0x20(%rsp)
subl $0x16, %eax
ja 0x7191
movq 0x20(%rsp), %rax
leaq 0x9537(%rip), %rcx      # 0x100c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x0, 0x68(%rsp)
jne 0x6baf
movq 0x98(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x70(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xef, %eax
je 0x6be0
movq 0x70(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xee, %eax
je 0x6be0
movq $0x0, 0x68(%rsp)
cmpl $0x0, 0x60(%rsp)
jne 0x6c2d
movq 0x58(%rsp), %rax
movzbl -0x1(%rax), %eax
andl $0x7, %eax
movl %eax, 0x54(%rsp)
cmpl $0x4, 0x54(%rsp)
jne 0x6c0d
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
andl $0x7, %eax
movl %eax, 0x54(%rsp)
cmpl $0x5, 0x54(%rsp)
je 0x6c2b
movq 0x58(%rsp), %rax
movzbl -0x1(%rax), %ecx
subl $0x80, %ecx
movb %cl, -0x1(%rax)
jmp 0x71b4
jmp 0x6c2d
movl 0x60(%rsp), %eax
addl $0x80, %eax
andl $0xffffff00, %eax       # imm = 0xFFFFFF00
cmpl $0x0, %eax
je 0x6c45
jmp 0x6ccd
movq 0x58(%rsp), %rax
movzbl -0x1(%rax), %ecx
subl $0x40, %ecx
movb %cl, -0x1(%rax)
jmp 0x6c56
jmp 0x6c58
movl 0x60(%rsp), %eax
movb %al, %cl
movq 0x98(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x98(%rsp)
movb %cl, (%rax)
jmp 0x71b4
movl 0x60(%rsp), %eax
addl $0x80, %eax
andl $0xffffff00, %eax       # imm = 0xFFFFFF00
cmpl $0x0, %eax
jne 0x6cc0
jmp 0x6c91
cmpq $0x0, 0x68(%rsp)
jne 0x6ca6
movq 0x98(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
movzbl -0x2(%rax), %ecx
addl $0x2, %ecx
movb %cl, -0x2(%rax)
movq $0x0, 0x68(%rsp)
jmp 0x6c58
movq $0x0, 0x68(%rsp)
jmp 0x6ccb
jmp 0x6ccd
jmp 0x6ccf
jmp 0x6cd1
movl 0x60(%rsp), %eax
movb %al, %cl
movq 0x98(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x98(%rsp)
movb %cl, (%rax)
movl 0x60(%rsp), %eax
sarl $0x8, %eax
movb %al, %cl
movq 0x98(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x98(%rsp)
movb %cl, (%rax)
jmp 0x6d14
movl 0x60(%rsp), %eax
sarl $0x10, %eax
movb %al, %cl
movq 0x98(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x98(%rsp)
movb %cl, (%rax)
movl 0x60(%rsp), %eax
sarl $0x10, %eax
sarl $0x8, %eax
movb %al, %cl
movq 0x98(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x98(%rsp)
movb %cl, (%rax)
jmp 0x6d5d
jmp 0x71b4
movl 0x60(%rsp), %eax
addl $0x80, %eax
andl $0xffffff00, %eax       # imm = 0xFFFFFF00
cmpl $0x0, %eax
jne 0x6d7a
jmp 0x6c91
movq $0x0, 0x68(%rsp)
jmp 0x6d85
jmp 0x6d87
movl 0x60(%rsp), %eax
movb %al, %cl
movq 0x98(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x98(%rsp)
movb %cl, (%rax)
movl 0x60(%rsp), %eax
sarl $0x8, %eax
movb %al, %cl
movq 0x98(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x98(%rsp)
movb %cl, (%rax)
jmp 0x71b4
movq 0x70(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x70(%rsp)
movzbl (%rax), %eax
movl %eax, 0x50(%rsp)
cmpl $0x2, 0x50(%rsp)
jl 0x6df7
movl 0x60(%rsp), %eax
shll $0x3, %eax
movl %eax, 0x60(%rsp)
movl 0x60(%rsp), %edx
movq 0x98(%rsp), %rax
movzbl -0x1(%rax), %ecx
orl %edx, %ecx
movb %cl, -0x1(%rax)
jmp 0x71b4
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
cmpl $0x0, 0x60(%rsp)
jl 0x6e28
jmp 0x6e7a
movq 0x80(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x80(%rsp)
movq 0xa8(%rsp), %rax
movq 0x30(%rax), %rax
xorl %ecx, %ecx
subl 0x60(%rsp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, 0x60(%rsp)
jmp 0x6e5b
movq 0x98(%rsp), %rax
addq $0x4, %rax
movl %eax, %ecx
movl 0x60(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x60(%rsp)
jmp 0x6ccd
jmp 0x6e7a
movq 0x80(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x80(%rsp)
movl (%rax), %eax
movl %eax, 0x4c(%rsp)
movq 0xa8(%rsp), %rax
addq $0x50, %rax
movl 0x60(%rsp), %ecx
sarl $0x18, %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq 0x60(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
cmpl $0x0, (%rax)
jge 0x6ee3
movq 0x40(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x60(%rsp)
jmp 0x6e5b
movq 0x40(%rsp), %rax
movl (%rax), %eax
movq 0x98(%rsp), %rcx
movq 0xa0(%rsp), %rdx
subq %rdx, %rcx
addl $0x4, %ecx
subl 0x4c(%rsp), %ecx
subl %ecx, %eax
movl %eax, 0x60(%rsp)
cmpl $0x0, 0x4c(%rsp)
jne 0x6f16
jmp 0x6ccd
cmpl $0x4, 0x4c(%rsp)
jne 0x6f4e
movq 0x98(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rax
movzbl (%rax), %eax
subl $0x10, %eax
movb %al, %cl
movq 0x98(%rsp), %rax
movb %cl, -0x1(%rax)
jmp 0x6f5a
movq 0x98(%rsp), %rax
movb $-0x15, -0x1(%rax)
jmp 0x6c58
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
cmpl $0x0, 0x60(%rsp)
jge 0x6f96
movq 0xa8(%rsp), %rax
movq 0x30(%rax), %rax
xorl %ecx, %ecx
subl 0x60(%rsp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, 0x60(%rsp)
jmp 0x6ccd
jmp 0x6f98
movq 0xa8(%rsp), %rax
addq $0x50, %rax
movl 0x60(%rsp), %ecx
sarl $0x18, %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq 0x60(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
cmpl $0x0, (%rax)
jge 0x6fe1
movq 0x38(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x1c(%rsp)
jmp 0x6ff6
movq 0x38(%rsp), %rax
movl (%rax), %eax
movq 0xa0(%rsp), %rcx
addl %ecx, %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x60(%rsp)
jmp 0x6ccd
movq 0x70(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x70(%rsp)
movzbl (%rax), %eax
movl %eax, 0x34(%rsp)
cmpl $0xa, 0x34(%rsp)
jl 0x7079
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x70(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xf2, %eax
jne 0x704e
movq 0x80(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
jmp 0x7056
movl 0x60(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %eax
cltq
addq %rax, %rdx
movq 0xa8(%rsp), %rax
movq 0x30(%rax), %rax
movslq 0x34(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x71b4
jmp 0x71b4
movq 0x70(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x70(%rsp)
movzbl (%rax), %eax
movl %eax, 0x30(%rsp)
movl 0x60(%rsp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, 0x60(%rsp)
cmpl $0x0, %eax
je 0x70ce
movl 0x30(%rsp), %eax
movb %al, %cl
movq 0x98(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x98(%rsp)
movb %cl, (%rax)
jmp 0x709b
jmp 0x71b4
movq 0x70(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x70(%rsp)
movzbl (%rax), %eax
movl %eax, 0x60(%rsp)
movq 0x98(%rsp), %rax
movq 0xa0(%rsp), %rcx
subq %rcx, %rax
movslq 0x60(%rsp), %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x7128
movq 0x98(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x98(%rsp)
movb $-0x70, (%rax)
jmp 0x70eb
jmp 0x71b4
movq 0xb8(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0x70(%rsp), %rax
movzbl 0x1(%rax), %edx
movq 0x70(%rsp), %rax
movzbl (%rax), %ecx
callq 0x7220
movl %eax, 0x60(%rsp)
movq 0x70(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x70(%rsp)
jmp 0x6ccd
movq 0x98(%rsp), %rax
movq %rax, 0x68(%rsp)
jmp 0x71b4
movq 0x70(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x70(%rsp)
movzbl (%rax), %eax
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
movb %al, %cl
movq 0x98(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x98(%rsp)
movb %cl, (%rax)
jmp 0x71b4
jmp 0x71b9
jmp 0x6b11
jmp 0x6ac7
jmp 0x71c0
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x6a55
movq 0xa0(%rsp), %rax
movq 0xa8(%rsp), %rcx
addq 0x40(%rcx), %rax
cmpq 0x98(%rsp), %rax
je 0x7201
movl $0x2000000, 0xc4(%rsp) # imm = 0x2000000
jmp 0x720c
movl $0x0, 0xc4(%rsp)
movl 0xc4(%rsp), %eax
addq $0xc8, %rsp
retq
nopl (%rax,%rax)