#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int scann(char *, char *, char, int *);
int Mscann(int nargs, int *args) {
  char *from = (char *)args[0];
  char *to = (char *)args[1];
  char c = args[2];
  int *starN = (int *)args[3];
  int n = *starN;
  int offset = scann(from, to, c, &n);
  *starN = n;
  return offset;
}


x86 assembly (clang, -O0):
<Mscann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq 0x4(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %al,-0x21(%rbp)
mov    -0x10(%rbp),%rax
movslq 0xc(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x34(%rbp),%rcx
movsbl -0x21(%rbp),%edx
call   1030 <scann@plt>
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mscann>:
push   %rbx
sub    $0x10,%rsp
movslq (%rsi),%rdi
movslq 0x4(%rsi),%rax
movsbl 0x8(%rsi),%edx
movslq 0xc(%rsi),%rbx
mov    (%rbx),%ecx
mov    %ecx,0xc(%rsp)
lea    0xc(%rsp),%rcx
mov    %rax,%rsi
call   1030 <scann@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Mscann(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %5
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %6
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = trunc i32 %23 to i8
store i8 %24, i8* %7
%25 = load i32*, i32** %4
%26 = getelementptr inbounds i32, i32* %25, i64 3
%27 = load i32, i32* %26
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i32*
store i32* %29, i32** %8
%30 = load i32*, i32** %8
%31 = load i32, i32* %30
store i32 %31, i32* %9
%32 = load i8*, i8** %5
%33 = load i8*, i8** %6
%34 = load i8, i8* %7
%35 = call i32 @scann(i8* %32, i8* %33, i8 signext %34, i32* %9)
store i32 %35, i32* %10
%36 = load i32, i32* %9
%37 = load i32*, i32** %8
store i32 %36, i32* %37
%38 = load i32, i32* %10
ret i32 %38
}

LLVM IR (-O2):
define i32 @Mscann(i32 %0, i32* nocapture %1) {
%3 = alloca i32
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = getelementptr inbounds i32, i32* %1, i64 1
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = getelementptr inbounds i32, i32* %1, i64 2
%12 = load i32, i32* %11
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds i32, i32* %1, i64 3
%15 = load i32, i32* %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = bitcast i32* %3 to i8*
%19 = load i32, i32* %17
store i32 %19, i32* %3
%20 = call i32 @scann(i8* %6, i8* %10, i8 signext %13, i32* %3)
%21 = load i32, i32* %3
store i32 %21, i32* %17
ret i32 %20
}