void f(void *d, const void *s, long unsigned int n) {
  void *t1 = __builtin_memcpy(d, s, n);
  if (t1 == 0)
    __builtin_abort();
  void *t2 = __builtin_memmove(d, s, n);
  if (t2 == 0)
    __builtin_abort();
  void *t3 = __builtin_memset(d, 0, n);
  if (t3 == 0)
    __builtin_abort();
  void *t4 = __builtin_strcpy(d, s);
  if (t4 == 0)
    __builtin_abort();
  void *t5 = __builtin_strncpy(d, s, n);
  if (t5 == 0)
    __builtin_abort();
  void *t6 = __builtin_strcat(d, s);
  if (t6 == 0)
    __builtin_abort();
  void *t7 = __builtin_strncat(d, s, n);
  if (t7 == 0)
    __builtin_abort();
  void *t8 = __builtin_stpcpy(d, s);
  if (t8 == 0)
    __builtin_abort();
  void *t9 = __builtin_stpncpy(d, s, n);
  if (t9 == 0)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x68(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1090 <memcpy@plt>
mov    -0x68(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11e4 <f+0x44>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x70(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   10b0 <memmove@plt>
mov    -0x70(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1211 <f+0x71>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x78(%rbp)
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x78(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    123c <f+0x9c>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcpy@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    125d <f+0xbd>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <strncpy@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1282 <f+0xe2>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10c0 <strcat@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    12a3 <f+0x103>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1080 <strncat@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    12c8 <f+0x128>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <stpcpy@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    12e9 <f+0x149>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   10a0 <stpncpy@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    130e <f+0x16e>
call   1030 <abort@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1090 <memcpy@plt>
test   %rbx,%rbx
je     1210 <f+0x80>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1070 <memset@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <strncpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   10b0 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1080 <strncat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <stpcpy@plt>
test   %rax,%rax
je     1210 <f+0x80>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   10a0 <stpncpy@plt>
test   %rax,%rax
je     1210 <f+0x80>
pop    %rbx
pop    %r14
pop    %r15
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%16 = load i8*, i8** %4
%17 = load i8*, i8** %5
%18 = load i64, i64* %6
store i8* %16, i8** %7
%19 = load i8*, i8** %7
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %22
21: ; preds = %3
unreachable
22: ; preds = %3
%23 = load i8*, i8** %4
%24 = load i8*, i8** %5
%25 = load i64, i64* %6
store i8* %23, i8** %8
%26 = load i8*, i8** %8
%27 = icmp eq i8* %26, null
br i1 %27, label %28, label %29
28: ; preds = %22
unreachable
29: ; preds = %22
%30 = load i8*, i8** %4
%31 = load i64, i64* %6
store i8* %30, i8** %9
%32 = load i8*, i8** %9
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %35
34: ; preds = %29
unreachable
35: ; preds = %29
%36 = load i8*, i8** %4
%37 = load i8*, i8** %5
%38 = call i8* @strcpy(i8* %36, i8* %37)
store i8* %38, i8** %10
%39 = load i8*, i8** %10
%40 = icmp eq i8* %39, null
br i1 %40, label %41, label %42
41: ; preds = %35
unreachable
42: ; preds = %35
%43 = load i8*, i8** %4
%44 = load i8*, i8** %5
%45 = load i64, i64* %6
%46 = call i8* @strncpy(i8* %43, i8* %44, i64 %45)
store i8* %46, i8** %11
%47 = load i8*, i8** %11
%48 = icmp eq i8* %47, null
br i1 %48, label %49, label %50
49: ; preds = %42
unreachable
50: ; preds = %42
%51 = load i8*, i8** %4
%52 = load i8*, i8** %5
%53 = call i8* @strcat(i8* %51, i8* %52)
store i8* %53, i8** %12
%54 = load i8*, i8** %12
%55 = icmp eq i8* %54, null
br i1 %55, label %56, label %57
56: ; preds = %50
unreachable
57: ; preds = %50
%58 = load i8*, i8** %4
%59 = load i8*, i8** %5
%60 = load i64, i64* %6
%61 = call i8* @strncat(i8* %58, i8* %59, i64 %60)
store i8* %61, i8** %13
%62 = load i8*, i8** %13
%63 = icmp eq i8* %62, null
br i1 %63, label %64, label %65
64: ; preds = %57
unreachable
65: ; preds = %57
%66 = load i8*, i8** %4
%67 = load i8*, i8** %5
%68 = call i8* @stpcpy(i8* %66, i8* %67)
store i8* %68, i8** %14
%69 = load i8*, i8** %14
%70 = icmp eq i8* %69, null
br i1 %70, label %71, label %72
71: ; preds = %65
unreachable
72: ; preds = %65
%73 = load i8*, i8** %4
%74 = load i8*, i8** %5
%75 = load i64, i64* %6
%76 = call i8* @stpncpy(i8* %73, i8* %74, i64 %75)
store i8* %76, i8** %15
%77 = load i8*, i8** %15
%78 = icmp eq i8* %77, null
br i1 %78, label %79, label %80
79: ; preds = %72
unreachable
80: ; preds = %72
ret void
}

LLVM IR (-O2):
define void @f(i8* %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @abort()
unreachable
6: ; preds = %3
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %2, i1 false)
%7 = tail call i8* @strcpy(i8* %0, i8* dereferenceable(1) %1)
%8 = tail call i8* @strncpy(i8* %0, i8* %1, i64 %2)
%9 = tail call i8* @strcat(i8* %0, i8* dereferenceable(1) %1)
%10 = tail call i8* @strncat(i8* %0, i8* %1, i64 %2)
%11 = tail call i8* @stpcpy(i8* %0, i8* %1)
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %6
tail call void @abort()
unreachable
14: ; preds = %6
%15 = tail call i8* @stpncpy(i8* %0, i8* %1, i64 %2)
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %18
17: ; preds = %14
tail call void @abort()
unreachable
18: ; preds = %14
ret void
}