#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 *, char *, char const *, char *, char const *,
                          char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strspn(char const *, char const *);
int main(void) {
  const char *string1 = "The value is 3.14159";
  const char *string2 = "aehi lsTuv";
  printf(
      "%s%s\n%s%s\n\n%s\n%s%u\n", "string1 = ", string1, "string2 = ", string2,
      "The length of the initial segment of string1",
      "containing only characters from string2 = ", strspn(string1, string2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xed4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strspn@plt>
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%r8
lea    0xeaf(%rip),%rdi
lea    0xebc(%rip),%rsi
lea    0xf0d(%rip),%rcx
lea    0xeb9(%rip),%r9
lea    0xedf(%rip),%r10
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf54(%rip),%rax
lea    0xf01(%rip),%rdi
lea    0xf0e(%rip),%rsi
lea    0xed3(%rip),%rdx
lea    0xf58(%rip),%rcx
lea    0xeda(%rip),%r8
lea    0xefd(%rip),%r9
push   $0xd
push   %rax
call   1030 <printf@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"The value is 3.14159\00"
@.str.1 = [11 x i8] c"aehi lsTuv\00"
@.str.2 = [20 x i8] c"%s%s\0A%s%s\0A\0A%s\0A%s%u\0A\00"
@.str.3 = [11 x i8] c"string1 = \00"
@.str.4 = [11 x i8] c"string2 = \00"
@.str.5 = [45 x i8] c"The length of the initial segment of string1\00"
@.str.6 = [43 x i8] c"containing only characters from string2 = \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i32 @strspn(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"The value is 3.14159\00"
@.str.1 = [11 x i8] c"aehi lsTuv\00"
@.str.2 = [20 x i8] c"%s%s\0A%s%s\0A\0A%s\0A%s%u\0A\00"
@.str.3 = [11 x i8] c"string1 = \00"
@.str.4 = [11 x i8] c"string2 = \00"
@.str.5 = [45 x i8] c"The length of the initial segment of string1\00"
@.str.6 = [43 x i8] c"containing only characters from string2 = \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i32 13)
ret i32 0
}