// File: /workspace/github_c_makefile_star2_O0/tylerneylon[P]APIsWithLua/lua/ltablib.c
// Function: tmove
static int tmove (lua_State *L) {
  lua_Integer f = luaL_checkinteger(L, 2);
  lua_Integer e = luaL_checkinteger(L, 3);
  lua_Integer t = luaL_checkinteger(L, 4);
  int tt = !lua_isnoneornil(L, 5) ? 5 : 1;  /* destination table */
  checktab(L, 1, TAB_R);
  checktab(L, tt, TAB_W);
  if (e >= f) {  /* otherwise, nothing to move */
    lua_Integer n, i;
    luaL_argcheck(L, f > 0 || e < LUA_MAXINTEGER + f, 3,
                  "too many elements to move");
    n = e - f + 1;  /* number of elements to move */
    luaL_argcheck(L, t <= LUA_MAXINTEGER - n + 1, 4,
                  "destination wrap around");
    if (t > e || t <= f || (tt != 1 && !lua_compare(L, 1, tt, LUA_OPEQ))) {
      for (i = 0; i < n; i++) {
        lua_geti(L, 1, f + i);
        lua_seti(L, tt, t + i);
      }
    }
    else {
      for (i = n - 1; i >= 0; i--) {
        lua_geti(L, 1, f + i);
        lua_seti(L, tt, t + i);
      }
    }
  }
  lua_pushvalue(L, tt);  /* return destination table */
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x20550
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x20550
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x20550
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x5, %esi
callq 0x61f0
cmpl $0x0, %eax
setle %dl
xorb $-0x1, %dl
movl $0x1, %eax
movl $0x5, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x30ef0
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x2, %edx
callq 0x30ef0
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jl 0x30e12
movb $0x1, %al
cmpq $0x0, -0x10(%rbp)
movb %al, -0x39(%rbp)
jg 0x30cf1
movq -0x18(%rbp), %rcx
movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF
addq -0x10(%rbp), %rdx
movb $0x1, %al
cmpq %rdx, %rcx
movb %al, -0x39(%rbp)
jl 0x30cf1
movq -0x8(%rbp), %rdi
movl $0x3, %esi
leaq 0x664a(%rip), %rdx      # 0x3732d
callq 0x1fab0
cmpl $0x0, %eax
setne %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
movq -0x18(%rbp), %rax
subq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rcx
movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF
subq -0x30(%rbp), %rdx
addq $0x1, %rdx
movb $0x1, %al
cmpq %rdx, %rcx
movb %al, -0x3a(%rbp)
jle 0x30d42
movq -0x8(%rbp), %rdi
movl $0x4, %esi
leaq 0x6613(%rip), %rdx      # 0x37347
callq 0x1fab0
cmpl $0x0, %eax
setne %al
movb %al, -0x3a(%rbp)
movb -0x3a(%rbp), %al
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jg 0x30d77
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jle 0x30d77
cmpl $0x1, -0x24(%rbp)
je 0x30dc3
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %edx
movl $0x1, %esi
xorl %ecx, %ecx
callq 0x6530
cmpl $0x0, %eax
jne 0x30dc3
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0x30dc1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq -0x38(%rbp), %rdx
movl $0x1, %esi
callq 0x7330
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x20(%rbp), %rdx
addq -0x38(%rbp), %rdx
callq 0x7b20
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x30d7f
jmp 0x30e10
movq -0x30(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jl 0x30e0e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq -0x38(%rbp), %rdx
movl $0x1, %esi
callq 0x7330
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x20(%rbp), %rdx
addq -0x38(%rbp), %rdx
callq 0x7b20
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x30dcf
jmp 0x30e10
jmp 0x30e12
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x6190
movl $0x1, %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)