#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 */
double *LineSegmentDetection(int *, double *, int, int, double, double, double,
                             double, double, double, int, int **, int *, int *);
double *lsd_scale_region(int *n_out, double *img, int X, int Y, double scale,
                         int **reg_img, int *reg_x, int *reg_y) {
  double sigma_scale = 0.6;
  double quant = 2.0;
  double ang_th = 22.5;
  double log_eps = 0.0;
  double density_th = 0.7;
  int n_bins = 1024;
  return LineSegmentDetection(n_out, img, X, Y, scale, sigma_scale, quant,
                              ang_th, log_eps, density_th, n_bins, reg_img,
                              reg_x, reg_y);
}


x86 assembly (clang, -O0):
<lsd_scale_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x400,-0x5c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
movsd  -0x20(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm4
movsd  -0x58(%rbp),%xmm5
mov    -0x5c(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <LineSegmentDetection@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsd_scale_region>:
push   %rax
mov    %r9,%rax
mov    %r8,%r9
movsd  0xee1(%rip),%xmm1
movsd  0xee1(%rip),%xmm2
movsd  0xee1(%rip),%xmm3
movsd  0xee1(%rip),%xmm5
xorps  %xmm4,%xmm4
mov    $0x400,%r8d
push   0x10(%rsp)
push   %rax
call   1030 <LineSegmentDetection@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define double* @lsd_scale_region(i32* %0, double* %1, i32 %2, i32 %3, double %4, i32** %5, i32* %6, i32* %7) {
%9 = alloca i32*
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca i32**
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca i32
store i32* %0, i32** %9
store double* %1, double** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store double %4, double* %13
store i32** %5, i32*** %14
store i32* %6, i32** %15
store i32* %7, i32** %16
store double 6.000000e-01, double* %17
store double 2.000000e+00, double* %18
store double 2.250000e+01, double* %19
store double 0.000000e+00, double* %20
store double 0x3FE6666666666666, double* %21
store i32 1024, i32* %22
%23 = load i32*, i32** %9
%24 = load double*, double** %10
%25 = load i32, i32* %11
%26 = load i32, i32* %12
%27 = load double, double* %13
%28 = load double, double* %17
%29 = load double, double* %18
%30 = load double, double* %19
%31 = load double, double* %20
%32 = load double, double* %21
%33 = load i32, i32* %22
%34 = load i32**, i32*** %14
%35 = load i32*, i32** %15
%36 = load i32*, i32** %16
%37 = call double* @LineSegmentDetection(i32* %23, double* %24, i32 %25, i32 %26, double %27, double %28, double %29, double %30, double %31, double %32, i32 %33, i32** %34, i32* %35, i32* %36)
ret double* %37
}

LLVM IR (-O2):
define double* @lsd_scale_region(i32* %0, double* %1, i32 %2, i32 %3, double %4, i32** %5, i32* %6, i32* %7) {
%9 = tail call double* @LineSegmentDetection(i32* %0, double* %1, i32 %2, i32 %3, double %4, double 6.000000e-01, double 2.000000e+00, double 2.250000e+01, double 0.000000e+00, double 0x3FE6666666666666, i32 1024, i32** %5, i32* %6, i32* %7)
ret double* %9
}