#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 EOF;
char getch();
char peekch();
char comment(void) {
  char c;
  while ((c = getch()) != EOF)
    if (c == '*' && peekch() == '/') {
      c = getch();
      c = getch();
      break;
    }
  return c;
}


x86 assembly (clang, -O0):
<comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getch@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%eax
mov    0x2eac(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1185 <comment+0x65>
movsbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
jne    1180 <comment+0x60>
mov    $0x0,%al
call   1040 <peekch@plt>
movsbl %al,%eax
cmp    $0x2f,%eax
jne    1180 <comment+0x60>
mov    $0x0,%al
call   1030 <getch@plt>
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <getch@plt>
mov    %al,-0x1(%rbp)
jmp    1185 <comment+0x65>
jmp    1128 <comment+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comment>:
push   %rbx
xor    %eax,%eax
call   1030 <getch@plt>
mov    0x2eb9(%rip),%rbx
jmp    1147 <comment+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getch@plt>
cmp    (%rbx),%al
je     1169 <comment+0x49>
cmp    $0x2a,%al
jne    1140 <comment+0x20>
xor    %eax,%eax
call   1040 <peekch@plt>
cmp    $0x2f,%al
jne    1140 <comment+0x20>
xor    %eax,%eax
call   1030 <getch@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <getch@plt>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define signext i8 @comment() {
%1 = alloca i8
br label %2
2: ; preds = %19, %0
%3 = call signext i8 (...) @getch()
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = load i8, i8* @EOF
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %4, %6
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 42
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = call signext i8 (...) @peekch()
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 47
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = call signext i8 (...) @getch()
store i8 %17, i8* %1
%18 = call signext i8 (...) @getch()
store i8 %18, i8* %1
br label %20
19: ; preds = %12, %8
br label %2
20: ; preds = %16, %2
%21 = load i8, i8* %1
ret i8 %21
}

LLVM IR (-O2):
@EOF = global i8 0
define signext i8 @comment() {
%1 = tail call signext i8 (...) @getch()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %17, label %4
4: ; preds = %0, %13
%5 = phi i8 [ %14, %13 ], [ %1, %0 ]
%6 = icmp eq i8 %5, 42
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = tail call signext i8 (...) @peekch()
%9 = icmp eq i8 %8, 47
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = tail call signext i8 (...) @getch()
%12 = tail call signext i8 (...) @getch()
br label %17
13: ; preds = %7, %4
%14 = tail call signext i8 (...) @getch()
%15 = load i8, i8* @EOF
%16 = icmp eq i8 %14, %15
br i1 %16, label %17, label %4
17: ; preds = %13, %0, %10
%18 = phi i8 [ %12, %10 ], [ %1, %0 ], [ %14, %13 ]
ret i8 %18
}