#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, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/, int **,
                             int *, int *);
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 *);
int /*<<< orphan*/ 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,
                             int /*<<< orphan*/);
int /*<<< orphan*/ write_pgm_image_int(int *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ write_svg(double *, int, int, int /*<<< orphan*/, int, int,
                             int /*<<< orphan*/);
int main(int argc, char **argv) {
  struct arguments *arg = process_arguments(
      "                                                                  "
      "#name: lsd                                                              "
      "       #author: rafael grompone von gioi <grompone@gmail.com>           "
      "              #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.         #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_int(arg, "n_bins"), is_assigned(arg, "reg") ? &region : NULL, &regX,
      &regY);
  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    $0x128,%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    0x163d(%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,-0xb0(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0xa0(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x1600(%rip),%rsi
call   1090 <get_double@plt>
mov    %eax,-0x9c(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x15f0(%rip),%rsi
call   1090 <get_double@plt>
mov    %eax,-0x98(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x15e5(%rip),%rsi
call   1090 <get_double@plt>
mov    %eax,-0x94(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x15d5(%rip),%rsi
call   1090 <get_double@plt>
mov    %eax,-0x90(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x15c6(%rip),%rsi
call   1090 <get_double@plt>
mov    %eax,-0x8c(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x15b8(%rip),%rsi
call   1090 <get_double@plt>
mov    %eax,-0x88(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x15ad(%rip),%rsi
call   1130 <get_int@plt>
mov    %eax,-0x84(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x159e(%rip),%rsi
call   1060 <is_assigned@plt>
cmp    $0x0,%rax
je     1354 <main+0x144>
lea    -0x70(%rbp),%rax
mov    %rax,-0xb8(%rbp)
jmp    1362 <main+0x152>
xor    %eax,%eax
mov    %rax,-0xb8(%rbp)
jmp    1362 <main+0x152>
mov    -0x84(%rbp),%ebx
mov    -0x88(%rbp),%r14d
mov    -0x8c(%rbp),%r15d
mov    -0x90(%rbp),%r12d
mov    -0x94(%rbp),%r13d
mov    -0x98(%rbp),%r9d
mov    -0x9c(%rbp),%r8d
mov    -0xa0(%rbp),%ecx
mov    -0xa4(%rbp),%edx
mov    -0xb0(%rbp),%rsi
mov    -0xb8(%rbp),%r11
lea    -0x64(%rbp),%rdi
lea    -0x74(%rbp),%r10
lea    -0x78(%rbp),%rax
mov    %r13d,(%rsp)
mov    %r12d,0x8(%rsp)
mov    %r15d,0x10(%rsp)
mov    %r14d,0x18(%rsp)
mov    %ebx,0x20(%rsp)
mov    %r11,0x28(%rsp)
mov    %r10,0x30(%rsp)
mov    %rax,0x38(%rsp)
call   1030 <LineSegmentDetection@plt>
mov    %rax,-0x60(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x14e5(%rip),%rsi
call   10e0 <get_str@plt>
mov    %eax,%edi
lea    0x14db(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    1422 <main+0x212>
mov    0x2bc2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    1444 <main+0x234>
mov    -0x40(%rbp),%rdi
lea    0x14aa(%rip),%rsi
call   10e0 <get_str@plt>
mov    %eax,%edi
lea    0x14a2(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    145b <main+0x24b>
lea    0x1489(%rip),%rdi
call   1100 <error@plt>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    14d7 <main+0x2c7>
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x68(%rbp),%eax
jge    14b7 <main+0x2a7>
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    0x1466(%rip),%rsi
mov    $0x1,%al
call   10c0 <fprintf@plt>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    1475 <main+0x265>
mov    -0x48(%rbp),%rdi
lea    0x144a(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1462 <main+0x252>
mov    -0x48(%rbp),%rax
mov    0x2af6(%rip),%rcx
cmp    (%rcx),%rax
je     1510 <main+0x300>
mov    -0x48(%rbp),%rdi
call   1080 <fclose@plt>
mov    0x2aed(%rip),%rcx
cmp    (%rcx),%rax
jne    1510 <main+0x300>
lea    0x1403(%rip),%rdi
call   1100 <error@plt>
mov    -0x40(%rbp),%rdi
lea    0x13b8(%rip),%rsi
call   1060 <is_assigned@plt>
cmp    $0x0,%rax
je     157a <main+0x36a>
mov    -0x70(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0xc0(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x1381(%rip),%rsi
call   10e0 <get_str@plt>
mov    -0xc8(%rbp),%rdi
mov    -0xc0(%rbp),%esi
mov    -0xbc(%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    0x13b8(%rip),%rsi
call   1060 <is_assigned@plt>
cmp    $0x0,%rax
je     1618 <main+0x408>
mov    -0x60(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0xdc(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0xd8(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x1381(%rip),%rsi
call   10e0 <get_str@plt>
mov    %eax,-0xd4(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0xd0(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0xcc(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x1361(%rip),%rsi
call   1090 <get_double@plt>
mov    -0xe8(%rbp),%rdi
mov    -0xdc(%rbp),%esi
mov    -0xd8(%rbp),%edx
mov    -0xd4(%rbp),%ecx
mov    -0xd0(%rbp),%r8d
mov    -0xcc(%rbp),%r9d
mov    %eax,(%rsp)
call   10f0 <write_eps@plt>
mov    -0x40(%rbp),%rdi
lea    0x1328(%rip),%rsi
call   1060 <is_assigned@plt>
cmp    $0x0,%rax
je     16b6 <main+0x4a6>
mov    -0x60(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0xfc(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0xf8(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x12f1(%rip),%rsi
call   10e0 <get_str@plt>
mov    %eax,-0xf4(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0xf0(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0xec(%rbp)
mov    -0x40(%rbp),%rdi
lea    0x12c3(%rip),%rsi
call   1090 <get_double@plt>
mov    -0x108(%rbp),%rdi
mov    -0xfc(%rbp),%esi
mov    -0xf8(%rbp),%edx
mov    -0xf4(%rbp),%ecx
mov    -0xf0(%rbp),%r8d
mov    -0xec(%rbp),%r9d
mov    %eax,(%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    0x28f8(%rip),%rax
mov    (%rax),%eax
add    $0x128,%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    $0x48,%rsp
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xdc6(%rip),%rdi
call   10e0 <process_arguments@plt>
mov    %rax,%r12
lea    0x164f(%rip),%rsi
mov    %rax,%rdi
call   10f0 <get_str@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    %eax,%edx
call   1050 <read_pgm_image_double@plt>
mov    %rax,%r15
mov    0xc(%rsp),%eax
mov    %eax,0x1c(%rsp)
mov    0x8(%rsp),%eax
mov    %eax,0x18(%rsp)
lea    0x161f(%rip),%rsi
mov    %r12,%rdi
call   1090 <get_double@plt>
mov    %eax,0x14(%rsp)
lea    0x1612(%rip),%rsi
mov    %r12,%rdi
call   1090 <get_double@plt>
mov    %eax,0x10(%rsp)
lea    0x160a(%rip),%rsi
mov    %r12,%rdi
call   1090 <get_double@plt>
mov    %rax,0x38(%rsp)
lea    0x15fc(%rip),%rsi
mov    %r12,%rdi
call   1090 <get_double@plt>
mov    %rax,0x30(%rsp)
lea    0x15ef(%rip),%rsi
mov    %r12,%rdi
call   1090 <get_double@plt>
mov    %eax,%r13d
lea    0x15e5(%rip),%rsi
mov    %r12,%rdi
call   1090 <get_double@plt>
mov    %eax,%r14d
lea    0x15de(%rip),%rsi
mov    %r12,%rdi
call   1140 <get_int@plt>
mov    %eax,%ebx
lea    0x15d4(%rip),%rsi
mov    %r12,%rdi
call   1060 <is_assigned@plt>
test   %rax,%rax
lea    0x28(%rsp),%rbp
cmove  %rax,%rbp
lea    0x20(%rsp),%rax
lea    0x24(%rsp),%r10
lea    0x4(%rsp),%rdi
mov    %r15,0x40(%rsp)
mov    %r15,%rsi
mov    0x1c(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
push   %rax
push   %r10
push   %rbp
push   %rbx
push   %r14
push   %r13
push   0x60(%rsp)
push   0x70(%rsp)
call   1030 <LineSegmentDetection@plt>
add    $0x40,%rsp
mov    %rax,%r15
lea    0x1577(%rip),%rsi
mov    %r12,%rdi
call   10f0 <get_str@plt>
lea    0x156c(%rip),%rsi
mov    %eax,%edi
call   10c0 <strcmp@plt>
test   %rax,%rax
je     15df <main+0x3bf>
lea    0x1551(%rip),%rsi
mov    %r12,%rdi
call   10f0 <get_str@plt>
lea    0x1548(%rip),%rsi
mov    %eax,%edi
call   1130 <fopen@plt>
mov    %rax,%r14
test   %r14,%r14
jne    13b0 <main+0x190>
lea    0x1534(%rip),%rdi
call   1110 <error@plt>
cmpl   $0x0,0x4(%rsp)
jle    1471 <main+0x251>
lea    0x30(%r15),%rbp
xor    %ebx,%ebx
lea    0x1540(%rip),%r13
nopl   0x0(%rax,%rax,1)
movsd  -0x30(%rbp),%xmm0
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
movsd  -0x28(%rbp),%xmm0
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
movsd  -0x20(%rbp),%xmm0
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
movsd  -0x18(%rbp),%xmm0
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
movsd  -0x10(%rbp),%xmm0
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
movsd  -0x8(%rbp),%xmm0
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
movsd  0x0(%rbp),%xmm0
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
mov    $0xa,%edi
mov    %r14,%rsi
call   10b0 <fputc@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rax
add    $0x38,%rbp
cmp    %rax,%rbx
jl     13d0 <main+0x1b0>
mov    0x2b60(%rip),%rax
cmp    (%rax),%r14
je     149d <main+0x27d>
mov    %r14,%rdi
call   1080 <fclose@plt>
mov    0x2b5c(%rip),%rcx
cmp    (%rcx),%rax
jne    149d <main+0x27d>
lea    0x1474(%rip),%rdi
call   1110 <error@plt>
lea    0x142f(%rip),%rsi
mov    %r12,%rdi
call   1060 <is_assigned@plt>
test   %rax,%rax
je     14e7 <main+0x2c7>
mov    0x28(%rsp),%rbx
mov    0x24(%rsp),%ebp
mov    0x20(%rsp),%r14d
lea    0x140d(%rip),%rsi
mov    %r12,%rdi
call   10f0 <get_str@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %eax,%ecx
call   10a0 <write_pgm_image_int@plt>
mov    0x28(%rsp),%rdi
call   1040 <free@plt>
lea    0x144d(%rip),%rsi
mov    %r12,%rdi
call   1060 <is_assigned@plt>
test   %rax,%rax
je     154a <main+0x32a>
mov    0x4(%rsp),%r14d
lea    0x1434(%rip),%rsi
mov    %r12,%rdi
call   10f0 <get_str@plt>
mov    %eax,%ebp
mov    0xc(%rsp),%ebx
mov    0x8(%rsp),%r13d
lea    0x1422(%rip),%rsi
mov    %r12,%rdi
call   1090 <get_double@plt>
sub    $0x8,%rsp
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x7,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
mov    %r13d,%r9d
push   %rax
call   1100 <write_eps@plt>
add    $0x10,%rsp
lea    0x13f8(%rip),%rsi
mov    %r12,%rdi
call   1060 <is_assigned@plt>
test   %rax,%rax
je     15ad <main+0x38d>
mov    0x4(%rsp),%r14d
lea    0x13df(%rip),%rsi
mov    %r12,%rdi
call   10f0 <get_str@plt>
mov    %eax,%ebp
mov    0xc(%rsp),%ebx
mov    0x8(%rsp),%r13d
lea    0x13bf(%rip),%rsi
mov    %r12,%rdi
call   1090 <get_double@plt>
sub    $0x8,%rsp
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x7,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
mov    %r13d,%r9d
push   %rax
call   1070 <write_svg@plt>
add    $0x10,%rsp
mov    0x40(%rsp),%rdi
call   1040 <free@plt>
mov    %r15,%rdi
call   1040 <free@plt>
mov    %r12,%rdi
call   1120 <free_arguments@plt>
mov    0x2a02(%rip),%rax
mov    (%rax),%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x29f2(%rip),%rax
mov    (%rax),%r14
test   %r14,%r14
jne    13b0 <main+0x190>
jmp    13a4 <main+0x184>

LLVM IR (-O0):
%struct.arguments = type { i32 }
@.str = [2200 x i8] c" #name: lsd #author: rafael grompone von gioi <grompone@gmail.com> #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. #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 = [7 x i8] c"n_bins\00"
@.str.9 = [4 x i8] c"reg\00"
@.str.10 = [4 x i8] c"out\00"
@.str.11 = [2 x i8] c"-\00"
@stdout = global i32* null
@.str.12 = [2 x i8] c"w\00"
@.str.13 = [41 x i8] c"Error: unable to open ASCII output file.\00"
@.str.14 = [4 x i8] c"%f \00"
@.str.15 = [2 x i8] c"\0A\00"
@EOF = global i64 0
@.str.16 = [47 x i8] c"Error: unable to close file while output file.\00"
@.str.17 = [8 x i8] c"epsfile\00"
@.str.18 = [6 x i8] c"width\00"
@.str.19 = [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 ([2200 x i8], [2200 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 i32 @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 i32 @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 i32 @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 i32 @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 i32 @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 i32 @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 i32 @get_int(%struct.arguments* %40, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%42 = load %struct.arguments*, %struct.arguments** %6
%43 = call i64 @is_assigned(%struct.arguments* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %2
br label %47
46: ; preds = %2
br label %47
47: ; preds = %46, %45
%48 = phi i32** [ %14, %45 ], [ null, %46 ]
%49 = call double* @LineSegmentDetection(i32* %12, double* %25, i32 %26, i32 %27, i32 %29, i32 %31, i32 %33, i32 %35, i32 %37, i32 %39, i32 %41, i32** %48, i32* %15, i32* %16)
store double* %49, double** %11
%50 = load %struct.arguments*, %struct.arguments** %6
%51 = call i32 @get_str(%struct.arguments* %50, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%52 = call i64 @strcmp(i32 %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %47
%55 = load i32*, i32** @stdout
store i32* %55, i32** %7
br label %60
56: ; preds = %47
%57 = load %struct.arguments*, %struct.arguments** %6
%58 = call i32 @get_str(%struct.arguments* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%59 = call i32* @fopen(i32 %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32* %59, i32** %7
br label %60
60: ; preds = %56, %54
%61 = load i32*, i32** %7
%62 = icmp eq i32* %61, null
br i1 %62, label %63, label %65
63: ; preds = %60
%64 = call i32 @error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.13, i64 0, i64 0))
br label %65
65: ; preds = %63, %60
store i32 0, i32* %17
br label %66
66: ; preds = %93, %65
%67 = load i32, i32* %17
%68 = load i32, i32* %12
%69 = icmp slt i32 %67, %68
br i1 %69, label %70, label %96
70: ; preds = %66
store i32 0, i32* %18
br label %71
71: ; preds = %87, %70
%72 = load i32, i32* %18
%73 = load i32, i32* %13
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %90
75: ; preds = %71
%76 = load i32*, i32** %7
%77 = load double*, double** %11
%78 = load i32, i32* %17
%79 = load i32, i32* %13
%80 = mul nsw i32 %78, %79
%81 = load i32, i32* %18
%82 = add nsw i32 %80, %81
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %77, i64 %83
%85 = load double, double* %84
%86 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), double %85)
br label %87
87: ; preds = %75
%88 = load i32, i32* %18
%89 = add nsw i32 %88, 1
store i32 %89, i32* %18
br label %71
90: ; preds = %71
%91 = load i32*, i32** %7
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
br label %93
93: ; preds = %90
%94 = load i32, i32* %17
%95 = add nsw i32 %94, 1
store i32 %95, i32* %17
br label %66
96: ; preds = %66
%97 = load i32*, i32** %7
%98 = load i32*, i32** @stdout
%99 = icmp ne i32* %97, %98
br i1 %99, label %100, label %107
100: ; preds = %96
%101 = load i32*, i32** %7
%102 = call i64 @fclose(i32* %101)
%103 = load i64, i64* @EOF
%104 = icmp eq i64 %102, %103
br i1 %104, label %105, label %107
105: ; preds = %100
%106 = call i32 @error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.16, i64 0, i64 0))
br label %107
107: ; preds = %105, %100, %96
%108 = load %struct.arguments*, %struct.arguments** %6
%109 = call i64 @is_assigned(%struct.arguments* %108, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%110 = icmp ne i64 %109, 0
br i1 %110, label %111, label %121
111: ; preds = %107
%112 = load i32*, i32** %14
%113 = load i32, i32* %15
%114 = load i32, i32* %16
%115 = load %struct.arguments*, %struct.arguments** %6
%116 = call i32 @get_str(%struct.arguments* %115, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%117 = call i32 @write_pgm_image_int(i32* %112, i32 %113, i32 %114, i32 %116)
%118 = load i32*, i32** %14
%119 = bitcast i32* %118 to i8*
%120 = call i32 @free(i8* %119)
br label %121
121: ; preds = %111, %107
%122 = load %struct.arguments*, %struct.arguments** %6
%123 = call i64 @is_assigned(%struct.arguments* %122, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%124 = icmp ne i64 %123, 0
br i1 %124, label %125, label %136
125: ; preds = %121
%126 = load double*, double** %11
%127 = load i32, i32* %12
%128 = load i32, i32* %13
%129 = load %struct.arguments*, %struct.arguments** %6
%130 = call i32 @get_str(%struct.arguments* %129, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%131 = load i32, i32* %9
%132 = load i32, i32* %10
%133 = load %struct.arguments*, %struct.arguments** %6
%134 = call i32 @get_double(%struct.arguments* %133, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%135 = call i32 @write_eps(double* %126, i32 %127, i32 %128, i32 %130, i32 %131, i32 %132, i32 %134)
br label %136
136: ; preds = %125, %121
%137 = load %struct.arguments*, %struct.arguments** %6
%138 = call i64 @is_assigned(%struct.arguments* %137, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%139 = icmp ne i64 %138, 0
br i1 %139, label %140, label %151
140: ; preds = %136
%141 = load double*, double** %11
%142 = load i32, i32* %12
%143 = load i32, i32* %13
%144 = load %struct.arguments*, %struct.arguments** %6
%145 = call i32 @get_str(%struct.arguments* %144, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%146 = load i32, i32* %9
%147 = load i32, i32* %10
%148 = load %struct.arguments*, %struct.arguments** %6
%149 = call i32 @get_double(%struct.arguments* %148, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%150 = call i32 @write_svg(double* %141, i32 %142, i32 %143, i32 %145, i32 %146, i32 %147, i32 %149)
br label %151
151: ; preds = %140, %136
%152 = load double*, double** %8
%153 = bitcast double* %152 to i8*
%154 = call i32 @free(i8* %153)
%155 = load double*, double** %11
%156 = bitcast double* %155 to i8*
%157 = call i32 @free(i8* %156)
%158 = load %struct.arguments*, %struct.arguments** %6
%159 = call i32 @free_arguments(%struct.arguments* %158)
%160 = load i32, i32* @EXIT_SUCCESS
ret i32 %160
}

LLVM IR (-O2):
%struct.arguments = type { i32 }
@.str = [2200 x i8] c" #name: lsd #author: rafael grompone von gioi <grompone@gmail.com> #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. #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 = [7 x i8] c"n_bins\00"
@.str.9 = [4 x i8] c"reg\00"
@.str.10 = [4 x i8] c"out\00"
@.str.11 = [2 x i8] c"-\00"
@stdout = global i32* null
@.str.12 = [2 x i8] c"w\00"
@.str.13 = [41 x i8] c"Error: unable to open ASCII output file.\00"
@.str.14 = [4 x i8] c"%f \00"
@EOF = global i64 0
@.str.16 = [47 x i8] c"Error: unable to close file while output file.\00"
@.str.17 = [8 x i8] c"epsfile\00"
@.str.18 = [6 x i8] c"width\00"
@.str.19 = [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 ([2200 x i8], [2200 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 i32 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%23 = call i32 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%24 = call i32 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%25 = call i32 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%26 = call i32 @get_int(%struct.arguments* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%27 = call i64 @is_assigned(%struct.arguments* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
%29 = select i1 %28, i32** null, i32** %6
%30 = call double* @LineSegmentDetection(i32* %5, double* %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32** %29, i32* %7, i32* %8)
%31 = call i32 @get_str(%struct.arguments* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%32 = call i64 @strcmp(i32 %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %2
%35 = load i32*, i32** @stdout
br label %39
36: ; preds = %2
%37 = call i32 @get_str(%struct.arguments* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%38 = call i32* @fopen(i32 %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %39
39: ; preds = %36, %34
%40 = phi i32* [ %35, %34 ], [ %38, %36 ]
%41 = icmp eq i32* %40, null
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = call i32 @error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.13, i64 0, i64 0))
br label %44
44: ; preds = %42, %39
%45 = load i32, i32* %5
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %82
47: ; preds = %44, %47
%48 = phi i64 [ %78, %47 ], [ 0, %44 ]
%49 = mul nuw nsw i64 %48, 7
%50 = getelementptr inbounds double, double* %30, i64 %49
%51 = load double, double* %50
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), double %51)
%53 = add nuw nsw i64 %49, 1
%54 = getelementptr inbounds double, double* %30, i64 %53
%55 = load double, double* %54
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), double %55)
%57 = add nuw nsw i64 %49, 2
%58 = getelementptr inbounds double, double* %30, i64 %57
%59 = load double, double* %58
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), double %59)
%61 = add nuw nsw i64 %49, 3
%62 = getelementptr inbounds double, double* %30, i64 %61
%63 = load double, double* %62
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), double %63)
%65 = add nuw nsw i64 %49, 4
%66 = getelementptr inbounds double, double* %30, i64 %65
%67 = load double, double* %66
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), double %67)
%69 = add nuw nsw i64 %49, 5
%70 = getelementptr inbounds double, double* %30, i64 %69
%71 = load double, double* %70
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), double %71)
%73 = add nuw nsw i64 %49, 6
%74 = getelementptr inbounds double, double* %30, i64 %73
%75 = load double, double* %74
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), double %75)
%77 = call i32 @fputc(i32 10, i32* %40)
%78 = add nuw nsw i64 %48, 1
%79 = load i32, i32* %5
%80 = sext i32 %79 to i64
%81 = icmp slt i64 %78, %80
br i1 %81, label %47, label %82
82: ; preds = %47, %44
%83 = load i32*, i32** @stdout
%84 = icmp eq i32* %40, %83
br i1 %84, label %91, label %85
85: ; preds = %82
%86 = call i64 @fclose(i32* %40)
%87 = load i64, i64* @EOF
%88 = icmp eq i64 %86, %87
br i1 %88, label %89, label %91
89: ; preds = %85
%90 = call i32 @error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.16, i64 0, i64 0))
br label %91
91: ; preds = %89, %85, %82
%92 = call i64 @is_assigned(%struct.arguments* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%93 = icmp eq i64 %92, 0
br i1 %93, label %103, label %94
94: ; preds = %91
%95 = load i32*, i32** %6
%96 = load i32, i32* %7
%97 = load i32, i32* %8
%98 = call i32 @get_str(%struct.arguments* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%99 = call i32 @write_pgm_image_int(i32* %95, i32 %96, i32 %97, i32 %98)
%100 = bitcast i32** %6 to i8**
%101 = load i8*, i8** %100
%102 = call i32 @free(i8* %101)
br label %103
103: ; preds = %94, %91
%104 = call i64 @is_assigned(%struct.arguments* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%105 = icmp eq i64 %104, 0
br i1 %105, label %113, label %106
106: ; preds = %103
%107 = load i32, i32* %5
%108 = call i32 @get_str(%struct.arguments* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%109 = load i32, i32* %3
%110 = load i32, i32* %4
%111 = call i32 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%112 = call i32 @write_eps(double* %30, i32 %107, i32 7, i32 %108, i32 %109, i32 %110, i32 %111)
br label %113
113: ; preds = %106, %103
%114 = call i64 @is_assigned(%struct.arguments* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%115 = icmp eq i64 %114, 0
br i1 %115, label %123, label %116
116: ; preds = %113
%117 = load i32, i32* %5
%118 = call i32 @get_str(%struct.arguments* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%119 = load i32, i32* %3
%120 = load i32, i32* %4
%121 = call i32 @get_double(%struct.arguments* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%122 = call i32 @write_svg(double* %30, i32 %117, i32 7, i32 %118, i32 %119, i32 %120, i32 %121)
br label %123
123: ; preds = %116, %113
%124 = bitcast double* %17 to i8*
%125 = call i32 @free(i8* %124)
%126 = bitcast double* %30 to i8*
%127 = call i32 @free(i8* %126)
%128 = call i32 @free_arguments(%struct.arguments* %9)
%129 = load i32, i32* @EXIT_SUCCESS
ret i32 %129
}