#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ isdigit(char);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main() {
  FILE *f = fopen("dat.txt", "r");
  int br = 0, l, flag = 0, start = 0, end = 0, m_start = 0, m_end = 0;
  int i = 0;
  char c;
  char word[100];
  char linija[100], max_linija[100];
  int max = 0;
  while (fgets(linija, 100, f) != NULL) {
    l = strlen(linija);
    flag = 0;
    for (i = 0; i < l; i++) {
      if (isdigit(linija[i])) {
        if (!flag) {
          start = i;
          flag = 1;
        }
        end = i;
      }
    }
    if (start != end) {
      if (l >= max) {
        max = l;
        strcpy(max_linija, linija);
        m_start = start;
        m_end = end;
      }
    }
  }
  strncpy(word, max_linija + m_start, m_end - m_start + 1);
  word[m_end - m_start + 1] = '\0';
  printf("%s\n", word);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe67(%rip),%rdi
lea    0xe68(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x184(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x64,%esi
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     12c4 <main+0x144>
lea    -0x110(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1277 <main+0xf7>
movslq -0x30(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%edi
ff
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     1264 <main+0xe4>
cmpl   $0x0,-0x1c(%rbp)
jne    125e <main+0xde>
mov    -0x30(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1269 <main+0xe9>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1220 <main+0xa0>
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     12bf <main+0x13f>
mov    -0x18(%rbp),%eax
cmp    -0x184(%rbp),%eax
jl     12ba <main+0x13a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x184(%rbp)
lea    -0x180(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1050 <strcpy@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    12bf <main+0x13f>
jmp    11e4 <main+0x64>
lea    -0xa0(%rbp),%rdi
lea    -0x180(%rbp),%rsi
movslq -0x28(%rbp),%rax
add    %rax,%rsi
mov    -0x2c(%rbp),%edx
sub    -0x28(%rbp),%edx
add    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x2c(%rbp),%eax
sub    -0x28(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x0,-0xa0(%rbp,%rax,1)
lea    -0xa0(%rbp),%rsi
lea    0xd02(%rip),%rdi
call   1080 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x168,%rsp
lea    0xe68(%rip),%rdi
lea    0xe69(%rip),%rsi
call   10a0 <fopen@plt>
lea    0x20(%rsp),%rdi
mov    $0x64,%esi
mov    %rax,0x18(%rsp)
mov    %rax,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     129e <main+0x11e>
movl   $0x0,0x10(%rsp)
lea    0x20(%rsp),%rbp
mov    $0x1,%ebx
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
xor    %r13d,%r13d
xor    %r15d,%r15d
jmp    1210 <main+0x90>
xchg   %ax,%ax
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x64,%esi
mov    0x18(%rsp),%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     12ae <main+0x12e>
mov    %rbp,%rdi
call   1070 <strlen@plt>
test   %eax,%eax
mov    %eax,0x14(%rsp)
jle    1260 <main+0xe0>
mov    %eax,%r12d
xor    %r14d,%r14d
xor    %ebp,%ebp
jmp    1247 <main+0xc7>
nopw   0x0(%rax,%rax,1)
test   %rax,%rax
cmovne %ebx,%ebp
cmovne %ecx,%r15d
cmovne %r14d,%r13d
add    $0x1,%r14
cmp    %r14,%r12
je     1260 <main+0xe0>
movsbl 0x20(%rsp,%r14,1),%edi
call   1040 <isdigit@plt>
mov    %r14d,%ecx
test   %ebp,%ebp
je     1230 <main+0xb0>
mov    %r15d,%ecx
jmp    1230 <main+0xb0>
xchg   %ax,%ax
cmp    %r13d,%r15d
je     11f0 <main+0x70>
mov    0x14(%rsp),%r14d
cmp    0x10(%rsp),%r14d
lea    0x20(%rsp),%rbp
jl     11f5 <main+0x75>
lea    0x90(%rsp),%rdi
mov    %rbp,%rsi
call   1050 <strcpy@plt>
mov    %r15d,0x8(%rsp)
mov    %r13d,0xc(%rsp)
mov    %r14d,0x10(%rsp)
jmp    11f5 <main+0x75>
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
movslq 0x8(%rsp),%rax
lea    (%rsp,%rax,1),%rsi
add    $0x90,%rsi
mov    0xc(%rsp),%ecx
sub    %eax,%ecx
movslq %ecx,%rbp
lea    0x1(%rbp),%rdx
lea    0x100(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strncpy@plt>
movb   $0x0,0x101(%rsp,%rbp,1)
lea    0xd20(%rip),%rdi
mov    %rbx,%rsi
call   1080 <printf@plt>
mov    0x18(%rsp),%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"dat.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 i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
%12 = alloca [100 x i8]
%13 = alloca [100 x i8]
%14 = alloca [100 x i8]
%15 = alloca i32
store i32 0, i32* %1
%16 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %16, i32** %2
store i32 0, i32* %3
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %15
br label %17
17: ; preds = %63, %0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%19 = load i32*, i32** %2
%20 = call i32* @fgets(i8* %18, i32 100, i32* %19)
%21 = icmp ne i32* %20, null
br i1 %21, label %22, label %64
22: ; preds = %17
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%24 = call i32 @strlen(i8* %23)
store i32 %24, i32* %4
store i32 0, i32* %5
store i32 0, i32* %10
br label %25
25: ; preds = %44, %22
%26 = load i32, i32* %10
%27 = load i32, i32* %4
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %47
29: ; preds = %25
%30 = load i32, i32* %10
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = call i64 @isdigit(i8 signext %33)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %43
36: ; preds = %29
%37 = load i32, i32* %5
%38 = icmp ne i32 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %36
%40 = load i32, i32* %10
store i32 %40, i32* %6
store i32 1, i32* %5
br label %41
41: ; preds = %39, %36
%42 = load i32, i32* %10
store i32 %42, i32* %7
br label %43
43: ; preds = %41, %29
br label %44
44: ; preds = %43
%45 = load i32, i32* %10
%46 = add nsw i32 %45, 1
store i32 %46, i32* %10
br label %25
47: ; preds = %25
%48 = load i32, i32* %6
%49 = load i32, i32* %7
%50 = icmp ne i32 %48, %49
br i1 %50, label %51, label %63
51: ; preds = %47
%52 = load i32, i32* %4
%53 = load i32, i32* %15
%54 = icmp sge i32 %52, %53
br i1 %54, label %55, label %62
55: ; preds = %51
%56 = load i32, i32* %4
store i32 %56, i32* %15
%57 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%58 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%59 = call i32 @strcpy(i8* %57, i8* %58)
%60 = load i32, i32* %6
store i32 %60, i32* %8
%61 = load i32, i32* %7
store i32 %61, i32* %9
br label %62
62: ; preds = %55, %51
br label %63
63: ; preds = %62, %47
br label %17
64: ; preds = %17
%65 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%66 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%67 = load i32, i32* %8
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %66, i64 %68
%70 = load i32, i32* %9
%71 = load i32, i32* %8
%72 = sub nsw i32 %70, %71
%73 = add nsw i32 %72, 1
%74 = call i32 @strncpy(i8* %65, i8* %69, i32 %73)
%75 = load i32, i32* %9
%76 = load i32, i32* %8
%77 = sub nsw i32 %75, %76
%78 = add nsw i32 %77, 1
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 %79
store i8 0, i8* %80
%81 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%82 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %81)
%83 = load i32*, i32** %2
%84 = call i32 @fclose(i32* %83)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"dat.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = call i32* @fgets(i8* %6, i32 100, i32* %4)
%9 = icmp eq i32* %8, null
br i1 %9, label %51, label %10
10: ; preds = %0, %45
%11 = phi i32 [ %48, %45 ], [ 0, %0 ]
%12 = phi i32 [ %47, %45 ], [ 0, %0 ]
%13 = phi i32 [ %46, %45 ], [ 0, %0 ]
%14 = phi i32 [ %39, %45 ], [ 0, %0 ]
%15 = phi i32 [ %38, %45 ], [ 0, %0 ]
%16 = call i32 @strlen(i8* %6)
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %37
18: ; preds = %10
%19 = zext i32 %16 to i64
br label %20
20: ; preds = %18, %20
%21 = phi i64 [ 0, %18 ], [ %35, %20 ]
%22 = phi i32 [ %14, %18 ], [ %34, %20 ]
%23 = phi i32 [ %15, %18 ], [ %33, %20 ]
%24 = phi i32 [ 0, %18 ], [ %32, %20 ]
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %21
%26 = load i8, i8* %25
%27 = call i64 @isdigit(i8 signext %26)
%28 = icmp eq i64 %27, 0
%29 = icmp eq i32 %24, 0
%30 = trunc i64 %21 to i32
%31 = select i1 %29, i32 %30, i32 %23
%32 = select i1 %28, i32 %24, i32 1
%33 = select i1 %28, i32 %23, i32 %31
%34 = select i1 %28, i32 %22, i32 %30
%35 = add nuw nsw i64 %21, 1
%36 = icmp eq i64 %35, %19
br i1 %36, label %37, label %20
37: ; preds = %20, %10
%38 = phi i32 [ %15, %10 ], [ %33, %20 ]
%39 = phi i32 [ %14, %10 ], [ %34, %20 ]
%40 = icmp eq i32 %38, %39
%41 = icmp slt i32 %16, %11
%42 = select i1 %40, i1 true, i1 %41
br i1 %42, label %45, label %43
43: ; preds = %37
%44 = call i32 @strcpy(i8* %7, i8* %6)
br label %45
45: ; preds = %43, %37
%46 = phi i32 [ %38, %43 ], [ %13, %37 ]
%47 = phi i32 [ %39, %43 ], [ %12, %37 ]
%48 = phi i32 [ %16, %43 ], [ %11, %37 ]
%49 = call i32* @fgets(i8* %6, i32 100, i32* %4)
%50 = icmp eq i32* %49, null
br i1 %50, label %51, label %10
51: ; preds = %45, %0
%52 = phi i32 [ 0, %0 ], [ %46, %45 ]
%53 = phi i32 [ 0, %0 ], [ %47, %45 ]
%54 = sext i32 %52 to i64
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %54
%56 = sub nsw i32 %53, %52
%57 = add nsw i32 %56, 1
%58 = call i32 @strncpy(i8* %5, i8* %55, i32 %57)
%59 = sext i32 %57 to i64
%60 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %59
store i8 0, i8* %60
%61 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%62 = call i32 @fclose(i32* %4)
ret i32 0
}