#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*/ sint1(int, double *, double *, double *, double *, int *);
void sint(int n, double x[], double wsave[]) {
  int iw1, iw2, iw3;
  iw1 = n / 2;
  iw2 = iw1 + n + 1;
  iw3 = iw2 + n + 1;
  sint1(n, x, wsave, wsave + iw1, wsave + iw2, (int *)(wsave + iw3));
}


x86 assembly (clang, -O0):
<sint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x18(%rbp),%r8
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%r8
mov    -0x18(%rbp),%r9
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
add    %rax,%r9
call   1030 <sint1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sint>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
lea    (%rdi,%rax,1),%r8d
add    $0x1,%r8d
lea    0x1(%rdi,%r8,1),%r9d
cltq
lea    (%rdx,%rax,8),%rcx
movslq %r8d,%rax
lea    (%rdx,%rax,8),%r8
movslq %r9d,%rax
lea    (%rdx,%rax,8),%r9
jmp    1030 <sint1@plt>

LLVM IR (-O0):
define void @sint(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 2
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %8
%16 = load i32, i32* %8
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %9
%20 = load i32, i32* %4
%21 = load double*, double** %5
%22 = load double*, double** %6
%23 = load double*, double** %6
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double*, double** %6
%28 = load i32, i32* %8
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double*, double** %6
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = bitcast double* %34 to i32*
%36 = call i32 @sint1(i32 %20, double* %21, double* %22, double* %26, double* %30, i32* %35)
ret void
}

LLVM IR (-O2):
define void @sint(i32 %0, double* %1, double* %2) {
%4 = sdiv i32 %0, 2
%5 = add i32 %0, 1
%6 = add i32 %5, %4
%7 = add i32 %5, %6
%8 = sext i32 %4 to i64
%9 = getelementptr inbounds double, double* %2, i64 %8
%10 = sext i32 %6 to i64
%11 = getelementptr inbounds double, double* %2, i64 %10
%12 = sext i32 %7 to i64
%13 = getelementptr inbounds double, double* %2, i64 %12
%14 = bitcast double* %13 to i32*
%15 = tail call i32 @sint1(i32 %0, double* %1, double* %2, double* %9, double* %11, i32* %14)
ret void
}