#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 const);
int /*<<< orphan*/ *strchr(char const *, char const);
int /*<<< orphan*/ write(int, char *, int);
int printColoredSpecial(const char *linbuff, int numChars) {
  const char *specials = "`&()[]{}*<>|!=.";
  if (strchr(specials, *linbuff) != NULL) {
    write(1, "\e\"\x04", 3);
    printf("%c", *linbuff);
    write(1, "\e\"\x07", 3);
    return 1;
  } else {
    return 0;
  };
}


x86 assembly (clang, -O0):
<printColoredSpecial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     11af <printColoredSpecial+0x7f>
mov    $0x1,%edi
lea    0xea0(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    -0x10(%rbp),%rax
lea    0xe8f(%rip),%rdi
movsbl (%rax),%esi
call   1050 <printf@plt>
mov    $0x1,%edi
lea    0xe7e(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b6 <printColoredSpecial+0x86>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printColoredSpecial>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%esi
lea    0xec0(%rip),%rdi
call   1040 <strchr@plt>
test   %rax,%rax
je     118c <printColoredSpecial+0x5c>
lea    0xebf(%rip),%rsi
mov    $0x1,%ebp
mov    $0x1,%edi
mov    $0x3,%edx
call   1030 <write@plt>
movsbl (%rbx),%esi
lea    0xea5(%rip),%rdi
call   1050 <printf@plt>
lea    0xe9c(%rip),%rsi
mov    $0x1,%edi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    118e <printColoredSpecial+0x5e>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"`&()[]{}*<>|!=.\00"
@.str.1 = [4 x i8] c"\1B\22\04\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [4 x i8] c"\1B\22\07\00"
define i32 @printColoredSpecial(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = call i32* @strchr(i8* %7, i8 signext %9)
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %15)
%17 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
store i32 1, i32* %3
br label %19
18: ; preds = %2
store i32 0, i32* %3
br label %19
19: ; preds = %18, %12
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [16 x i8] c"`&()[]{}*<>|!=.\00"
@.str.1 = [4 x i8] c"\1B\22\04\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [4 x i8] c"\1B\22\07\00"
define i32 @printColoredSpecial(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = tail call i32* @strchr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%8 = load i8, i8* %0
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %8)
%10 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %12
}