#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 *read_line(int /*<<< orphan*/ *, char *, size_t);
scalar_t__ strlen(char *);
char *find_block_start(FILE *file, char *buff, size_t buff_size) {
  char *line;
  for (;;) {
    line = read_line(file, buff, buff_size);
    if (line == NULL)
      break;
    if (strlen(line) == 0 || line[0] == '#')
      continue;
    else
      break;
  }
  return line;
}


x86 assembly (clang, -O0):
<find_block_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <read_line@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <find_block_start+0x39>
jmp    1186 <find_block_start+0x66>
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     117c <find_block_start+0x5c>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1181 <find_block_start+0x61>
jmp    1134 <find_block_start+0x14>
jmp    1186 <find_block_start+0x66>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_block_start>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
jmp    1129 <find_block_start+0x19>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <read_line@plt>
test   %rax,%rax
je     1141 <find_block_start+0x31>
movzbl (%rax),%ecx
cmp    $0x23,%cl
je     1120 <find_block_start+0x10>
test   %cl,%cl
je     1120 <find_block_start+0x10>
jmp    1143 <find_block_start+0x33>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @find_block_start(i32* %0, i8* %1, i64 %2) {
%4 = tail call i8* @read_line(i32* %0, i8* %1, i64 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3, %9
%7 = phi i8* [ %10, %9 ], [ %4, %3 ]
%8 = load i8, i8* %7
switch i8 %8, label %12 [
i8 0, label %9
i8 35, label %9
]
9: ; preds = %6, %6
%10 = tail call i8* @read_line(i32* %0, i8* %1, i64 %2)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %9, %6, %3
%13 = phi i8* [ null, %3 ], [ %7, %6 ], [ null, %9 ]
ret i8* %13
}