#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 fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int getrecord(double *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ writeresult(int, int /*<<< orphan*/);
int execute(void) {
  double inpval[256];
  int count;
  int nread;
  long nlin;
  FILE *fp;
  fp = stdin;
  ;
  while (!feof(fp)) {
    count = 0;
    for (nlin = 0; (nread = getrecord(inpval, fp)) > 0; nlin++) {
      if (inpval[0] > 0)
        ++count;
    }
    if (!feof(fp))
      writeresult(count, stdout);
  }
  return (fclose(fp));
}


x86 assembly (clang, -O0):
<execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x818(%rbp)
mov    -0x818(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117d <execute+0x3d>
jmp    1222 <execute+0xe2>
movl   $0x0,-0x804(%rbp)
movq   $0x0,-0x810(%rbp)
lea    -0x800(%rbp),%rdi
mov    -0x818(%rbp),%rsi
call   1050 <getrecord@plt>
mov    %eax,-0x808(%rbp)
cmp    $0x0,%eax
jle    11f4 <execute+0xb4>
movsd  -0x800(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11d8 <execute+0x98>
mov    -0x804(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x804(%rbp)
jmp    11dd <execute+0x9d>
mov    -0x810(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x810(%rbp)
jmp    1192 <execute+0x52>
mov    -0x818(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
jne    121d <execute+0xdd>
mov    -0x804(%rbp),%edi
mov    0x2dc2(%rip),%rax
mov    (%rax),%esi
call   1030 <writeresult@plt>
jmp    115c <execute+0x1c>
mov    -0x818(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    0x2e94(%rip),%rax
mov    (%rax),%rbx
mov    %rbx,%rdi
call   1060 <feof@plt>
test   %eax,%eax
je     1179 <execute+0x39>
mov    %rbx,%rdi
call   1040 <fclose@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsp,%r14
mov    0x2e55(%rip),%r15
jmp    11a8 <execute+0x68>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1060 <feof@plt>
test   %eax,%eax
je     11f0 <execute+0xb0>
mov    %rbx,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    1163 <execute+0x23>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <getrecord@plt>
xor    %ebp,%ebp
test   %eax,%eax
jle    1190 <execute+0x50>
nopl   0x0(%rax)
movsd  (%rsp),%xmm0
xor    %eax,%eax
ucomisd 0xe31(%rip),%xmm0
seta   %al
add    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <getrecord@plt>
test   %eax,%eax
jg     11c0 <execute+0x80>
jmp    1190 <execute+0x50>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15),%esi
mov    %ebp,%edi
call   1030 <writeresult@plt>
jmp    119c <execute+0x5c>

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32 0
define i32 @execute() {
%1 = alloca [256 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32*
%6 = load i32*, i32** @stdin
store i32* %6, i32** %5
br label %7
7: ; preds = %37, %0
%8 = load i32*, i32** %5
%9 = call i32 @feof(i32* %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %38
12: ; preds = %7
store i32 0, i32* %2
store i64 0, i64* %4
br label %13
13: ; preds = %26, %12
%14 = getelementptr inbounds [256 x double], [256 x double]* %1, i64 0, i64 0
%15 = load i32*, i32** %5
%16 = call i32 @getrecord(double* %14, i32* %15)
store i32 %16, i32* %3
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %29
18: ; preds = %13
%19 = getelementptr inbounds [256 x double], [256 x double]* %1, i64 0, i64 0
%20 = load double, double* %19
%21 = fcmp ogt double %20, 0.000000e+00
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %25
25: ; preds = %22, %18
br label %26
26: ; preds = %25
%27 = load i64, i64* %4
%28 = add nsw i64 %27, 1
store i64 %28, i64* %4
br label %13
29: ; preds = %13
%30 = load i32*, i32** %5
%31 = call i32 @feof(i32* %30)
%32 = icmp ne i32 %31, 0
br i1 %32, label %37, label %33
33: ; preds = %29
%34 = load i32, i32* %2
%35 = load i32, i32* @stdout
%36 = call i32 @writeresult(i32 %34, i32 %35)
br label %37
37: ; preds = %33, %29
br label %7
38: ; preds = %7
%39 = load i32*, i32** %5
%40 = call i32 @fclose(i32* %39)
ret i32 %40
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32 0
define i32 @execute() {
%1 = alloca [256 x double]
%2 = bitcast [256 x double]* %1 to i8*
%3 = load i32*, i32** @stdin
%4 = call i32 @feof(i32* %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %29
6: ; preds = %0
%7 = getelementptr inbounds [256 x double], [256 x double]* %1, i64 0, i64 0
br label %8
8: ; preds = %6, %26
%9 = call i32 @getrecord(double* %7, i32* %3)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %8, %11
%12 = phi i32 [ %16, %11 ], [ 0, %8 ]
%13 = load double, double* %7
%14 = fcmp ogt double %13, 0.000000e+00
%15 = zext i1 %14 to i32
%16 = add nuw nsw i32 %12, %15
%17 = call i32 @getrecord(double* %7, i32* %3)
%18 = icmp sgt i32 %17, 0
br i1 %18, label %11, label %19
19: ; preds = %11, %8
%20 = phi i32 [ 0, %8 ], [ %16, %11 ]
%21 = call i32 @feof(i32* %3)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32, i32* @stdout
%25 = call i32 @writeresult(i32 %20, i32 %24)
br label %26
26: ; preds = %23, %19
%27 = call i32 @feof(i32* %3)
%28 = icmp eq i32 %27, 0
br i1 %28, label %8, label %29
29: ; preds = %26, %0
%30 = call i32 @fclose(i32* %3)
ret i32 %30
}