#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 getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  while (1) {
    int c = getchar();
    if (c == -1) {
      return 0;
    } else if (c == '(') {
      putchar('p');
    } else if (c == '-' || (c >= '0' && c <= '9')) {
      putchar('n');
    } else {
      putchar('o');
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    114b <main+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
cmpl   $0x28,-0x8(%rbp)
jne    1164 <main+0x44>
mov    $0x70,%edi
call   1030 <putchar@plt>
jmp    11a0 <main+0x80>
cmpl   $0x2d,-0x8(%rbp)
je     1182 <main+0x62>
cmpl   $0x30,-0x8(%rbp)
jl     1191 <main+0x71>
cmpl   $0x39,-0x8(%rbp)
jg     1191 <main+0x71>
mov    $0x6e,%edi
call   1030 <putchar@plt>
jmp    119b <main+0x7b>
mov    $0x6f,%edi
call   1030 <putchar@plt>
jmp    11a0 <main+0x80>
jmp    11a5 <main+0x85>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
jmp    113a <main+0x1a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x6e,%cl
movzbl %cl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x28,%eax
je     1160 <main+0x40>
cmp    $0x2d,%eax
je     1130 <main+0x10>
cmp    $0xffffffff,%eax
je     1164 <main+0x44>
add    $0xffffffd0,%eax
mov    $0x6f,%cl
cmp    $0x9,%eax
jbe    1130 <main+0x10>
jmp    1132 <main+0x12>
nopl   0x0(%rax)
mov    $0x70,%cl
jmp    1132 <main+0x12>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %28
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %3
ret i32 0
8: ; preds = %3
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 40
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @putchar(i8 signext 112)
br label %27
13: ; preds = %8
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 45
br i1 %15, label %22, label %16
16: ; preds = %13
%17 = load i32, i32* %2
%18 = icmp sge i32 %17, 48
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %2
%21 = icmp sle i32 %20, 57
br i1 %21, label %22, label %24
22: ; preds = %19, %13
%23 = call i32 @putchar(i8 signext 110)
br label %26
24: ; preds = %19, %16
%25 = call i32 @putchar(i8 signext 111)
br label %26
26: ; preds = %24, %22
br label %27
27: ; preds = %26, %11
br label %28
28: ; preds = %27
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %7, %0
%2 = tail call i32 (...) @getchar()
switch i32 %2, label %3 [
i32 -1, label %10
i32 40, label %7
i32 45, label %6
]
3: ; preds = %1
%4 = add i32 %2, -48
%5 = icmp ult i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %1, %3
br label %7
7: ; preds = %3, %1, %6
%8 = phi i8 [ 110, %6 ], [ 112, %1 ], [ 111, %3 ]
%9 = tail call i32 @putchar(i8 signext %8)
br label %1
10: ; preds = %1
ret i32 0
}