#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(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
int strlen(char *);
void error_malformed_input_line(char *line) {
  int i;
  for (i = 0; i < strlen(line); i++) {
    if (!(((line[i]) >= 32 && (line[i]) <= 126) || (line[i]) == '\t' ||
          (line[i]) == '\n')) {
      line = "<cannot display line due to unprintable characters>\n";
      break;
    }
  }
  fprintf(stderr,
          "Error - malformed input line:\n%s\n"
          "Expected integral values in range [0, 2^31-1], in format:\n"
          "    \"pid arrival cpu-burst (io-burst) cpu-burst "
          "(io-burst) ... cpu-burst\"\n"
          "    (every process having between 1 and %d bursts, "
          "ending on a CPU burst)\n",
          line, 1000);
  exit(-1);
}


x86 assembly (clang, -O0):
<error_malformed_input_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    11d6 <error_malformed_input_line+0xa6>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jl     1189 <error_malformed_input_line+0x59>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7e,%eax
jle    11c3 <error_malformed_input_line+0x93>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
je     11c3 <error_malformed_input_line+0x93>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     11c3 <error_malformed_input_line+0x93>
lea    0xe46(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d6 <error_malformed_input_line+0xa6>
jmp    11c8 <error_malformed_input_line+0x98>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <error_malformed_input_line+0x13>
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe4b(%rip),%rsi
mov    $0x3e8,%ecx
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error_malformed_input_line>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1179 <error_malformed_input_line+0x49>
xor    %ebx,%ebx
lea    0xeb6(%rip),%r15
jmp    1163 <error_malformed_input_line+0x33>
nopl   0x0(%rax)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    1179 <error_malformed_input_line+0x49>
movzbl (%r14,%rbx,1),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5f,%cl
jb     1150 <error_malformed_input_line+0x20>
add    $0xf7,%al
cmp    $0x2,%al
jb     1150 <error_malformed_input_line+0x20>
mov    %r15,%r14
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %r14,%rdx
mov    $0x3e8,%ecx
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"<cannot display line due to unprintable characters>\0A\00"
@stderr = global i32 0
@.str.1 = [240 x i8] c"Error - malformed input line:\0A%s\0AExpected integral values in range [0, 2^31-1], in format:\0A \22pid arrival cpu-burst (io-burst) cpu-burst (io-burst) ... cpu-burst\22\0A (every process having between 1 and %d bursts, ending on a CPU burst)\0A\00"
define void @error_malformed_input_line(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %43, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %46
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 32
br i1 %16, label %17, label %25
17: ; preds = %9
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 126
br i1 %24, label %42, label %25
25: ; preds = %17, %9
%26 = load i8*, i8** %2
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 9
br i1 %32, label %42, label %33
33: ; preds = %25
%34 = load i8*, i8** %2
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %34, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 10
br i1 %40, label %42, label %41
41: ; preds = %33
store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8** %2
br label %46
42: ; preds = %33, %25, %17
br label %43
43: ; preds = %42
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 1
store i32 %45, i32* %3
br label %4
46: ; preds = %41, %4
%47 = load i32, i32* @stderr
%48 = load i8*, i8** %2
%49 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([240 x i8], [240 x i8]* @.str.1, i64 0, i64 0), i8* %48, i32 1000)
%50 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [53 x i8] c"<cannot display line due to unprintable characters>\0A\00"
@stderr = global i32 0
@.str.1 = [240 x i8] c"Error - malformed input line:\0A%s\0AExpected integral values in range [0, 2^31-1], in format:\0A \22pid arrival cpu-burst (io-burst) cpu-burst (io-burst) ... cpu-burst\22\0A (every process having between 1 and %d bursts, ending on a CPU burst)\0A\00"
define void @error_malformed_input_line(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %8, label %18
4: ; preds = %8
%5 = tail call i32 @strlen(i8* %0)
%6 = sext i32 %5 to i64
%7 = icmp slt i64 %17, %6
br i1 %7, label %8, label %18
8: ; preds = %1, %4
%9 = phi i64 [ %17, %4 ], [ 0, %1 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = add i8 %11, -32
%13 = icmp ult i8 %12, 95
%14 = add i8 %11, -9
%15 = icmp ult i8 %14, 2
%16 = or i1 %13, %15
%17 = add nuw nsw i64 %9, 1
br i1 %16, label %4, label %18
18: ; preds = %4, %8, %1
%19 = phi i8* [ %0, %1 ], [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), %8 ], [ %0, %4 ]
%20 = load i32, i32* @stderr
%21 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([240 x i8], [240 x i8]* @.str.1, i64 0, i64 0), i8* %19, i32 1000)
%22 = tail call i32 @exit(i32 -1)
unreachable
}