#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 /*<<< orphan*/ printf(char *, ...);
size_t strspn(char const *, char const *);
int main() {
  size_t len;
  const char str1[] = "ABCDEFG02018ABCDEFG02018";
  const char str2[] = "ABCD";
  const char str3[] = "2018";
  const char str4[] = "AB";
  const char str5[] = "AC";
  const char str6[] = "aC";
  len = strspn(str1, str2);
  printf("%d\n", (unsigned int)len);
  len = strspn(str1, str3);
  printf("%d\n", (unsigned int)len);
  len = strspn(str1, str4);
  printf("%d\n", (unsigned int)len);
  len = strspn(str1, str5);
  printf("%d\n", (unsigned int)len);
  len = strspn(str1, str6);
  printf("%d\n", (unsigned int)len);
  char strtext[] = "129th";
  char cset[] = "1234567890";
  len = strspn(strtext, cset);
  printf("The initial number has %d digits.\n", (int)len);
  const char *string = "abcde312$#@";
  const char *low_alpha = "qwertyuiopasdfghjklzxcvbnm";
  len = strspn(string, low_alpha);
  printf("%d\n", (int)len);
  printf("After skipping initial lowercase letters from '%s'\n"
         "The remainder is '%s'\n",
         string, string + len);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec2(%rip),%al
mov    %al,-0x18(%rbp)
mov    0xeba(%rip),%eax
mov    %eax,-0x35(%rbp)
mov    0xeb5(%rip),%al
mov    %al,-0x31(%rbp)
mov    0xead(%rip),%eax
mov    %eax,-0x3a(%rbp)
mov    0xea8(%rip),%al
mov    %al,-0x36(%rbp)
mov    0xe9f(%rip),%ax
mov    %ax,-0x3d(%rbp)
mov    0xe97(%rip),%al
mov    %al,-0x3b(%rbp)
mov    0xe8e(%rip),%ax
mov    %ax,-0x40(%rbp)
mov    0xe86(%rip),%al
mov    %al,-0x3e(%rbp)
mov    0xe7d(%rip),%ax
mov    %ax,-0x43(%rbp)
mov    0xe75(%rip),%al
mov    %al,-0x41(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x35(%rbp),%rsi
call   1040 <strspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x3a(%rbp),%rsi
call   1040 <strspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x3d(%rbp),%rsi
call   1040 <strspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <strspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x43(%rbp),%rsi
call   1040 <strspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xdb8(%rip),%eax
mov    %eax,-0x49(%rbp)
mov    0xdb2(%rip),%ax
mov    %ax,-0x45(%rbp)
mov    0xda9(%rip),%rax
mov    %rax,-0x54(%rbp)
mov    0xda6(%rip),%ax
mov    %ax,-0x4c(%rbp)
mov    0xd9e(%rip),%al
mov    %al,-0x4a(%rbp)
lea    -0x49(%rbp),%rdi
lea    -0x54(%rbp),%rsi
call   1040 <strspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd93(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xd94(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
call   1040 <strspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xd2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x60(%rbp),%rsi
mov    -0x60(%rbp),%rdx
add    -0x10(%rbp),%rdx
lea    0xd73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
lea    0xe9a(%rip),%rsi
lea    0xe98(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str1 = [25 x i8] c"ABCDEFG02018ABCDEFG02018\00"
@__const.main.str2 = [5 x i8] c"ABCD\00"
@__const.main.str3 = [5 x i8] c"2018\00"
@__const.main.str4 = [3 x i8] c"AB\00"
@__const.main.str5 = [3 x i8] c"AC\00"
@__const.main.str6 = [3 x i8] c"aC\00"
@.str = [4 x i8] c"%d\0A\00"
@__const.main.strtext = [6 x i8] c"129th\00"
@__const.main.cset = [11 x i8] c"1234567890\00"
@.str.1 = [35 x i8] c"The initial number has %d digits.\0A\00"
@.str.2 = [12 x i8] c"abcde312$#@\00"
@.str.3 = [27 x i8] c"qwertyuiopasdfghjklzxcvbnm\00"
@.str.4 = [74 x i8] c"After skipping initial lowercase letters from '%s'\0AThe remainder is '%s'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca [25 x i8]
%4 = alloca [5 x i8]
%5 = alloca [5 x i8]
%6 = alloca [3 x i8]
%7 = alloca [3 x i8]
%8 = alloca [3 x i8]
%9 = alloca [6 x i8]
%10 = alloca [11 x i8]
%11 = alloca i8*
%12 = alloca i8*
store i32 0, i32* %1
%13 = bitcast [25 x i8]* %3 to i8*
%14 = bitcast [5 x i8]* %4 to i8*
%15 = bitcast [5 x i8]* %5 to i8*
%16 = bitcast [3 x i8]* %6 to i8*
%17 = bitcast [3 x i8]* %7 to i8*
%18 = bitcast [3 x i8]* %8 to i8*
%19 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%20 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%21 = call i64 @strspn(i8* %19, i8* %20)
store i64 %21, i64* %2
%22 = load i64, i64* %2
%23 = trunc i64 %22 to i32
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%26 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%27 = call i64 @strspn(i8* %25, i8* %26)
store i64 %27, i64* %2
%28 = load i64, i64* %2
%29 = trunc i64 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%32 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%33 = call i64 @strspn(i8* %31, i8* %32)
store i64 %33, i64* %2
%34 = load i64, i64* %2
%35 = trunc i64 %34 to i32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%38 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%39 = call i64 @strspn(i8* %37, i8* %38)
store i64 %39, i64* %2
%40 = load i64, i64* %2
%41 = trunc i64 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%44 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 0
%45 = call i64 @strspn(i8* %43, i8* %44)
store i64 %45, i64* %2
%46 = load i64, i64* %2
%47 = trunc i64 %46 to i32
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %47)
%49 = bitcast [6 x i8]* %9 to i8*
%50 = bitcast [11 x i8]* %10 to i8*
%51 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%52 = getelementptr inbounds [11 x i8], [11 x i8]* %10, i64 0, i64 0
%53 = call i64 @strspn(i8* %51, i8* %52)
store i64 %53, i64* %2
%54 = load i64, i64* %2
%55 = trunc i64 %54 to i32
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %55)
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8** %11
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8** %12
%57 = load i8*, i8** %11
%58 = load i8*, i8** %12
%59 = call i64 @strspn(i8* %57, i8* %58)
store i64 %59, i64* %2
%60 = load i64, i64* %2
%61 = trunc i64 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %61)
%63 = load i8*, i8** %11
%64 = load i8*, i8** %11
%65 = load i64, i64* %2
%66 = getelementptr inbounds i8, i8* %64, i64 %65
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.4, i64 0, i64 0), i8* %63, i8* %66)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [35 x i8] c"The initial number has %d digits.\0A\00"
@.str.2 = [12 x i8] c"abcde312$#@\00"
@.str.4 = [74 x i8] c"After skipping initial lowercase letters from '%s'\0AThe remainder is '%s'\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 3)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 5))
ret i32 0
}