#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*/ fatal_error(char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ string_of_repeated(char, char *);
int strlen(char *);
void look_for_illegal_symbols(char *str) {
  if (strlen(str) > 1 && string_of_repeated('-', str)) {
    printf("bad string: %s\n", str);
    fatal_error(
        "operations that are strings of repeated \"-\" are not allowed");
  } else if (strlen(str) > 1 && string_of_repeated('\'', str))
    fatal_error(
        "operations that are strings of repeated \"\'\" are not allowed");
}


x86 assembly (clang, -O0):
<look_for_illegal_symbols>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jle    1197 <look_for_illegal_symbols+0x57>
mov    -0x8(%rbp),%rsi
mov    $0x2d,%edi
call   1060 <string_of_repeated@plt>
cmp    $0x0,%rax
je     1197 <look_for_illegal_symbols+0x57>
mov    -0x8(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe83(%rip),%rdi
call   1050 <fatal_error@plt>
jmp    11d2 <look_for_illegal_symbols+0x92>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jle    11cd <look_for_illegal_symbols+0x8d>
mov    -0x8(%rbp),%rsi
mov    $0x27,%edi
call   1060 <string_of_repeated@plt>
cmp    $0x0,%rax
je     11cd <look_for_illegal_symbols+0x8d>
lea    0xe84(%rip),%rdi
call   1050 <fatal_error@plt>
jmp    11d2 <look_for_illegal_symbols+0x92>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<look_for_illegal_symbols>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     117c <look_for_illegal_symbols+0x3c>
mov    $0x2d,%edi
mov    %rbx,%rsi
call   1060 <string_of_repeated@plt>
test   %rax,%rax
je     117c <look_for_illegal_symbols+0x3c>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
pop    %rbx
jmp    1050 <fatal_error@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     11a8 <look_for_illegal_symbols+0x68>
mov    $0x27,%edi
mov    %rbx,%rsi
call   1060 <string_of_repeated@plt>
test   %rax,%rax
je     11a8 <look_for_illegal_symbols+0x68>
lea    0xeaa(%rip),%rdi
pop    %rbx
jmp    1050 <fatal_error@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"bad string: %s\0A\00"
@.str.1 = [60 x i8] c"operations that are strings of repeated \22-\22 are not allowed\00"
@.str.2 = [60 x i8] c"operations that are strings of repeated \22'\22 are not allowed\00"
define void @look_for_illegal_symbols(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @string_of_repeated(i8 signext 45, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @fatal_error(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
br label %25
14: ; preds = %6, %1
%15 = load i8*, i8** %2
%16 = call i32 @strlen(i8* %15)
%17 = icmp sgt i32 %16, 1
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i8*, i8** %2
%20 = call i64 @string_of_repeated(i8 signext 39, i8* %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @fatal_error(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %18, %14
br label %25
25: ; preds = %24, %10
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"bad string: %s\0A\00"
@.str.1 = [60 x i8] c"operations that are strings of repeated \22-\22 are not allowed\00"
@.str.2 = [60 x i8] c"operations that are strings of repeated \22'\22 are not allowed\00"
define void @look_for_illegal_symbols(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i64 @string_of_repeated(i8 signext 45, i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %15
9: ; preds = %4, %1
%10 = tail call i32 @strlen(i8* %0)
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = tail call i64 @string_of_repeated(i8 signext 39, i8* %0)
%14 = icmp eq i64 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %12, %7
%16 = phi i8* [ getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0), %7 ], [ getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), %12 ]
%17 = tail call i32 @fatal_error(i8* %16)
br label %18
18: ; preds = %15, %9, %12
ret void
}