#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 */
scalar_t__ feof(int /*<<< orphan*/ *);
scalar_t__ getline(char **, size_t *, int /*<<< orphan*/ *);
int _get_non_comment_line(char **line, size_t *n, FILE *file) {
  *line = NULL;
  while ((getline(line, n, file) >= 0) && ((*line)[0] == '#')) {
  }
  if (feof(file)) {
    return -1;
  }
  return *n;
}


x86 assembly (clang, -O0):
<_get_non_comment_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <getline@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x21(%rbp)
jl     1175 <_get_non_comment_line+0x55>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1185 <_get_non_comment_line+0x65>
jmp    118a <_get_non_comment_line+0x6a>
jmp    113f <_get_non_comment_line+0x1f>
mov    -0x20(%rbp),%rdi
call   1030 <feof@plt>
cmp    $0x0,%rax
je     11a9 <_get_non_comment_line+0x89>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b3 <_get_non_comment_line+0x93>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_non_comment_line>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
movq   $0x0,(%rdi)
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <getline@plt>
test   %rax,%rax
js     115b <_get_non_comment_line+0x3b>
mov    (%rbx),%rax
cmpb   $0x23,(%rax)
je     1140 <_get_non_comment_line+0x20>
mov    %r15,%rdi
call   1030 <feof@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1173 <_get_non_comment_line+0x53>
mov    (%r14),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @_get_non_comment_line(i8** %0, i64* %1, i32* %2) {
store i8* null, i8** %0
br label %4
4: ; preds = %7, %3
%5 = tail call i64 @getline(i8** %0, i64* %1, i32* %2)
%6 = icmp sgt i64 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i8*, i8** %0
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 35
br i1 %10, label %4, label %11
11: ; preds = %4, %7
%12 = tail call i64 @feof(i32* %2)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i64, i64* %1
%16 = trunc i64 %15 to i32
br label %17
17: ; preds = %11, %14
%18 = phi i32 [ %16, %14 ], [ -1, %11 ]
ret i32 %18
}