// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_string_set
static s7_pointer g_string_set(s7_scheme *sc, s7_pointer args)
    {
#define H_string_set "(string-set! str index chr) sets the index-th element of the string str to the character chr"
#define Q_string_set s7_make_signature(sc, 4, sc->is_char_symbol, sc->is_string_symbol, sc->is_integer_symbol, sc->is_char_symbol)

        s7_pointer strng, c, index;
        char *str;
        s7_int ind;

        strng = car(args);
        if (!is_mutable_string(strng))
            return(mutable_method_or_bust(sc, strng, sc->string_set_symbol, args, T_STRING, 1));

        index = cadr(args);
        if (!s7_is_integer(index))
            return(method_or_bust(sc, index, sc->string_set_symbol, args, T_INTEGER, 2));
        ind = s7_integer(index);
        if (ind < 0)
            return(wrong_type_argument_with_type(sc, sc->string_set_symbol, 2, index, a_non_negative_integer_string));
        if (ind >= string_length(strng))
            return(out_of_range(sc, sc->string_set_symbol, small_int(2), index, its_too_large_string));

        str = string_value(strng);
        c = caddr(args);
        if (!s7_is_character(c))
            return(method_or_bust(sc, c, sc->string_set_symbol, args, T_CHARACTER, 3));

        str[ind] = (char)s7_character(c);
        return(c);
    }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rax
andq $0x10000ff, %rax        # imm = 0x10000FF
cmpq $0x13, %rax
je 0x8b946
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x68(%rsp), %rax
movq 0x1550(%rax), %rdx
movq 0x60(%rsp), %rcx
movl $0x13, %r8d
movl $0x1, %r9d
callq 0x192ea0
movq %rax, 0x70(%rsp)
jmp 0x8bb8a
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
callq 0x11340
testb $0x1, %al
jne 0x8b99c
movq 0x68(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x68(%rsp), %rax
movq 0x1550(%rax), %rdx
movq 0x60(%rsp), %rcx
movl $0xb, %r8d
movl $0x2, %r9d
callq 0x13c50
movq %rax, 0x70(%rsp)
jmp 0x8bb8a
movq 0x48(%rsp), %rdi
callq 0x10790
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jge 0x8babb
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rax
movq 0x1550(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq $0x2, 0x30(%rsp)
movq 0x30(%rsp), %rax
andq $-0x800, %rax           # imm = 0xF800
cmpq $0x0, %rax
jne 0x8ba06
movq 0x30(%rsp), %rcx
leaq 0x18aa84(%rip), %rax    # 0x216480
movq (%rax,%rcx,8), %rax
movq %rax, (%rsp)
jmp 0x8ba7c
jmp 0x8ba08
movq 0x68(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x68(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x8ba2c
movq 0x68(%rsp), %rdi
callq 0xc670
movq 0x68(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq $0xb, (%rax)
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq (%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x68(%rsp), %rax
movq 0x140(%rax), %r8
movq 0x196c7c(%rip), %r9     # 0x222728
callq 0xc560
movq %rax, 0x70(%rsp)
jmp 0x8bb8a
movq 0x38(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jl 0x8bb02
movq 0x68(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x1550(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x18a9a9(%rip), %rdx    # 0x216490
movq 0x48(%rsp), %rcx
movq 0x18ea7d(%rip), %r8     # 0x21a570
callq 0x13880
movq %rax, 0x70(%rsp)
jmp 0x8bb8a
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0x14430
testb $0x1, %al
jne 0x8bb67
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x68(%rsp), %rax
movq 0x1550(%rax), %rdx
movq 0x60(%rsp), %rcx
movl $0x8, %r8d
movl $0x3, %r9d
callq 0x13c50
movq %rax, 0x70(%rsp)
jmp 0x8bb8a
movq 0x50(%rsp), %rdi
callq 0x14450
movb %al, %dl
movq 0x40(%rsp), %rax
movq 0x38(%rsp), %rcx
movb %dl, (%rax,%rcx)
movq 0x50(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)