#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*/ free(char *);
int /*<<< orphan*/ ioNext();
char ioPeek();
char *malloc(int);
int /*<<< orphan*/ skipWhite();
char *scanGetLOp(void) {
  char *s = malloc(3);
  char *t = s;
  switch (ioPeek()) {
  case '<':
    *t++ = '<';
    ioNext();
    if (ioPeek() == '=' || ioPeek() == '>') {
      *t++ = ioPeek();
      ioNext();
    }
    *t = 0;
    skipWhite();
    return (s);
  case '>':
    *t++ = '>';
    ioNext();
    if (ioPeek() == '=') {
      *t++ = ioPeek();
      ioNext();
    }
    *t = 0;
    skipWhite();
    return (s);
  case '=':
    *t++ = '=';
    *t = 0;
    ioNext();
    skipWhite();
    return (s);
  }
  if (s) {
    free(s);
  }
  return (NULL);
}


x86 assembly (clang, -O0):
<scanGetLOp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x3,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
call   1070 <ioPeek@plt>
movsbl %al,%eax
mov    %eax,-0x1c(%rbp)
sub    $0x3c,%eax
je     11ab <scanGetLOp+0x5b>
jmp    1189 <scanGetLOp+0x39>
mov    -0x1c(%rbp),%eax
sub    $0x3d,%eax
je     128e <scanGetLOp+0x13e>
jmp    119a <scanGetLOp+0x4a>
mov    -0x1c(%rbp),%eax
sub    $0x3e,%eax
je     1226 <scanGetLOp+0xd6>
jmp    12c2 <scanGetLOp+0x172>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x3c,(%rax)
mov    $0x0,%al
call   1040 <ioNext@plt>
mov    $0x0,%al
call   1070 <ioPeek@plt>
movsbl %al,%eax
cmp    $0x3d,%eax
je     11ea <scanGetLOp+0x9a>
mov    $0x0,%al
call   1070 <ioPeek@plt>
movsbl %al,%eax
cmp    $0x3e,%eax
jne    120b <scanGetLOp+0xbb>
mov    $0x0,%al
call   1070 <ioPeek@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <ioNext@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x0,%al
call   1060 <skipWhite@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    12de <scanGetLOp+0x18e>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x3e,(%rax)
mov    $0x0,%al
call   1040 <ioNext@plt>
mov    $0x0,%al
call   1070 <ioPeek@plt>
movsbl %al,%eax
cmp    $0x3d,%eax
jne    1273 <scanGetLOp+0x123>
mov    $0x0,%al
call   1070 <ioPeek@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <ioNext@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x0,%al
call   1060 <skipWhite@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    12de <scanGetLOp+0x18e>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x3d,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x0,%al
call   1040 <ioNext@plt>
mov    $0x0,%al
call   1060 <skipWhite@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    12de <scanGetLOp+0x18e>
cmpq   $0x0,-0x10(%rbp)
je     12d6 <scanGetLOp+0x186>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanGetLOp>:
push   %r14
push   %rbx
push   %rax
mov    $0x3,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1070 <ioPeek@plt>
movsbl %al,%eax
cmp    $0x3e,%eax
je     11a4 <scanGetLOp+0x54>
cmp    $0x3d,%eax
je     11d8 <scanGetLOp+0x88>
cmp    $0x3c,%eax
jne    11ee <scanGetLOp+0x9e>
movb   $0x3c,(%r14)
xor    %eax,%eax
call   1040 <ioNext@plt>
xor    %eax,%eax
call   1070 <ioPeek@plt>
cmp    $0x3d,%al
je     11ba <scanGetLOp+0x6a>
xor    %eax,%eax
call   1070 <ioPeek@plt>
cmp    $0x3e,%al
je     11ba <scanGetLOp+0x6a>
mov    %r14,%rbx
add    $0x1,%rbx
jmp    11d3 <scanGetLOp+0x83>
movb   $0x3e,(%r14)
xor    %eax,%eax
call   1040 <ioNext@plt>
xor    %eax,%eax
call   1070 <ioPeek@plt>
cmp    $0x3d,%al
jne    119b <scanGetLOp+0x4b>
xor    %eax,%eax
call   1070 <ioPeek@plt>
mov    %r14,%rbx
add    $0x2,%rbx
mov    %al,0x1(%r14)
xor    %eax,%eax
call   1040 <ioNext@plt>
movb   $0x0,(%rbx)
jmp    11e5 <scanGetLOp+0x95>
movw   $0x3d,(%r14)
xor    %eax,%eax
call   1040 <ioNext@plt>
xor    %eax,%eax
call   1060 <skipWhite@plt>
jmp    11fe <scanGetLOp+0xae>
test   %r14,%r14
je     11fb <scanGetLOp+0xab>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @scanGetLOp() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = call i8* @malloc(i32 3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = call signext i8 (...) @ioPeek()
%7 = sext i8 %6 to i32
switch i32 %7, label %51 [
i32 60, label %8
i32 62, label %28
i32 61, label %44
]
8: ; preds = %0
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 60, i8* %9
%11 = call i32 (...) @ioNext()
%12 = call signext i8 (...) @ioPeek()
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 61
br i1 %14, label %19, label %15
15: ; preds = %8
%16 = call signext i8 (...) @ioPeek()
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 62
br i1 %18, label %19, label %24
19: ; preds = %15, %8
%20 = call signext i8 (...) @ioPeek()
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
store i8 %20, i8* %21
%23 = call i32 (...) @ioNext()
br label %24
24: ; preds = %19, %15
%25 = load i8*, i8** %3
store i8 0, i8* %25
%26 = call i32 (...) @skipWhite()
%27 = load i8*, i8** %2
store i8* %27, i8** %1
br label %58
28: ; preds = %0
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %3
store i8 62, i8* %29
%31 = call i32 (...) @ioNext()
%32 = call signext i8 (...) @ioPeek()
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 61
br i1 %34, label %35, label %40
35: ; preds = %28
%36 = call signext i8 (...) @ioPeek()
%37 = load i8*, i8** %3
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %3
store i8 %36, i8* %37
%39 = call i32 (...) @ioNext()
br label %40
40: ; preds = %35, %28
%41 = load i8*, i8** %3
store i8 0, i8* %41
%42 = call i32 (...) @skipWhite()
%43 = load i8*, i8** %2
store i8* %43, i8** %1
br label %58
44: ; preds = %0
%45 = load i8*, i8** %3
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %3
store i8 61, i8* %45
%47 = load i8*, i8** %3
store i8 0, i8* %47
%48 = call i32 (...) @ioNext()
%49 = call i32 (...) @skipWhite()
%50 = load i8*, i8** %2
store i8* %50, i8** %1
br label %58
51: ; preds = %0
%52 = load i8*, i8** %2
%53 = icmp ne i8* %52, null
br i1 %53, label %54, label %57
54: ; preds = %51
%55 = load i8*, i8** %2
%56 = call i32 @free(i8* %55)
br label %57
57: ; preds = %54, %51
store i8* null, i8** %1
br label %58
58: ; preds = %57, %44, %40, %24
%59 = load i8*, i8** %1
ret i8* %59
}

