// File: /workspace/github_c_makefile_star2_O2/LuaJIT[P]LuaJIT/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 = -1;
  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 < 0) mrm = p[-2]; if ((mrm&7) != 5) break; }
	/* fallthrough */
      case DASM_IMM_DB: if (((n+128)&-256) == 0) goto ob; /* fallthrough */
      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; /* fallthrough */
      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&-16) == 0 && (n != 4 || (*p>>5) != 2), RANGE_VREG);
	if (*p < 0x40 && p[1] == DASM_DISP) mrm = n;
	if (*p < 0x20 && (n&7) == 4) ofs++;
	switch ((*p++ >> 3) & 3) {
	case 3: n |= b[pos-3]; /* fallthrough */
	case 2: n |= b[pos-2]; /* fallthrough */
	case 1: if (n <= 7) { b[pos-1] |= 0x10; ofs--; }
	}
	continue;
      }
      mrm = -1;
    } 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. */
	} else if (sizeof(ptrdiff_t) == 8) {
	  ofs += 4;
	}
	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 0x5561
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, %r12
addq 0x8(%r15), %r12
movq 0x38(%r15), %rsi
movl 0x18(%rsi), %r13d
movl 0x20(%rsi), %ebp
cmpl 0x1c(%rsi), %r13d
movq %rsi, 0x18(%rsp)
jge 0x5586
movq (%rsi), %rax
jmp 0x55f5
movq 0x10(%rsi), %r14
movq %r14, %rax
subq $-0xc8, %rax
jae 0x55cf
cmpq $0x11, %r14
pushq $0x10
popq %rcx
cmovaeq %r14, %rcx
movq %rcx, %r14
addq %rcx, %rcx
cmpq %rax, %r14
jb 0x55a0
movq 0x8(%rsi), %rdi
movq %r14, %rsi
callq 0x5180
movq 0x18(%rsp), %rsi
movq %rax, 0x8(%rsi)
testq %rax, %rax
je 0x5a5e
movq %r14, 0x10(%rsi)
jmp 0x55d3
movq 0x8(%rsi), %rax
movl %r13d, %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 %r13d, %rcx
incl %r13d
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 $-0x1
popq %rdx
leaq 0x5a0f(%rip), %rsi      # 0xb040
leaq 0x59d8(%rip), %r8       # 0xb010
movl %edx, %r10d
leaq 0x1(%r12), %r11
movzbl (%r12), %r9d
cmpl $0xe8, %r9d
ja 0x5655
incl %ebp
movq %r11, %r12
jmp 0x563b
movslq %r13d, %rbx
cmpb $-0xd, %r9b
ja 0x5696
movl (%rsp), %edi
cmpq $0x28, %rdi
ja 0x56ed
movq %rdi, %rbx
addq 0x10(%rsp), %rbx
addl $0x8, %edi
movl %edi, (%rsp)
movl (%rbx), %r14d
movslq %r13d, %rbx
incl %r13d
movl %r14d, (%rax,%rbx,4)
addl $0xffffff17, %r9d       # imm = 0xFFFFFF17
movslq (%rsi,%r9,4), %rdi
addq %rsi, %rdi
jmpq *%rdi
leal -0xf4(%r9), %edi
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
jmpq *%rdi
movzbl 0x1(%r12), %edi
addq $0x2, %r12
leal (,%rdi,4), %r14d
addq 0x10(%r15), %r14
cmpl $0xf6, %edi
ja 0x577e
cmpb $0x9, %dil
ja 0x56d8
cmpl $0x0, (%r14)
jns 0x59ed
shll $0x2, %edi
cmpq 0x18(%r15), %rdi
jae 0x59ed
movq %r12, %r11
jmp 0x57c8
movq 0x8(%rsp), %rdi
leaq 0x8(%rdi), %r14
movq %r14, 0x8(%rsp)
movl (%rdi), %r14d
incl %r13d
movl %r14d, (%rax,%rbx,4)
addl $0xffffff17, %r9d       # imm = 0xFFFFFF17
movslq (%rsi,%r9,4), %rdi
addq %rsi, %rdi
jmpq *%rdi
testl %r14d, %r14d
je 0x5999
movsbl %r14b, %edi
cmpl %r14d, %edi
je 0x588e
addl $0x4, %ebp
jmp 0x589a
movl (%rsp), %r14d
cmpq $0x28, %r14
ja 0x579d
movq %r14, %rdi
addq 0x10(%rsp), %rdi
addl $0x8, %r14d
movl %r14d, (%rsp)
jmp 0x57ab
movzbl 0x1(%r12), %r9d
addq $0x2, %r12
shll $0x2, %r9d
cmpq 0x18(%r15), %r9
jae 0x59ed
addq 0x10(%r15), %r9
jmp 0x5967
movzbl -0x1(%r12), %r10d
movq %r11, %r12
jmp 0x563b
movl -0x3d8(%r14), %edi
addq $-0x3d8, %r14           # imm = 0xFC28
testl %edi, %edi
movl $0x0, %r11d
cmovlel %r11d, %edi
movq %r12, %r11
jmp 0x57cf
movq 0x8(%rsp), %rdi
leaq 0x8(%rdi), %r14
movq %r14, 0x8(%rsp)
movslq (%rdi), %rdi
leaq (,%rdi,4), %r14
cmpq 0x28(%r15), %r14
jae 0x59db
movq 0x20(%r15), %r14
leaq (%r14,%rdi,4), %r14
movl (%r14), %edi
testl %edi, %edi
js 0x57d7
movl %edi, (%rax,%rbx,4)
movl %r13d, (%r14)
jmp 0x57dc
negl %edi
movl %edi, (%rax,%rbx,4)
leal 0x1(%r13), %edi
andb $-0x2, %r9b
cmpb $-0xc, %r9b
jne 0x57ff
addl $0x4, %ebp
addl $0x2, %r13d
movslq %edi, %rdi
movl %ebp, (%rax,%rdi,4)
movq %r11, %r12
jmp 0x563b
addl $0x8, %ebp
movl %edi, %r13d
movq %r11, %r12
jmp 0x563b
addq $0x3, %r12
addl $0x4, %ebp
jmp 0x563b
movl (%rsp), %r9d
cmpq $0x28, %r9
ja 0x593d
movq %r9, %rdi
addq 0x10(%rsp), %rdi
addl $0x8, %r9d
movl %r9d, (%rsp)
jmp 0x594b
movzbl 0x1(%r12), %edi
addq $0x2, %r12
addl %edi, %ebp
jmp 0x598e
addq $0x2, %r12
incl %ebp
jmp 0x563b
movsbl %r14b, %edi
cmpl %r14d, %edi
je 0x588e
jmp 0x59c9
movsbl %r14b, %edi
cmpl %r14d, %edi
je 0x588e
cmpl $0x10000, %r14d         # imm = 0x10000
jae 0x59c9
addl $0x2, %ebp
jmp 0x589a
cmpl $0x100, %r14d           # imm = 0x100
jae 0x59c9
incl %ebp
jmp 0x589a
movl $0xc0000000, -0x4(%rax,%rbx,4) # imm = 0xC0000000
movl %edx, %r10d
movq %r11, %r12
jmp 0x563b
cmpl $0xf, %r14d
ja 0x5a03
movzbl (%r11), %r9d
cmpl $0x4, %r14d
jne 0x58ca
movl %r9d, %edi
andb $-0x20, %dil
cmpb $0x40, %dil
je 0x5a03
cmpb $0x3f, %r9b
ja 0x58da
cmpb $-0x17, 0x2(%r12)
cmovel %r14d, %r10d
cmpb $0x20, %r9b
setb %dil
movl %r14d, %r11d
andl $0x7, %r11d
cmpl $0x4, %r11d
sete %r11b
andb %dil, %r11b
movzbl %r11b, %edi
addl %edi, %ebp
addq $0x2, %r12
shrl $0x3, %r9d
andl $0x3, %r9d
leaq 0x575f(%rip), %rdi      # 0xb06c
movslq (%rdi,%r9,4), %r9
addq %rdi, %r9
movl %r14d, %edi
jmpq *%r9
movl -0x8(%rax,%rbx,4), %edi
orl %r14d, %edi
orl -0x4(%rax,%rbx,4), %edi
cmpl $0x7, %edi
jg 0x563b
orl $0x10, %r14d
movl %r14d, (%rax,%rbx,4)
decl %ebp
jmp 0x563b
movq 0x8(%rsp), %rdi
leaq 0x8(%rdi), %r9
movq %r9, 0x8(%rsp)
movslq (%rdi), %rdi
leaq (,%rdi,4), %r9
cmpq 0x28(%r15), %r9
jae 0x59db
movq 0x20(%r15), %r9
leaq (%r9,%rdi,4), %r9
movq %r11, %r12
movl (%r9), %edi
testl %edi, %edi
jle 0x5986
movl %edi, %r11d
shrl $0x18, %edi
imulq $0x28, %rdi, %rdi
movq (%rcx,%rdi), %r14
movl (%r14,%r11,4), %edi
movl %r13d, (%r14,%r11,4)
jmp 0x596a
movl %r13d, %edi
negl %edi
movl %edi, (%r9)
incl %r13d
movl %ebp, (%rax,%rbx,4)
jmp 0x563b
testl %r10d, %r10d
jns 0x59a4
movzbl -0x1(%r12), %r10d
andl $0x7, %r10d
movq %r11, %r12
cmpl $0x5, %r10d
movl %edx, %r10d
jne 0x563b
jmp 0x588e
addq $0x2, %r12
addl %r14d, %ebp
jmp 0x5638
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r11d
orl $0x11000000, %r11d      # imm = 0x11000000
jmp 0x5a48
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r11d
orl $0x14000000, %r11d      # imm = 0x14000000
jmp 0x5a48
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r12d
orl $0x13000000, %r12d      # imm = 0x13000000
movl %r12d, 0x4c(%r15)
jmp 0x5a4c
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r11d
orl $0x15000000, %r11d      # imm = 0x15000000
jmp 0x5a48
movzbl (%r11), %eax
cmpl %eax, 0x48(%r15)
jle 0x5a38
imulq $0x28, %rax, %rax
addq %rax, %rcx
movq %rcx, 0x38(%r15)
movq 0x18(%rsp), %rax
movl %r13d, 0x18(%rax)
movl %ebp, 0x20(%rax)
jmp 0x5a4c
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r11d
orl $0x12000000, %r11d      # imm = 0x12000000
movl %r11d, 0x4c(%r15)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
callq 0x51c0