#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 */
scalar_t__ isgraph(char const);
unsigned int strlen(char const *);
int isremark(const char *line) {
  if (line == NULL) {
    return -1;
  }
  unsigned int i;
  for (i = 0; i < strlen(line); i++) {
    if (isgraph(line[i])) {
      if (line[i] == '#')
        return 1;
      else
        return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isremark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <isremark+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c6 <isremark+0xa6>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jae    11bf <isremark+0x9f>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
je     11ac <isremark+0x8c>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
jne    11a0 <isremark+0x80>
movl   $0x1,-0x4(%rbp)
jmp    11c6 <isremark+0xa6>
movl   $0x0,-0x4(%rbp)
jmp    11c6 <isremark+0xa6>
jmp    11b1 <isremark+0x91>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <isremark+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isremark>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1163 <isremark+0x43>
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    $0x1,%r14d
test   %eax,%eax
je     1176 <isremark+0x56>
xor    %ebp,%ebp
nopl   (%rax)
movsbl (%rbx,%rbp,1),%edi
call   1040 <isgraph@plt>
test   %rax,%rax
jne    116b <isremark+0x4b>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%rbp
jb     1140 <isremark+0x20>
jmp    1176 <isremark+0x56>
mov    $0xffffffff,%r14d
jmp    1176 <isremark+0x56>
xor    %r14d,%r14d
cmpb   $0x23,(%rbx,%rbp,1)
sete   %r14b
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isremark(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %23, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %23, label %6
6: ; preds = %3, %18
%7 = phi i64 [ %19, %18 ], [ 0, %3 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i64 @isgraph(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %6
%13 = and i64 %7, 4294967295
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 35
%17 = zext i1 %16 to i32
br label %23
18: ; preds = %6
%19 = add nuw nsw i64 %7, 1
%20 = tail call i32 @strlen(i8* %0)
%21 = zext i32 %20 to i64
%22 = icmp ult i64 %19, %21
br i1 %22, label %6, label %23
23: ; preds = %18, %3, %12, %1
%24 = phi i32 [ -1, %1 ], [ %17, %12 ], [ 1, %3 ], [ 1, %18 ]
ret i32 %24
}