#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ report_error(char *);
void error_on_invalid_char(char c) {
  if (c == '\\') {
    report_error("Strings with escape codes are not supported");
    exit(EXIT_FAILURE);
  }
  if (c < 32 || c > 126) {
    report_error("Strings may contain only alpha-numeric characters");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<error_on_invalid_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x5c,%eax
jne    1155 <error_on_invalid_char+0x35>
lea    0xebe(%rip),%rdi
call   1030 <report_error@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jl     116f <error_on_invalid_char+0x4f>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
jle    1189 <error_on_invalid_char+0x69>
lea    0xeb6(%rip),%rdi
call   1030 <report_error@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_on_invalid_char>:
push   %rax
cmp    $0x5c,%dil
je     1133 <error_on_invalid_char+0x13>
add    $0x81,%dil
cmp    $0xa0,%dil
jbe    113c <error_on_invalid_char+0x1c>
pop    %rax
ret
lea    0xec6(%rip),%rdi
jmp    1143 <error_on_invalid_char+0x23>
lea    0xee9(%rip),%rdi
call   1030 <report_error@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Strings with escape codes are not supported\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [50 x i8] c"Strings may contain only alpha-numeric characters\00"
define void @error_on_invalid_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 92
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @report_error(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp slt i32 %12, 32
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sgt i32 %16, 126
br i1 %17, label %18, label %22
18: ; preds = %14, %10
%19 = call i32 @report_error(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %14
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Strings with escape codes are not supported\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [50 x i8] c"Strings may contain only alpha-numeric characters\00"
define void @error_on_invalid_char(i8 signext %0) {
%2 = icmp eq i8 %0, 92
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @report_error(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
%8 = add i8 %0, -127
%9 = icmp ult i8 %8, -95
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = tail call i32 @report_error(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %7
ret void
}