#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 /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  int v = 0, pv = 0, t = 0;
  int ntpt = 0;
  int f = 0;
  while (!feof(stdin)) {
    t++;
    fscanf(stdin, "%d", &v);
    if (pv < 0 && v > 0) {
      ntpt = t;
    } else if (pv > 0 && v < 0) {
      f = t - ntpt;
    }
    pv = v;
    fprintf(stdout, "%d %d\n", t, f);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    118c <main+0x5c>
jmp    1215 <main+0xe5>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
lea    0xe5b(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <fscanf@plt>
cmpl   $0x0,-0x18(%rbp)
jge    11cd <main+0x9d>
cmpl   $0x0,-0x14(%rbp)
jle    11cd <main+0x9d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    11ef <main+0xbf>
cmpl   $0x0,-0x18(%rbp)
jle    11ea <main+0xba>
cmpl   $0x0,-0x14(%rbp)
jge    11ea <main+0xba>
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11ef <main+0xbf>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2ddc(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x24(%rbp),%ecx
lea    0xdf8(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1169 <main+0x39>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2e9e(%rip),%r13
mov    0x0(%r13),%edi
call   1050 <feof@plt>
test   %eax,%eax
je     1168 <main+0x38>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebx,%ebx
mov    $0x1,%ebp
xor    %r15d,%r15d
xor    %r14d,%r14d
jmp    11bd <main+0x8d>
nopw   0x0(%rax,%rax,1)
mov    %ebp,%eax
sub    %r15d,%eax
test   %r12d,%r12d
cmovns %ebx,%eax
test   %r14d,%r14d
cmovg  %eax,%ebx
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
lea    0xe62(%rip),%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <fprintf@plt>
mov    0x0(%r13),%edi
call   1050 <feof@plt>
add    $0x1,%ebp
mov    %r12d,%r14d
test   %eax,%eax
jne    1157 <main+0x27>
mov    0x0(%r13),%edi
lea    0xe38(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <fscanf@plt>
mov    0x4(%rsp),%r12d
test   %r14d,%r14d
jns    1180 <main+0x50>
test   %r12d,%r12d
jle    1180 <main+0x50>
mov    %ebp,%r15d
jmp    1191 <main+0x61>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@stdout = global i32 0
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %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
br label %11
11: ; preds = %39, %2
%12 = load i32, i32* @stdin
%13 = call i32 @feof(i32 %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br i1 %15, label %16, label %45
16: ; preds = %11
%17 = load i32, i32* %8
%18 = add nsw i32 %17, 1
store i32 %18, i32* %8
%19 = load i32, i32* @stdin
%20 = call i32 @fscanf(i32 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %16
%24 = load i32, i32* %6
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32, i32* %8
store i32 %27, i32* %9
br label %39
28: ; preds = %23, %16
%29 = load i32, i32* %7
%30 = icmp sgt i32 %29, 0
br i1 %30, label %31, label %38
31: ; preds = %28
%32 = load i32, i32* %6
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %31
%35 = load i32, i32* %8
%36 = load i32, i32* %9
%37 = sub nsw i32 %35, %36
store i32 %37, i32* %10
br label %38
38: ; preds = %34, %31, %28
br label %39
39: ; preds = %38, %26
%40 = load i32, i32* %6
store i32 %40, i32* %7
%41 = load i32, i32* @stdout
%42 = load i32, i32* %8
%43 = load i32, i32* %10
%44 = call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %42, i32 %43)
br label %11
45: ; preds = %11
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@stdout = global i32 0
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = load i32, i32* @stdin
%6 = call i32 @feof(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %34
8: ; preds = %2, %26
%9 = phi i32 [ %28, %26 ], [ 0, %2 ]
%10 = phi i32 [ %27, %26 ], [ 0, %2 ]
%11 = phi i32 [ %13, %26 ], [ 0, %2 ]
%12 = phi i32 [ %17, %26 ], [ 0, %2 ]
%13 = add nuw nsw i32 %11, 1
%14 = load i32, i32* @stdin
%15 = call i32 @fscanf(i32 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%16 = icmp slt i32 %12, 0
%17 = load i32, i32* %3
%18 = icmp sgt i32 %17, 0
%19 = select i1 %16, i1 %18, i1 false
br i1 %19, label %26, label %20
20: ; preds = %8
%21 = icmp sgt i32 %12, 0
%22 = icmp slt i32 %17, 0
%23 = select i1 %21, i1 %22, i1 false
%24 = sub nsw i32 %13, %10
%25 = select i1 %23, i32 %24, i32 %9
br label %26
26: ; preds = %20, %8
%27 = phi i32 [ %13, %8 ], [ %10, %20 ]
%28 = phi i32 [ %9, %8 ], [ %25, %20 ]
%29 = load i32, i32* @stdout
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %28)
%31 = load i32, i32* @stdin
%32 = call i32 @feof(i32 %31)
%33 = icmp eq i32 %32, 0
br i1 %33, label %8, label %34
34: ; preds = %26, %2
ret i32 0
}