#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*/ dobldobl_generate(int, int, int *, double *, double *);
int /*<<< orphan*/ dobldobl_operate(int, int, int *, double *, double *);
void dobldobl_test(int nbt, int dim) {
  int wind[nbt];
  double dir[2 * nbt * dim];
  double err[2 * nbt];
  dobldobl_generate(nbt, dim, wind, dir, err);
  dobldobl_operate(nbt, dim, wind, dir, err);
}


x86 assembly (clang, -O0):
<dobldobl_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x40(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %ecx,%eax
add    %eax,%eax
mov    %rax,%rsi
shl    $0x3,%rsi
mov    %rsp,%rcx
sub    %rsi,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    %eax,%eax
mov    %rax,%rsi
shl    $0x3,%rsi
mov    %rsp,%r8
sub    %rsi,%r8
mov    %r8,-0x30(%rbp)
mov    %r8,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <dobldobl_generate@plt>
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <dobldobl_operate@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_test>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%r15d
mov    %edi,%eax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
lea    (%r15,%r15,1),%eax
mov    %eax,%ecx
imul   %esi,%ecx
shl    $0x3,%rcx
mov    %rsp,%r13
sub    %rcx,%r13
mov    %r13,%rsp
mov    %rsp,%rbx
shl    $0x3,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
call   1030 <dobldobl_generate@plt>
mov    %r15d,%edi
mov    %r14d,%esi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
call   1040 <dobldobl_operate@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @dobldobl_test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %5
%12 = alloca i32, i64 %10
store i64 %10, i64* %6
%13 = load i32, i32* %3
%14 = mul nsw i32 2, %13
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
%17 = zext i32 %16 to i64
%18 = alloca double, i64 %17
store i64 %17, i64* %7
%19 = load i32, i32* %3
%20 = mul nsw i32 2, %19
%21 = zext i32 %20 to i64
%22 = alloca double, i64 %21
store i64 %21, i64* %8
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = call i32 @dobldobl_generate(i32 %23, i32 %24, i32* %12, double* %18, double* %22)
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = call i32 @dobldobl_operate(i32 %26, i32 %27, i32* %12, double* %18, double* %22)
%29 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @dobldobl_test(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = alloca i32, i64 %3
%5 = shl nsw i32 %0, 1
%6 = mul nsw i32 %5, %1
%7 = zext i32 %6 to i64
%8 = alloca double, i64 %7
%9 = zext i32 %5 to i64
%10 = alloca double, i64 %9
%11 = call i32 @dobldobl_generate(i32 %0, i32 %1, i32* %4, double* %8, double* %10)
%12 = call i32 @dobldobl_operate(i32 %0, i32 %1, i32* %4, double* %8, double* %10)
ret void
}