// File: /workspace/github_c_makefile_star2_O3/mattn[P]orelang/ore.c
// Function: ore_set
void
ore_set(ore_context* ore, const char* name, ore_value v) {
  khint_t k;
  int r = 0;
  ore_value old = ore_value_nil();
  while (ore) {
    k = kh_get(value, ore->env, name);
    if (k != kh_end(ore->env)) {
      old = kh_value(ore->env, k);
      ore_value_ref(v);
      ore_value_unref(old);
      k = kh_put(value, ore->env, name, &r);
      kh_value(ore->env, k) = v;
      return;
    }
    if (ore->parent == NULL) {
      if (k != kh_end(ore->env)) 
        old = kh_value(ore->env, k);
      ore_value_ref(v);
      ore_value_unref(old);
      k = kh_put(value, ore->env, name, &r);
      kh_value(ore->env, k) = v;
      return;
    }
    ore = ore->parent;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x80(%rsp)
leaq 0x2(%rsi), %rax
movq %rax, 0x40(%rsp)
testq %rdi, %rdi
je 0xd1a2
movq %rdi, 0x38(%rsp)
movq (%rdi), %rax
movq %rax, 0x28(%rsp)
movl (%rax), %edi
testl %edi, %edi
je 0xd03d
movsbl (%rsi), %r12d
testl %r12d, %r12d
je 0xd044
movb 0x1(%rsi), %al
testb %al, %al
je 0xd047
movq 0x40(%rsp), %rcx
movl %r12d, %edx
shll $0x5, %edx
subl %r12d, %edx
movsbl %al, %r12d
addl %edx, %r12d
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0xd022
jmp 0xd047
xorl %ebx, %ebx
jmp 0xd0d2
xorl %r12d, %r12d
movq %rdi, 0x48(%rsp)
leal -0x1(%rdi), %edx
andl %edx, %r12d
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0x1, %r13d
movl %r12d, %ebx
movl %edx, 0x34(%rsp)
movq %rdi, 0x50(%rsp)
movl %ebx, %eax
shrl $0x4, %eax
movl (%rdi,%rax,4), %r14d
leal (%rbx,%rbx), %ebp
andl $0x1e, %ebp
movl %r14d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0xd0c1
testb $0x1, %al
jne 0xd0b2
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rdi
movq %rsi, %r15
callq 0x2150
movq 0x50(%rsp), %rdi
movl 0x34(%rsp), %edx
movq %r15, %rsi
testl %eax, %eax
je 0xd0c1
addl %r13d, %ebx
andl %edx, %ebx
incl %r13d
cmpl %r12d, %ebx
jne 0xd06d
jmp 0xd0d6
movl %ebp, %ecx
shrl %cl, %r14d
testb $0x3, %r14b
movq 0x48(%rsp), %rdi
cmovnel %edi, %ebx
cmpl %edi, %ebx
jne 0xd0ea
movq 0x38(%rsp), %r15
movq 0x8(%r15), %rdi
testq %rdi, %rdi
jne 0xcff1
jmp 0xd11e
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
movl %ebx, %ecx
leaq (%rcx,%rcx,4), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq %rdx, 0x80(%rsp)
movups (%rax,%rcx,8), %xmm0
movups 0x10(%rax,%rcx,8), %xmm1
movaps %xmm1, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movq 0x38(%rsp), %r15
leaq 0xc0(%rsp), %rbx
movq 0x20(%rbx), %rax
movq %rax, 0x20(%rsp)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rsi, %r14
callq 0xcab9
movq 0x80(%rsp), %rax
movq %rax, 0x20(%rsp)
movaps 0x60(%rsp), %xmm0
movaps 0x70(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0xc6e3
movq (%r15), %rdi
leaq 0x5c(%rsp), %rdx
movq %r14, %rsi
callq 0xd1b4
movq (%r15), %rcx
movq 0x20(%rcx), %rcx
movl %eax, %eax
leaq (%rax,%rax,4), %rax
movq 0x20(%rbx), %rdx
movq %rdx, 0x20(%rcx,%rax,8)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x10(%rcx,%rax,8)
movups %xmm0, (%rcx,%rax,8)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq