#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 */
char EOF;
int atoi(char *);
double cos(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char getopt(int, char **, char *);
int /*<<< orphan*/ help();
char *optarg;
scalar_t__ optind;
int /*<<< orphan*/ printf(char *, double);
double sin(double);
int /*<<< orphan*/ stderr;
void five(int argc, char *argv[]) {
  int N = 80;
  char ch;
  while ((ch = getopt(argc, argv, "hN:")) != EOF)
    switch (ch) {
    case 'N':
      N = atoi(optarg);
      break;
    case 'h':
      help();
      break;
    default:
      fprintf(stderr, "Unknown option for one: '%s'\n", optarg);
      help();
    }
  argc -= optind;
  argv += optind;
  double x = 1, y = 1, z = 1, v = 0, zold, m, yold;
  long int n = 0;
  for (; n < N; n++) {
    zold = z;
    z = 1.4 + 0.3 * v - z * z;
    v = zold;
    m = 0.4 - 6.0 / (1.0 + x * x + y * y);
    yold = y;
    y = 0.7 * (x * sin(m) + y * cos(m));
    x = 1 + 0.7 * (x * cos(m) + yold * sin(m)) + 0.2 * zold;
    printf("%.6f\n", x);
  }
}


x86 assembly (clang, -O0):
<five>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x50,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xea1(%rip),%rdx
call   1070 <getopt@plt>
mov    %al,-0x15(%rbp)
movsbl %al,%eax
mov    0x2e37(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1228 <five+0xb8>
movsbl -0x15(%rbp),%eax
mov    %eax,-0x5c(%rbp)
sub    $0x4e,%eax
je     11da <five+0x6a>
jmp    11c9 <five+0x59>
mov    -0x5c(%rbp),%eax
sub    $0x68,%eax
je     11f1 <five+0x81>
jmp    11fd <five+0x8d>
mov    0x2e17(%rip),%rax
mov    (%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    1223 <five+0xb3>
mov    $0x0,%al
call   1080 <help@plt>
jmp    1223 <five+0xb3>
mov    0x2dc4(%rip),%rax
mov    (%rax),%edi
mov    0x2deb(%rip),%rax
mov    (%rax),%rdx
lea    0xe25(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1080 <help@plt>
jmp    1189 <five+0x19>
mov    0x2da9(%rip),%rax
mov    (%rax),%rcx
movslq -0x4(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    0x2d95(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  0xda6(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xd99(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xd8c(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movq   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jge    1453 <five+0x2e3>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  0xd77(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xd73(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xcf1(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xcf3(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xcdf(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1060 <cos@plt>
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x88(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xc65(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1050 <sin@plt>
movsd  -0x78(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xc09(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xbed(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  0xbe4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xc1d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    1289 <five+0x119>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<five>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%r13
mov    %edi,%ebp
lea    0xedb(%rip),%rdx
call   1070 <getopt@plt>
mov    0x2e47(%rip),%r12
mov    $0x50,%ebx
cmp    (%r12),%al
je     1218 <five+0xa8>
mov    $0x50,%r15d
lea    0xeb7(%rip),%r14
mov    0x2e40(%rip),%rbx
jmp    11f2 <five+0x82>
nopw   0x0(%rax,%rax,1)
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1080 <help@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    %r14,%rdx
call   1070 <getopt@plt>
cmp    (%r12),%al
je     120c <five+0x9c>
movsbl %al,%eax
cmp    $0x68,%eax
je     11d8 <five+0x68>
cmp    $0x4e,%eax
jne    11c0 <five+0x50>
mov    (%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%r15d
jmp    11df <five+0x6f>
test   %r15d,%r15d
jle    137f <five+0x20f>
movslq %r15d,%rbx
movapd 0xde0(%rip),%xmm1
movsd  0xe18(%rip),%xmm3
xorps  %xmm2,%xmm2
lea    0xe58(%rip),%rbp
movapd %xmm1,0x20(%rsp)
nopl   0x0(%rax,%rax,1)
movsd  %xmm3,0x18(%rsp)
movaps %xmm2,0x60(%rsp)
movapd %xmm1,0x40(%rsp)
movapd %xmm1,%xmm0
xorpd  0xdb3(%rip),%xmm0
movapd %xmm0,0x70(%rsp)
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
movapd %xmm0,0x30(%rsp)
mulsd  %xmm0,%xmm0
addsd  0xdc3(%rip),%xmm0
movapd %xmm3,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm0,%xmm1
movsd  0xdb7(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xdb3(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1050 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x30(%rsp),%xmm1
addsd  %xmm0,%xmm1
mulsd  0xd81(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,0x50(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x18(%rsp),%xmm0
movapd 0x50(%rsp),%xmm1
mulsd  0x30(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd 0x60(%rsp),%xmm0
unpcklpd %xmm1,%xmm0
mulpd  0xd00(%rip),%xmm0
addpd  0xd08(%rip),%xmm0
movapd %xmm0,%xmm1
movapd 0x20(%rsp),%xmm2
movhpd 0xd26(%rip),%xmm2
movapd 0x70(%rsp),%xmm0
unpcklpd 0x40(%rsp),%xmm0
mulpd  %xmm0,%xmm2
addpd  %xmm1,%xmm2
movapd %xmm2,0x20(%rsp)
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
mov    %rbp,%rdi
call   1030 <printf@plt>
movaps 0x40(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
movapd 0x20(%rsp),%xmm1
add    $0xffffffffffffffff,%rbx
jne    1240 <five+0xd0>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"hN:\00"
@EOF = global i8 0
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [30 x i8] c"Unknown option for one: '%s'\0A\00"
@optind = global i64 0
@.str.2 = [6 x i8] c"%.6f\0A\00"
define void @five(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 80, i32* %5
br label %15
15: ; preds = %36, %2
%16 = load i32, i32* %3
%17 = load i8**, i8*** %4
%18 = call signext i8 @getopt(i32 %16, i8** %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8 %18, i8* %6
%19 = sext i8 %18 to i32
%20 = load i8, i8* @EOF
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %19, %21
br i1 %22, label %23, label %37
23: ; preds = %15
%24 = load i8, i8* %6
%25 = sext i8 %24 to i32
switch i32 %25, label %31 [
i32 78, label %26
i32 104, label %29
]
26: ; preds = %23
%27 = load i8*, i8** @optarg
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %5
br label %36
29: ; preds = %23
%30 = call i32 (...) @help()
br label %36
31: ; preds = %23
%32 = load i32, i32* @stderr
%33 = load i8*, i8** @optarg
%34 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %33)
%35 = call i32 (...) @help()
br label %36
36: ; preds = %31, %29, %26
br label %15
37: ; preds = %15
%38 = load i64, i64* @optind
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = sub nsw i64 %40, %38
%42 = trunc i64 %41 to i32
store i32 %42, i32* %3
%43 = load i64, i64* @optind
%44 = load i8**, i8*** %4
%45 = getelementptr inbounds i8*, i8** %44, i64 %43
store i8** %45, i8*** %4
store double 1.000000e+00, double* %7
store double 1.000000e+00, double* %8
store double 1.000000e+00, double* %9
store double 0.000000e+00, double* %10
store i64 0, i64* %14
br label %46
46: ; preds = %91, %37
%47 = load i64, i64* %14
%48 = load i32, i32* %5
%49 = sext i32 %48 to i64
%50 = icmp slt i64 %47, %49
br i1 %50, label %51, label %94
51: ; preds = %46
%52 = load double, double* %9
store double %52, double* %11
%53 = load double, double* %10
%54 = call double @llvm.fmuladd.f64(double 3.000000e-01, double %53, double 1.400000e+00)
%55 = load double, double* %9
%56 = load double, double* %9
%57 = fneg double %55
%58 = call double @llvm.fmuladd.f64(double %57, double %56, double %54)
store double %58, double* %9
%59 = load double, double* %11
store double %59, double* %10
%60 = load double, double* %7
%61 = load double, double* %7
%62 = call double @llvm.fmuladd.f64(double %60, double %61, double 1.000000e+00)
%63 = load double, double* %8
%64 = load double, double* %8
%65 = call double @llvm.fmuladd.f64(double %63, double %64, double %62)
%66 = fdiv double 6.000000e+00, %65
%67 = fsub double 4.000000e-01, %66
store double %67, double* %12
%68 = load double, double* %8
store double %68, double* %13
%69 = load double, double* %7
%70 = load double, double* %12
%71 = call double @sin(double %70)
%72 = load double, double* %8
%73 = load double, double* %12
%74 = call double @cos(double %73)
%75 = fmul double %72, %74
%76 = call double @llvm.fmuladd.f64(double %69, double %71, double %75)
%77 = fmul double 0x3FE6666666666666, %76
store double %77, double* %8
%78 = load double, double* %7
%79 = load double, double* %12
%80 = call double @cos(double %79)
%81 = load double, double* %13
%82 = load double, double* %12
%83 = call double @sin(double %82)
%84 = fmul double %81, %83
%85 = call double @llvm.fmuladd.f64(double %78, double %80, double %84)
%86 = call double @llvm.fmuladd.f64(double 0x3FE6666666666666, double %85, double 1.000000e+00)
%87 = load double, double* %11
%88 = call double @llvm.fmuladd.f64(double 2.000000e-01, double %87, double %86)
store double %88, double* %7
%89 = load double, double* %7
%90 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %89)
br label %91
91: ; preds = %51
%92 = load i64, i64* %14
%93 = add nsw i64 %92, 1
store i64 %93, i64* %14
br label %46
94: ; preds = %46
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"hN:\00"
@EOF = global i8 0
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [30 x i8] c"Unknown option for one: '%s'\0A\00"
@optind = global i64 0
@.str.2 = [6 x i8] c"%.6f\0A\00"
define void @five(i32 %0, i8** %1) {
%3 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %9, label %11
6: ; preds = %25
%7 = sext i32 %26 to i64
%8 = icmp sgt i32 %26, 0
br i1 %8, label %9, label %62
9: ; preds = %2, %6
%10 = phi i64 [ %7, %6 ], [ 80, %2 ]
br label %30
11: ; preds = %2, %25
%12 = phi i8 [ %27, %25 ], [ %3, %2 ]
%13 = phi i32 [ %26, %25 ], [ 80, %2 ]
%14 = sext i8 %12 to i32
switch i32 %14, label %20 [
i32 78, label %15
i32 104, label %18
]
15: ; preds = %11
%16 = load i8*, i8** @optarg
%17 = tail call i32 @atoi(i8* %16)
br label %25
18: ; preds = %11
%19 = tail call i32 (...) @help()
br label %25
20: ; preds = %11
%21 = load i32, i32* @stderr
%22 = load i8*, i8** @optarg
%23 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = tail call i32 (...) @help()
br label %25
25: ; preds = %20, %18, %15
%26 = phi i32 [ %13, %20 ], [ %13, %18 ], [ %17, %15 ]
%27 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%28 = load i8, i8* @EOF
%29 = icmp eq i8 %27, %28
br i1 %29, label %6, label %11
30: ; preds = %9, %30
%31 = phi i64 [ %60, %30 ], [ 0, %9 ]
%32 = phi double [ %35, %30 ], [ 0.000000e+00, %9 ]
%33 = phi double [ %46, %30 ], [ 1.000000e+00, %9 ]
%34 = phi <2 x double> [ %57, %30 ], [ <double 1.000000e+00, double 1.000000e+00>, %9 ]
%35 = extractelement <2 x double> %34, i64 0
%36 = fneg double %35
%37 = extractelement <2 x double> %34, i64 1
%38 = tail call double @llvm.fmuladd.f64(double %37, double %37, double 1.000000e+00)
%39 = tail call double @llvm.fmuladd.f64(double %33, double %33, double %38)
%40 = fdiv double 6.000000e+00, %39
%41 = fsub double 4.000000e-01, %40
%42 = tail call double @sin(double %41)
%43 = tail call double @cos(double %41)
%44 = fmul double %33, %43
%45 = tail call double @llvm.fmuladd.f64(double %37, double %42, double %44)
%46 = fmul double %45, 0x3FE6666666666666
%47 = tail call double @cos(double %41)
%48 = tail call double @sin(double %41)
%49 = fmul double %33, %48
%50 = tail call double @llvm.fmuladd.f64(double %37, double %47, double %49)
%51 = insertelement <2 x double> poison, double %32, i64 0
%52 = insertelement <2 x double> %51, double %50, i64 1
%53 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %52, <2 x double> <double 3.000000e-01, double 0x3FE6666666666666>, <2 x double> <double 1.400000e+00, double 1.000000e+00>)
%54 = insertelement <2 x double> poison, double %36, i64 0
%55 = shufflevector <2 x double> %54, <2 x double> %34, <2 x i32> <i32 0, i32 2>
%56 = insertelement <2 x double> %34, double 2.000000e-01, i64 1
%57 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %55, <2 x double> %56, <2 x double> %53)
%58 = extractelement <2 x double> %57, i64 1
%59 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %58)
%60 = add nuw nsw i64 %31, 1
%61 = icmp eq i64 %60, %10
br i1 %61, label %62, label %30
62: ; preds = %30, %6
ret void
}