#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*/ gotoendofline(char **);
scalar_t__ isspace(int);
int getnewline(char **line) {
  char *c = *line;
  while (1) {
    while (isspace((int)*c))
      c++;
    if (*c == '#' || *c == ';')
      gotoendofline(&c);
    else
      break;
  }
  *line = c;
  if (*c == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<getnewline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    113c <getnewline+0x1c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1163 <getnewline+0x43>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113c <getnewline+0x1c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     1183 <getnewline+0x63>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
jne    1191 <getnewline+0x71>
lea    -0x18(%rbp),%rdi
call   1040 <gotoendofline@plt>
jmp    1196 <getnewline+0x76>
jmp    119b <getnewline+0x7b>
jmp    1137 <getnewline+0x17>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11c2 <getnewline+0xa2>
movl   $0x0,-0x4(%rbp)
jmp    11c9 <getnewline+0xa9>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnewline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rax
mov    %rax,(%rsp)
mov    %rsp,%rbx
movsbl (%rax),%edi
jmp    1150 <getnewline+0x30>
cs nopw 0x0(%rax,%rax,1)
mov    (%rsp),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rsp)
movsbl 0x1(%rax),%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1140 <getnewline+0x20>
mov    (%rsp),%rcx
movzbl (%rcx),%eax
cmp    $0x3b,%al
je     1169 <getnewline+0x49>
cmp    $0x23,%al
jne    117a <getnewline+0x5a>
mov    %rbx,%rdi
call   1040 <gotoendofline@plt>
mov    (%rsp),%rax
movsbl (%rax),%edi
jmp    1150 <getnewline+0x30>
mov    %rcx,(%r14)
xor    %eax,%eax
cmpb   $0x0,(%rcx)
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @getnewline(i8** nocapture %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = load i8*, i8** %0
store i8* %4, i8** %2
br label %5
5: ; preds = %21, %1
%6 = phi i8* [ %23, %21 ], [ %4, %1 ]
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = call i64 @isspace(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %5, %11
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i64 @isspace(i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %11
18: ; preds = %11, %5
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
switch i8 %20, label %24 [
i8 35, label %21
i8 59, label %21
]
21: ; preds = %18, %18
%22 = call i32 @gotoendofline(i8** %2)
%23 = load i8*, i8** %2
br label %5
24: ; preds = %18
store i8* %19, i8** %0
%25 = load i8, i8* %19
%26 = icmp ne i8 %25, 0
%27 = zext i1 %26 to i32
ret i32 %27
}