#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 get_next_chars(int /*<<< orphan*/);
int /*<<< orphan*/ skip_possible_comments(int *, int, int);
int comment_or_white(int start, int end, int cmtmode) {
  char c;
  while (start < end) {
    skip_possible_comments(&start, cmtmode, 1);
    if (start < end) {
      c = get_next_chars(start++);
      if ((c != ' ') && (c != '\n') && (c != '\t'))
        return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<comment_or_white>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11aa <comment_or_white+0x8a>
mov    -0x10(%rbp),%esi
lea    -0x8(%rbp),%rdi
mov    $0x1,%edx
call   1030 <skip_possible_comments@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a5 <comment_or_white+0x85>
mov    -0x8(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1040 <get_next_chars@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x20,%eax
je     11a0 <comment_or_white+0x80>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
je     11a0 <comment_or_white+0x80>
movsbl -0x11(%rbp),%eax
cmp    $0x9,%eax
je     11a0 <comment_or_white+0x80>
movl   $0x0,-0x4(%rbp)
jmp    11b1 <comment_or_white+0x91>
jmp    11a5 <comment_or_white+0x85>
jmp    1131 <comment_or_white+0x11>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comment_or_white>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
mov    $0x1,%eax
cmp    %esi,%edi
jge    1192 <comment_or_white+0x72>
mov    %edx,%ebx
mov    %esi,%ebp
lea    0x4(%rsp),%r14
movabs $0x100000600,%r15
jmp    1156 <comment_or_white+0x36>
nopl   0x0(%rax)
cmp    %ebp,0x4(%rsp)
jge    118d <comment_or_white+0x6d>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <skip_possible_comments@plt>
mov    0x4(%rsp),%edi
cmp    %ebp,%edi
jge    1150 <comment_or_white+0x30>
lea    0x1(%rdi),%eax
mov    %eax,0x4(%rsp)
call   1040 <get_next_chars@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x20,%cl
ja     1192 <comment_or_white+0x72>
movzbl %cl,%ecx
bt     %rcx,%r15
jb     1150 <comment_or_white+0x30>
jmp    1192 <comment_or_white+0x72>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @comment_or_white(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
br label %9
9: ; preds = %36, %3
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %37
13: ; preds = %9
%14 = load i32, i32* %7
%15 = call i32 @skip_possible_comments(i32* %5, i32 %14, i32 1)
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %36
19: ; preds = %13
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
%22 = call signext i8 @get_next_chars(i32 %20)
store i8 %22, i8* %8
%23 = load i8, i8* %8
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 32
br i1 %25, label %26, label %35
26: ; preds = %19
%27 = load i8, i8* %8
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 10
br i1 %29, label %30, label %35
30: ; preds = %26
%31 = load i8, i8* %8
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 9
br i1 %33, label %34, label %35
34: ; preds = %30
store i32 0, i32* %4
br label %38
35: ; preds = %30, %26, %19
br label %36
36: ; preds = %35, %13
br label %9
37: ; preds = %9
store i32 1, i32* %4
br label %38
38: ; preds = %37, %34
%39 = load i32, i32* %4
ret i32 %39
}

LLVM IR (-O2):
define i32 @comment_or_white(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = icmp slt i32 %0, %1
br i1 %5, label %6, label %16
6: ; preds = %3, %13
%7 = call i32 @skip_possible_comments(i32* %4, i32 %2, i32 1)
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, %1
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = add nsw i32 %8, 1
store i32 %11, i32* %4
%12 = call signext i8 @get_next_chars(i32 %8)
switch i8 %12, label %16 [
i8 32, label %13
i8 10, label %13
i8 9, label %13
]
13: ; preds = %10, %10, %10, %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, %1
br i1 %15, label %6, label %16
16: ; preds = %10, %13, %3
%17 = phi i32 [ 1, %3 ], [ 1, %13 ], [ 0, %10 ]
ret i32 %17
}