#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*/ buff;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ skip(int /*<<< orphan*/ *, char);
int /*<<< orphan*/ stderr;
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void printFrom(FILE *f, int fromline) {
  int len;
  int cnt = 0;
  int skipped = 0;
  char buff[1024];
  strncpy(buff, "", 1024);
  while (fgets(buff, sizeof(buff), f) != NULL) {
    cnt++;
    len = strlen(buff);
    if (buff[len - 1] != '\n') {
      if (skip(f, '\n') == 0) {
        buff[len - 1] = '\n';
        if (skipped == 0) {
          skipped = 1;
          fprintf(stderr, "Prilis velka delka radku!\n");
        }
      }
    }
    if (cnt >= fromline)
      printf("%s", buff);
  }
}


x86 assembly (clang, -O0):
<printFrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
lea    0xe8c(%rip),%rsi
mov    $0x400,%edx
call   1040 <strncpy@plt>
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1264 <printFrom+0x104>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x420(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
je     1240 <printFrom+0xe0>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <skip@plt>
cmp    $0x0,%rax
jne    123b <printFrom+0xdb>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0xa,-0x420(%rbp,%rax,1)
0a
cmpl   $0x0,-0x18(%rbp)
jne    1236 <printFrom+0xd6>
movl   $0x1,-0x18(%rbp)
mov    0x2db8(%rip),%rax
mov    (%rax),%edi
lea    0xdcf(%rip),%rsi
call   1080 <fprintf@plt>
jmp    123b <printFrom+0xdb>
jmp    1240 <printFrom+0xe0>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     125f <printFrom+0xff>
lea    -0x420(%rbp),%rsi
lea    0xdc1(%rip),%rdi
call   1060 <printf@plt>
jmp    1198 <printFrom+0x38>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFrom>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %esi,%r14d
mov    %rdi,%r13
lea    0xe9c(%rip),%rsi
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x400,%edx
call   1040 <strncpy@plt>
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1240 <printFrom+0xe0>
xor    %r12d,%r12d
mov    $0x1,%ebx
jmp    11d8 <printFrom+0x78>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
add    $0x1,%ebx
test   %rax,%rax
je     1240 <printFrom+0xe0>
mov    %rbp,%rdi
call   1050 <strlen@plt>
movslq %eax,%r15
cmpb   $0xa,-0x1(%r15,%rbp,1)
je     11fd <printFrom+0x9d>
mov    %r13,%rdi
mov    $0xa,%esi
call   1030 <skip@plt>
test   %rax,%rax
je     1213 <printFrom+0xb3>
cmp    %r14d,%ebx
jl     11c0 <printFrom+0x60>
lea    0xe12(%rip),%rdi
mov    %rbp,%rsi
call   1060 <printf@plt>
jmp    11c0 <printFrom+0x60>
movb   $0xa,-0x1(%rsp,%r15,1)
test   %r12d,%r12d
jne    1233 <printFrom+0xd3>
mov    0x2dbb(%rip),%rax
mov    (%rax),%edi
lea    0xdd2(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%r12d
cmp    %r14d,%ebx
jl     11c0 <printFrom+0x60>
jmp    1202 <printFrom+0xa2>
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@stderr = global i32 0
@.str.1 = [27 x i8] c"Prilis velka delka radku!\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define void @printFrom(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [1024 x i8]
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %6
store i32 0, i32* %7
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%10 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1024)
br label %11
11: ; preds = %51, %2
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%13 = load i32*, i32** %3
%14 = call i32* @fgets(i8* %12, i32 1024, i32* %13)
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %52
16: ; preds = %11
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%20 = call i32 @strlen(i8* %19)
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = sub nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 10
br i1 %27, label %28, label %44
28: ; preds = %16
%29 = load i32*, i32** %3
%30 = call i64 @skip(i32* %29, i8 signext 10)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %43
32: ; preds = %28
%33 = load i32, i32* %5
%34 = sub nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %35
store i8 10, i8* %36
%37 = load i32, i32* %7
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %32
store i32 1, i32* %7
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %42
42: ; preds = %39, %32
br label %43
43: ; preds = %42, %28
br label %44
44: ; preds = %43, %16
%45 = load i32, i32* %6
%46 = load i32, i32* %4
%47 = icmp sge i32 %45, %46
br i1 %47, label %48, label %51
48: ; preds = %44
%49 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%50 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %49)
br label %51
51: ; preds = %48, %44
br label %11
52: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@stderr = global i32 0
@.str.1 = [27 x i8] c"Prilis velka delka radku!\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define void @printFrom(i32* %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1024)
%6 = call i32* @fgets(i8* %4, i32 1024, i32* %0)
%7 = icmp eq i32* %6, null
br i1 %7, label %34, label %8
8: ; preds = %2, %31
%9 = phi i32 [ %27, %31 ], [ 0, %2 ]
%10 = phi i32 [ %11, %31 ], [ 0, %2 ]
%11 = add nuw nsw i32 %10, 1
%12 = call i32 @strlen(i8* %4)
%13 = add nsw i32 %12, -1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 10
br i1 %17, label %26, label %18
18: ; preds = %8
%19 = call i64 @skip(i32* %0, i8 signext 10)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %18
store i8 10, i8* %15
%22 = icmp eq i32 %9, 0
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = load i32, i32* @stderr
%25 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %18, %23, %21, %8
%27 = phi i32 [ 1, %23 ], [ 1, %21 ], [ %9, %18 ], [ %9, %8 ]
%28 = icmp slt i32 %11, %1
br i1 %28, label %31, label %29
29: ; preds = %26
%30 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
br label %31
31: ; preds = %29, %26
%32 = call i32* @fgets(i8* %4, i32 1024, i32* %0)
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %8
34: ; preds = %31, %2
ret void
}