#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 EOF;
int gettoken(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int ncss_Getchar();
int /*<<< orphan*/ ncss_Ungetc(int);
int skipws();
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strlen(char *);
int getoverloadedop(char *buf) {
  char *savebuf = buf;
  char tmpbuf[256];
  int c = gettoken(tmpbuf, NULL, NULL);
  if (c == '(') {
    *buf++ = c;
    while (c != ')') {
      if ((c = skipws()) == EOF)
        break;
      *buf++ = c;
    }
  } else if (c == ((256 + 20) + 2)) {
    *buf++ = '_';
    *buf = '\0';
    strcat(buf, tmpbuf);
    buf += strlen(buf);
    *buf++ = '(';
    *buf++ = ')';
    *buf = '\0';
  } else if (c != EOF) {
    *buf++ = c;
    while ((c = ncss_Getchar()) != EOF) {
      if (!((c) == (256 + 1) || (c) == '\n' || (c) == '\t' || (c) == ' ')) {
        if (c == '(' || c == ';') {
          ncss_Ungetc(c);
          break;
        } else
          *buf++ = c;
      }
    }
  }
  *buf = '\0';
  return c;
}


x86 assembly (clang, -O0):
<getoverloadedop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1050 <gettoken@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x28,-0x114(%rbp)
jne    1207 <getoverloadedop+0xa7>
mov    -0x114(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
cmpl   $0x29,-0x114(%rbp)
je     1202 <getoverloadedop+0xa2>
mov    $0x0,%al
call   1070 <skipws@plt>
mov    %eax,-0x114(%rbp)
mov    0x2e11(%rip),%rcx
cmp    (%rcx),%eax
jne    11e4 <getoverloadedop+0x84>
jmp    1202 <getoverloadedop+0xa2>
mov    -0x114(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    11b6 <getoverloadedop+0x56>
jmp    1366 <getoverloadedop+0x206>
cmpl   $0x116,-0x114(%rbp)
jne    1289 <getoverloadedop+0x129>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x5f,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x8(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x28,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x29,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1361 <getoverloadedop+0x201>
mov    -0x114(%rbp),%eax
mov    0x2d52(%rip),%rcx
cmp    (%rcx),%eax
je     135c <getoverloadedop+0x1fc>
mov    -0x114(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    $0x0,%al
call   1030 <ncss_Getchar@plt>
mov    %eax,-0x114(%rbp)
mov    0x2d1d(%rip),%rcx
cmp    (%rcx),%eax
je     1357 <getoverloadedop+0x1f7>
cmpl   $0x101,-0x114(%rbp)
je     1352 <getoverloadedop+0x1f2>
cmpl   $0xa,-0x114(%rbp)
je     1352 <getoverloadedop+0x1f2>
cmpl   $0x9,-0x114(%rbp)
je     1352 <getoverloadedop+0x1f2>
cmpl   $0x20,-0x114(%rbp)
je     1352 <getoverloadedop+0x1f2>
cmpl   $0x28,-0x114(%rbp)
je     1324 <getoverloadedop+0x1c4>
cmpl   $0x3b,-0x114(%rbp)
jne    1334 <getoverloadedop+0x1d4>
mov    -0x114(%rbp),%edi
call   1040 <ncss_Ungetc@plt>
jmp    1357 <getoverloadedop+0x1f7>
mov    -0x114(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1352 <getoverloadedop+0x1f2>
jmp    12b7 <getoverloadedop+0x157>
jmp    135c <getoverloadedop+0x1fc>
jmp    1361 <getoverloadedop+0x201>
jmp    1366 <getoverloadedop+0x206>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x114(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getoverloadedop>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <gettoken@plt>
cmp    $0x116,%eax
je     11c8 <getoverloadedop+0x68>
mov    %eax,%ebp
cmp    $0x28,%eax
jne    1200 <getoverloadedop+0xa0>
movb   $0x28,(%rbx)
add    $0x1,%rbx
mov    0x2e4e(%rip),%r14
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <skipws@plt>
mov    %eax,%ebp
cmp    (%r14),%eax
je     127b <getoverloadedop+0x11b>
mov    %bpl,(%rbx)
add    $0x1,%rbx
cmp    $0x29,%ebp
jne    11a0 <getoverloadedop+0x40>
mov    $0x29,%ebp
jmp    127b <getoverloadedop+0x11b>
lea    0x1(%rbx),%rbp
movw   $0x5f,(%rbx)
mov    %rsp,%rsi
mov    %rbp,%rdi
call   1080 <strcat@plt>
mov    %rbp,%rdi
call   1060 <strlen@plt>
cltq
movw   $0x2928,0x1(%rbx,%rax,1)
movb   $0x0,0x3(%rbx,%rax,1)
add    %rax,%rbx
add    $0x3,%rbx
mov    $0x116,%ebp
jmp    127b <getoverloadedop+0x11b>
mov    0x2de1(%rip),%r14
cmp    (%r14),%ebp
je     127b <getoverloadedop+0x11b>
mov    %bpl,(%rbx)
add    $0x1,%rbx
xor    %eax,%eax
call   1030 <ncss_Getchar@plt>
mov    %eax,%ebp
cmp    (%r14),%eax
je     127b <getoverloadedop+0x11b>
movabs $0x100000600,%r15
movabs $0x800010000000000,%r12
jmp    1256 <getoverloadedop+0xf6>
nopw   0x0(%rax,%rax,1)
mov    %ebp,%eax
bt     %rax,%r15
jae    125d <getoverloadedop+0xfd>
xor    %eax,%eax
call   1030 <ncss_Getchar@plt>
mov    %eax,%ebp
cmp    (%r14),%eax
je     127b <getoverloadedop+0x11b>
cmp    $0x3b,%ebp
jbe    1240 <getoverloadedop+0xe0>
jmp    1263 <getoverloadedop+0x103>
bt     %rax,%r12
jb     1274 <getoverloadedop+0x114>
cmp    $0x101,%ebp
je     1248 <getoverloadedop+0xe8>
mov    %bpl,(%rbx)
add    $0x1,%rbx
jmp    1248 <getoverloadedop+0xe8>
mov    %ebp,%edi
call   1040 <ncss_Ungetc@plt>
movb   $0x0,(%rbx)
mov    %ebp,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @getoverloadedop(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [256 x i8]
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
store i8* %6, i8** %3
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%8 = call i32 @gettoken(i8* %7, i32* null, i32* null)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 40
br i1 %10, label %11, label %30
11: ; preds = %1
%12 = load i32, i32* %5
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
store i8 %13, i8* %14
br label %16
16: ; preds = %24, %11
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 41
br i1 %18, label %19, label %29
19: ; preds = %16
%20 = call i32 (...) @skipws()
store i32 %20, i32* %5
%21 = load i32, i32* @EOF
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %24
23: ; preds = %19
br label %29
24: ; preds = %19
%25 = load i32, i32* %5
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %2
store i8 %26, i8* %27
br label %16
29: ; preds = %23, %16
br label %94
30: ; preds = %1
%31 = load i32, i32* %5
%32 = icmp eq i32 %31, 278
br i1 %32, label %33, label %50
33: ; preds = %30
%34 = load i8*, i8** %2
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %2
store i8 95, i8* %34
%36 = load i8*, i8** %2
store i8 0, i8* %36
%37 = load i8*, i8** %2
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%39 = call i32 @strcat(i8* %37, i8* %38)
%40 = load i8*, i8** %2
%41 = call i32 @strlen(i8* %40)
%42 = load i8*, i8** %2
%43 = sext i32 %41 to i64
%44 = getelementptr inbounds i8, i8* %42, i64 %43
store i8* %44, i8** %2
%45 = load i8*, i8** %2
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %2
store i8 40, i8* %45
%47 = load i8*, i8** %2
%48 = getelementptr inbounds i8, i8* %47, i32 1
store i8* %48, i8** %2
store i8 41, i8* %47
%49 = load i8*, i8** %2
store i8 0, i8* %49
br label %93
50: ; preds = %30
%51 = load i32, i32* %5
%52 = load i32, i32* @EOF
%53 = icmp ne i32 %51, %52
br i1 %53, label %54, label %92
54: ; preds = %50
%55 = load i32, i32* %5
%56 = trunc i32 %55 to i8
%57 = load i8*, i8** %2
%58 = getelementptr inbounds i8, i8* %57, i32 1
store i8* %58, i8** %2
store i8 %56, i8* %57
br label %59
59: ; preds = %90, %54
%60 = call i32 (...) @ncss_Getchar()
store i32 %60, i32* %5
%61 = load i32, i32* @EOF
%62 = icmp ne i32 %60, %61
br i1 %62, label %63, label %91
63: ; preds = %59
%64 = load i32, i32* %5
%65 = icmp eq i32 %64, 257
br i1 %65, label %90, label %66
66: ; preds = %63
%67 = load i32, i32* %5
%68 = icmp eq i32 %67, 10
br i1 %68, label %90, label %69
69: ; preds = %66
%70 = load i32, i32* %5
%71 = icmp eq i32 %70, 9
br i1 %71, label %90, label %72
72: ; preds = %69
%73 = load i32, i32* %5
%74 = icmp eq i32 %73, 32
br i1 %74, label %90, label %75
75: ; preds = %72
%76 = load i32, i32* %5
%77 = icmp eq i32 %76, 40
br i1 %77, label %81, label %78
78: ; preds = %75
%79 = load i32, i32* %5
%80 = icmp eq i32 %79, 59
br i1 %80, label %81, label %84
81: ; preds = %78, %75
%82 = load i32, i32* %5
%83 = call i32 @ncss_Ungetc(i32 %82)
br label %91
84: ; preds = %78
%85 = load i32, i32* %5
%86 = trunc i32 %85 to i8
%87 = load i8*, i8** %2
%88 = getelementptr inbounds i8, i8* %87, i32 1
store i8* %88, i8** %2
store i8 %86, i8* %87
br label %89
89: ; preds = %84
br label %90
90: ; preds = %89, %72, %69, %66, %63
br label %59
91: ; preds = %81, %59
br label %92
92: ; preds = %91, %50
br label %93
93: ; preds = %92, %33
br label %94
94: ; preds = %93, %29
%95 = load i8*, i8** %2
store i8 0, i8* %95
%96 = load i32, i32* %5
ret i32 %96
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @getoverloadedop(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @gettoken(i8* %3, i32* null, i32* null)
switch i32 %4, label %24 [
i32 40, label %5
i32 278, label %16
]
5: ; preds = %1
store i8 40, i8* %0
%6 = getelementptr inbounds i8, i8* %0, i64 1
br label %7
7: ; preds = %5, %12
%8 = phi i8* [ %6, %5 ], [ %14, %12 ]
%9 = call i32 (...) @skipws()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %46, label %12
12: ; preds = %7
%13 = trunc i32 %9 to i8
store i8 %13, i8* %8
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = icmp eq i32 %9, 41
br i1 %15, label %46, label %7
16: ; preds = %1
%17 = getelementptr inbounds i8, i8* %0, i64 1
store i8 95, i8* %0
store i8 0, i8* %17
%18 = call i32 @strcat(i8* %17, i8* %3)
%19 = call i32 @strlen(i8* %17)
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %17, i64 %20
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 40, i8* %21
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 41, i8* %22
store i8 0, i8* %23
br label %46
24: ; preds = %1
%25 = load i32, i32* @EOF
%26 = icmp eq i32 %4, %25
br i1 %26, label %46, label %27
27: ; preds = %24
%28 = trunc i32 %4 to i8
%29 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %28, i8* %0
%30 = call i32 (...) @ncss_Getchar()
%31 = load i32, i32* @EOF
%32 = icmp eq i32 %30, %31
br i1 %32, label %46, label %33
33: ; preds = %27, %41
%34 = phi i32 [ %43, %41 ], [ %30, %27 ]
%35 = phi i8* [ %42, %41 ], [ %29, %27 ]
switch i32 %34, label %38 [
i32 257, label %41
i32 32, label %41
i32 10, label %41
i32 9, label %41
i32 59, label %36
i32 40, label %36
]
36: ; preds = %33, %33
%37 = call i32 @ncss_Ungetc(i32 %34)
br label %46
38: ; preds = %33
%39 = trunc i32 %34 to i8
%40 = getelementptr inbounds i8, i8* %35, i64 1
store i8 %39, i8* %35
br label %41
41: ; preds = %33, %33, %33, %33, %38
%42 = phi i8* [ %35, %33 ], [ %40, %38 ], [ %35, %33 ], [ %35, %33 ], [ %35, %33 ]
%43 = call i32 (...) @ncss_Getchar()
%44 = load i32, i32* @EOF
%45 = icmp eq i32 %43, %44
br i1 %45, label %46, label %33
46: ; preds = %12, %7, %41, %27, %16, %36, %24
%47 = phi i8* [ %23, %16 ], [ %35, %36 ], [ %0, %24 ], [ %29, %27 ], [ %42, %41 ], [ %8, %7 ], [ %14, %12 ]
%48 = phi i32 [ 278, %16 ], [ %34, %36 ], [ %4, %24 ], [ %30, %27 ], [ %43, %41 ], [ %9, %7 ], [ 41, %12 ]
store i8 0, i8* %47
ret i32 %48
}