#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*/ putchar(char);
int remove_white_space(int ch, int prevch) {
  if (ch == ' ' && prevch == ' ') {
    return 0;
  } else if (ch == ' ' && (prevch == ';' || prevch == ')' || prevch == '}' ||
                           prevch == '{' || prevch == '(' || prevch == '\n')) {
    return 0;
  } else if (ch == '\n' || ch == '\t') {
    if (prevch != ' ' && prevch != ';' && prevch != '{' && prevch != '}' &&
        prevch != '\n' && prevch != '\t')
      putchar(' ');
    return 0;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<remove_white_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x20,-0x8(%rbp)
jne    113e <remove_white_space+0x2e>
cmpl   $0x20,-0xc(%rbp)
jne    113e <remove_white_space+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    11fd <remove_white_space+0xed>
cmpl   $0x20,-0x8(%rbp)
jne    1190 <remove_white_space+0x80>
cmpl   $0x3b,-0xc(%rbp)
je     1184 <remove_white_space+0x74>
cmpl   $0x29,-0xc(%rbp)
je     1184 <remove_white_space+0x74>
cmpl   $0x7d,-0xc(%rbp)
je     1184 <remove_white_space+0x74>
cmpl   $0x7b,-0xc(%rbp)
je     1184 <remove_white_space+0x74>
cmpl   $0x28,-0xc(%rbp)
je     1184 <remove_white_space+0x74>
cmpl   $0xa,-0xc(%rbp)
jne    1190 <remove_white_space+0x80>
movl   $0x0,-0x4(%rbp)
jmp    11fd <remove_white_space+0xed>
cmpl   $0xa,-0x8(%rbp)
je     11a4 <remove_white_space+0x94>
cmpl   $0x9,-0x8(%rbp)
jne    11f6 <remove_white_space+0xe6>
cmpl   $0x20,-0xc(%rbp)
je     11ea <remove_white_space+0xda>
cmpl   $0x3b,-0xc(%rbp)
je     11ea <remove_white_space+0xda>
cmpl   $0x7b,-0xc(%rbp)
je     11ea <remove_white_space+0xda>
cmpl   $0x7d,-0xc(%rbp)
je     11ea <remove_white_space+0xda>
cmpl   $0xa,-0xc(%rbp)
je     11ea <remove_white_space+0xda>
cmpl   $0x9,-0xc(%rbp)
je     11ea <remove_white_space+0xda>
mov    $0x20,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x4(%rbp)
jmp    11fd <remove_white_space+0xed>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_white_space>:
xor    %eax,%eax
cmp    $0x20,%edi
jne    111f <remove_white_space+0xf>
cmp    $0x20,%esi
jne    111f <remove_white_space+0xf>
xor    %eax,%eax
ret
cmp    $0x20,%edi
jne    1150 <remove_white_space+0x40>
cmp    $0x3b,%esi
ja     113b <remove_white_space+0x2b>
mov    %esi,%ecx
movabs $0x800030000000400,%rdx
bt     %rcx,%rdx
jb     1190 <remove_white_space+0x80>
cmp    $0x7b,%esi
je     1190 <remove_white_space+0x80>
mov    $0x0,%eax
cmp    $0x7d,%esi
je     1190 <remove_white_space+0x80>
mov    $0x1,%eax
ret
add    $0xfffffff7,%edi
mov    $0x1,%eax
cmp    $0x1,%edi
ja     1190 <remove_white_space+0x80>
cmp    $0x3b,%esi
ja     1174 <remove_white_space+0x64>
mov    %esi,%eax
movabs $0x800000100000600,%rcx
bt     %rax,%rcx
jb     111c <remove_white_space+0xc>
cmp    $0x7b,%esi
je     111c <remove_white_space+0xc>
cmp    $0x7d,%esi
je     111c <remove_white_space+0xc>
push   %rax
mov    $0x20,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
ret

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

LLVM IR (-O2):
define i32 @remove_white_space(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 32
%4 = icmp eq i32 %1, 32
%5 = and i1 %3, %4
br i1 %5, label %15, label %6
6: ; preds = %2
br i1 %3, label %7, label %9
7: ; preds = %6
switch i32 %1, label %8 [
i32 125, label %15
i32 123, label %15
i32 59, label %15
i32 41, label %15
i32 40, label %15
i32 10, label %15
]
8: ; preds = %7
br label %15
9: ; preds = %6
%10 = add i32 %0, -9
%11 = icmp ult i32 %10, 2
br i1 %11, label %12, label %15
12: ; preds = %9
switch i32 %1, label %13 [
i32 125, label %15
i32 123, label %15
i32 59, label %15
i32 32, label %15
i32 10, label %15
i32 9, label %15
]
13: ; preds = %12
%14 = tail call i32 @putchar(i8 signext 32)
br label %15
15: ; preds = %8, %9, %13, %12, %12, %12, %12, %12, %12, %7, %7, %7, %7, %7, %7, %2
%16 = phi i32 [ 0, %2 ], [ 0, %7 ], [ 0, %7 ], [ 0, %7 ], [ 0, %7 ], [ 0, %7 ], [ 0, %7 ], [ 0, %12 ], [ 0, %12 ], [ 0, %12 ], [ 0, %12 ], [ 0, %12 ], [ 0, %12 ], [ 0, %13 ], [ 1, %9 ], [ 1, %8 ]
ret i32 %16
}