// File: /workspace/github_c_makefile_star2_O2/zenkj[P]luajit-arm64/src/./../dynasm/dasm_x86.h
// Function: dasm_put
void dasm_put(Dst_DECL, int start, ...)
{
  va_list ap;
  dasm_State *D = Dst_REF;
  dasm_ActList p = D->actionlist + start;
  dasm_Section *sec = D->section;
  int pos = sec->pos, ofs = sec->ofs, mrm = 4;
  int *b;

  if (pos >= sec->epos) {
    DASM_M_GROW(Dst, int, sec->buf, sec->bsize,
      sec->bsize + 2*DASM_MAXSECPOS*sizeof(int));
    sec->rbuf = sec->buf - DASM_POS2BIAS(pos);
    sec->epos = (int)sec->bsize/sizeof(int) - DASM_MAXSECPOS+DASM_POS2BIAS(pos);
  }

  b = sec->rbuf;
  b[pos++] = start;

  va_start(ap, start);
  while (1) {
    int action = *p++;
    if (action < DASM_DISP) {
      ofs++;
    } else if (action <= DASM_REL_A) {
      int n = va_arg(ap, int);
      b[pos++] = n;
      switch (action) {
      case DASM_DISP:
	if (n == 0) { if ((mrm&7) == 4) mrm = p[-2]; if ((mrm&7) != 5) break; }
      case DASM_IMM_DB: if (((n+128)&-256) == 0) goto ob;
      case DASM_REL_A: /* Assumes ptrdiff_t is int. !x64 */
      case DASM_IMM_D: ofs += 4; break;
      case DASM_IMM_S: CK(((n+128)&-256) == 0, RANGE_I); goto ob;
      case DASM_IMM_B: CK((n&-256) == 0, RANGE_I); ob: ofs++; break;
      case DASM_IMM_WB: if (((n+128)&-256) == 0) goto ob;
      case DASM_IMM_W: CK((n&-65536) == 0, RANGE_I); ofs += 2; break;
      case DASM_SPACE: p++; ofs += n; break;
      case DASM_SETLABEL: b[pos-2] = -0x40000000; break;  /* Neg. label ofs. */
      case DASM_VREG: CK((n&-8) == 0 && (n != 4 || (*p&1) == 0), RANGE_VREG);
	if (*p++ == 1 && *p == DASM_DISP) mrm = n; continue;
      }
      mrm = 4;
    } else {
      int *pl, n;
      switch (action) {
      case DASM_REL_LG:
      case DASM_IMM_LG:
	n = *p++; pl = D->lglabels + n;
	/* Bkwd rel or global. */
	if (n <= 246) { CK(n>=10||*pl<0, RANGE_LG); CKPL(lg, LG); goto putrel; }
	pl -= 246; n = *pl;
	if (n < 0) n = 0;  /* Start new chain for fwd rel if label exists. */
	goto linkrel;
      case DASM_REL_PC:
      case DASM_IMM_PC: pl = D->pclabels + va_arg(ap, int); CKPL(pc, PC);
      putrel:
	n = *pl;
	if (n < 0) {  /* Label exists. Get label pos and store it. */
	  b[pos] = -n;
	} else {
      linkrel:
	  b[pos] = n;  /* Else link to rel chain, anchored at label. */
	  *pl = pos;
	}
	pos++;
	ofs += 4;  /* Maximum offset needed. */
	if (action == DASM_REL_LG || action == DASM_REL_PC)
	  b[pos++] = ofs;  /* Store pass1 offset estimate. */
	break;
      case DASM_LABEL_LG: pl = D->lglabels + *p++; CKPL(lg, LG); goto putlabel;
      case DASM_LABEL_PC: pl = D->pclabels + va_arg(ap, int); CKPL(pc, PC);
      putlabel:
	n = *pl;  /* n > 0: Collapse rel chain and replace with label pos. */
	while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = pos; }
	*pl = -pos;  /* Label exists now. */
	b[pos++] = ofs;  /* Store pass1 offset estimate. */
	break;
      case DASM_ALIGN:
	ofs += *p++;  /* Maximum alignment needed (arg is 2**n-1). */
	b[pos++] = ofs;  /* Store pass1 offset estimate. */
	break;
      case DASM_EXTERN: p += 2; ofs += 4; break;
      case DASM_ESC: p++; ofs++; break;
      case DASM_MARK: mrm = p[-2]; break;
      case DASM_SECTION:
	n = *p; CK(n < D->maxsection, RANGE_SEC); D->section = &D->sections[n];
      case DASM_STOP: goto stop;
      }
    }
  }
