#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 */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *read_line(int /*<<< orphan*/ *, char *, size_t);
int /*<<< orphan*/ stderr;
scalar_t__ strlen(char *);
char *read_empty_line(FILE *file, char *buff, size_t buff_size) {
  char *ret;
  ret = read_line(file, buff, buff_size);
  if (ret != NULL && strlen(ret) != 0) {
    fprintf(stderr, "expecting an empty line: %s", buff);
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<read_empty_line>:
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   1050 <read_line@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11aa <read_empty_line+0x6a>
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     11aa <read_empty_line+0x6a>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe65(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_empty_line>:
push   %rbx
mov    %rsi,%rbx
call   1040 <read_line@plt>
test   %rax,%rax
je     1143 <read_empty_line+0x13>
cmpb   $0x0,(%rax)
jne    1145 <read_empty_line+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"expecting an empty line: %s\00"
define i8* @read_empty_line(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
%8 = load i32*, i32** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @read_line(i32* %8, i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %23
14: ; preds = %3
%15 = load i8*, i8** %7
%16 = call i64 @strlen(i8* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %5
%21 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %14, %3
%24 = load i8*, i8** %7
ret i8* %24
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"expecting an empty line: %s\00"
define i8* @read_empty_line(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 %13, label %6
6: ; preds = %3
%7 = load i8, i8* %4
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %1)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %6, %3
ret i8* %4
}