// File: /workspace/github_c_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq %rdi, %rbx
movq 0x8(%rsi), %r14
cmpb $0x13, (%r14)
jne 0x75f3c
movq 0x10(%rcx), %rax
movq 0x8(%rax), %r15
cmpb $0x13, (%r15)
jne 0x75f57
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
jne 0x75f80
movq 0x8(%rax), %rax
cmpb $0xb, (%rax)
jne 0x75f85
movq 0x8(%rax), %r12
testq %r12, %r12
js 0x75faa
movb $0x1, %cl
jmp 0x75fd7
movq 0x1540(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x13, %r8d
movl $0x1, %r9d
jmp 0x75f70
movq 0x1540(%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x13, %r8d
movl $0x2, %r9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf1ae
xorl %r12d, %r12d
jmp 0x75fdb
movq 0x1540(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
movl $0xb, %r8d
movl $0x3, %r9d
callq 0xf1ae
xorl %ecx, %ecx
xorl %r12d, %r12d
jmp 0x75fd7
movq 0x1540(%rbx), %rcx
movq 0x8(%rcx), %rsi
movq 0xd89ac(%rip), %rdx     # 0x14e968
movq 0x140(%rbx), %r8
movq 0xe4c0e(%rip), %r9      # 0x15abd8
movq %rbx, %rdi
movq %rax, %rcx
callq 0xb31d
xorl %ecx, %ecx
testb %cl, %cl
je 0x76023
cmpq $0x0, 0x8(%r14)
je 0x7601c
cmpq 0x8(%r15), %r12
jge 0x7601c
movq 0x10(%r15), %r15
movq 0x10(%r14), %rsi
addq %r15, %r12
movq %r12, %rdi
callq 0x9700
testq %rax, %rax
je 0x7601c
movq %rax, %r14
subq %r15, %r14
cmpq $0x7ff, %r14            # imm = 0x7FF
ja 0x7602f
leaq 0xd893a(%rip), %rax     # 0x14e950
movq (%rax,%r14,8), %rax
jmp 0x76023
movq 0x120(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x76047
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0xb, (%rax)
movq %r14, 0x8(%rax)
jmp 0x76023