// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: g_make_string
static s7_pointer g_make_string(s7_scheme *sc, s7_pointer args)
    {
#define H_make_string "(make-string len (val #\\space)) makes a string of length len filled with the character val (default: space)"
#define Q_make_string s7_make_signature(sc, 3, sc->is_string_symbol, sc->is_integer_symbol, sc->is_char_symbol)

        s7_pointer n;
        s7_int len;

        n = car(args);
        if (!s7_is_integer(n))
        {
            check_method(sc, n, sc->make_string_symbol, args);
            return(wrong_type_argument(sc, sc->make_string_symbol, 1, n, T_INTEGER));
        }

        len = s7_integer(n);
#if WITH_GMP
        if ((len == 0) && (!s7_is_zero(n)))
            return(s7_out_of_range_error(sc, "make-string", 1, n, "big integer is too big for s7_int"));
#endif
        if ((len < 0) || (len > sc->max_string_length))
            return(out_of_range(sc, sc->make_string_symbol, small_int(1), n, (len < 0) ? its_negative_string : its_too_large_string));

        if (is_not_null(cdr(args)))
        {
            char fill;
            if (!s7_is_character(cadr(args)))
                return(method_or_bust(sc, cadr(args), sc->make_string_symbol, args, T_CHARACTER, 2));
            fill = s7_character(cadr(args));
            n = make_empty_string(sc, len, fill);
            if ((fill == '\0') && (len > 0))
                memclr((void *)string_value(n), (size_t)len);
            return(n);
        }
        return(make_empty_string(sc, len, '\0')); /* #\null here means "don't fill/clear" */
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r12
cmpb $0xb, (%r12)
jne 0x70913
movq 0x8(%r12), %r15
testq %r15, %r15
js 0x70897
cmpq 0x2a8(%rbx), %r15
jle 0x70a7a
testq %r15, %r15
movq 0x1310(%rbx), %rax
movq 0x8(%rax), %rax
movq 0xd60ac(%rip), %rcx     # 0x146958
leaq 0xda195(%rip), %rdx     # 0x14aa48
leaq 0xda186(%rip), %rsi     # 0x14aa40
cmovsq %rdx, %rsi
movq (%rsi), %rdx
movq 0x1ee8(%rbx), %rsi
movq 0x10(%rsi), %rsi
movq %rax, 0x8(%rsi)
movq 0x10(%rsi), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %r12, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
movq 0x1948(%rbx), %r14
movq 0x1ee8(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x38dfa
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x40, 0x3(%r12)
je 0x70a41
cmpb $0x1, 0x24c(%rbx)
jne 0x70a41
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8a63
movq 0x1310(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x89ff
cmpq 0x128(%rbx), %rax
je 0x70a41
cmpb $0x1, (%r14)
jne 0x70b46
movq %rax, (%rsp)
movq %r14, 0x4c8(%rbx)
movq 0x8(%r14), %r13
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %rbp
cmpq 0x98(%rbx), %rax
ja 0x70995
movq %rbx, %rdi
callq 0xa550
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r12
movq $0x200001, (%r12)       # imm = 0x200001
movq %r13, 0x8(%r12)
movq %rbp, 0x10(%r12)
movq %r12, 0x4e8(%rbx)
movq 0x10(%r14), %r14
cmpb $0x1, (%r14)
jne 0x70a23
movq %r12, %r13
movq 0x8(%r14), %rbp
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r15
cmpq 0x98(%rbx), %rax
ja 0x709f4
movq %rbx, %rdi
callq 0xa550
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %rbp, 0x8(%rax)
movq %r15, 0x10(%rax)
movq %rax, 0x10(%r13)
movq 0x10(%r14), %r14
cmpb $0x1, (%r14)
movq %rax, %r13
je 0x709ca
movq 0x110(%rbx), %rax
movq %rax, 0x4e8(%rbx)
movq %rax, 0x4c8(%rbx)
movq (%rsp), %rax
jmp 0x70b4d
movq 0x1310(%rbx), %rax
movq 0x8(%rax), %rsi
movq 0xd5f05(%rip), %rdx     # 0x146958
movq 0x140(%rbx), %r8
movq 0xda057(%rip), %r9      # 0x14aab8
movq %rbx, %rdi
movq %r12, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa4e4
movq 0x10(%r14), %rax
cmpq 0x110(%rbx), %rax
je 0x70aff
movq 0x8(%rax), %rsi
cmpb $0x8, (%rsi)
jne 0x70b1a
movb 0x8(%rsi), %bpl
movsbl %bpl, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xeab0
movq %rax, %r14
testq %r15, %r15
je 0x70901
testb %bpl, %bpl
jne 0x70901
movq 0x10(%r14), %rbx
cmpq $0x8, %r15
jb 0x70aed
movabsq $0x7ffffffffffffff8, %r12 # imm = 0x7FFFFFFFFFFFFFF8
andq %r15, %r12
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x8270
andq $0x7, %r15
je 0x70901
addq %r12, %rbx
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x8270
jmp 0x70901
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xeab0
movq 0x1310(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rcx
movl $0x8, %r8d
movl $0x2, %r9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe42d
movq 0x110(%rbx), %r12
movq %rbx, %rdi
movq %rax, %rsi
movq %r12, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xaee6