#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*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int strlen(char *);
int main() {
  char line[25000];
  FILE *fin = fopen("input.txt", "r");
  while (fgets(line, sizeof line, fin) != NULL) {
    if (strlen(line) >= 50) {
      printf("%s\n", line);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x61c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x61b8(%rbp)
lea    -0x61b0(%rbp),%rdi
mov    -0x61b8(%rbp),%rdx
mov    $0x61a8,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     11bb <main+0x7b>
lea    -0x61b0(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x32,%eax
jl     11b6 <main+0x76>
lea    -0x61b0(%rbp),%rsi
lea    0xe5b(%rip),%rdi
call   1040 <printf@plt>
jmp    116c <main+0x2c>
xor    %eax,%eax
add    $0x61c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x61b0,%rsp
lea    0xead(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
mov    %rsp,%rdi
mov    $0x61a8,%esi
mov    %rax,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     11bf <main+0x7f>
mov    %rsp,%rbx
lea    0xe8b(%rip),%r15
jmp    11a5 <main+0x65>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    $0x61a8,%esi
mov    %r14,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     11bf <main+0x7f>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x32,%eax
jl     1190 <main+0x50>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    1190 <main+0x50>
xor    %eax,%eax
add    $0x61b0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [25000 x i8]
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
br label %5
5: ; preds = %17, %0
%6 = getelementptr inbounds [25000 x i8], [25000 x i8]* %2, i64 0, i64 0
%7 = load i32*, i32** %3
%8 = call i32* @fgets(i8* %6, i32 25000, i32* %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = getelementptr inbounds [25000 x i8], [25000 x i8]* %2, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = icmp sge i32 %12, 50
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = getelementptr inbounds [25000 x i8], [25000 x i8]* %2, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %10
br label %5
18: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [25000 x i8]
%2 = getelementptr inbounds [25000 x i8], [25000 x i8]* %1, i64 0, i64 0
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32* @fgets(i8* %2, i32 25000, i32* %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %14, label %6
6: ; preds = %0, %11
%7 = call i32 @strlen(i8* %2)
%8 = icmp sgt i32 %7, 49
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2)
br label %11
11: ; preds = %9, %6
%12 = call i32* @fgets(i8* %2, i32 25000, i32* %3)
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %6
14: ; preds = %11, %0
ret i32 0
}