// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movabsq $0x7ffc000000000000, %r13 # imm = 0x7FFC000000000000
movq %rsi, %rax
notq %rax
testq %r13, %rax
jne 0x16c58
movq %r15, %rax
shrq %rax
movabsq $0x3ffe800000000001, %rcx # imm = 0x3FFE800000000001
cmpq %rcx, %rax
jne 0x16c64
movabsq $0x7ffd000000000002, %rax # imm = 0x7FFD000000000002
incq %rax
cmpq %rax, %r15
je 0x16d38
xorpd %xmm0, %xmm0
jmp 0x16c60
movq %r15, %rdi
callq 0x9060
movb $0x1, %al
jmp 0x16c66
xorl %eax, %eax
testb %al, %al
je 0x16cb4
movq %r14, %rax
notq %rax
testq %rax, %r13
movsd %xmm0, 0x8(%rsp)
jne 0x16d21
movq %r14, %rax
shrq %rax
movabsq $0x3ffe800000000001, %rcx # imm = 0x3FFE800000000001
cmpq %rcx, %rax
jne 0x16d45
movabsq $0x7ffd000000000002, %rax # imm = 0x7FFD000000000002
incq %rax
cmpq %rax, %r14
je 0x16e25
xorpd %xmm1, %xmm1
jmp 0x16d33
movq %r15, %rax
shrq $0x32, %rax
movl $0x3fff, %ecx           # imm = 0x3FFF
cmpl %ecx, %eax
setb %al
movq %r14, %rdx
shrq $0x32, %rdx
cmpl %ecx, %edx
setb %cl
orb %al, %cl
jne 0x16dcd
movabsq $-0x4000000000001, %r12 # imm = 0xFFFBFFFFFFFFFFFF
movabsq $0xffffffffffff, %rdx   # imm = 0xFFFFFFFFFFFF
movq %r15, %rsi
andq %rdx, %rsi
andq %r14, %rdx
movl (%rsi), %ecx
movb $0x1, %al
cmpl $0x1, %ecx
je 0x16db2
testl %ecx, %ecx
jne 0x16dc9
cmpl $0x0, (%rdx)
jne 0x16dc9
movq %rbx, %rdi
callq 0x9ba7
jmp 0x16dbf
movq %r14, %rdi
callq 0x9060
movapd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
movb $0x1, %bpl
jmp 0x16d47
movsd 0x6380(%rip), %xmm0     # 0x1d0c0
jmp 0x16c60
xorl %ebp, %ebp
testb %bpl, %bpl
jne 0x16d9b
movsd %xmm1, 0x10(%rsp)
movq 0x5f0(%rbx), %rax
cmpq $0x0, 0x58(%rax)
jne 0x16e37
leaq 0x962f(%rip), %rsi      # 0x2039a
leaq 0x7ec4(%rip), %rdx      # 0x1ec36
movq %rbx, %rdi
xorl %eax, %eax
callq 0x95d0
movq 0x5f0(%rbx), %rcx
movq %rax, 0x58(%rcx)
movq %r13, %r12
testb %bpl, %bpl
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
je 0x16e13
addsd %xmm1, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x905b
cmpl $0x1, (%rdx)
jne 0x16dc9
movq %rbx, %rdi
callq 0x9ddb
incq %r12
orq %rax, %r12
xorl %eax, %eax
jmp 0x16dc9
testb %al, %al
je 0x16e13
movq 0x5f0(%rbx), %rax
cmpq $0x0, 0x58(%rax)
jne 0x16e32
movq %r15, %rdi
callq 0xaa1a
movq %rax, %r15
movq %r14, %rdi
callq 0xaa1a
leaq 0x7e56(%rip), %rsi      # 0x1ec4b
movq %rbx, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x95d0
movq 0x5f0(%rbx), %rcx
movq %rax, 0x58(%rcx)
movq %r13, %r12
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x6293(%rip), %xmm1     # 0x1d0c0
jmp 0x16d33
callq 0x6603
callq 0x6639