#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*/ isspace(int);
int is_blank_line(char *str) {
  int i;
  for (i = 0; str[i]; i++) {
    if (str[i] == '#')
      return 1;
    if (!isspace((int)str[i]))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_blank_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     118f <is_blank_line+0x7f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
jne    1156 <is_blank_line+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1196 <is_blank_line+0x86>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    117c <is_blank_line+0x6c>
movl   $0x0,-0x4(%rbp)
jmp    1196 <is_blank_line+0x86>
jmp    1181 <is_blank_line+0x71>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <is_blank_line+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank_line>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
mov    $0x1,%eax
test   %edi,%edi
je     1141 <is_blank_line+0x31>
cmp    $0x23,%dil
je     1141 <is_blank_line+0x31>
call   1030 <isspace@plt>
add    $0x1,%rbx
test   %eax,%eax
jne    1120 <is_blank_line+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_blank_line(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %10, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %11
i8 35, label %11
]
6: ; preds = %2
%7 = sext i8 %5 to i32
%8 = tail call i32 @isspace(i32 %7)
%9 = icmp eq i32 %8, 0
%10 = add nuw i64 %3, 1
br i1 %9, label %11, label %2
11: ; preds = %2, %6, %2
%12 = phi i32 [ 1, %2 ], [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}