stop:
  va_end(ap);
  sec->pos = pos;
  sec->ofs = ofs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %esi, %ebx
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x5571
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), %r15
movslq %esi, %r13
addq 0x8(%r15), %r13
movq 0x38(%r15), %rsi
movl 0x18(%rsi), %r12d
movl 0x20(%rsi), %ebp
cmpl 0x1c(%rsi), %r12d
movq %rsi, 0x18(%rsp)
jge 0x5596
movq (%rsi), %rax
jmp 0x5605
movq 0x10(%rsi), %r14
movq %r14, %rax
subq $-0xc8, %rax
jae 0x55df
cmpq $0x11, %r14
pushq $0x10
popq %rcx
cmovaeq %r14, %rcx
movq %rcx, %r14
addq %rcx, %rcx
cmpq %rax, %r14
jb 0x55b0
movq 0x8(%rsi), %rdi
movq %r14, %rsi
callq 0x5180
movq 0x18(%rsp), %rsi
movq %rax, 0x8(%rsi)
testq %rax, %rax
je 0x5a37
movq %r14, 0x10(%rsi)
jmp 0x55e3
movq 0x8(%rsi), %rax
movl %r12d, %ecx
andl $0xff000000, %ecx       # imm = 0xFF000000
movslq %r14d, %rdx
shrq $0x2, %rdx
addl %ecx, %edx
addl $-0x19, %edx
shlq $0x2, %rcx
subq %rcx, %rax
movq %rax, (%rsi)
movl %edx, 0x1c(%rsi)
movslq %r12d, %rcx
incl %r12d
movl %ebx, (%rax,%rcx,4)
leaq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x110(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movabsq $0x3000000010, %rcx     # imm = 0x3000000010
movq %rcx, (%rsp)
leaq 0x50(%r15), %rcx
pushq $0x4
popq %rdx
leaq 0x59ff(%rip), %rsi      # 0xb040
leaq 0x59c8(%rip), %rdi      # 0xb010
movl %edx, %r9d
movl %r12d, %r11d
leaq 0x1(%r13), %r10
movzbl (%r13), %r14d
cmpl $0xe8, %r14d
ja 0x566a
incl %ebp
movl %r11d, %r12d
movq %r10, %r13
jmp 0x564b
movslq %r11d, %rbx
cmpb $-0xd, %r14b
ja 0x56b2
movl (%rsp), %r8d
cmpq $0x28, %r8
ja 0x570b
movq %r8, %rbx
addq 0x10(%rsp), %rbx
addl $0x8, %r8d
movl %r8d, (%rsp)
movl (%rbx), %r8d
movslq %r11d, %rbx
incl %r11d
movl %r8d, (%rax,%rbx,4)
addl $0xffffff17, %r14d      # imm = 0xFFFFFF17
movslq (%rsi,%r14,4), %r14
addq %rsi, %r14
movl %r11d, %r12d
jmpq *%r14
leal -0xf4(%r14), %r8d
movslq (%rdi,%r8,4), %r8
addq %rdi, %r8
jmpq *%r8
movzbl 0x1(%r13), %r10d
addq $0x2, %r13
leal (,%r10,4), %r8d
addq 0x10(%r15), %r8
cmpl $0xf6, %r10d
ja 0x57a1
cmpb $0x9, %r10b
ja 0x56f5
cmpl $0x0, (%r8)
jns 0x59c6
shll $0x2, %r10d
cmpq 0x18(%r15), %r10
jae 0x59c6
movq %r13, %r10
jmp 0x57e9
movq 0x8(%rsp), %r8
leaq 0x8(%r8), %r12
movq %r12, 0x8(%rsp)
movl (%r8), %r8d
incl %r11d
movl %r8d, (%rax,%rbx,4)
addl $0xffffff17, %r14d      # imm = 0xFFFFFF17
movslq (%rsi,%r14,4), %r14
addq %rsi, %r14
movl %r11d, %r12d
jmpq *%r14
testl %r8d, %r8d
je 0x596e
movsbl %r8b, %r9d
movl %r12d, %r11d
cmpl %r8d, %r9d
je 0x58b6
addl $0x4, %ebp
movl %edx, %r9d
jmp 0x5662
movl (%rsp), %r12d
cmpq $0x28, %r12
ja 0x57be
movq %r12, %r8
addq 0x10(%rsp), %r8
addl $0x8, %r12d
movl %r12d, (%rsp)
jmp 0x57cc
movzbl 0x1(%r13), %r8d
addq $0x2, %r13
shll $0x2, %r8d
cmpq 0x18(%r15), %r8
jae 0x59c6
addq 0x10(%r15), %r8
jmp 0x5936
movzbl -0x1(%r13), %r9d
jmp 0x5662
movl -0x3d8(%r8), %r12d
addq $-0x3d8, %r8            # imm = 0xFC28
testl %r12d, %r12d
movl $0x0, %r10d
cmovlel %r10d, %r12d
jmp 0x57f4
movq 0x8(%rsp), %r8
leaq 0x8(%r8), %r12
movq %r12, 0x8(%rsp)
movslq (%r8), %r8
leaq (,%r8,4), %r12
cmpq 0x28(%r15), %r12
jae 0x59b4
movq 0x20(%r15), %r12
leaq (%r12,%r8,4), %r8
movl (%r8), %r12d
testl %r12d, %r12d
js 0x57fd
movq %r10, %r13
movl %r12d, (%rax,%rbx,4)
movl %r11d, (%r8)
jmp 0x5807
negl %r12d
movl %r12d, (%rax,%rbx,4)
movq %r10, %r13
leal 0x1(%r11), %r12d
addl $0x4, %ebp
andb $-0x2, %r14b
cmpb $-0xc, %r14b
jne 0x564b
addl $0x2, %r11d
movslq %r12d, %r8
movl %ebp, (%rax,%r8,4)
movl %r11d, %r12d
jmp 0x564b
addq $0x3, %r13
addl $0x4, %ebp
movl %r11d, %r12d
jmp 0x564b
movl (%rsp), %r14d
cmpq $0x28, %r14
ja 0x5908
movq %r14, %r8
addq 0x10(%rsp), %r8
addl $0x8, %r14d
movl %r14d, (%rsp)
jmp 0x5916
movzbl 0x1(%r13), %r8d
addq $0x2, %r13
addl %r8d, %ebp
jmp 0x5960
addq $0x2, %r13
incl %ebp
movl %r11d, %r12d
jmp 0x564b
movsbl %r8b, %r9d
cmpl %r8d, %r9d
je 0x58b6
jmp 0x59a2
movsbl %r8b, %r9d
cmpl %r8d, %r9d
je 0x58b6
cmpl $0x10000, %r8d          # imm = 0x10000
jae 0x59a2
addl $0x2, %ebp
jmp 0x58c2
cmpl $0x100, %r8d            # imm = 0x100
jae 0x59a2
incl %ebp
jmp 0x58c2
movl $0xc0000000, -0x4(%rax,%rbx,4) # imm = 0xC0000000
movl %edx, %r9d
movq %r10, %r13
jmp 0x564b
cmpl $0x7, %r8d
ja 0x59dc
movb (%r10), %r11b
cmpl $0x4, %r8d
jne 0x58ec
movl %r11d, %ebx
andb $0x1, %bl
jne 0x59dc
addq $0x2, %r13
cmpb $0x1, %r11b
jne 0x564b
cmpb $-0x17, (%r13)
cmovel %r8d, %r9d
jmp 0x564b
movq 0x8(%rsp), %r8
leaq 0x8(%r8), %r14
movq %r14, 0x8(%rsp)
movslq (%r8), %r8
leaq (,%r8,4), %r14
cmpq 0x28(%r15), %r14
jae 0x59b4
movq 0x20(%r15), %r14
leaq (%r14,%r8,4), %r8
movq %r10, %r13
movl (%r8), %r10d
testl %r10d, %r10d
jle 0x5957
movl %r10d, %r14d
shrl $0x18, %r10d
imulq $0x28, %r10, %r10
movq (%rcx,%r10), %r12
movl (%r12,%r14,4), %r10d
movl %r11d, (%r12,%r14,4)
jmp 0x5939
movl %r11d, %r10d
negl %r10d
movl %r10d, (%r8)
incl %r11d
movl %ebp, (%rax,%rbx,4)
movl %r11d, %r12d
jmp 0x564b
andl $0x7, %r9d
cmpl $0x4, %r9d
jne 0x5981
movzbl -0x1(%r13), %r9d
andl $0x7, %r9d
movq %r10, %r13
cmpl $0x5, %r9d
movl %edx, %r9d
jne 0x564b
jmp 0x58b6
addq $0x2, %r13
addl %r8d, %ebp
jmp 0x5648
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r10d
orl $0x11000000, %r10d      # imm = 0x11000000
jmp 0x5a21
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r10d
orl $0x14000000, %r10d      # imm = 0x14000000
jmp 0x5a21
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r13d
orl $0x13000000, %r13d      # imm = 0x13000000
movl %r13d, 0x4c(%r15)
jmp 0x5a25
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r10d
orl $0x15000000, %r10d      # imm = 0x15000000
jmp 0x5a21
movzbl (%r10), %eax
cmpl %eax, 0x48(%r15)
jle 0x5a11
imulq $0x28, %rax, %rax
addq %rax, %rcx
movq %rcx, 0x38(%r15)
movq 0x18(%rsp), %rax
movl %r11d, 0x18(%rax)
movl %ebp, 0x20(%rax)
jmp 0x5a25
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r10d
orl $0x12000000, %r10d      # imm = 0x12000000
movl %r10d, 0x4c(%r15)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
callq 0x51c0