// File: /workspace/github_c_makefile_star2_O3/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 0x5a4a
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 0x5a6f
movq (%rsi), %rax
jmp 0x5ae0
movq 0x10(%rsi), %r14
movq %r14, %rax
subq $-0xc8, %rax
jae 0x5aba
cmpq $0x11, %r14
movl $0x10, %ecx
cmovaeq %r14, %rcx
movq %rcx, %r14
addq %rcx, %rcx
cmpq %rax, %r14
jb 0x5a8b
movq 0x8(%rsi), %rdi
movq %r14, %rsi
callq 0x5170
movq 0x18(%rsp), %rsi
movq %rax, 0x8(%rsi)
testq %rax, %rax
je 0x5f6a
movq %r14, 0x10(%rsi)
jmp 0x5abe
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
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
leaq 0x6521(%rip), %rdx      # 0xc040
leaq 0x6546(%rip), %rsi      # 0xc06c
leaq 0x64e3(%rip), %rdi      # 0xc010
leaq 0x1(%r12), %r10
movzbl (%r12), %ebx
cmpl $0xe8, %ebx
ja 0x5b46
incl %ebp
movq %r10, %r12
jmp 0x5b2d
cmpb $-0xd, %bl
ja 0x5b85
movl (%rsp), %r11d
cmpq $0x28, %r11
ja 0x5bdf
movq %r11, %r14
addq 0x10(%rsp), %r14
addl $0x8, %r11d
movl %r11d, (%rsp)
movl (%r14), %r11d
movslq %r13d, %r14
incl %r13d
movl %r11d, (%rax,%r14,4)
addl $0xffffff17, %ebx       # imm = 0xFFFFFF17
movslq (%rdx,%rbx,4), %rbx
addq %rdx, %rbx
jmpq *%rbx
leal -0xf4(%rbx), %r8d
movslq (%rdi,%r8,4), %r8
addq %rdi, %r8
jmpq *%r8
movzbl 0x1(%r12), %r10d
addq $0x2, %r12
leal (,%r10,4), %r11d
addq 0x10(%r15), %r11
cmpl $0xf6, %r10d
ja 0x5c72
cmpb $0x9, %r10b
ja 0x5bc9
cmpl $0x0, (%r11)
jns 0x5ef8
shll $0x2, %r10d
cmpq 0x18(%r15), %r10
jae 0x5ef8
movq %r12, %r10
jmp 0x5cbd
movq 0x8(%rsp), %r11
leaq 0x8(%r11), %r14
movq %r14, 0x8(%rsp)
movl (%r11), %r11d
movslq %r13d, %r14
incl %r13d
movl %r11d, (%rax,%r14,4)
addl $0xffffff17, %ebx       # imm = 0xFFFFFF17
movslq (%rdx,%rbx,4), %rbx
addq %rdx, %rbx
jmpq *%rbx
testl %r11d, %r11d
je 0x5ead
movsbl %r11b, %r9d
cmpl %r11d, %r9d
je 0x5d9e
addl $0x4, %ebp
jmp 0x5dab
movl (%rsp), %r14d
cmpq $0x28, %r14
ja 0x5c92
movq %r14, %r11
addq 0x10(%rsp), %r11
leal 0x8(%r14), %r8d
movl %r8d, (%rsp)
jmp 0x5ca0
movzbl 0x1(%r12), %r11d
addq $0x2, %r12
shll $0x2, %r11d
cmpq 0x18(%r15), %r11
jae 0x5ef8
addq 0x10(%r15), %r11
jmp 0x5e74
movzbl -0x1(%r12), %r9d
movq %r10, %r12
jmp 0x5b2d
movl -0x3d8(%r11), %r14d
addq $-0x3d8, %r11           # imm = 0xFC28
testl %r14d, %r14d
movl $0x0, %r8d
cmovlel %r8d, %r14d
movq %r12, %r10
jmp 0x5cc5
movq 0x8(%rsp), %r11
leaq 0x8(%r11), %r8
movq %r8, 0x8(%rsp)
movslq (%r11), %r11
leaq (,%r11,4), %r8
cmpq 0x28(%r15), %r8
jae 0x5ee6
movq 0x20(%r15), %r8
leaq (%r8,%r11,4), %r11
movl (%r11), %r14d
testl %r14d, %r14d
js 0x5cd1
movslq %r13d, %r8
movl %r14d, (%rax,%r8,4)
movl %r13d, (%r11)
jmp 0x5cdb
negl %r14d
movslq %r13d, %r8
movl %r14d, (%rax,%r8,4)
leal 0x1(%r13), %r11d
andb $-0x2, %bl
cmpb $-0xc, %bl
jne 0x5cfd
addl $0x4, %ebp
addl $0x2, %r13d
movslq %r11d, %r8
movl %ebp, (%rax,%r8,4)
movq %r10, %r12
jmp 0x5b2d
addl $0x8, %ebp
movl %r11d, %r13d
movq %r10, %r12
jmp 0x5b2d
addq $0x3, %r12
addl $0x4, %ebp
jmp 0x5b2d
movl (%rsp), %ebx
cmpq $0x28, %rbx
ja 0x5e4a
movq %rbx, %r11
addq 0x10(%rsp), %r11
leal 0x8(%rbx), %r8d
movl %r8d, (%rsp)
jmp 0x5e58
movzbl 0x1(%r12), %r8d
addq $0x2, %r12
addl %r8d, %ebp
jmp 0x5e9e
addq $0x2, %r12
incl %ebp
jmp 0x5b2d
movsbl %r11b, %r9d
cmpl %r11d, %r9d
je 0x5d9e
jmp 0x5ed4
addq $0x2, %r12
addl %r11d, %ebp
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
jmp 0x5b2d
movsbl %r11b, %r9d
cmpl %r11d, %r9d
je 0x5d9e
cmpl $0x10000, %r11d         # imm = 0x10000
jae 0x5ed4
addl $0x2, %ebp
jmp 0x5dab
cmpl $0x100, %r11d           # imm = 0x100
jae 0x5ed4
incl %ebp
jmp 0x5dab
movl $0xc0000000, -0x4(%rax,%r14,4) # imm = 0xC0000000
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movq %r10, %r12
jmp 0x5b2d
cmpl $0xf, %r11d
ja 0x5f0e
movzbl (%r10), %ebx
cmpl $0x4, %r11d
jne 0x5dde
movl %ebx, %r8d
andb $-0x20, %r8b
cmpb $0x40, %r8b
je 0x5f0e
cmpb $0x3f, %bl
ja 0x5ded
cmpb $-0x17, 0x2(%r12)
cmovel %r11d, %r9d
cmpb $0x20, %bl
setb %r8b
movl %r11d, %r10d
andl $0x7, %r10d
cmpl $0x4, %r10d
sete %r10b
andb %r8b, %r10b
movzbl %r10b, %r8d
addl %r8d, %ebp
addq $0x2, %r12
shrl $0x3, %ebx
andl $0x3, %ebx
movslq (%rsi,%rbx,4), %r8
addq %rsi, %r8
movl %r11d, %r10d
jmpq *%r8
movl -0x8(%rax,%r14,4), %r10d
orl %r11d, %r10d
orl -0x4(%rax,%r14,4), %r10d
cmpl $0x7, %r10d
jg 0x5b2d
orl $0x10, %r11d
movl %r11d, (%rax,%r14,4)
decl %ebp
jmp 0x5b2d
movq 0x8(%rsp), %r11
leaq 0x8(%r11), %r8
movq %r8, 0x8(%rsp)
movslq (%r11), %r11
leaq (,%r11,4), %r8
cmpq 0x28(%r15), %r8
jae 0x5ee6
movq 0x20(%r15), %r8
leaq (%r8,%r11,4), %r11
movq %r10, %r12
movl (%r11), %r10d
testl %r10d, %r10d
jle 0x5e95
movl %r10d, %r8d
shrl $0x18, %r10d
leaq (%r10,%r10,4), %r10
movq (%rcx,%r10,8), %rbx
movl (%rbx,%r8,4), %r10d
movl %r13d, (%rbx,%r8,4)
jmp 0x5e77
movl %r13d, %r8d
negl %r8d
movl %r8d, (%r11)
movslq %r13d, %r8
incl %r13d
movl %ebp, (%rax,%r8,4)
jmp 0x5b2d
testl %r9d, %r9d
jns 0x5eb8
movzbl -0x1(%r12), %r9d
andl $0x7, %r9d
movq %r10, %r12
cmpl $0x5, %r9d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
jne 0x5b2d
jmp 0x5d9e
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r10d
orl $0x11000000, %r10d      # imm = 0x11000000
jmp 0x5f54
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r10d
orl $0x14000000, %r10d      # imm = 0x14000000
jmp 0x5f54
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r12d
orl $0x13000000, %r12d      # imm = 0x13000000
movl %r12d, 0x4c(%r15)
jmp 0x5f58
movl 0x8(%r15), %eax
notl %eax
addl %eax, %r10d
orl $0x15000000, %r10d      # imm = 0x15000000
jmp 0x5f54
movzbl (%r10), %eax
cmpl %eax, 0x48(%r15)
jle 0x5f44
leaq (%rax,%rax,4), %rax
leaq (%rcx,%rax,8), %rax
movq %rax, 0x38(%r15)
movq 0x18(%rsp), %rax
movl %r13d, 0x18(%rax)
movl %ebp, 0x20(%rax)
jmp 0x5f58
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
movl $0x1, %edi
callq 0x51c0