#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 */
char getCharacter();
char skipComment();
int /*<<< orphan*/ ungetCharacter(char);
char getCharacterSkippingWhitespaceAndComments() {
  char c;
  char c2;
  do {
    c = getCharacter();
    if (c == '/') {
      c2 = getCharacter();
      if (c2 == '*')
        c = skipComment();
      else
        (ungetCharacter(c2));
    }
  } while ((c == ' ' || c == '\t' || c == '\n'));
}


x86 assembly (clang, -O0):
<getCharacterSkippingWhitespaceAndComments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getCharacter@plt>
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x2f,%eax
jne    1183 <getCharacterSkippingWhitespaceAndComments+0x53>
mov    $0x0,%al
call   1040 <getCharacter@plt>
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
cmp    $0x2a,%eax
jne    1175 <getCharacterSkippingWhitespaceAndComments+0x45>
mov    $0x0,%al
call   1050 <skipComment@plt>
mov    %al,-0x2(%rbp)
jmp    117e <getCharacterSkippingWhitespaceAndComments+0x4e>
movsbl -0x3(%rbp),%edi
call   1030 <ungetCharacter@plt>
jmp    1183 <getCharacterSkippingWhitespaceAndComments+0x53>
jmp    1188 <getCharacterSkippingWhitespaceAndComments+0x58>
movsbl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x4(%rbp)
je     11b9 <getCharacterSkippingWhitespaceAndComments+0x89>
movsbl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x4(%rbp)
je     11b9 <getCharacterSkippingWhitespaceAndComments+0x89>
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
test   $0x1,%al
jne    1138 <getCharacterSkippingWhitespaceAndComments+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCharacterSkippingWhitespaceAndComments>:
push   %rbx
movabs $0x100000600,%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getCharacter@plt>
cmp    $0x2f,%al
jne    115d <getCharacterSkippingWhitespaceAndComments+0x2d>
xor    %eax,%eax
call   1040 <getCharacter@plt>
cmp    $0x2a,%al
jne    116c <getCharacterSkippingWhitespaceAndComments+0x3c>
xor    %eax,%eax
call   1050 <skipComment@plt>
cmp    $0x20,%al
ja     116a <getCharacterSkippingWhitespaceAndComments+0x3a>
movzbl %al,%eax
bt     %rax,%rbx
jb     1140 <getCharacterSkippingWhitespaceAndComments+0x10>
pop    %rbx
ret
movsbl %al,%edi
call   1030 <ungetCharacter@plt>
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @getCharacterSkippingWhitespaceAndComments() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
br label %4
4: ; preds = %33, %0
%5 = call signext i8 (...) @getCharacter()
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 47
br i1 %8, label %9, label %20
9: ; preds = %4
%10 = call signext i8 (...) @getCharacter()
store i8 %10, i8* %3
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 42
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call signext i8 (...) @skipComment()
store i8 %15, i8* %2
br label %19
16: ; preds = %9
%17 = load i8, i8* %3
%18 = call i32 @ungetCharacter(i8 signext %17)
br label %19
19: ; preds = %16, %14
br label %20
20: ; preds = %19, %4
br label %21
21: ; preds = %20
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 32
br i1 %24, label %33, label %25
25: ; preds = %21
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 9
br i1 %28, label %33, label %29
29: ; preds = %25
%30 = load i8, i8* %2
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 10
br label %33
33: ; preds = %29, %25, %21
%34 = phi i1 [ true, %25 ], [ true, %21 ], [ %32, %29 ]
br i1 %34, label %4, label %35
35: ; preds = %33
%36 = load i8, i8* %1
ret i8 %36
}

LLVM IR (-O2):
define signext i8 @getCharacterSkippingWhitespaceAndComments() {
br label %1
1: ; preds = %13, %0
%2 = tail call signext i8 (...) @getCharacter()
%3 = icmp eq i8 %2, 47
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call signext i8 (...) @getCharacter()
%6 = icmp eq i8 %5, 42
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call signext i8 (...) @skipComment()
br label %11
9: ; preds = %4
%10 = tail call i32 @ungetCharacter(i8 signext %5)
br label %14
11: ; preds = %1, %7
%12 = phi i8 [ %8, %7 ], [ %2, %1 ]
switch i8 %12, label %14 [
i8 32, label %13
i8 10, label %13
i8 9, label %13
]
13: ; preds = %11, %11, %11
br label %1
14: ; preds = %11, %9
ret i8 undef
}