LLVM IR (-O2):
define noalias i8* @scanGetLOp() {
%1 = tail call dereferenceable_or_null(3) i8* @malloc(i32 3)
%2 = tail call signext i8 (...) @ioPeek()
%3 = sext i8 %2 to i32
switch i32 %3, label %35 [
i32 60, label %4
i32 62, label %19
i32 61, label %31
]
4: ; preds = %0
%5 = getelementptr inbounds i8, i8* %1, i64 1
store i8 60, i8* %1
%6 = tail call i32 (...) @ioNext()
%7 = tail call signext i8 (...) @ioPeek()
%8 = icmp eq i8 %7, 61
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = tail call signext i8 (...) @ioPeek()
%11 = icmp eq i8 %10, 62
br i1 %11, label %12, label %16
12: ; preds = %9, %4
%13 = tail call signext i8 (...) @ioPeek()
%14 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %13, i8* %5
%15 = tail call i32 (...) @ioNext()
br label %16
16: ; preds = %12, %9
%17 = phi i8* [ %14, %12 ], [ %5, %9 ]
store i8 0, i8* %17
%18 = tail call i32 (...) @skipWhite()
br label %39
19: ; preds = %0
%20 = getelementptr inbounds i8, i8* %1, i64 1
store i8 62, i8* %1
%21 = tail call i32 (...) @ioNext()
%22 = tail call signext i8 (...) @ioPeek()
%23 = icmp eq i8 %22, 61
br i1 %23, label %24, label %28
24: ; preds = %19
%25 = tail call signext i8 (...) @ioPeek()
%26 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %25, i8* %20
%27 = tail call i32 (...) @ioNext()
br label %28
28: ; preds = %24, %19
%29 = phi i8* [ %26, %24 ], [ %20, %19 ]
store i8 0, i8* %29
%30 = tail call i32 (...) @skipWhite()
br label %39
31: ; preds = %0
%32 = getelementptr inbounds i8, i8* %1, i64 1
store i8 61, i8* %1
store i8 0, i8* %32
%33 = tail call i32 (...) @ioNext()
%34 = tail call i32 (...) @skipWhite()
br label %39
35: ; preds = %0
%36 = icmp eq i8* %1, null
br i1 %36, label %39, label %37
37: ; preds = %35
%38 = tail call i32 @free(i8* %1)
br label %39
39: ; preds = %35, %37, %31, %28, %16
%40 = phi i8* [ %1, %31 ], [ %1, %28 ], [ %1, %16 ], [ null, %37 ], [ null, %35 ]
ret i8* %40
}