// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xb8, %rsp
movq %rdi, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rdi
callq 0x11340
testb $0x1, %al
jne 0x8b646
movq 0x98(%rsp), %rax
movq (%rax), %rax
andq $0x40000000, %rax       # imm = 0x40000000
cmpq $0x0, %rax
je 0x8b515
movq 0xa8(%rsp), %rax
testb $0x1, 0x24c(%rax)
je 0x8b515
movq 0xa8(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xa8(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x9a10
movq 0x58(%rsp), %rdi
movq %rax, %rsi
movq 0xa8(%rsp), %rax
movq 0x1310(%rax), %rdx
callq 0x98d0
movq %rax, 0x88(%rsp)
movq 0xa8(%rsp), %rcx
cmpq 0x128(%rcx), %rax
je 0x8b515
movq 0xa8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0xa8(%rsp), %rdi
movq 0xa0(%rsp), %rsi
callq 0x44270
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq %rax, %rdx
callq 0xda50
movq %rax, 0xb0(%rsp)
jmp 0x8b832
movq 0xa8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xa8(%rsp), %rax
movq 0x1310(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movq $0x1, 0x80(%rsp)
movq 0x80(%rsp), %rax
andq $-0x800, %rax           # imm = 0xF800
cmpq $0x0, %rax
jne 0x8b577
movq 0x80(%rsp), %rcx
leaq 0x18af17(%rip), %rax    # 0x216480
movq (%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
jmp 0x8b5fd
jmp 0x8b579
movq 0xa8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x8b5a6
movq 0xa8(%rsp), %rdi
callq 0xc670
movq 0xa8(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq $0xb, (%rax)
movq 0x80(%rsp), %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x70(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rdx
movq 0x98(%rsp), %rcx
movq 0xa8(%rsp), %rax
movq 0x140(%rax), %r8
movq 0x18efb4(%rip), %r9     # 0x21a5e8
callq 0xc560
movq %rax, 0xb0(%rsp)
jmp 0x8b832
movq 0x98(%rsp), %rdi
callq 0x10790
movq %rax, 0x90(%rsp)
cmpq $0x0, 0x90(%rsp)
jl 0x8b683
movq 0x90(%rsp), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x2a8(%rcx), %rax
jle 0x8b711
movq 0xa8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xa8(%rsp), %rax
movq 0x1310(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18add9(%rip), %rax    # 0x216488
movq %rax, 0x20(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x90(%rsp)
jge 0x8b6da
movq 0x18eea5(%rip), %rax    # 0x21a578
movq %rax, 0x8(%rsp)
jmp 0x8b6e6
movq 0x18ee8f(%rip), %rax    # 0x21a570
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %r8
callq 0x13880
movq %rax, 0xb0(%rsp)
jmp 0x8b832
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x110(%rcx), %rax
je 0x8b813
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x14430
testb $0x1, %al
jne 0x8b798
movq 0xa8(%rsp), %rdi
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movq 0xa8(%rsp), %rax
movq 0x1310(%rax), %rdx
movq 0xa0(%rsp), %rcx
movl $0x8, %r8d
movl $0x2, %r9d
callq 0x13c50
movq %rax, 0xb0(%rsp)
jmp 0x8b832
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x14450
movb %al, 0x67(%rsp)
movq 0xa8(%rsp), %rdi
movq 0x90(%rsp), %rsi
movsbl 0x67(%rsp), %edx
callq 0x146a0
movq %rax, 0x98(%rsp)
movsbl 0x67(%rsp), %eax
cmpl $0x0, %eax
jne 0x8b801
cmpq $0x0, 0x90(%rsp)
jle 0x8b801
movq 0x98(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x90(%rsp), %rsi
callq 0xd2340
movq 0x98(%rsp), %rax
movq %rax, 0xb0(%rsp)
jmp 0x8b832
movq 0xa8(%rsp), %rdi
movq 0x90(%rsp), %rsi
xorl %edx, %edx
callq 0x146a0
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
addq $0xb8, %rsp
retq
nopw %cs:(%rax,%rax)