#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);
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strncmp(char *, char *, int);
char *LeLinha(FILE *InStream, FILE *OutStream) {
  char ENTRADA[100];
  char COMENT[1] = "#";
  do {
    fgets(ENTRADA, 100, InStream);
    strcat(ENTRADA, "\0");
    fprintf(OutStream, "%s %s", "Input>", ENTRADA);
  } while ((strncmp(ENTRADA, COMENT, 1) == 0) && !feof(InStream));
  if (feof(InStream)) {
    printf("EOF do arquivo de configuracao antes do tempo!");
    exit(1);
  }
  return (ENTRADA);
}


x86 assembly (clang, -O0):
<LeLinha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe77(%rip),%al
mov    %al,-0x81(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x64,%esi
call   1050 <fgets@plt>
lea    -0x80(%rbp),%rdi
lea    0xe55(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rcx
lea    0xe43(%rip),%rsi
lea    0xe42(%rip),%rdx
call   1060 <fprintf@plt>
lea    -0x80(%rbp),%rdi
lea    -0x81(%rbp),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x82(%rbp)
jne    120e <LeLinha+0x9e>
mov    -0x8(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x82(%rbp)
mov    -0x82(%rbp),%al
test   $0x1,%al
jne    118f <LeLinha+0x1f>
mov    -0x8(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%rax
je     1245 <LeLinha+0xd5>
lea    0xdda(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
lea    -0x80(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeLinha>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
movb   $0x23,0xf(%rsp)
lea    0x10(%rsp),%rbx
lea    0xe6d(%rip),%r13
lea    0xe6c(%rip),%rbp
lea    0xf(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
mov    %rbx,%rdi
lea    0xe36(%rip),%rsi
call   1080 <strcat@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
mov    %rbx,%rcx
call   1060 <fprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1202 <LeLinha+0x92>
mov    %r15,%rdi
call   1070 <feof@plt>
test   %rax,%rax
je     11b0 <LeLinha+0x40>
mov    %r15,%rdi
call   1070 <feof@plt>
test   %rax,%rax
jne    1223 <LeLinha+0xb3>
lea    0x10(%rsp),%rax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xde5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@__const.LeLinha.COMENT = [1 x i8] c"#"
@.str = [2 x i8] zeroinitializer
@.str.1 = [6 x i8] c"%s %s\00"
@.str.2 = [7 x i8] c"Input>\00"
@.str.3 = [47 x i8] c"EOF do arquivo de configuracao antes do tempo!\00"
define i8* @LeLinha(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [100 x i8]
%6 = alloca [1 x i8]
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = bitcast [1 x i8]* %6 to i8*
br label %8
8: ; preds = %27, %2
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%10 = load i32*, i32** %3
%11 = call i32 @fgets(i8* %9, i32 100, i32* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%13 = call i32 @strcat(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = load i32*, i32** %4
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%16 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %8
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%19 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
%20 = call i64 @strncmp(i8* %18, i8* %19, i32 1)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %17
%23 = load i32*, i32** %3
%24 = call i64 @feof(i32* %23)
%25 = icmp ne i64 %24, 0
%26 = xor i1 %25, true
br label %27
27: ; preds = %22, %17
%28 = phi i1 [ false, %17 ], [ %26, %22 ]
br i1 %28, label %8, label %29
29: ; preds = %27
%30 = load i32*, i32** %3
%31 = call i64 @feof(i32* %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %29
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
ret i8* %37
}

LLVM IR (-O2):
@.str = [2 x i8] zeroinitializer
@.str.1 = [6 x i8] c"%s %s\00"
@.str.2 = [7 x i8] c"Input>\00"
@.str.3 = [47 x i8] c"EOF do arquivo de configuracao antes do tempo!\00"
define i8* @LeLinha(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [100 x i8]
%4 = alloca [1 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
store i8 35, i8* %6
br label %7
7: ; preds = %13, %2
%8 = call i32 @fgets(i8* %5, i32 100, i32* %0)
%9 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%11 = call i64 @strncmp(i8* %5, i8* %6, i32 1)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %7
%14 = call i64 @feof(i32* %0)
%15 = icmp eq i64 %14, 0
br i1 %15, label %7, label %16
16: ; preds = %7, %13
%17 = call i64 @feof(i32* %0)
%18 = icmp eq i64 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %16
ret i8* %5
}