// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_string_position
static s7_pointer g_string_position(s7_scheme *sc, s7_pointer args)
    {
#define H_string_position "(string-position str1 str2 (start 0)) returns the starting position of str1 in str2 or #f"
#define Q_string_position s7_make_signature(sc, 4, s7_make_signature(sc, 2, sc->is_integer_symbol, sc->not_symbol), sc->is_string_symbol, sc->is_string_symbol, sc->is_integer_symbol)
        const char *s1, *s2, *p2;
        s7_int start = 0;
        s7_pointer s1p, s2p;

        s1p = car(args);
        if (!is_string(s1p))
            return(method_or_bust(sc, s1p, sc->string_position_symbol, args, T_STRING, 1));

        s2p = cadr(args);
        if (!is_string(s2p))
            return(method_or_bust(sc, s2p, sc->string_position_symbol, args, T_STRING, 2));

        if (is_pair(cddr(args)))
        {
            s7_pointer arg3;
            arg3 = caddr(args);
            if (!s7_is_integer(arg3))
                return(method_or_bust(sc, arg3, sc->string_position_symbol, args, T_INTEGER, 3));
            start = s7_integer(arg3);
            if (start < 0)
                return(wrong_type_argument_with_type(sc, sc->string_position_symbol, 3, caddr(args), a_non_negative_integer_string));
        }

        if (string_length(s1p) == 0)
            return(sc->F);
        s1 = string_value(s1p);
        s2 = string_value(s2p);
        if (start >= string_length(s2p))
            return(sc->F);

        p2 = strstr((const char *)(s2 + start), s1);
        if (!p2) return(sc->F);
        return(make_integer(sc, p2 - s2));
    }

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movq $0x0, 0x80(%rsp)
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x13, %eax
je 0x8b003
movq 0xa8(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0xa8(%rsp), %rax
movq 0x1540(%rax), %rdx
movq 0xa0(%rsp), %rcx
movl $0x13, %r8d
movl $0x1, %r9d
callq 0x13c50
movq %rax, 0xb0(%rsp)
jmp 0x8b3e2
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x13, %eax
je 0x8b067
movq 0xa8(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0xa8(%rsp), %rax
movq 0x1540(%rax), %rdx
movq 0xa0(%rsp), %rcx
movl $0x13, %r8d
movl $0x2, %r9d
callq 0x13c50
movq %rax, 0xb0(%rsp)
jmp 0x8b3e2
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x8b240
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
callq 0x11340
testb $0x1, %al
jne 0x8b0ec
movq 0xa8(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0xa8(%rsp), %rax
movq 0x1540(%rax), %rdx
movq 0xa0(%rsp), %rcx
movl $0xb, %r8d
movl $0x3, %r9d
callq 0x13c50
movq %rax, 0xb0(%rsp)
jmp 0x8b3e2
movq 0x68(%rsp), %rdi
callq 0x10790
movq %rax, 0x80(%rsp)
cmpq $0x0, 0x80(%rsp)
jge 0x8b23e
movq 0xa8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xa8(%rsp), %rax
movq 0x1540(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movq $0x3, 0x60(%rsp)
movq 0x60(%rsp), %rax
andq $-0x800, %rax           # imm = 0xF800
cmpq $0x0, %rax
jne 0x8b166
movq 0x60(%rsp), %rcx
leaq 0x18b328(%rip), %rax    # 0x216480
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
jmp 0x8b1e9
jmp 0x8b168
movq 0xa8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x8b195
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, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq $0xb, (%rax)
movq 0x60(%rsp), %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdx
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
movq 0xa8(%rsp), %rax
movq 0x140(%rax), %r8
movq 0x1974fc(%rip), %r9     # 0x222728
callq 0xc560
movq %rax, 0xb0(%rsp)
jmp 0x8b3e2
jmp 0x8b240
movq 0x78(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x8b268
movq 0xa8(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0xb0(%rsp)
jmp 0x8b3e2
movq 0x78(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x98(%rsp)
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x90(%rsp)
movq 0x80(%rsp), %rax
movq 0x70(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jl 0x8b2b9
movq 0xa8(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0xb0(%rsp)
jmp 0x8b3e2
movq 0x90(%rsp), %rdi
addq 0x80(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x9700
movq %rax, 0x88(%rsp)
cmpq $0x0, 0x88(%rsp)
jne 0x8b305
movq 0xa8(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0xb0(%rsp)
jmp 0x8b3e2
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
andq $-0x800, %rax           # imm = 0xF800
cmpq $0x0, %rax
jne 0x8b348
movq 0x40(%rsp), %rcx
leaq 0x18b146(%rip), %rax    # 0x216480
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
jmp 0x8b3cb
jmp 0x8b34a
movq 0xa8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x8b377
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, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq $0xb, (%rax)
movq 0x40(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
addq $0xb8, %rsp
retq
nopw %cs:(%rax,%rax)