#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ADD_TO_TEXT_RECORD(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ GET_LINE(char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ eoln(char);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *, char *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
void PSEUDO_CODE(char *OPERATOR, FILE *INPUT_STREAM, FILE *OBJECT_STREAM,
                 FILE *LISTING_STREAM) {
  char CH;
  if ((strcmp(OPERATOR, "WORD")) && (strcmp(OPERATOR, "BYTE")))
    (void)fprintf(LISTING_STREAM, "          ");
  else {
    CH = fgetc(INPUT_STREAM);
    if (CH == 't') {
      int LOCATION;
      char TEMP_CH;
      char *REST_OF_LINE;
      (void)fscanf(INPUT_STREAM, "%d%c", &LOCATION, &TEMP_CH);
      GET_LINE(&REST_OF_LINE, INPUT_STREAM);
      (void)fprintf(LISTING_STREAM, "%s", REST_OF_LINE);
      if (strlen(REST_OF_LINE) <= 8) {
        int I;
        for (I = (strlen(REST_OF_LINE) + 1); I <= 10; I++)
          (void)fprintf(LISTING_STREAM, " ");
      } else
        (void)fprintf(LISTING_STREAM,
                      " {source on next line}\n                  ");
      if (TEMP_CH == 'W')
        ADD_TO_TEXT_RECORD(REST_OF_LINE, LOCATION, OBJECT_STREAM);
      else {
        char TEMP[2 + 1];
        int DELTA = 0;
        for (TEMP[2] = '\0'; !eoln(*REST_OF_LINE); REST_OF_LINE += 2) {
          (void)strncpy(TEMP, REST_OF_LINE, 2);
          ADD_TO_TEXT_RECORD(TEMP, (LOCATION + DELTA), OBJECT_STREAM);
          DELTA++;
        }
      }
    } else {
      (void)ungetc(CH, INPUT_STREAM);
      (void)fprintf(LISTING_STREAM, "          ");
    }
  }
}


