#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 test_memchr();
int test_memcmp();
int test_memcpy();
int test_memmove();
int test_strcat();
int test_strchr();
int test_strcspn();
int test_strncat();
int test_strncpy();
int test_strpbrk();
int test_strrchr();
int test_strstr();
int test_string(void) {
  return 0 + test_memchr() + test_memcmp() + test_memcpy() + test_memmove() +
         test_strncpy() + test_strcat() + test_strncat() + test_strchr() +
         test_strrchr() + test_strstr() + test_strpbrk() + test_strcspn();
}


x86 assembly (clang, -O0):
<test_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1090 <test_memchr@plt>
add    $0x0,%eax
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   10d0 <test_memcmp@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <test_memcpy@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1080 <test_memmove@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <test_strncpy@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1060 <test_strcat@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   10a0 <test_strncat@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   10c0 <test_strchr@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1070 <test_strrchr@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <test_strstr@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   10b0 <test_strpbrk@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   10e0 <test_strcspn@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_string>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1090 <test_memchr@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10d0 <test_memcmp@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1050 <test_memcpy@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1080 <test_memmove@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1040 <test_strncpy@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1060 <test_strcat@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   10a0 <test_strncat@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   10c0 <test_strchr@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1070 <test_strrchr@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1030 <test_strstr@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   10b0 <test_strpbrk@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   10e0 <test_strcspn@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @test_string() {
%1 = call i32 (...) @test_memchr()
%2 = add nsw i32 0, %1
%3 = call i32 (...) @test_memcmp()
%4 = add nsw i32 %2, %3
%5 = call i32 (...) @test_memcpy()
%6 = add nsw i32 %4, %5
%7 = call i32 (...) @test_memmove()
%8 = add nsw i32 %6, %7
%9 = call i32 (...) @test_strncpy()
%10 = add nsw i32 %8, %9
%11 = call i32 (...) @test_strcat()
%12 = add nsw i32 %10, %11
%13 = call i32 (...) @test_strncat()
%14 = add nsw i32 %12, %13
%15 = call i32 (...) @test_strchr()
%16 = add nsw i32 %14, %15
%17 = call i32 (...) @test_strrchr()
%18 = add nsw i32 %16, %17
%19 = call i32 (...) @test_strstr()
%20 = add nsw i32 %18, %19
%21 = call i32 (...) @test_strpbrk()
%22 = add nsw i32 %20, %21
%23 = call i32 (...) @test_strcspn()
%24 = add nsw i32 %22, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @test_string() {
%1 = tail call i32 (...) @test_memchr()
%2 = tail call i32 (...) @test_memcmp()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @test_memcpy()
%5 = add nsw i32 %3, %4
%6 = tail call i32 (...) @test_memmove()
%7 = add nsw i32 %5, %6
%8 = tail call i32 (...) @test_strncpy()
%9 = add nsw i32 %7, %8
%10 = tail call i32 (...) @test_strcat()
%11 = add nsw i32 %9, %10
%12 = tail call i32 (...) @test_strncat()
%13 = add nsw i32 %11, %12
%14 = tail call i32 (...) @test_strchr()
%15 = add nsw i32 %13, %14
%16 = tail call i32 (...) @test_strrchr()
%17 = add nsw i32 %15, %16
%18 = tail call i32 (...) @test_strstr()
%19 = add nsw i32 %17, %18
%20 = tail call i32 (...) @test_strpbrk()
%21 = add nsw i32 %19, %20
%22 = tail call i32 (...) @test_strcspn()
%23 = add nsw i32 %21, %22
ret i32 %23
}