// File: /workspace/github_c_makefile_star2_O1/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
movl $0x0, 0x3c(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x80(%rsp)
leaq 0x2(%rsi), %rax
movq %rax, 0x50(%rsp)
testq %rdi, %rdi
je 0xd3c2
movq %rdi, %r15
movq (%rdi), %rax
movq %rax, 0x30(%rsp)
movl (%rax), %edi
testl %edi, %edi
je 0xd256
movq %r15, 0x48(%rsp)
movsbl (%rsi), %r12d
testl %r12d, %r12d
je 0xd25e
movb 0x1(%rsi), %al
testb %al, %al
je 0xd261
movq 0x50(%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 0xd23b
jmp 0xd261
xorl %r14d, %r14d
jmp 0xd2fa
xorl %r12d, %r12d
movq %rdi, 0x40(%rsp)
leal -0x1(%rdi), %edx
andl %edx, %r12d
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0x1, %r13d
movl %r12d, %r14d
movl %edx, 0x38(%rsp)
movq %rdi, 0x58(%rsp)
movl %r14d, %eax
shrl $0x4, %eax
movl (%rdi,%rax,4), %ebx
leal (%r14,%r14), %ebp
andl $0x1e, %ebp
movl %ebx, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0xd2e5
testb $0x1, %al
jne 0xd2cd
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
movq %rsi, %r15
callq 0x2150
movq 0x58(%rsp), %rdi
movl 0x38(%rsp), %edx
movq %r15, %rsi
testl %eax, %eax
je 0xd2e5
addl %r13d, %r14d
andl %edx, %r14d
incl %r13d
cmpl %r12d, %r14d
jne 0xd287
movq 0x40(%rsp), %rdi
movl %edi, %r14d
jmp 0xd2f5
movl %ebp, %ecx
shrl %cl, %ebx
testb $0x3, %bl
movq 0x40(%rsp), %rdi
cmovnel %edi, %r14d
movq 0x48(%rsp), %r15
cmpl %edi, %r14d
jne 0xd30e
movq 0x8(%r15), %rdi
testq %rdi, %rdi
jne 0xd207
jmp 0xd33e
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rax
movl %r14d, %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)
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 0xc9e2
movq 0x80(%rsp), %rax
movq %rax, 0x20(%rsp)
movaps 0x60(%rsp), %xmm0
movaps 0x70(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0xc8b7
movq (%r15), %rdi
leaq 0x3c(%rsp), %rdx
movq %r14, %rsi
callq 0xd3d4
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