#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 */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *no_prefix(const char *s) {
  static char buffer[1024];
  static char *p = buffer;
  char *cp = p;
  int size = 3 + strlen(s) + 1;
  if (p + size >= buffer + sizeof(buffer))
    abort();
  cp[0] = 'n', cp[1] = 'o', cp[2] = '-';
  strcpy(cp + 3, s);
  p += size;
  return cp;
}


x86 assembly (clang, -O0):
<no_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ef5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x3,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    0x2ed8(%rip),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
lea    0x2ee2(%rip),%rcx
add    $0x400,%rcx
cmp    %rcx,%rax
jb     1185 <no_prefix+0x55>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
movb   $0x6e,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x6f,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x2d,0x2(%rax)
mov    -0x10(%rbp),%rdi
add    $0x3,%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x14(%rbp),%ecx
mov    0x2e81(%rip),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,0x2e74(%rip)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_prefix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2ef9(%rip),%r15
call   1050 <strlen@plt>
movslq %eax,%rbx
add    $0x4,%rbx
mov    0x2ee6(%rip),%rax
add    %rbx,%rax
lea    0x32f4(%rip),%rcx
cmp    %rcx,%rax
jae    1188 <no_prefix+0x58>
movw   $0x6f6e,(%r15)
movb   $0x2d,0x2(%r15)
lea    0x3(%r15),%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
add    %rbx,0x2eb9(%rip)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@no_prefix.buffer = internal global [1024 x i8] zeroinitializer
@no_prefix.p = internal global i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @no_prefix.buffer, i32 0, i32 0)
define i8* @no_prefix(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** @no_prefix.p
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 3, %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
%10 = load i8*, i8** @no_prefix.p
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = icmp uge i8* %13, getelementptr inbounds ([1024 x i8], [1024 x i8]* @no_prefix.buffer, i64 1, i64 0)
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %1
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 0
store i8 110, i8* %19
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8 111, i8* %21
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8 45, i8* %23
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8*, i8** %2
%27 = call i32 @strcpy(i8* %25, i8* %26)
%28 = load i32, i32* %4
%29 = load i8*, i8** @no_prefix.p
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds i8, i8* %29, i64 %30
store i8* %31, i8** @no_prefix.p
%32 = load i8*, i8** %3
ret i8* %32
}

LLVM IR (-O2):
@no_prefix.buffer = internal global [1024 x i8] zeroinitializer
@no_prefix.p = internal unnamed_addr global i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @no_prefix.buffer, i64 0, i64 0)
define i8* @no_prefix(i8* %0) {
%2 = load i8*, i8** @no_prefix.p
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 4
%5 = load i8*, i8** @no_prefix.p
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = icmp ult i8* %7, getelementptr inbounds ([1024 x i8], [1024 x i8]* @no_prefix.buffer, i64 1, i64 0)
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %1
store i8 110, i8* %2
%12 = getelementptr inbounds i8, i8* %2, i64 1
store i8 111, i8* %12
%13 = getelementptr inbounds i8, i8* %2, i64 2
store i8 45, i8* %13
%14 = getelementptr inbounds i8, i8* %2, i64 3
%15 = tail call i32 @strcpy(i8* %14, i8* %0)
%16 = load i8*, i8** @no_prefix.p
%17 = getelementptr inbounds i8, i8* %16, i64 %6
store i8* %17, i8** @no_prefix.p
ret i8* %2
}