// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: g_list_set_i
static s7_pointer g_list_set_i(s7_scheme *sc, s7_pointer args)
                {
                    s7_pointer p, lst, val;
                    s7_int i, index;
                    lst = car(args);
                    if (!is_mutable_pair(lst))
                        return(mutable_method_or_bust(sc, lst, sc->list_set_symbol, args, T_PAIR, 1));

                    index = s7_integer(cadr(args));
                    if ((index < 0) || (index > sc->max_list_length))
                        return(out_of_range(sc, sc->list_set_symbol, small_int(2), wrap_integer1(sc, index), (index < 0) ? its_negative_string : its_too_large_string));

                    for (i = 0, p = lst; (i < index) && is_pair(p); i++, p = cdr(p)) {}
                    if (!is_pair(p))
                    {
                        if (is_null(p))
                            return(out_of_range(sc, sc->list_set_symbol, small_int(2), wrap_integer1(sc, index), its_too_large_string));
                        return(wrong_type_argument_with_type(sc, sc->list_set_symbol, 1, lst, a_proper_list_string));
                    }

                    val = caddr(args);
                    set_car(p, val);
                    return(val);
                }

// Assembly:
pushq %rbx
movq %rsi, %rax
movq 0x8(%rsi), %rcx
movq (%rcx), %rsi
movl %esi, %edx
andl $0x10000ff, %edx        # imm = 0x10000FF
cmpl $0x1, %edx
jne 0x102e1b
movq 0x10(%rax), %rdx
movq 0x8(%rdx), %rax
cmpb $0xb, (%rax)
jne 0x102e34
movq 0x8(%rax), %rax
testq %rax, %rax
js 0x102e91
cmpq 0x2b0(%rdi), %rax
jg 0x102e5a
testq %rax, %rax
je 0x102f51
movq %rax, %rsi
movq %rcx, %r8
cmpb $0x1, (%r8)
jne 0x102e5e
movq 0x10(%r8), %r8
decq %rsi
jne 0x102e07
movb (%r8), %sil
jmp 0x102e43
movq 0x1260(%rdi), %rdx
movq %rcx, %rsi
movq %rax, %rcx
movl $0x1, %r8d
popq %rbx
jmp 0xe7180
xorl %eax, %eax
cmpq $0x0, 0x2b0(%rdi)
js 0x102e5a
movq %rcx, %r8
cmpb $0x1, %sil
jne 0x102e5e
movq 0x10(%rdx), %rax
movq 0x8(%rax), %rbx
movq %rbx, 0x8(%r8)
jmp 0x102f0b
xorl %ecx, %ecx
jmp 0x102e93
movq 0x1260(%rdi), %rdx
movq 0x8(%rdx), %rsi
cmpq 0x110(%rdi), %r8
je 0x102f10
movq 0x43adb(%rip), %rdx     # 0x146958
movq 0x140(%rdi), %r8
movq 0x4fd8d(%rip), %r9      # 0x152c18
popq %rbx
jmp 0xa4e4
movb $0x1, %cl
movq 0x1260(%rdi), %rdx
movq 0x8(%rdx), %rdx
movq 0x43abb(%rip), %rsi     # 0x146960
movq 0x1f00(%rdi), %r8
movq %rax, 0x8(%r8)
movq 0x1ee8(%rdi), %rax
leaq 0x47b8a(%rip), %r8      # 0x14aa48
leaq 0x47b7b(%rip), %r9      # 0x14aa40
testb %cl, %cl
cmovneq %r8, %r9
movq 0x1f00(%rdi), %rcx
movq (%r9), %r8
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rsi, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %r8, 0x8(%rax)
movq 0x1948(%rdi), %rbx
movq 0x1ee8(%rdi), %rdx
movq %rbx, %rsi
callq 0x38dfa
movq %rbx, %rax
popq %rbx
retq
movq 0x43a49(%rip), %rcx     # 0x146960
movq 0x1f00(%rdi), %rdx
movq %rax, 0x8(%rdx)
movq 0x1ee8(%rdi), %rax
movq 0x1f00(%rdi), %rdx
movq 0x47b09(%rip), %r8      # 0x14aa40
movq 0x10(%rax), %rax
movq %rsi, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
jmp 0x102eed
xorl %eax, %eax
jmp 0x102e40