#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 *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
double gauss(double, double);
char getopt(int, char **, char *);
int /*<<< orphan*/ help();
char *optarg;
scalar_t__ optind;
int /*<<< orphan*/ printf(char *, double);
double sqrt(double);
int /*<<< orphan*/ stderr;
void three(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 = 20, y = 0;
  double dx = 0, dy = 0;
  double sigV = 3, sigW = 1, a = 0.5, b = 3, T = 0.1;
  long int n = 0;
  sigV = sqrt(sigV);
  sigW = sqrt(sigW);
  for (; n < N; n++) {
    dx = y + gauss(0.0, sigV);
    dy = -a * y - b * x;
    x = x + T * dx + gauss(0.0, sigW);
    y = y + T * dy;
    printf("%.6f\n", x);
  }
}


x86 assembly (clang, -O0):
<three>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x50,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe91(%rip),%rdx
call   1060 <getopt@plt>
mov    %al,-0x15(%rbp)
movsbl %al,%eax
mov    0x2e37(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1228 <three+0xb8>
movsbl -0x15(%rbp),%eax
mov    %eax,-0x6c(%rbp)
sub    $0x4e,%eax
je     11da <three+0x6a>
jmp    11c9 <three+0x59>
mov    -0x6c(%rbp),%eax
sub    $0x68,%eax
je     11f1 <three+0x81>
jmp    11fd <three+0x8d>
mov    0x2e17(%rip),%rax
mov    (%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    1223 <three+0xb3>
mov    $0x0,%al
call   1070 <help@plt>
jmp    1223 <three+0xb3>
mov    0x2dc4(%rip),%rax
mov    (%rax),%edi
mov    0x2deb(%rip),%rax
mov    (%rax),%rdx
lea    0xe15(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1070 <help@plt>
jmp    1189 <three+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  0xdc6(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xd89(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xd8c(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xd77(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd62(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xd4d(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x68(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jge    13de <three+0x26e>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x40(%rbp),%xmm1
xorps  %xmm0,%xmm0
call   1030 <gauss@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm1
xorps  %xmm0,%xmm0
call   1030 <gauss@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xc82(%rip),%rdi
call   1040 <printf@plt>
mov    -0x68(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x68(%rbp)
jmp    12de <three+0x16e>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<three>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%r12d
lea    0xeb5(%rip),%rdx
call   1060 <getopt@plt>
mov    0x2e59(%rip),%r13
mov    $0x50,%ebp
cmp    0x0(%r13),%al
je     120b <three+0xab>
mov    $0x50,%r15d
lea    0xe91(%rip),%r14
mov    0x2e52(%rip),%rbp
jmp    11e4 <three+0x84>
nopl   0x0(%rax,%rax,1)
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0xe70(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1070 <help@plt>
mov    %r12d,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <getopt@plt>
cmp    0x0(%r13),%al
je     11ff <three+0x9f>
movsbl %al,%eax
cmp    $0x68,%eax
je     11c9 <three+0x69>
cmp    $0x4e,%eax
jne    11b0 <three+0x50>
mov    0x0(%rbp),%rdi
call   1080 <atoi@plt>
mov    %eax,%r15d
jmp    11d0 <three+0x70>
test   %r15d,%r15d
jle    12d2 <three+0x172>
movslq %r15d,%rbp
movsd  0xded(%rip),%xmm0
movsd  %xmm0,(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xe29(%rip),%rbx
nopl   0x0(%rax)
xorpd  %xmm0,%xmm0
movsd  0xdcc(%rip),%xmm1
call   1030 <gauss@plt>
movapd %xmm0,%xmm3
movsd  0x8(%rsp),%xmm2
addsd  %xmm2,%xmm3
movsd  (%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  0xdb0(%rip),%xmm0
mulsd  0xdb0(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x10(%rsp)
movsd  0xda6(%rip),%xmm0
mulsd  %xmm0,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,(%rsp)
xorpd  %xmm0,%xmm0
movsd  0xd95(%rip),%xmm1
call   1030 <gauss@plt>
addsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm2
mulsd  0xd75(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    %rbx,%rdi
movsd  %xmm0,(%rsp)
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbp
jne    1230 <three+0xd0>
add    $0x18,%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 @three(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 double
%15 = alloca double
%16 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 80, i32* %5
br label %17
17: ; preds = %38, %2
%18 = load i32, i32* %3
%19 = load i8**, i8*** %4
%20 = call signext i8 @getopt(i32 %18, i8** %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8 %20, i8* %6
%21 = sext i8 %20 to i32
%22 = load i8, i8* @EOF
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %21, %23
br i1 %24, label %25, label %39
25: ; preds = %17
%26 = load i8, i8* %6
%27 = sext i8 %26 to i32
switch i32 %27, label %33 [
i32 78, label %28
i32 104, label %31
]
28: ; preds = %25
%29 = load i8*, i8** @optarg
%30 = call i32 @atoi(i8* %29)
store i32 %30, i32* %5
br label %38
31: ; preds = %25
%32 = call i32 (...) @help()
br label %38
33: ; preds = %25
%34 = load i32, i32* @stderr
%35 = load i8*, i8** @optarg
%36 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %35)
%37 = call i32 (...) @help()
br label %38
38: ; preds = %33, %31, %28
br label %17
39: ; preds = %17
%40 = load i64, i64* @optind
%41 = load i32, i32* %3
%42 = sext i32 %41 to i64
%43 = sub nsw i64 %42, %40
%44 = trunc i64 %43 to i32
store i32 %44, i32* %3
%45 = load i64, i64* @optind
%46 = load i8**, i8*** %4
%47 = getelementptr inbounds i8*, i8** %46, i64 %45
store i8** %47, i8*** %4
store double 2.000000e+01, double* %7
store double 0.000000e+00, double* %8
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
store double 3.000000e+00, double* %11
store double 1.000000e+00, double* %12
store double 5.000000e-01, double* %13
store double 3.000000e+00, double* %14
store double 1.000000e-01, double* %15
store i64 0, i64* %16
%48 = load double, double* %11
%49 = call double @sqrt(double %48)
store double %49, double* %11
%50 = load double, double* %12
%51 = call double @sqrt(double %50)
store double %51, double* %12
br label %52
52: ; preds = %83, %39
%53 = load i64, i64* %16
%54 = load i32, i32* %5
%55 = sext i32 %54 to i64
%56 = icmp slt i64 %53, %55
br i1 %56, label %57, label %86
57: ; preds = %52
%58 = load double, double* %8
%59 = load double, double* %11
%60 = call double @gauss(double 0.000000e+00, double %59)
%61 = fadd double %58, %60
store double %61, double* %9
%62 = load double, double* %13
%63 = fneg double %62
%64 = load double, double* %8
%65 = load double, double* %14
%66 = load double, double* %7
%67 = fmul double %65, %66
%68 = fneg double %67
%69 = call double @llvm.fmuladd.f64(double %63, double %64, double %68)
store double %69, double* %10
%70 = load double, double* %7
%71 = load double, double* %15
%72 = load double, double* %9
%73 = call double @llvm.fmuladd.f64(double %71, double %72, double %70)
%74 = load double, double* %12
%75 = call double @gauss(double 0.000000e+00, double %74)
%76 = fadd double %73, %75
store double %76, double* %7
%77 = load double, double* %8
%78 = load double, double* %15
%79 = load double, double* %10
%80 = call double @llvm.fmuladd.f64(double %78, double %79, double %77)
store double %80, double* %8
%81 = load double, double* %7
%82 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %81)
br label %83
83: ; preds = %57
%84 = load i64, i64* %16
%85 = add nsw i64 %84, 1
store i64 %85, i64* %16
br label %52
86: ; preds = %52
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 @three(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 %45
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 [ %43, %30 ], [ 0, %9 ]
%32 = phi double [ %41, %30 ], [ 0.000000e+00, %9 ]
%33 = phi double [ %40, %30 ], [ 2.000000e+01, %9 ]
%34 = tail call double @gauss(double 0.000000e+00, double 0x3FFBB67AE8584CAA)
%35 = fadd double %32, %34
%36 = fmul double %33, -3.000000e+00
%37 = tail call double @llvm.fmuladd.f64(double %32, double -5.000000e-01, double %36)
%38 = tail call double @llvm.fmuladd.f64(double %35, double 1.000000e-01, double %33)
%39 = tail call double @gauss(double 0.000000e+00, double 1.000000e+00)
%40 = fadd double %39, %38
%41 = tail call double @llvm.fmuladd.f64(double %37, double 1.000000e-01, double %32)
%42 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %40)
%43 = add nuw nsw i64 %31, 1
%44 = icmp eq i64 %43, %10
br i1 %44, label %45, label %30
45: ; preds = %30, %6
ret void
}