#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*/ error(char *);
void R_approxtest(double *x, double *y, int *nxy, int *method, double *f) {
  int i;
  switch (*method) {
  case 1:
    break;
  case 2:
    if (!1 || *f < 0 || *f > 1)
      error(("approx(): invalid f value"));
    break;
  default:
    error(("approx(): invalid interpolation method"));
    break;
  }
  for (i = 0; i < *nxy; i++)
    if (0 || 0)
      error(("approx(): attempted to interpolate NA values"));
}


x86 assembly (clang, -O0):
<R_approxtest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
sub    $0x1,%eax
je     1154 <R_approxtest+0x44>
jmp    1143 <R_approxtest+0x33>
mov    -0x30(%rbp),%eax
sub    $0x2,%eax
je     1159 <R_approxtest+0x49>
jmp    1195 <R_approxtest+0x85>
jmp    11a1 <R_approxtest+0x91>
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
ja     1184 <R_approxtest+0x74>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe86(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1190 <R_approxtest+0x80>
lea    0xe7d(%rip),%rdi
call   1030 <error@plt>
jmp    11a1 <R_approxtest+0x91>
lea    0xe86(%rip),%rdi
call   1030 <error@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    11ca <R_approxtest+0xba>
jmp    11bc <R_approxtest+0xac>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11a8 <R_approxtest+0x98>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_approxtest>:
mov    (%rcx),%eax
cmp    $0x1,%eax
je     113c <R_approxtest+0x2c>
cmp    $0x2,%eax
jne    113d <R_approxtest+0x2d>
movsd  (%r8),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
lea    0xed8(%rip),%rdi
ja     1144 <R_approxtest+0x34>
ucomisd 0xec6(%rip),%xmm0
ja     1144 <R_approxtest+0x34>
ret
lea    0xede(%rip),%rdi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"approx(): invalid f value\00"
@.str.1 = [39 x i8] c"approx(): invalid interpolation method\00"
define void @R_approxtest(double* %0, double* %1, i32* %2, i32* %3, double* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca double*
%11 = alloca i32
store double* %0, double** %6
store double* %1, double** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store double* %4, double** %10
%12 = load i32*, i32** %9
%13 = load i32, i32* %12
switch i32 %13, label %26 [
i32 1, label %14
i32 2, label %15
]
14: ; preds = %5
br label %28
15: ; preds = %5
%16 = load double*, double** %10
%17 = load double, double* %16
%18 = fcmp olt double %17, 0.000000e+00
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load double*, double** %10
%21 = load double, double* %20
%22 = fcmp ogt double %21, 1.000000e+00
br i1 %22, label %23, label %25
23: ; preds = %19, %15
%24 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %25
25: ; preds = %23, %19
br label %28
26: ; preds = %5
%27 = call i32 @error(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %25, %14
store i32 0, i32* %11
br label %29
29: ; preds = %35, %28
%30 = load i32, i32* %11
%31 = load i32*, i32** %8
%32 = load i32, i32* %31
%33 = icmp slt i32 %30, %32
br i1 %33, label %34, label %38
34: ; preds = %29
br label %35
35: ; preds = %34
%36 = load i32, i32* %11
%37 = add nsw i32 %36, 1
store i32 %37, i32* %11
br label %29
38: ; preds = %29
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"approx(): invalid f value\00"
@.str.1 = [39 x i8] c"approx(): invalid interpolation method\00"
define void @R_approxtest(double* nocapture readnone %0, double* nocapture readnone %1, i32* nocapture %2, i32* nocapture %3, double* nocapture %4) {
%6 = load i32, i32* %3
switch i32 %6, label %12 [
i32 1, label %15
i32 2, label %7
]
7: ; preds = %5
%8 = load double, double* %4
%9 = fcmp olt double %8, 0.000000e+00
%10 = fcmp ogt double %8, 1.000000e+00
%11 = or i1 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %5, %7
%13 = phi i8* [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), %7 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), %5 ]
%14 = tail call i32 @error(i8* %13)
br label %15
15: ; preds = %12, %7, %5
ret void
}