#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 */
struct arguments {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int EXIT_SUCCESS;
double *LineSegmentDetection(int *, double *, int, int, scalar_t__, scalar_t__,
                             scalar_t__, scalar_t__, scalar_t__, scalar_t__,
                             scalar_t__, int, scalar_t__, int /*<<< orphan*/,
                             int /*<<< orphan*/, int **, int *, int *,
                             scalar_t__, scalar_t__);
int /*<<< orphan*/ error(char *);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ free_arguments(struct arguments *);
scalar_t__ get_double(struct arguments *, char *);
int /*<<< orphan*/ get_int(struct arguments *, char *);
int /*<<< orphan*/ get_str(struct arguments *, char *);
scalar_t__ is_assigned(struct arguments *, char *);
struct arguments *process_arguments(char *, int, char **);
double *read_pgm_image_double(int *, int *, int /*<<< orphan*/);
int /*<<< orphan*/ *stdout;
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int /*<<< orphan*/ write_eps(double *, int, int, int /*<<< orphan*/, int, int,
                             scalar_t__);
int /*<<< orphan*/ write_pgm_image_int(int *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ write_svg(double *, int, int, int /*<<< orphan*/, int, int,
                             scalar_t__);
int main(int argc, char **argv) {
  struct arguments *arg = process_arguments(
      "                                                                  "
      "#name: lsd                                                              "
      "       #author: rafael grompone von gioi                                "
      "              #version: 1.6 of November 11, 2011                        "
      "                     #year: 2007-2011                                   "
      "                            #desc: Line Segment Detector                "
      "                                   #opt: scale | s | double | 0.8 | 0.0 "
      "| |                                             Scale image by Gaussian "
      "filter before processing.                        #opt: sigma_coef | c | "
      "double | 0.6 | 0.0 | |                                        Sigma for "
      "Gaussian filter is computed as sigma_coef/scale.               #opt: "
      "quant | q | double | 2.0 | 0.0 | |                                      "
      "       Bound to quantization error on the gradient norm.                "
      "        #opt: ang_th | a | double | 22.5 | 0.0 | 180.0 |                "
      "                     Gradient angle tolerance in degrees.               "
      "                      #opt: log_eps | e | double | 0.0 | | | Detection "
      "threshold, -log10(max. NFA)   #opt: density_th | d | double | 0.7 | 0.0 "
      "| 1.0 |                                    Minimal density of region "
      "points in a rectangle to be accepted.          #opt: n_bins | b | int | "
      "1024 | 1 | |                                                Number of "
      "bins in 'ordering' of gradient modulus.                        #opt: "
      "reg | R | str | | | |                                                   "
      "       Output image: owner LS number at each pixel. Scaled size. (PGM)  "
      "        #opt: epsfile | P | str | | | | Output line segments into EPS "
      "file 'epsfile'.  #opt: svgfile | S | str | | | | Output line segments "
      "into SVG file 'svgfile'.  #opt: width | W | double | 1.5 | | |          "
      "                                       LS width used in EPS and SVG "
      "files. If <=0, use detected values.         #opt: need_to_union | U | "
      "int | 0 | 0 | 1 |                                          Do you need "
      "to post procces image by union close segments                #opt: "
      "union_ang_th | A | double | 7 | 0.0 | 180.0 |                           "
      "    Union angle tolerance in degrees.                                   "
      "     #opt: union_log_eps | E | double | -1.0 | | |                      "
      "                   Union detection threshold                            "
      "                    #opt: length_threshold | L | double | 5 | 0.0 | |   "
      "                                Minimum length of segment to union      "
      "                                 #opt: dist_threshold | D | double | 5 "
      "| 0.0 | |                                     Maximum distance between "
      "two line which we would union                   #req: in  | | str | | | "
      "| Input image (PGM)                                    #req: out | | "
      "str | | | |                                                            "
      "Line Segment output (each ascii line: x1,y1,x2,y2,width,p,-log10(NFA) ) "
      " ",
      argc, argv);
  FILE *output;
  double *image;
  int X, Y;
  double *segs;
  int n;
  int dim = 7;
  int *region;
  int regX, regY;
  int i, j;
  image = read_pgm_image_double(&X, &Y, get_str(arg, "in"));
  segs = LineSegmentDetection(
      &n, image, X, Y, get_double(arg, "scale"), get_double(arg, "sigma_coef"),
      get_double(arg, "quant"), get_double(arg, "ang_th"),
      get_double(arg, "log_eps"), get_double(arg, "density_th"),
      get_double(arg, "union_ang_th"), get_double(arg, "union_log_eps") >= 0,
      get_double(arg, "union_log_eps"), get_int(arg, "n_bins"),
      get_int(arg, "need_to_union"), is_assigned(arg, "reg") ? &region : NULL,
      &regX, &regY, get_double(arg, "length_threshold"),
      get_double(arg, "dist_threshold"));
  if (strcmp(get_str(arg, "out"), "-") == 0)
    output = stdout;
  else
    output = fopen(get_str(arg, "out"), "w");
  if (output == NULL)
    error("Error: unable to open ASCII output file.");
  for (i = 0; i < n; i++) {
    for (j = 0; j < dim; j++)
      fprintf(output, "%f ", segs[i * dim + j]);
    fprintf(output, "\n");
  }
  if (output != stdout && fclose(output) == EOF)
    error("Error: unable to close file while output file.");
  if (is_assigned(arg, "reg")) {
    write_pgm_image_int(region, regX, regY, get_str(arg, "reg"));
    free((void *)region);
  }
  if (is_assigned(arg, "epsfile"))
    write_eps(segs, n, dim, get_str(arg, "epsfile"), X, Y,
              get_double(arg, "width"));
  if (is_assigned(arg, "svgfile"))
    write_svg(segs, n, dim, get_str(arg, "svgfile"), X, Y,
              get_double(arg, "width"));
  free((void *)image);
  free((void *)segs);
  free_arguments(arg);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x188,%rsp
movl   $0x0,-0x2c(%rbp)
mov    %edi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    -0x30(%rbp),%esi
mov    -0x38(%rbp),%rdx
lea    0xdc0(%rip),%rdi
call   10d0 <process_arguments@plt>
mov    %rax,-0x40(%rbp)
movl   $0x7,-0x68(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x194f(%rip),%rsi
call   10e0 <get_str@plt>
mov    %eax,%edx
lea    -0x54(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1050 <read_pgm_image_double@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0xd8(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0xd4(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x1912(%rip),%rsi
call   1090 <get_double@plt>
mov    %rax,-0xd0(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x1901(%rip),%rsi
call   1090 <get_double@plt>
mov    %rax,-0xc8(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x18f5(%rip),%rsi
call   1090 <get_double@plt>
mov    %rax,-0xc0(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x18f5(%rip),%rsi
call   1090 <get_double@plt>
mov    %rax,-0xb8(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x18eb(%rip),%rsi
call   1090 <get_double@plt>
mov    %rax,-0xb0(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x18b6(%rip),%rsi
call   1090 <get_double@plt>
mov    %rax,-0xa8(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x18aa(%rip),%rsi
call   1090 <get_double@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x18a0(%rip),%rsi
call   1090 <get_double@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x94(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x187e(%rip),%rsi
call   1090 <get_double@plt>
mov    %rax,-0x90(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x1875(%rip),%rsi
call   1130 <get_int@plt>
mov    %eax,-0x88(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x1866(%rip),%rsi
call   1130 <get_int@plt>
mov    %eax,-0x84(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x185e(%rip),%rsi
call   1060 <is_assigned@plt>
cmp    $0x0,%rax
je     13c0 <main+0x1b0>
lea    -0x70(%rbp),%rax
mov    %rax,-0xe8(%rbp)
jmp    13ce <main+0x1be>
xor    %eax,%eax
mov    %rax,-0xe8(%rbp)
jmp    13ce <main+0x1be>
mov    -0x88(%rbp),%r12d
mov    -0x90(%rbp),%r13
mov    -0xc0(%rbp),%r15
mov    -0xe8(%rbp),%r14
mov    -0x40(%rbp),%rdi
lea    0x180e(%rip),%rsi
call   1090 <get_double@plt>
mov    %rax,-0xf0(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x1808(%rip),%rsi
call   1090 <get_double@plt>
mov    -0xe0(%rbp),%rsi
mov    -0xd8(%rbp),%edx
mov    -0xd4(%rbp),%ecx
mov    -0xd0(%rbp),%r8
mov    -0xc8(%rbp),%r9
mov    -0xf0(%rbp),%r10
lea    -0x64(%rbp),%rdi
lea    -0x74(%rbp),%rbx
lea    -0x78(%rbp),%r11
mov    %r15,(%rsp)
mov    -0xb8(%rbp),%r15
mov    %r15,0x8(%rsp)
mov    -0xb0(%rbp),%r15
mov    %r15,0x10(%rsp)
mov    -0xa8(%rbp),%r15
mov    %r15,0x18(%rsp)
mov    -0xa0(%rbp),%r15
mov    %r15,0x20(%rsp)
mov    -0x94(%rbp),%r15d
mov    %r15d,0x28(%rsp)
mov    -0x84(%rbp),%r15d
mov    %r13,0x30(%rsp)
mov    %r12d,0x38(%rsp)
mov    %r15d,0x40(%rsp)
mov    %r14,0x48(%rsp)
mov    %rbx,0x50(%rsp)
mov    %r11,0x58(%rsp)
mov    %r10,0x60(%rsp)
mov    %rax,0x68(%rsp)
call   1030 <LineSegmentDetection@plt>
mov    %rax,-0x60(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x175b(%rip),%rsi
call   10e0 <get_str@plt>
mov    %eax,%edi
lea    0x1751(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    14f8 <main+0x2e8>
mov    0x2aec(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    151a <main+0x30a>
mov    -0x40(%rbp),%rdi
lea    0x1720(%rip),%rsi
call   10e0 <get_str@plt>
mov    %eax,%edi
lea    0x1718(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1531 <main+0x321>
lea    0x16ff(%rip),%rdi
call   1100 <error@plt>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    15ad <main+0x39d>
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x68(%rbp),%eax
jge    158d <main+0x37d>
mov    -0x48(%rbp),%rdi
mov    -0x60(%rbp),%rax
mov    -0x7c(%rbp),%ecx
imul   -0x68(%rbp),%ecx
add    -0x80(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0x16dc(%rip),%rsi
mov    $0x1,%al
call   10c0 <fprintf@plt>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    154b <main+0x33b>
mov    -0x48(%rbp),%rdi
lea    0x16c0(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1538 <main+0x328>
mov    -0x48(%rbp),%rax
mov    0x2a20(%rip),%rcx
cmp    (%rcx),%rax
je     15e6 <main+0x3d6>
mov    -0x48(%rbp),%rdi
call   1080 <fclose@plt>
mov    0x2a17(%rip),%rcx
cmp    (%rcx),%rax
jne    15e6 <main+0x3d6>
lea    0x1679(%rip),%rdi
call   1100 <error@plt>
mov    -0x40(%rbp),%rdi
lea    0x160e(%rip),%rsi
call   1060 <is_assigned@plt>
cmp    $0x0,%rax
je     1650 <main+0x440>
mov    -0x70(%rbp),%rax
mov    %rax,-0x100(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0xf8(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0xf4(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x15d7(%rip),%rsi
call   10e0 <get_str@plt>
mov    -0x100(%rbp),%rdi
mov    -0xf8(%rbp),%esi
mov    -0xf4(%rbp),%edx
mov    %eax,%ecx
call   10a0 <write_pgm_image_int@plt>
mov    -0x70(%rbp),%rdi
call   1040 <free@plt>
mov    -0x40(%rbp),%rdi
lea    0x162e(%rip),%rsi
call   1060 <is_assigned@plt>
cmp    $0x0,%rax
je     16ef <main+0x4df>
mov    -0x60(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0x114(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0x110(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x15f7(%rip),%rsi
call   10e0 <get_str@plt>
mov    %eax,-0x10c(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x108(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x104(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x15d7(%rip),%rsi
call   1090 <get_double@plt>
mov    -0x120(%rbp),%rdi
mov    -0x114(%rbp),%esi
mov    -0x110(%rbp),%edx
mov    -0x10c(%rbp),%ecx
mov    -0x108(%rbp),%r8d
mov    -0x104(%rbp),%r9d
mov    %rax,(%rsp)
call   10f0 <write_eps@plt>
mov    -0x40(%rbp),%rdi
lea    0x159d(%rip),%rsi
call   1060 <is_assigned@plt>
cmp    $0x0,%rax
je     178e <main+0x57e>
mov    -0x60(%rbp),%rax
mov    %rax,-0x140(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0x134(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0x130(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x1566(%rip),%rsi
call   10e0 <get_str@plt>
mov    %eax,-0x12c(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x128(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x124(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x1538(%rip),%rsi
call   1090 <get_double@plt>
mov    -0x140(%rbp),%rdi
mov    -0x134(%rbp),%esi
mov    -0x130(%rbp),%edx
mov    -0x12c(%rbp),%ecx
mov    -0x128(%rbp),%r8d
mov    -0x124(%rbp),%r9d
mov    %rax,(%rsp)
call   1070 <write_svg@plt>
mov    -0x50(%rbp),%rdi
call   1040 <free@plt>
mov    -0x60(%rbp),%rdi
call   1040 <free@plt>
mov    -0x40(%rbp),%rdi
call   1110 <free_arguments@plt>
mov    0x2820(%rip),%rax
mov    (%rax),%eax
add    $0x188,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xdc6(%rip),%rdi
call   10e0 <process_arguments@plt>
mov    %rax,%r15
lea    0x1961(%rip),%rsi
mov    %rax,%rdi
call   10f0 <get_str@plt>
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    %eax,%edx
call   1050 <read_pgm_image_double@plt>
mov    %rax,0x28(%rsp)
mov    0x14(%rsp),%eax
mov    %eax,0x1c(%rsp)
mov    0x10(%rsp),%eax
mov    %eax,0x18(%rsp)
lea    0x192f(%rip),%rsi
mov    %r15,%rdi
call   1090 <get_double@plt>
mov    %rax,0x60(%rsp)
lea    0x1921(%rip),%rsi
mov    %r15,%rdi
call   1090 <get_double@plt>
mov    %rax,0x50(%rsp)
lea    0x1918(%rip),%rsi
mov    %r15,%rdi
call   1090 <get_double@plt>
mov    %rax,0x70(%rsp)
lea    0x191b(%rip),%rsi
mov    %r15,%rdi
call   1090 <get_double@plt>
mov    %rax,0x68(%rsp)
lea    0x1914(%rip),%rsi
mov    %r15,%rdi
call   1090 <get_double@plt>
mov    %rax,0x58(%rsp)
lea    0x18e2(%rip),%rsi
mov    %r15,%rdi
call   1090 <get_double@plt>
mov    %rax,0x48(%rsp)
lea    0x18d9(%rip),%rsi
mov    %r15,%rdi
call   1090 <get_double@plt>
mov    %rax,0x40(%rsp)
lea    0x18d2(%rip),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <get_double@plt>
mov    %rax,%r14
shr    $0x3f,%r14
xor    $0x1,%r14d
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <get_double@plt>
mov    %rax,0x38(%rsp)
lea    0x18b3(%rip),%rsi
mov    %r15,%rdi
call   1140 <get_int@plt>
mov    %eax,%r12d
lea    0x18a8(%rip),%rsi
mov    %r15,%rdi
call   1140 <get_int@plt>
mov    %eax,%r13d
lea    0x18a4(%rip),%rsi
mov    %r15,%rdi
call   1060 <is_assigned@plt>
test   %rax,%rax
lea    0x30(%rsp),%rbx
cmove  %rax,%rbx
lea    0x188d(%rip),%rsi
mov    %r15,%rdi
call   1090 <get_double@plt>
mov    %rax,%rbp
lea    0x188c(%rip),%rsi
mov    %r15,%rdi
call   1090 <get_double@plt>
lea    0x20(%rsp),%r10
lea    0x24(%rsp),%r11
lea    0xc(%rsp),%rdi
mov    0x28(%rsp),%rsi
mov    0x1c(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x60(%rsp),%r8
mov    0x50(%rsp),%r9
push   %rax
push   %rbp
push   %r10
push   %r11
push   %rbx
push   %r13
push   %r12
push   0x70(%rsp)
push   %r14
push   0x88(%rsp)
push   0x98(%rsp)
push   0xb0(%rsp)
push   0xc8(%rsp)
push   0xd8(%rsp)
call   1030 <LineSegmentDetection@plt>
add    $0x70,%rsp
mov    %rax,%r14
lea    0x1826(%rip),%rsi
mov    %r15,%rdi
call   10f0 <get_str@plt>
lea    0x181b(%rip),%rsi
mov    %eax,%edi
call   10c0 <strcmp@plt>
test   %rax,%rax
je     167e <main+0x45e>
lea    0x1800(%rip),%rsi
mov    %r15,%rdi
call   10f0 <get_str@plt>
lea    0x17f7(%rip),%rsi
mov    %eax,%edi
call   1130 <fopen@plt>
mov    %rax,%r13
test   %r13,%r13
jne    144d <main+0x22d>
lea    0x17e3(%rip),%rdi
call   1110 <error@plt>
cmpl   $0x0,0xc(%rsp)
jle    1510 <main+0x2f0>
lea    0x30(%r14),%rbx
xor    %ebp,%ebp
lea    0x17ef(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
movsd  -0x30(%rbx),%xmm0
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
movsd  -0x28(%rbx),%xmm0
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
movsd  -0x20(%rbx),%xmm0
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
movsd  -0x18(%rbx),%xmm0
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
movsd  -0x10(%rbx),%xmm0
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
movsd  -0x8(%rbx),%xmm0
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
movsd  (%rbx),%xmm0
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
mov    $0xa,%edi
mov    %r13,%rsi
call   10b0 <fputc@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
add    $0x38,%rbx
cmp    %rax,%rbp
jl     1470 <main+0x250>
mov    0x2ac1(%rip),%rax
cmp    (%rax),%r13
je     153c <main+0x31c>
mov    %r13,%rdi
call   1080 <fclose@plt>
mov    0x2abd(%rip),%rcx
cmp    (%rcx),%rax
jne    153c <main+0x31c>
lea    0x1721(%rip),%rdi
call   1110 <error@plt>
lea    0x16bc(%rip),%rsi
mov    %r15,%rdi
call   1060 <is_assigned@plt>
test   %rax,%rax
je     1586 <main+0x366>
mov    0x30(%rsp),%rbx
mov    0x24(%rsp),%ebp
mov    0x20(%rsp),%r12d
lea    0x169a(%rip),%rsi
mov    %r15,%rdi
call   10f0 <get_str@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %eax,%ecx
call   10a0 <write_pgm_image_int@plt>
mov    0x30(%rsp),%rdi
call   1040 <free@plt>
lea    0x16fa(%rip),%rsi
mov    %r15,%rdi
call   1060 <is_assigned@plt>
test   %rax,%rax
je     15e9 <main+0x3c9>
mov    0xc(%rsp),%r12d
lea    0x16e1(%rip),%rsi
mov    %r15,%rdi
call   10f0 <get_str@plt>
mov    %eax,%ebp
mov    0x14(%rsp),%ebx
mov    0x10(%rsp),%r13d
lea    0x16cf(%rip),%rsi
mov    %r15,%rdi
call   1090 <get_double@plt>
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %r12d,%esi
mov    $0x7,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
mov    %r13d,%r9d
push   %rax
call   1100 <write_eps@plt>
add    $0x10,%rsp
lea    0x16a5(%rip),%rsi
mov    %r15,%rdi
call   1060 <is_assigned@plt>
test   %rax,%rax
je     164c <main+0x42c>
mov    0xc(%rsp),%r12d
lea    0x168c(%rip),%rsi
mov    %r15,%rdi
call   10f0 <get_str@plt>
mov    %eax,%ebp
mov    0x14(%rsp),%ebx
mov    0x10(%rsp),%r13d
lea    0x166c(%rip),%rsi
mov    %r15,%rdi
call   1090 <get_double@plt>
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %r12d,%esi
mov    $0x7,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
mov    %r13d,%r9d
push   %rax
call   1070 <write_svg@plt>
add    $0x10,%rsp
mov    0x28(%rsp),%rdi
call   1040 <free@plt>
mov    %r14,%rdi
call   1040 <free@plt>
mov    %r15,%rdi
call   1120 <free_arguments@plt>
mov    0x2963(%rip),%rax
mov    (%rax),%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2953(%rip),%rax
mov    (%rax),%r13
test   %r13,%r13
jne    144d <main+0x22d>
jmp    1441 <main+0x221>

LLVM IR (-O0):
%struct.arguments = type { i32 }
@.str = [2986 x i8] c" #name: lsd #author: rafael grompone von gioi #version: 1.6 of November 11, 2011 #year: 2007-2011 #desc: Line Segment Detector #opt: scale | s | double | 0.8 | 0.0 | | Scale image by Gaussian filter before processing. #opt: sigma_coef | c | double | 0.6 | 0.0 | | Sigma for Gaussian filter is computed as sigma_coef/scale. #opt: quant | q | double | 2.0 | 0.0 | | Bound to quantization error on the gradient norm. #opt: ang_th | a | double | 22.5 | 0.0 | 180.0 | Gradient angle tolerance in degrees. #opt: log_eps | e | double | 0.0 | | | Detection threshold, -log10(max. NFA) #opt: density_th | d | double | 0.7 | 0.0 | 1.0 | Minimal density of region points in a rectangle to be accepted. #opt: n_bins | b | int | 1024 | 1 | | Number of bins in 'ordering' of gradient modulus. #opt: reg | R | str | | | | Output image: owner LS number at each pixel. Scaled size. (PGM) #opt: epsfile | P | str | | | | Output line segments into EPS file 'epsfile'. #opt: svgfile | S | str | | | | Output line segments into SVG file 'svgfile'. #opt: width | W | double | 1.5 | | | LS width used in EPS and SVG files. If <=0, use detected values. #opt: need_to_union | U | int | 0 | 0 | 1 | Do you need to post procces image by union close segments #opt: union_ang_th | A | double | 7 | 0.0 | 180.0 | Union angle tolerance in degrees. #opt: union_log_eps | E | double | -1.0 | | | Union detection threshold #opt: length_threshold | L | double | 5 | 0.0 | | Minimum length of segment to union #opt: dist_threshold | D | double | 5 | 0.0 | | Maximum distance between two line which we would union #req: in | | str | | | | Input image (PGM) #req: out | | str | | | | Line Segment output (each ascii line: x1,y1,x2,y2,width,p,-log10(NFA) ) \00"
@.str.1 = [3 x i8] c"in\00"
@.str.2 = [6 x i8] c"scale\00"
@.str.3 = [11 x i8] c"sigma_coef\00"
@.str.4 = [6 x i8] c"quant\00"
@.str.5 = [7 x i8] c"ang_th\00"
@.str.6 = [8 x i8] c"log_eps\00"
@.str.7 = [11 x i8] c"density_th\00"
@.str.8 = [13 x i8] c"union_ang_th\00"
@.str.9 = [14 x i8] c"union_log_eps\00"
@.str.10 = [7 x i8] c"n_bins\00"
@.str.11 = [14 x i8] c"need_to_union\00"
@.str.12 = [4 x i8] c"reg\00"
@.str.13 = [17 x i8] c"length_threshold\00"
@.str.14 = [15 x i8] c"dist_threshold\00"
@.str.15 = [4 x i8] c"out\00"
@.str.16 = [2 x i8] c"-\00"
@stdout = global i32* null
@.str.17 = [2 x i8] c"w\00"
@.str.18 = [41 x i8] c"Error: unable to open ASCII output file.\00"
@.str.19 = [4 x i8] c"%f \00"
@.str.20 = [2 x i8] c"\0A\00"
@EOF = global i64 0
@.str.21 = [47 x i8] c"Error: unable to close file while output file.\00"
@.str.22 = [8 x i8] c"epsfile\00"
@.str.23 = [6 x i8] c"width\00"
@.str.24 = [8 x i8] c"svgfile\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.arguments*
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = call %struct.arguments* @process_arguments(i8* getelementptr inbounds ([2986 x i8], [2986 x i8]* @.str, i64 0, i64 0), i32 %19, i8** %20)
store %struct.arguments* %21, %struct.arguments** %6
store i32 7, i32* %13
%22 = load %struct.arguments*, %struct.arguments** %6
%23 = call i32 @get_str(%struct.arguments* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%24 = call double* @read_pgm_image_double(i32* %9, i32* %10, i32 %23)
store double* %24, double** %8
%25 = load double*, double** %8
%26 = load i32, i32* %9
%27 = load i32, i32* %10
%28 = load %struct.arguments*, %struct.arguments** %6
%29 = call i64 @get_double(%struct.arguments* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%30 = load %struct.arguments*, %struct.arguments** %6
%31 = call i64 @get_double(%struct.arguments* %30, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%32 = load %struct.arguments*, %struct.arguments** %6
%33 = call i64 @get_double(%struct.arguments* %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%34 = load %struct.arguments*, %struct.arguments** %6
%35 = call i64 @get_double(%struct.arguments* %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%36 = load %struct.arguments*, %struct.arguments** %6
%37 = call i64 @get_double(%struct.arguments* %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%38 = load %struct.arguments*, %struct.arguments** %6
%39 = call i64 @get_double(%struct.arguments* %38, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%40 = load %struct.arguments*, %struct.arguments** %6
%41 = call i64 @get_double(%struct.arguments* %40, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%42 = load %struct.arguments*, %struct.arguments** %6
%43 = call i64 @get_double(%struct.arguments* %42, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%44 = icmp sge i64 %43, 0
%45 = zext i1 %44 to i32
%46 = load %struct.arguments*, %struct.arguments** %6
%47 = call i64 @get_double(%struct.arguments* %46, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%48 = load %struct.arguments*, %struct.arguments** %6
%49 = call i32 @get_int(%struct.arguments* %48, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%50 = load %struct.arguments*, %struct.arguments** %6
%51 = call i32 @get_int(%struct.arguments* %50, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
%52 = load %struct.arguments*, %struct.arguments** %6
%53 = call i64 @is_assigned(%struct.arguments* %52, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %56
55: ; preds = %2
br label %57
56: ; preds = %2
br label %57
57: ; preds = %56, %55
%58 = phi i32** [ %14, %55 ], [ null, %56 ]
%59 = load %struct.arguments*, %struct.arguments** %6
%60 = call i64 @get_double(%struct.arguments* %59, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
%61 = load %struct.arguments*, %struct.arguments** %6
%62 = call i64 @get_double(%struct.arguments* %61, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0))
%63 = call double* @LineSegmentDetection(i32* %12, double* %25, i32 %26, i32 %27, i64 %29, i64 %31, i64 %33, i64 %35, i64 %37, i64 %39, i64 %41, i32 %45, i64 %47, i32 %49, i32 %51, i32** %58, i32* %15, i32* %16, i64 %60, i64 %62)
store double* %63, double** %11
%64 = load %struct.arguments*, %struct.arguments** %6
%65 = call i32 @get_str(%struct.arguments* %64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%66 = call i64 @strcmp(i32 %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %57
%69 = load i32*, i32** @stdout
store i32* %69, i32** %7
br label %74
70: ; preds = %57
%71 = load %struct.arguments*, %struct.arguments** %6
%72 = call i32 @get_str(%struct.arguments* %71, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%73 = call i32* @fopen(i32 %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
store i32* %73, i32** %7
br label %74
74: ; preds = %70, %68
%75 = load i32*, i32** %7
%76 = icmp eq i32* %75, null
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = call i32 @error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.18, i64 0, i64 0))
br label %79
79: ; preds = %77, %74
store i32 0, i32* %17
br label %80
80: ; preds = %107, %79
%81 = load i32, i32* %17
%82 = load i32, i32* %12
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %110
84: ; preds = %80
store i32 0, i32* %18
br label %85
85: ; preds = %101, %84
%86 = load i32, i32* %18
%87 = load i32, i32* %13
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %104
89: ; preds = %85
%90 = load i32*, i32** %7
%91 = load double*, double** %11
%92 = load i32, i32* %17
%93 = load i32, i32* %13
%94 = mul nsw i32 %92, %93
%95 = load i32, i32* %18
%96 = add nsw i32 %94, %95
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double, double* %91, i64 %97
%99 = load double, double* %98
%100 = call i32 (i32*, i8*, ...) @fprintf(i32* %90, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double %99)
br label %101
101: ; preds = %89
%102 = load i32, i32* %18
%103 = add nsw i32 %102, 1
store i32 %103, i32* %18
br label %85
104: ; preds = %85
%105 = load i32*, i32** %7
%106 = call i32 (i32*, i8*, ...) @fprintf(i32* %105, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
br label %107
107: ; preds = %104
%108 = load i32, i32* %17
%109 = add nsw i32 %108, 1
store i32 %109, i32* %17
br label %80
110: ; preds = %80
%111 = load i32*, i32** %7
%112 = load i32*, i32** @stdout
%113 = icmp ne i32* %111, %112
br i1 %113, label %114, label %121
114: ; preds = %110
%115 = load i32*, i32** %7
%116 = call i64 @fclose(i32* %115)
%117 = load i64, i64* @EOF
%118 = icmp eq i64 %116, %117
br i1 %118, label %119, label %121
119: ; preds = %114
%120 = call i32 @error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.21, i64 0, i64 0))
br label %121
121: ; preds = %119, %114, %110
%122 = load %struct.arguments*, %struct.arguments** %6
%123 = call i64 @is_assigned(%struct.arguments* %122, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%124 = icmp ne i64 %123, 0
br i1 %124, label %125, label %135
125: ; preds = %121
%126 = load i32*, i32** %14
%127 = load i32, i32* %15
%128 = load i32, i32* %16
%129 = load %struct.arguments*, %struct.arguments** %6
%130 = call i32 @get_str(%struct.arguments* %129, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%131 = call i32 @write_pgm_image_int(i32* %126, i32 %127, i32 %128, i32 %130)
%132 = load i32*, i32** %14
%133 = bitcast i32* %132 to i8*
%134 = call i32 @free(i8* %133)
br label %135
135: ; preds = %125, %121
%136 = load %struct.arguments*, %struct.arguments** %6
%137 = call i64 @is_assigned(%struct.arguments* %136, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
%138 = icmp ne i64 %137, 0
br i1 %138, label %139, label %150
139: ; preds = %135
%140 = load double*, double** %11
%141 = load i32, i32* %12
%142 = load i32, i32* %13
%143 = load %struct.arguments*, %struct.arguments** %6
%144 = call i32 @get_str(%struct.arguments* %143, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
%145 = load i32, i32* %9
%146 = load i32, i32* %10
%147 = load %struct.arguments*, %struct.arguments** %6
%148 = call i64 @get_double(%struct.arguments* %147, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
%149 = call i32 @write_eps(double* %140, i32 %141, i32 %142, i32 %144, i32 %145, i32 %146, i64 %148)
br label %150
150: ; preds = %139, %135
%151 = load %struct.arguments*, %struct.arguments** %6
%152 = call i64 @is_assigned(%struct.arguments* %151, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%153 = icmp ne i64 %152, 0
br i1 %153, label %154, label %165
154: ; preds = %150
%155 = load double*, double** %11
%156 = load i32, i32* %12
%157 = load i32, i32* %13
%158 = load %struct.arguments*, %struct.arguments** %6
%159 = call i32 @get_str(%struct.arguments* %158, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%160 = load i32, i32* %9
%161 = load i32, i32* %10
%162 = load %struct.arguments*, %struct.arguments** %6
%163 = call i64 @get_double(%struct.arguments* %162, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
%164 = call i32 @write_svg(double* %155, i32 %156, i32 %157, i32 %159, i32 %160, i32 %161, i64 %163)
br label %165
165: ; preds = %154, %150
%166 = load double*, double** %8
%167 = bitcast double* %166 to i8*
%168 = call i32 @free(i8* %167)
%169 = load double*, double** %11
%170 = bitcast double* %169 to i8*
%171 = call i32 @free(i8* %170)
%172 = load %struct.arguments*, %struct.arguments** %6
%173 = call i32 @free_arguments(%struct.arguments* %172)
%174 = load i32, i32* @EXIT_SUCCESS
ret i32 %174
}

LLVM IR (-O2):
%struct.arguments = type { i32 }
@.str = [2986 x i8] c" #name: lsd #author: rafael grompone von gioi #version: 1.6 of November 11, 2011 #year: 2007-2011 #desc: Line Segment Detector #opt: scale | s | double | 0.8 | 0.0 | | Scale image by Gaussian filter before processing. #opt: sigma_coef | c | double | 0.6 | 0.0 | | Sigma for Gaussian filter is computed as sigma_coef/scale. #opt: quant | q | double | 2.0 | 0.0 | | Bound to quantization error on the gradient norm. #opt: ang_th | a | double | 22.5 | 0.0 | 180.0 | Gradient angle tolerance in degrees. #opt: log_eps | e | double | 0.0 | | | Detection threshold, -log10(max. NFA) #opt: density_th | d | double | 0.7 | 0.0 | 1.0 | Minimal density of region points in a rectangle to be accepted. #opt: n_bins | b | int | 1024 | 1 | | Number of bins in 'ordering' of gradient modulus. #opt: reg | R | str | | | | Output image: owner LS number at each pixel. Scaled size. (PGM) #opt: epsfile | P | str | | | | Output line segments into EPS file 'epsfile'. #opt: svgfile | S | str | | | | Output line segments into SVG file 'svgfile'. #opt: width | W | double | 1.5 | | | LS width used in EPS and SVG files. If <=0, use detected values. #opt: need_to_union | U | int | 0 | 0 | 1 | Do you need to post procces image by union close segments #opt: union_ang_th | A | double | 7 | 0.0 | 180.0 | Union angle tolerance in degrees. #opt: union_log_eps | E | double | -1.0 | | | Union detection threshold #opt: length_threshold | L | double | 5 | 0.0 | | Minimum length of segment to union #opt: dist_threshold | D | double | 5 | 0.0 | | Maximum distance between two line which we would union #req: in | | str | | | | Input image (PGM) #req: out | | str | | | | Line Segment output (each ascii line: x1,y1,x2,y2,width,p,-log10(NFA) ) \00"
@.str.1 = [3 x i8] c"in\00"
@.str.2 = [6 x i8] c"scale\00"
@.str.3 = [11 x i8] c"sigma_coef\00"
@.str.4 = [6 x i8] c"quant\00"
@.str.5 = [7 x i8] c"ang_th\00"
@.str.6 = [8 x i8] c"log_eps\00"
@.str.7 = [11 x i8] c"density_th\00"
@.str.8 = [13 x i8] c"union_ang_th\00"
@.str.9 = [14 x i8] c"union_log_eps\00"
@.str.10 = [7 x i8] c"n_bins\00"
@.str.11 = [14 x i8] c"need_to_union\00"
@.str.12 = [4 x i8] c"reg\00"
@.str.13 = [17 x i8] c"length_threshold\00"
@.str.14 = [15 x i8] c"dist_threshold\00"
@.str.15 = [4 x i8] c"out\00"
@.str.16 = [2 x i8] c"-\00"
@stdout = global i32* null
@.str.17 = [2 x i8] c"w\00"
@.str.18 = [41 x i8] c"Error: unable to open ASCII output file.\00"
@.str.19 = [4 x i8] c"%f \00"
@EOF = global i64 0
@.str.21 = [47 x i8] c"Error: unable to close file while output file.\00"
@.str.22 = [8 x i8] c"epsfile\00"
@.str.23 = [6 x i8] c"width\00"
@.str.24 = [8 x i8] c"svgfile\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = tail call %struct.arguments* @process_arguments(i8* getelementptr inbounds ([2986 x i8], [2986 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %1)
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32** %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = bitcast i32* %8 to i8*
%16 = tail call i32 @get_str(%struct.arguments* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%17 = call double* @read_pgm_image_double(i32* %3, i32* %4, i32 %16)
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%21 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%22 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%23 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%24 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%25 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%26 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%27 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%28 = lshr i64 %27, 63
%29 = trunc i64 %28 to i32
%30 = xor i32 %29, 1
%31 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%32 = call i32 @get_int(%struct.arguments* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%33 = call i32 @get_int(%struct.arguments* %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
%34 = call i64 @is_assigned(%struct.arguments* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
%36 = select i1 %35, i32** null, i32** %6
%37 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
%38 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0))
%39 = call double* @LineSegmentDetection(i32* %5, double* %17, i32 %18, i32 %19, i64 %20, i64 %21, i64 %22, i64 %23, i64 %24, i64 %25, i64 %26, i32 %30, i64 %31, i32 %32, i32 %33, i32** %36, i32* %7, i32* %8, i64 %37, i64 %38)
%40 = call i32 @get_str(%struct.arguments* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%41 = call i64 @strcmp(i32 %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %2
%44 = load i32*, i32** @stdout
br label %48
45: ; preds = %2
%46 = call i32 @get_str(%struct.arguments* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%47 = call i32* @fopen(i32 %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
br label %48
48: ; preds = %45, %43
%49 = phi i32* [ %44, %43 ], [ %47, %45 ]
%50 = icmp eq i32* %49, null
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 @error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.18, i64 0, i64 0))
br label %53
53: ; preds = %51, %48
%54 = load i32, i32* %5
%55 = icmp sgt i32 %54, 0
br i1 %55, label %56, label %91
56: ; preds = %53, %56
%57 = phi i64 [ %87, %56 ], [ 0, %53 ]
%58 = mul nuw nsw i64 %57, 7
%59 = getelementptr inbounds double, double* %39, i64 %58
%60 = load double, double* %59
%61 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double %60)
%62 = add nuw nsw i64 %58, 1
%63 = getelementptr inbounds double, double* %39, i64 %62
%64 = load double, double* %63
%65 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double %64)
%66 = add nuw nsw i64 %58, 2
%67 = getelementptr inbounds double, double* %39, i64 %66
%68 = load double, double* %67
%69 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double %68)
%70 = add nuw nsw i64 %58, 3
%71 = getelementptr inbounds double, double* %39, i64 %70
%72 = load double, double* %71
%73 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double %72)
%74 = add nuw nsw i64 %58, 4
%75 = getelementptr inbounds double, double* %39, i64 %74
%76 = load double, double* %75
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double %76)
%78 = add nuw nsw i64 %58, 5
%79 = getelementptr inbounds double, double* %39, i64 %78
%80 = load double, double* %79
%81 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double %80)
%82 = add nuw nsw i64 %58, 6
%83 = getelementptr inbounds double, double* %39, i64 %82
%84 = load double, double* %83
%85 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double %84)
%86 = call i32 @fputc(i32 10, i32* %49)
%87 = add nuw nsw i64 %57, 1
%88 = load i32, i32* %5
%89 = sext i32 %88 to i64
%90 = icmp slt i64 %87, %89
br i1 %90, label %56, label %91
91: ; preds = %56, %53
%92 = load i32*, i32** @stdout
%93 = icmp eq i32* %49, %92
br i1 %93, label %100, label %94
94: ; preds = %91
%95 = call i64 @fclose(i32* %49)
%96 = load i64, i64* @EOF
%97 = icmp eq i64 %95, %96
br i1 %97, label %98, label %100
98: ; preds = %94
%99 = call i32 @error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.21, i64 0, i64 0))
br label %100
100: ; preds = %98, %94, %91
%101 = call i64 @is_assigned(%struct.arguments* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%102 = icmp eq i64 %101, 0
br i1 %102, label %112, label %103
103: ; preds = %100
%104 = load i32*, i32** %6
%105 = load i32, i32* %7
%106 = load i32, i32* %8
%107 = call i32 @get_str(%struct.arguments* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%108 = call i32 @write_pgm_image_int(i32* %104, i32 %105, i32 %106, i32 %107)
%109 = bitcast i32** %6 to i8**
%110 = load i8*, i8** %109
%111 = call i32 @free(i8* %110)
br label %112
112: ; preds = %103, %100
%113 = call i64 @is_assigned(%struct.arguments* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
%114 = icmp eq i64 %113, 0
br i1 %114, label %122, label %115
115: ; preds = %112
%116 = load i32, i32* %5
%117 = call i32 @get_str(%struct.arguments* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
%118 = load i32, i32* %3
%119 = load i32, i32* %4
%120 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
%121 = call i32 @write_eps(double* %39, i32 %116, i32 7, i32 %117, i32 %118, i32 %119, i64 %120)
br label %122
122: ; preds = %115, %112
%123 = call i64 @is_assigned(%struct.arguments* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%124 = icmp eq i64 %123, 0
br i1 %124, label %132, label %125
125: ; preds = %122
%126 = load i32, i32* %5
%127 = call i32 @get_str(%struct.arguments* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%128 = load i32, i32* %3
%129 = load i32, i32* %4
%130 = call i64 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
%131 = call i32 @write_svg(double* %39, i32 %126, i32 7, i32 %127, i32 %128, i32 %129, i64 %130)
br label %132
132: ; preds = %125, %122
%133 = bitcast double* %17 to i8*
%134 = call i32 @free(i8* %133)
%135 = bitcast double* %39 to i8*
%136 = call i32 @free(i8* %135)
%137 = call i32 @free_arguments(%struct.arguments* %9)
%138 = load i32, i32* @EXIT_SUCCESS
ret i32 %138
}