#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 */
typedef int /*<<< orphan*/ line;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ do_make_intrinsic(unsigned int, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ isatty(int /*<<< orphan*/);
int /*<<< orphan*/ output_finish(int /*<<< orphan*/);
int /*<<< orphan*/ output_start(int /*<<< orphan*/);
char *skip_whitespace(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ stdout;
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char **argv) {
  char line[1024];
  FILE *fp;
  unsigned int linenum;
  if (isatty(0) || (argc > 1)) {
    fprintf(stderr, "Usage: %s < infile > outfile\n", argv[0]);
    exit(1);
  }
  output_start(stdout);
  fp = stdin;
  linenum = 0;
  while (NULL != fgets(line, sizeof(line), fp)) {
    char *p = skip_whitespace(line);
    linenum++;
    if (*p != 'M')
      continue;
    if (0 != strncmp(p, "MAKE_INTRINSIC", 14))
      continue;
    if (p[14] != '_') {
      fprintf(stderr, "Warning: line %u is old-fashioned\n", linenum);
      continue;
    }
    p += 15;
    switch (*p) {
    case 'I':
    case 'S':
    case '0':
      do_make_intrinsic(linenum, p);
      break;
    default:
      fprintf(stderr,
              "Warning: Unable to handle MAKE_INTRINSIC form on line %u\n",
              linenum);
      break;
    }
  }
  output_finish(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <isatty@plt>
cmp    $0x0,%rax
jne    11c4 <main+0x34>
cmpl   $0x1,-0x8(%rbp)
jle    11ec <main+0x5c>
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe25(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    0x2ddd(%rip),%rax
mov    (%rax),%edi
call   10a0 <output_start@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x418(%rbp)
movl   $0x0,-0x41c(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    $0x400,%esi
call   1080 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1367 <main+0x1d7>
lea    -0x410(%rbp),%rdi
call   1070 <skip_whitespace@plt>
mov    %rax,-0x428(%rbp)
mov    -0x41c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x41c(%rbp)
mov    -0x428(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x4d,%eax
je     1275 <main+0xe5>
jmp    1215 <main+0x85>
mov    -0x428(%rbp),%rdi
lea    0xd9b(%rip),%rsi
mov    $0xe,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     12a0 <main+0x110>
jmp    1215 <main+0x85>
mov    -0x428(%rbp),%rax
movsbl 0xe(%rax),%eax
cmp    $0x5f,%eax
je     12d6 <main+0x146>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
mov    -0x41c(%rbp),%edx
lea    0xd63(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1215 <main+0x85>
mov    -0x428(%rbp),%rax
add    $0xf,%rax
mov    %rax,-0x428(%rbp)
mov    -0x428(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x42c(%rbp)
sub    $0x30,%eax
je     132e <main+0x19e>
jmp    1306 <main+0x176>
mov    -0x42c(%rbp),%eax
sub    $0x49,%eax
je     132e <main+0x19e>
jmp    131a <main+0x18a>
mov    -0x42c(%rbp),%eax
sub    $0x53,%eax
jne    1345 <main+0x1b5>
jmp    132e <main+0x19e>
mov    -0x41c(%rbp),%edi
mov    -0x428(%rbp),%rsi
call   1050 <do_make_intrinsic@plt>
jmp    1362 <main+0x1d2>
mov    0x2c8c(%rip),%rax
mov    (%rax),%edi
mov    -0x41c(%rbp),%edx
lea    0xcf5(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1215 <main+0x85>
mov    0x2c62(%rip),%rax
mov    (%rax),%edi
call   1060 <output_finish@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
call   1040 <isatty@plt>
cmp    $0x1,%ebp
jg     12c5 <main+0x135>
test   %rax,%rax
jne    12c5 <main+0x135>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
call   10a0 <output_start@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%r14
mov    %rsp,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     12a3 <main+0x113>
mov    $0x1,%ebp
mov    %rsp,%rbx
lea    0xe1f(%rip),%r15
mov    0x2dd2(%rip),%r13
jmp    1238 <main+0xa8>
mov    0x0(%r13),%edi
lea    0xe1a(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   1080 <fgets@plt>
add    $0x1,%ebp
test   %rax,%rax
je     12a3 <main+0x113>
mov    %rbx,%rdi
call   1070 <skip_whitespace@plt>
cmpb   $0x4d,(%rax)
jne    1220 <main+0x90>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    $0xe,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1220 <main+0x90>
cmpb   $0x5f,0xe(%r12)
jne    1208 <main+0x78>
movsbl 0xf(%r12),%eax
add    $0xffffffd0,%eax
cmp    $0x23,%eax
ja     1293 <main+0x103>
movabs $0x802000001,%rcx
bt     %rax,%rcx
jae    1293 <main+0x103>
add    $0xf,%r12
mov    %ebp,%edi
mov    %r12,%rsi
call   1050 <do_make_intrinsic@plt>
jmp    1220 <main+0x90>
mov    0x0(%r13),%edi
lea    0xdb2(%rip),%rsi
jmp    1213 <main+0x83>
mov    0x2d26(%rip),%rax
mov    (%rax),%edi
call   1060 <output_finish@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d0c(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xd28(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: %s < infile > outfile\0A\00"
@stdout = global i32 0
@stdin = global i32* null
@.str.1 = [15 x i8] c"MAKE_INTRINSIC\00"
@.str.2 = [35 x i8] c"Warning: line %u is old-fashioned\0A\00"
@.str.3 = [58 x i8] c"Warning: Unable to handle MAKE_INTRINSIC form on line %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i64 @isatty(i32 0)
%11 = icmp ne i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 1
br i1 %14, label %15, label %22
15: ; preds = %12, %2
%16 = load i32, i32* @stderr
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %12
%23 = load i32, i32* @stdout
%24 = call i32 @output_start(i32 %23)
%25 = load i32*, i32** @stdin
store i32* %25, i32** %7
store i32 0, i32* %8
br label %26
26: ; preds = %70, %52, %45, %40, %22
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%28 = load i32*, i32** %7
%29 = call i32* @fgets(i8* %27, i32 1024, i32* %28)
%30 = icmp ne i32* null, %29
br i1 %30, label %31, label %71
31: ; preds = %26
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%33 = call i8* @skip_whitespace(i8* %32)
store i8* %33, i8** %9
%34 = load i32, i32* %8
%35 = add i32 %34, 1
store i32 %35, i32* %8
%36 = load i8*, i8** %9
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %38, 77
br i1 %39, label %40, label %41
40: ; preds = %31
br label %26
41: ; preds = %31
%42 = load i8*, i8** %9
%43 = call i64 @strncmp(i8* %42, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 14)
%44 = icmp ne i64 0, %43
br i1 %44, label %45, label %46
45: ; preds = %41
br label %26
46: ; preds = %41
%47 = load i8*, i8** %9
%48 = getelementptr inbounds i8, i8* %47, i64 14
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp ne i32 %50, 95
br i1 %51, label %52, label %56
52: ; preds = %46
%53 = load i32, i32* @stderr
%54 = load i32, i32* %8
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %54)
br label %26
56: ; preds = %46
%57 = load i8*, i8** %9
%58 = getelementptr inbounds i8, i8* %57, i64 15
store i8* %58, i8** %9
%59 = load i8*, i8** %9
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
switch i32 %61, label %66 [
i32 73, label %62
i32 83, label %62
i32 48, label %62
]
62: ; preds = %56, %56, %56
%63 = load i32, i32* %8
%64 = load i8*, i8** %9
%65 = call i32 @do_make_intrinsic(i32 %63, i8* %64)
br label %70
66: ; preds = %56
%67 = load i32, i32* @stderr
%68 = load i32, i32* %8
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0), i32 %68)
br label %70
70: ; preds = %66, %62
br label %26
71: ; preds = %26
%72 = load i32, i32* @stdout
%73 = call i32 @output_finish(i32 %72)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: %s < infile > outfile\0A\00"
@stdout = global i32 0
@stdin = global i32* null
@.str.1 = [15 x i8] c"MAKE_INTRINSIC\00"
@.str.2 = [35 x i8] c"Warning: line %u is old-fashioned\0A\00"
@.str.3 = [58 x i8] c"Warning: Unable to handle MAKE_INTRINSIC form on line %u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = tail call i64 @isatty(i32 0)
%6 = icmp ne i64 %5, 0
%7 = icmp sgt i32 %0, 1
%8 = or i1 %7, %6
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %1
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i32, i32* @stdout
%16 = tail call i32 @output_start(i32 %15)
%17 = load i32*, i32** @stdin
%18 = call i32* @fgets(i8* %4, i32 1024, i32* %17)
%19 = icmp eq i32* %18, null
br i1 %19, label %48, label %20
20: ; preds = %14, %45
%21 = phi i32 [ %23, %45 ], [ 0, %14 ]
%22 = call i8* @skip_whitespace(i8* %4)
%23 = add i32 %21, 1
%24 = load i8, i8* %22
%25 = icmp eq i8 %24, 77
br i1 %25, label %26, label %45
26: ; preds = %20
%27 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 14)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %45
29: ; preds = %26
%30 = getelementptr inbounds i8, i8* %22, i64 14
%31 = load i8, i8* %30
%32 = icmp eq i8 %31, 95
br i1 %32, label %36, label %33
33: ; preds = %29
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %23)
br label %45
36: ; preds = %29
%37 = getelementptr inbounds i8, i8* %22, i64 15
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
switch i32 %39, label %42 [
i32 73, label %40
i32 83, label %40
i32 48, label %40
]
40: ; preds = %36, %36, %36
%41 = call i32 @do_make_intrinsic(i32 %23, i8* %37)
br label %45
42: ; preds = %36
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0), i32 %23)
br label %45
45: ; preds = %40, %42, %26, %20, %33
%46 = call i32* @fgets(i8* %4, i32 1024, i32* %17)
%47 = icmp eq i32* %46, null
br i1 %47, label %48, label %20
48: ; preds = %45, %14
%49 = load i32, i32* @stdout
%50 = call i32 @output_finish(i32 %49)
ret i32 0
}