#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 */

/* Variables and functions */
int _getline(char *, int);
int /*<<< orphan*/ copy(char *, char *);
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  char line[256];
  char longest[256];
  char shortest[256];
  int len;
  int max = 0, min = 256;
  while ((len = _getline(line, 256)) > -1) {
    if (len >= max) {
      max = len;
      copy(longest, line);
    } else if (len <= min) {
      min = len;
      copy(shortest, line);
    }
  }
  if (max > 0)
    printf("%d:%s", max, longest);
  if (min < 256)
    printf("%d:%s", min, shortest);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x320,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x318(%rbp)
movl   $0x100,-0x31c(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1050 <_getline@plt>
mov    %eax,-0x314(%rbp)
cmp    $0xffffffff,%eax
jle    11e7 <main+0xb7>
mov    -0x314(%rbp),%eax
cmp    -0x318(%rbp),%eax
jl     11ac <main+0x7c>
mov    -0x314(%rbp),%eax
mov    %eax,-0x318(%rbp)
lea    -0x210(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1040 <copy@plt>
jmp    11e2 <main+0xb2>
mov    -0x314(%rbp),%eax
cmp    -0x31c(%rbp),%eax
jg     11dd <main+0xad>
mov    -0x314(%rbp),%eax
mov    %eax,-0x31c(%rbp)
lea    -0x310(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1040 <copy@plt>
jmp    11e2 <main+0xb2>
jmp    1156 <main+0x26>
cmpl   $0x0,-0x318(%rbp)
jle    120d <main+0xdd>
mov    -0x318(%rbp),%esi
lea    -0x210(%rbp),%rdx
lea    0xdf8(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x100,-0x31c(%rbp)
jge    1236 <main+0x106>
mov    -0x31c(%rbp),%esi
lea    -0x310(%rbp),%rdx
lea    0xdcf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x320,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x308,%rsp
lea    0x200(%rsp),%rdi
mov    $0x100,%ebp
mov    $0x100,%esi
call   1050 <_getline@plt>
test   %eax,%eax
js     11e8 <main+0xb8>
mov    %eax,%ebx
xor    %r15d,%r15d
lea    0x100(%rsp),%r12
mov    %rsp,%r13
lea    0x200(%rsp),%r14
jmp    11a5 <main+0x75>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %ebx,%r15d
mov    %ebp,%ebx
mov    %r14,%rsi
call   1040 <copy@plt>
mov    %ebx,%ebp
mov    %r14,%rdi
mov    $0x100,%esi
call   1050 <_getline@plt>
mov    %eax,%ebx
test   %eax,%eax
js     11b3 <main+0x83>
cmp    %r15d,%ebx
jge    1180 <main+0x50>
mov    %r13,%rdi
cmp    %ebp,%ebx
jle    1188 <main+0x58>
jmp    1192 <main+0x62>
test   %r15d,%r15d
jle    11cf <main+0x9f>
lea    0xe41(%rip),%rdi
lea    0x100(%rsp),%rdx
mov    %r15d,%esi
call   1030 <printf@plt>
cmp    $0xff,%ebp
jg     11e8 <main+0xb8>
lea    0xe22(%rip),%rdi
mov    %rsp,%rdx
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x308,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d:%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
store i32 256, i32* %7
br label %8
8: ; preds = %31, %0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%10 = call i32 @_getline(i8* %9, i32 256)
store i32 %10, i32* %5
%11 = icmp sgt i32 %10, -1
br i1 %11, label %12, label %32
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sge i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i32, i32* %5
store i32 %17, i32* %6
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%20 = call i32 @copy(i8* %18, i8* %19)
br label %31
21: ; preds = %12
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i32, i32* %5
store i32 %26, i32* %7
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%29 = call i32 @copy(i8* %27, i8* %28)
br label %30
30: ; preds = %25, %21
br label %31
31: ; preds = %30, %16
br label %8
32: ; preds = %8
%33 = load i32, i32* %6
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %32
%36 = load i32, i32* %6
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%38 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %36, i8* %37)
br label %39
39: ; preds = %35, %32
%40 = load i32, i32* %7
%41 = icmp slt i32 %40, 256
br i1 %41, label %42, label %46
42: ; preds = %39
%43 = load i32, i32* %7
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%45 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %43, i8* %44)
br label %46
46: ; preds = %42, %39
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d:%s\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = call i32 @_getline(i8* %4, i32 256)
%8 = icmp sgt i32 %7, -1
br i1 %8, label %9, label %34
9: ; preds = %0, %21
%10 = phi i32 [ %24, %21 ], [ %7, %0 ]
%11 = phi i32 [ %23, %21 ], [ 256, %0 ]
%12 = phi i32 [ %22, %21 ], [ 0, %0 ]
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = icmp sgt i32 %10, %11
br i1 %15, label %21, label %16
16: ; preds = %14, %9
%17 = phi i8* [ %5, %9 ], [ %6, %14 ]
%18 = phi i32 [ %10, %9 ], [ %12, %14 ]
%19 = phi i32 [ %11, %9 ], [ %10, %14 ]
%20 = call i32 @copy(i8* %17, i8* %4)
br label %21
21: ; preds = %16, %14
%22 = phi i32 [ %12, %14 ], [ %18, %16 ]
%23 = phi i32 [ %11, %14 ], [ %19, %16 ]
%24 = call i32 @_getline(i8* %4, i32 256)
%25 = icmp sgt i32 %24, -1
br i1 %25, label %9, label %26
26: ; preds = %21
%27 = icmp sgt i32 %22, 0
br i1 %27, label %28, label %30
28: ; preds = %26
%29 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %22, i8* %5)
br label %30
30: ; preds = %28, %26
%31 = icmp slt i32 %23, 256
br i1 %31, label %32, label %34
32: ; preds = %30
%33 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %23, i8* %6)
br label %34
34: ; preds = %0, %32, %30
ret i32 0
}