#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 EOF;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
int fscanf(int /*<<< orphan*/ *, char *, double *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ skipWord(int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int interval(FILE *stream) {
  double oldnumber, newnumber, interval;
  int test;
  if (fscanf(stream, "%lf", &oldnumber) != 1) {
    perror("num-utils-ng");
    exit(EXIT_FAILURE);
  }
  while ((test = fscanf(stream, "%lf", &newnumber)) != EOF) {
    if (test == 0)
      skipWord(stream);
    else {
      interval = newnumber - oldnumber;
      fprintf(stdout, "%lf\n", interval);
      oldnumber = newnumber;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<interval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe99(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <fscanf@plt>
cmp    $0x1,%eax
je     1193 <interval+0x43>
lea    0xe84(%rip),%rdi
call   1060 <perror@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
jmp    1198 <interval+0x48>
mov    -0x8(%rbp),%rdi
lea    0xe5d(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <fscanf@plt>
mov    %eax,-0x24(%rbp)
mov    0x2e32(%rip),%rcx
cmp    (%rcx),%eax
je     120e <interval+0xbe>
cmpl   $0x0,-0x24(%rbp)
jne    11d6 <interval+0x86>
mov    -0x8(%rbp),%rdi
call   1050 <skipWord@plt>
jmp    1209 <interval+0xb9>
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
movsd  -0x20(%rbp),%xmm0
lea    0xe17(%rip),%rsi
call   1040 <fprintf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1198 <interval+0x48>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interval>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xe98(%rip),%rsi
lea    0x10(%rsp),%rdx
call   1030 <fscanf@plt>
cmp    $0x1,%eax
jne    1215 <interval+0xc5>
lea    0xe7e(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1030 <fscanf@plt>
mov    0x2e52(%rip),%r13
cmp    0x0(%r13),%eax
jne    11ad <interval+0x5d>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe4c(%rip),%r14
lea    0x8(%rsp),%r15
mov    0x2e10(%rip),%rbp
lea    0xe4a(%rip),%r12
jmp    1207 <interval+0xb7>
nopl   0x0(%rax)
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
mov    0x0(%rbp),%edi
mov    %r12,%rsi
call   1040 <fprintf@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <fscanf@plt>
cmp    0x0(%r13),%eax
je     119c <interval+0x4c>
test   %eax,%eax
jne    11d0 <interval+0x80>
mov    %rbx,%rdi
call   1050 <skipWord@plt>
jmp    11f3 <interval+0xa3>
lea    0xde8(%rip),%rdi
call   1060 <perror@plt>
mov    0x2db0(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [13 x i8] c"num-utils-ng\00"
@EXIT_FAILURE = global i32 0
@EOF = global i32 0
@stdout = global i32 0
@.str.2 = [5 x i8] c"%lf\0A\00"
define i32 @interval(i32* %0) {
%2 = alloca i32*
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store i32* %0, i32** %2
%7 = load i32*, i32** %2
%8 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
br label %15
15: ; preds = %34, %14
%16 = load i32*, i32** %2
%17 = call i32 @fscanf(i32* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
store i32 %17, i32* %6
%18 = load i32, i32* @EOF
%19 = icmp ne i32 %17, %18
br i1 %19, label %20, label %35
20: ; preds = %15
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32*, i32** %2
%25 = call i32 @skipWord(i32* %24)
br label %34
26: ; preds = %20
%27 = load double, double* %4
%28 = load double, double* %3
%29 = fsub double %27, %28
store double %29, double* %5
%30 = load i32, i32* @stdout
%31 = load double, double* %5
%32 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %31)
%33 = load double, double* %4
store double %33, double* %3
br label %34
34: ; preds = %26, %23
br label %15
35: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [13 x i8] c"num-utils-ng\00"
@EXIT_FAILURE = global i32 0
@EOF = global i32 0
@stdout = global i32 0
@.str.2 = [5 x i8] c"%lf\0A\00"
define i32 @interval(i32* %0) {
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %2 to i8*
%5 = bitcast double* %3 to i8*
%6 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %32, label %16
12: ; preds = %1
%13 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %8, %28
%17 = phi i32 [ %29, %28 ], [ %9, %8 ]
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @skipWord(i32* %0)
br label %28
21: ; preds = %16
%22 = load double, double* %3
%23 = load double, double* %2
%24 = fsub double %22, %23
%25 = load i32, i32* @stdout
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %24)
%27 = load double, double* %3
store double %27, double* %2
br label %28
28: ; preds = %21, %19
%29 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%30 = load i32, i32* @EOF
%31 = icmp eq i32 %29, %30
br i1 %31, label %32, label %16
32: ; preds = %28, %8
ret i32 0
}