#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*/ g2_c_raspln(int, double *, double, double *const);
int /*<<< orphan*/ g2_free(double *const);
scalar_t__ g2_malloc(int const);
int /*<<< orphan*/ g2_poly_line(int, int const, double *const);
void g2_raspln(int dev, int n, double *points, double tn) {
  const int m = (n - 1) * 40 + 1;
  double *const sxy = (double *)g2_malloc(m * 2 * sizeof(double));
  g2_c_raspln(n, points, tn, sxy);
  g2_poly_line(dev, m, sxy);
  g2_free(sxy);
}


x86 assembly (clang, -O0):
<g2_raspln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
imul   $0x28,%eax,%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <g2_malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
mov    -0x28(%rbp),%rdx
call   1060 <g2_c_raspln@plt>
mov    -0x4(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1040 <g2_poly_line@plt>
mov    -0x28(%rbp),%rdi
call   1050 <g2_free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_raspln>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdx,%r14
mov    %esi,%ebx
mov    %edi,%r15d
lea    (%rbx,%rbx,4),%eax
lea    -0x27(,%rax,8),%r12d
ff
mov    %r12d,%edi
shl    $0x4,%edi
call   1030 <g2_malloc@plt>
mov    %rax,%rbp
mov    %ebx,%edi
mov    %r14,%rsi
movsd  0x8(%rsp),%xmm0
mov    %rax,%rdx
call   1060 <g2_c_raspln@plt>
mov    %r15d,%edi
mov    %r12d,%esi
mov    %rbp,%rdx
call   1040 <g2_poly_line@plt>
mov    %rbp,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <g2_free@plt>

LLVM IR (-O0):
define void @g2_raspln(i32 %0, i32 %1, double* %2, double %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double
%9 = alloca i32
%10 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double %3, double* %8
%11 = load i32, i32* %6
%12 = sub nsw i32 %11, 1
%13 = mul nsw i32 %12, 40
%14 = add nsw i32 %13, 1
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = mul nsw i32 %15, 2
%17 = sext i32 %16 to i64
%18 = mul i64 %17, 8
%19 = trunc i64 %18 to i32
%20 = call i64 @g2_malloc(i32 %19)
%21 = inttoptr i64 %20 to double*
store double* %21, double** %10
%22 = load i32, i32* %6
%23 = load double*, double** %7
%24 = load double, double* %8
%25 = load double*, double** %10
%26 = call i32 @g2_c_raspln(i32 %22, double* %23, double %24, double* %25)
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = load double*, double** %10
%30 = call i32 @g2_poly_line(i32 %27, i32 %28, double* %29)
%31 = load double*, double** %10
%32 = call i32 @g2_free(double* %31)
ret void
}

LLVM IR (-O2):
define void @g2_raspln(i32 %0, i32 %1, double* %2, double %3) {
%5 = mul i32 %1, 40
%6 = add i32 %5, -39
%7 = shl i32 %6, 4
%8 = tail call i64 @g2_malloc(i32 %7)
%9 = inttoptr i64 %8 to double*
%10 = tail call i32 @g2_c_raspln(i32 %1, double* %2, double %3, double* %9)
%11 = tail call i32 @g2_poly_line(i32 %0, i32 %6, double* %9)
%12 = tail call i32 @g2_free(double* %9)
ret void
}