#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *fgets(char *, int, int /*<<< orphan*/ *);
scalar_t__ isblankline(char *);
scalar_t__ iscommentline(char *);
int nextline(char *line, int n, FILE *fp) {
  char *s;
  do {
    s = fgets(line, n, fp);
  } while (s && (iscommentline(line) || isblankline(line)));
  if (s == NULL)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<nextline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <fgets@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x28(%rbp)
mov    %al,-0x29(%rbp)
je     119b <nextline+0x6b>
mov    -0x10(%rbp),%rdi
call   1030 <iscommentline@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2a(%rbp)
jne    1195 <nextline+0x65>
mov    -0x10(%rbp),%rdi
call   1050 <isblankline@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2a(%rbp)
mov    -0x2a(%rbp),%al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    1143 <nextline+0x13>
cmpq   $0x0,-0x28(%rbp)
jne    11bd <nextline+0x8d>
movl   $0x0,-0x4(%rbp)
jmp    11c4 <nextline+0x94>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextline>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <fgets@plt>
xor    %r14d,%r14d
jmp    115d <nextline+0x2d>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1182 <nextline+0x52>
mov    %rbx,%rdi
call   1030 <iscommentline@plt>
test   %rax,%rax
jne    1150 <nextline+0x20>
mov    %rbx,%rdi
call   1050 <isblankline@plt>
test   %rax,%rax
jne    1150 <nextline+0x20>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nextline(i8* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
br label %9
9: ; preds = %27, %3
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = call i8* @fgets(i8* %10, i32 %11, i32* %12)
store i8* %13, i8** %8
br label %14
14: ; preds = %9
%15 = load i8*, i8** %8
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %27
17: ; preds = %14
%18 = load i8*, i8** %5
%19 = call i64 @iscommentline(i8* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %17
%22 = load i8*, i8** %5
%23 = call i64 @isblankline(i8* %22)
%24 = icmp ne i64 %23, 0
br label %25
25: ; preds = %21, %17
%26 = phi i1 [ true, %17 ], [ %24, %21 ]
br label %27
27: ; preds = %25, %14
%28 = phi i1 [ false, %14 ], [ %26, %25 ]
br i1 %28, label %9, label %29
29: ; preds = %27
%30 = load i8*, i8** %8
%31 = icmp eq i8* %30, null
br i1 %31, label %32, label %33
32: ; preds = %29
store i32 0, i32* %4
br label %34
33: ; preds = %29
store i32 1, i32* %4
br label %34
34: ; preds = %33, %32
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
define i32 @nextline(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i8* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %15, label %6
6: ; preds = %3, %12
%7 = tail call i64 @iscommentline(i8* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = tail call i64 @isblankline(i8* %0)
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9, %6
%13 = tail call i8* @fgets(i8* %0, i32 %1, i32* %2)
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %6
15: ; preds = %12, %9, %3
%16 = phi i32 [ 0, %3 ], [ 1, %9 ], [ 0, %12 ]
ret i32 %16
}