// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_core.c
// Function: varAdd
Var varAdd(PKVM* vm, Var v1, Var v2) {
  double d1, d2;

  if (isNumeric(v1, &d1)) {
    if (validateNumeric(vm, v2, &d2, RIGHT_OPERAND)) {
      return VAR_NUM(d1 + d2);
    }
    return VAR_NULL;
  }

  if (IS_OBJ(v1) && IS_OBJ(v2)) {
    Object *o1 = AS_OBJ(v1), *o2 = AS_OBJ(v2);
    switch (o1->type) {

      case OBJ_STRING:
      {
        if (o2->type == OBJ_STRING) {
          return VAR_OBJ(stringJoin(vm, (String*)o1, (String*)o2));
        }
      } break;

      case OBJ_LIST:
      {
        if (o2->type == OBJ_LIST) {
          return VAR_OBJ(listJoin(vm, (List*)o1, (List*)o2));
        }
      } break;

      case OBJ_MAP:
      case OBJ_RANGE:
      case OBJ_SCRIPT:
      case OBJ_FUNC:
      case OBJ_FIBER:
      case OBJ_CLASS:
      case OBJ_INST:
        break;
    }
  }

  UNSUPPORTED_OPERAND_TYPES("+");
  return VAR_NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %r14
movabsq $0x7ffc000000000000, %rbx # imm = 0x7FFC000000000000
movq %rsi, %rax
notq %rax
testq %rbx, %rax
jne 0x1638d
movq %rsi, %rax
shrq %rax
movabsq $0x3ffe800000000001, %rcx # imm = 0x3FFE800000000001
cmpq %rcx, %rax
jne 0x16403
movabsq $0x7ffd000000000002, %rax # imm = 0x7FFD000000000002
incq %rax
cmpq %rax, %rsi
je 0x1648e
xorpd %xmm1, %xmm1
jmp 0x16399
movq %rsi, %rdi
callq 0x8fa4
movapd %xmm0, %xmm1
movq %r15, %rax
notq %rax
testq %rax, %rbx
jne 0x163d9
movq %r15, %rax
shrq %rax
movabsq $0x3ffe800000000001, %rcx # imm = 0x3FFE800000000001
cmpq %rcx, %rax
jne 0x16462
movabsq $0x7ffd000000000002, %rax # imm = 0x7FFD000000000002
incq %rax
cmpq %rax, %r15
je 0x1649b
xorpd %xmm0, %xmm0
jmp 0x163eb
movq %r15, %rdi
movsd %xmm1, (%rsp)
callq 0x8fa4
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8f9f
movq %rsi, %rax
shrq $0x32, %rax
movl $0x3fff, %ecx           # imm = 0x3FFF
cmpl %ecx, %eax
setb %al
movq %r15, %rdx
shrq $0x32, %rdx
cmpl %ecx, %edx
setb %cl
orb %al, %cl
jne 0x164c3
movabsq $-0x4000000000001, %r12 # imm = 0xFFFBFFFFFFFFFFFF
movabsq $0xffffffffffff, %rdx   # imm = 0xFFFFFFFFFFFF
movq %rsi, %rax
andq %rdx, %rax
andq %r15, %rdx
movl (%rax), %ecx
cmpl $0x1, %ecx
je 0x164a8
testl %ecx, %ecx
jne 0x164c3
cmpl $0x0, (%rdx)
jne 0x164c3
movq %r14, %rdi
movq %rax, %rsi
callq 0x9a9a
jmp 0x164b8
movq 0x5f0(%r14), %rax
cmpq $0x0, 0x58(%rax)
jne 0x1651a
leaq 0x8f5f(%rip), %rsi      # 0x1f3da
leaq 0x77f4(%rip), %rdx      # 0x1dc76
movq %r14, %rdi
xorl %eax, %eax
callq 0x94f4
jmp 0x164fb
movsd 0x5c2a(%rip), %xmm1     # 0x1c0c0
jmp 0x16399
movsd 0x5c1d(%rip), %xmm0     # 0x1c0c0
jmp 0x163eb
cmpl $0x1, (%rdx)
jne 0x164c3
movq %r14, %rdi
movq %rax, %rsi
callq 0x9cc3
incq %r12
orq %rax, %r12
movq %r12, %rbx
jmp 0x16506
movq 0x5f0(%r14), %rax
cmpq $0x0, 0x58(%rax)
jne 0x16515
movq %rsi, %rdi
callq 0xa89c
movq %rax, %r12
movq %r15, %rdi
callq 0xa89c
leaq 0x77a0(%rip), %rsi      # 0x1dc8b
movq %r14, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x94f4
movq 0x5f0(%r14), %rcx
movq %rax, 0x58(%rcx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x65cd
callq 0x6603