x86 assembly (clang, -O0):
<PSEUDO_CODE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe3d(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1203 <PSEUDO_CODE+0x63>
mov    -0x8(%rbp),%rdi
lea    0xe28(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1203 <PSEUDO_CODE+0x63>
mov    -0x20(%rbp),%rdi
lea    0xe3a(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1376 <PSEUDO_CODE+0x1d6>
mov    -0x10(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x74,%eax
jne    1350 <PSEUDO_CODE+0x1b0>
mov    -0x10(%rbp),%rdi
lea    0xde3(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x29(%rbp),%rcx
call   1050 <fscanf@plt>
mov    -0x10(%rbp),%rsi
lea    -0x38(%rbp),%rdi
call   10c0 <GET_LINE@plt>
mov    -0x20(%rbp),%rdi
mov    -0x38(%rbp),%rdx
lea    0xdbf(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x8,%eax
jg     12a7 <PSEUDO_CODE+0x107>
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jg     12a2 <PSEUDO_CODE+0x102>
mov    -0x20(%rbp),%rdi
lea    0xdad(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1278 <PSEUDO_CODE+0xd8>
jmp    12b9 <PSEUDO_CODE+0x119>
mov    -0x20(%rbp),%rdi
lea    0xd60(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movsbl -0x29(%rbp),%eax
cmp    $0x57,%eax
jne    12db <PSEUDO_CODE+0x13b>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1070 <ADD_TO_TEXT_RECORD@plt>
jmp    134b <PSEUDO_CODE+0x1ab>
movl   $0x0,-0x44(%rbp)
movb   $0x0,-0x3d(%rbp)
mov    -0x38(%rbp),%rax
movsbl (%rax),%edi
call   10b0 <eoln@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1307 <PSEUDO_CODE+0x167>
jmp    1346 <PSEUDO_CODE+0x1a6>
lea    -0x3f(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
lea    -0x3f(%rbp),%rdi
mov    -0x28(%rbp),%esi
add    -0x44(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1070 <ADD_TO_TEXT_RECORD@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x38(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x38(%rbp)
jmp    12e6 <PSEUDO_CODE+0x146>
jmp    134b <PSEUDO_CODE+0x1ab>
jmp    1371 <PSEUDO_CODE+0x1d1>
mov    -0x21(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   10a0 <ungetc@plt>
mov    -0x20(%rbp),%rdi
lea    0xcc7(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1376 <PSEUDO_CODE+0x1d6>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PSEUDO_CODE>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0xe21(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1201 <PSEUDO_CODE+0x41>
lea    0xe15(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    12a9 <PSEUDO_CODE+0xe9>
mov    %r12,%rdi
call   1070 <fgetc@plt>
cmp    $0x74,%al
jne    129e <PSEUDO_CODE+0xde>
lea    0xdf2(%rip),%rsi
lea    0x18(%rsp),%rdx
lea    0xf(%rsp),%rcx
mov    %r12,%rdi
call   1060 <fscanf@plt>
lea    0x10(%rsp),%rdi
mov    %r12,%rsi
call   10e0 <GET_LINE@plt>
mov    0x10(%rsp),%rdi
mov    %r15,%rsi
call   1050 <fputs@plt>
mov    0x10(%rsp),%rdi
call   1040 <strlen@plt>
cmp    $0x8,%eax
jg     12ce <PSEUDO_CODE+0x10e>
mov    0x10(%rsp),%rdi
call   1040 <strlen@plt>
cmp    $0x9,%eax
jg     1281 <PSEUDO_CODE+0xc1>
mov    %eax,%ebx
add    $0xfffffff6,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
mov    %r15,%rsi
call   1080 <fputc@plt>
inc    %ebx
jne    1270 <PSEUDO_CODE+0xb0>
cmpb   $0x57,0xf(%rsp)
jne    12ee <PSEUDO_CODE+0x12e>
mov    0x10(%rsp),%rdi
mov    0x18(%rsp),%esi
mov    %r14,%rdx
call   1090 <ADD_TO_TEXT_RECORD@plt>
jmp    1351 <PSEUDO_CODE+0x191>
movsbl %al,%edi
mov    %r12,%rsi
call   10b0 <ungetc@plt>
lea    0xd7e(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %r15,%rcx
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    10d0 <fwrite@plt>
lea    0xd3a(%rip),%rdi
mov    $0x29,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10d0 <fwrite@plt>
cmpb   $0x57,0xf(%rsp)
je     1288 <PSEUDO_CODE+0xc8>
movb   $0x0,0x1f(%rsp)
mov    0x10(%rsp),%rax
movsbl (%rax),%edi
call   10c0 <eoln@plt>
test   %eax,%eax
jne    1351 <PSEUDO_CODE+0x191>
xor    %ebp,%ebp
lea    0x1d(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <strncpy@plt>
mov    0x18(%rsp),%esi
add    %ebp,%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1090 <ADD_TO_TEXT_RECORD@plt>
add    $0x1,%ebp
mov    0x10(%rsp),%rax
lea    0x2(%rax),%rcx
mov    %rcx,0x10(%rsp)
movsbl 0x2(%rax),%edi
call   10c0 <eoln@plt>
test   %eax,%eax
je     1310 <PSEUDO_CODE+0x150>
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"WORD\00"
@.str.1 = [5 x i8] c"BYTE\00"
@.str.2 = [11 x i8] c" \00"
@.str.3 = [5 x i8] c"%d%c\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [2 x i8] c" \00"
@.str.6 = [42 x i8] c" {source on next line}\0A \00"
define void @PSEUDO_CODE(i8* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8
%10 = alloca i32
%11 = alloca i8
%12 = alloca i8*
%13 = alloca i32
%14 = alloca [3 x i8]
%15 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%16 = load i8*, i8** %5
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %4
%20 = load i8*, i8** %5
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32*, i32** %8
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %101
26: ; preds = %19, %4
%27 = load i32*, i32** %6
%28 = call signext i8 @fgetc(i32* %27)
store i8 %28, i8* %9
%29 = load i8, i8* %9
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 116
br i1 %31, label %32, label %94
32: ; preds = %26
%33 = load i32*, i32** %6
%34 = call i32 @fscanf(i32* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* %10, i8* %11)
%35 = load i32*, i32** %6
%36 = call i32 @GET_LINE(i8** %12, i32* %35)
%37 = load i32*, i32** %8
%38 = load i8*, i8** %12
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %38)
%40 = load i8*, i8** %12
%41 = call i32 @strlen(i8* %40)
%42 = icmp sle i32 %41, 8
br i1 %42, label %43, label %57
43: ; preds = %32
%44 = load i8*, i8** %12
%45 = call i32 @strlen(i8* %44)
%46 = add nsw i32 %45, 1
store i32 %46, i32* %13
br label %47
47: ; preds = %53, %43
%48 = load i32, i32* %13
%49 = icmp sle i32 %48, 10
br i1 %49, label %50, label %56
50: ; preds = %47
%51 = load i32*, i32** %8
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %53
53: ; preds = %50
%54 = load i32, i32* %13
%55 = add nsw i32 %54, 1
store i32 %55, i32* %13
br label %47
56: ; preds = %47
br label %60
57: ; preds = %32
%58 = load i32*, i32** %8
%59 = call i32 (i32*, i8*, ...) @fprintf(i32* %58, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0))
br label %60
60: ; preds = %57, %56
%61 = load i8, i8* %11
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %62, 87
br i1 %63, label %64, label %69
64: ; preds = %60
%65 = load i8*, i8** %12
%66 = load i32, i32* %10
%67 = load i32*, i32** %7
%68 = call i32 @ADD_TO_TEXT_RECORD(i8* %65, i32 %66, i32* %67)
br label %93
69: ; preds = %60
store i32 0, i32* %15
%70 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 2
store i8 0, i8* %70
br label %71
71: ; preds = %89, %69
%72 = load i8*, i8** %12
%73 = load i8, i8* %72
%74 = call i32 @eoln(i8 signext %73)
%75 = icmp ne i32 %74, 0
%76 = xor i1 %75, true
br i1 %76, label %77, label %92
77: ; preds = %71
%78 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%79 = load i8*, i8** %12
%80 = call i32 @strncpy(i8* %78, i8* %79, i32 2)
%81 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%82 = load i32, i32* %10
%83 = load i32, i32* %15
%84 = add nsw i32 %82, %83
%85 = load i32*, i32** %7
%86 = call i32 @ADD_TO_TEXT_RECORD(i8* %81, i32 %84, i32* %85)
%87 = load i32, i32* %15
%88 = add nsw i32 %87, 1
store i32 %88, i32* %15
br label %89
89: ; preds = %77
%90 = load i8*, i8** %12
%91 = getelementptr inbounds i8, i8* %90, i64 2
store i8* %91, i8** %12
br label %71
92: ; preds = %71
br label %93
93: ; preds = %92, %64
br label %100
94: ; preds = %26
%95 = load i8, i8* %9
%96 = load i32*, i32** %6
%97 = call i32 @ungetc(i8 signext %95, i32* %96)
%98 = load i32*, i32** %8
%99 = call i32 (i32*, i8*, ...) @fprintf(i32* %98, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %100
100: ; preds = %94, %93
br label %101
101: ; preds = %100, %23
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"WORD\00"
@.str.1 = [5 x i8] c"BYTE\00"
@.str.2 = [11 x i8] c" \00"
@.str.3 = [5 x i8] c"%d%c\00"
@.str.6 = [42 x i8] c" {source on next line}\0A \00"
define void @PSEUDO_CODE(i8* %0, i32* %1, i32* %2, i32* nocapture %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8*
%8 = alloca [3 x i8]
%9 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %4
%12 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64 10, i64 1, i32* %3)
br label %72
16: ; preds = %11, %4
%17 = tail call signext i8 @fgetc(i32* %1)
%18 = icmp eq i8 %17, 116
br i1 %18, label %19, label %69
19: ; preds = %16
%20 = bitcast i32* %5 to i8*
%21 = bitcast i8** %7 to i8*
%22 = call i32 @fscanf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* %5, i8* %6)
%23 = call i32 @GET_LINE(i8** %7, i32* %1)
%24 = load i8*, i8** %7
%25 = call i32 @fputs(i8* %24, i32* %3)
%26 = load i8*, i8** %7
%27 = call i32 @strlen(i8* %26)
%28 = icmp slt i32 %27, 9
br i1 %28, label %29, label %38
29: ; preds = %19
%30 = load i8*, i8** %7
%31 = call i32 @strlen(i8* %30)
%32 = icmp slt i32 %31, 10
br i1 %32, label %33, label %40
33: ; preds = %29, %33
%34 = phi i32 [ %35, %33 ], [ %31, %29 ]
%35 = add i32 %34, 1
%36 = call i32 @fputc(i32 32, i32* %3)
%37 = icmp eq i32 %35, 10
br i1 %37, label %40, label %33
38: ; preds = %19
%39 = call i64 @fwrite(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0), i64 41, i64 1, i32* %3)
br label %40
40: ; preds = %33, %29, %38
%41 = load i8, i8* %6
%42 = icmp eq i8 %41, 87
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = load i8*, i8** %7
%45 = load i32, i32* %5
%46 = call i32 @ADD_TO_TEXT_RECORD(i8* %44, i32 %45, i32* %2)
br label %68
47: ; preds = %40
%48 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 0
%49 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 2
store i8 0, i8* %49
%50 = load i8*, i8** %7
%51 = load i8, i8* %50
%52 = call i32 @eoln(i8 signext %51)
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %67
54: ; preds = %47, %54
%55 = phi i32 [ %61, %54 ], [ 0, %47 ]
%56 = load i8*, i8** %7
%57 = call i32 @strncpy(i8* %48, i8* %56, i32 2)
%58 = load i32, i32* %5
%59 = add nsw i32 %58, %55
%60 = call i32 @ADD_TO_TEXT_RECORD(i8* %48, i32 %59, i32* %2)
%61 = add nuw nsw i32 %55, 1
%62 = load i8*, i8** %7
%63 = getelementptr inbounds i8, i8* %62, i64 2
store i8* %63, i8** %7
%64 = load i8, i8* %63
%65 = call i32 @eoln(i8 signext %64)
%66 = icmp eq i32 %65, 0
br i1 %66, label %54, label %67
67: ; preds = %54, %47
br label %68
68: ; preds = %67, %43
br label %72
69: ; preds = %16
%70 = tail call i32 @ungetc(i8 signext %17, i32* %1)
%71 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64 10, i64 1, i32* %3)
br label %72
72: ; preds = %68, %69, %14
ret void
}