#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 atoi(char *);
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char line[2048];
  int i, delay;
  if (argc >= 2)
    delay = atoi(argv[1]);
  else
    delay = 3;
  while (!feof(stdin)) {
    for (i = 0; i < 10; i++) {
      gets(line);
      printf("%s\n", line);
    }
    sleep(delay);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     118b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x818(%rbp)
jmp    1195 <main+0x45>
movl   $0x3,-0x818(%rbp)
jmp    119a <main+0x4a>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11bd <main+0x6d>
jmp    1217 <main+0xc7>
movl   $0x0,-0x814(%rbp)
cmpl   $0xa,-0x814(%rbp)
jge    1207 <main+0xb7>
lea    -0x810(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x810(%rbp),%rsi
lea    0xe12(%rip),%rdi
call   1030 <printf@plt>
mov    -0x814(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x814(%rbp)
jmp    11c7 <main+0x77>
mov    -0x818(%rbp),%edi
call   1070 <sleep@plt>
jmp    119a <main+0x4a>
mov    -0x4(%rbp),%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    $0x3,%r14d
cmp    $0x2,%edi
jl     1174 <main+0x24>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%r14d
mov    0x2e6d(%rip),%r15
mov    (%r15),%edi
call   1040 <feof@plt>
test   %eax,%eax
jne    1276 <main+0x126>
mov    %rsp,%rbx
lea    0xe6b(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r14d,%edi
call   1070 <sleep@plt>
mov    (%r15),%edi
call   1040 <feof@plt>
test   %eax,%eax
je     11a0 <main+0x50>
xor    %eax,%eax
add    $0x808,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2048 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp sge i32 %9, 2
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %8
br label %17
16: ; preds = %2
store i32 3, i32* %8
br label %17
17: ; preds = %16, %11
br label %18
18: ; preds = %35, %17
%19 = load i32, i32* @stdin
%20 = call i32 @feof(i32 %19)
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
br i1 %22, label %23, label %38
23: ; preds = %18
store i32 0, i32* %7
br label %24
24: ; preds = %32, %23
%25 = load i32, i32* %7
%26 = icmp slt i32 %25, 10
br i1 %26, label %27, label %35
27: ; preds = %24
%28 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%29 = call i32 @gets(i8* %28)
%30 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %30)
br label %32
32: ; preds = %27
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %24
35: ; preds = %24
%36 = load i32, i32* %8
%37 = call i32 @sleep(i32 %36)
br label %18
38: ; preds = %18
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 3, %2 ]
%12 = load i32, i32* @stdin
%13 = call i32 @feof(i32 %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %40
15: ; preds = %10, %15
%16 = call i32 @gets(i8* %4)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%18 = call i32 @gets(i8* %4)
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%20 = call i32 @gets(i8* %4)
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%22 = call i32 @gets(i8* %4)
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%24 = call i32 @gets(i8* %4)
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%26 = call i32 @gets(i8* %4)
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%28 = call i32 @gets(i8* %4)
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%30 = call i32 @gets(i8* %4)
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%32 = call i32 @gets(i8* %4)
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%34 = call i32 @gets(i8* %4)
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%36 = call i32 @sleep(i32 %11)
%37 = load i32, i32* @stdin
%38 = call i32 @feof(i32 %37)
%39 = icmp eq i32 %38, 0
br i1 %39, label %15, label %40
40: ; preds = %15, %10
ret i32 0
}