#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ quote_no_matter_what(char const *, char *);
int /*<<< orphan*/ *strchr(char const *, char);
int /*<<< orphan*/ *strstr(char const *, char *);
const char *quote(const char *s) {
  static char *sbuf = NULL;
  if (sbuf == NULL)
    sbuf = (char *)malloc(65535);
  if (strchr(s, ' ') == NULL && strstr(s, "/*") == NULL &&
      strstr(s, "*/") == NULL)
    return s;
  else {
    quote_no_matter_what(s, sbuf);
    return sbuf;
  }
}


x86 assembly (clang, -O0):
<quote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,0x2ef4(%rip)
jne    116b <quote+0x2b>
mov    $0xffff,%edi
call   1040 <malloc@plt>
mov    %rax,0x2edd(%rip)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    11c4 <quote+0x84>
mov    -0x10(%rbp),%rdi
lea    0xe72(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
jne    11c4 <quote+0x84>
mov    -0x10(%rbp),%rdi
lea    0xe5b(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
jne    11c4 <quote+0x84>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11df <quote+0x9f>
mov    -0x10(%rbp),%rdi
mov    0x2e79(%rip),%rsi
call   1050 <quote_no_matter_what@plt>
mov    0x2e6d(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quote>:
push   %rbx
mov    %rdi,%rbx
cmpq   $0x0,0x2efc(%rip)
jne    115f <quote+0x1f>
mov    $0xffff,%edi
call   1040 <malloc@plt>
mov    %rax,0x2ee9(%rip)
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1199 <quote+0x59>
lea    0xe88(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
jne    1199 <quote+0x59>
lea    0xe77(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     11af <quote+0x6f>
mov    0x2ea8(%rip),%rsi
mov    %rbx,%rdi
call   1050 <quote_no_matter_what@plt>
mov    0x2e99(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@quote.sbuf = internal global i8* null
@.str = [3 x i8] c"/*\00"
@.str.1 = [3 x i8] c"*/\00"
define i8* @quote(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** @quote.sbuf
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i64 @malloc(i32 65535)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** @quote.sbuf
br label %9
9: ; preds = %6, %1
%10 = load i8*, i8** %3
%11 = call i32* @strchr(i8* %10, i8 signext 32)
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = call i32* @strstr(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = load i8*, i8** %3
%19 = call i32* @strstr(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load i8*, i8** %3
store i8* %22, i8** %2
br label %28
23: ; preds = %17, %13, %9
%24 = load i8*, i8** %3
%25 = load i8*, i8** @quote.sbuf
%26 = call i32 @quote_no_matter_what(i8* %24, i8* %25)
%27 = load i8*, i8** @quote.sbuf
store i8* %27, i8** %2
br label %28
28: ; preds = %23, %21
%29 = load i8*, i8** %2
ret i8* %29
}

LLVM IR (-O2):
@quote.sbuf = internal unnamed_addr global i8* null
@.str = [3 x i8] c"/*\00"
@.str.1 = [3 x i8] c"*/\00"
define i8* @quote(i8* %0) {
%2 = load i8*, i8** @quote.sbuf
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i64 @malloc(i32 65535)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** @quote.sbuf
br label %7
7: ; preds = %4, %1
%8 = tail call i32* @strchr(i8* %0, i8 signext 32)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %20, label %16
16: ; preds = %13, %10, %7
%17 = load i8*, i8** @quote.sbuf
%18 = tail call i32 @quote_no_matter_what(i8* %0, i8* %17)
%19 = load i8*, i8** @quote.sbuf
br label %20
20: ; preds = %13, %16
%21 = phi i8* [ %19, %16 ], [ %0, %13 ]
ret i8* %21
}