#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 */
typedef int /*<<< orphan*/ s;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int M_PI;
int atof(char *);
float cos(float);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char const *);
float sin(float);
int /*<<< orphan*/ strncmp(char *, char *, int);
void main(int argument_count, char *argument[], char *environment[]) {
  char s[100], p;
  int i, state, lines, arcs, circles, linewidth = 1;
  float x, y, x1, y1, x2, y2, x3, y3, r, theta1, theta3, xorg, yorg;
  FILE *ifile, *ofile;
  const char *help =
      "Program that crunches a DXF file with circles, arcs and lines\n"
      "into an Eagle script file. Items are put on the dimension layer.\n"
      "Usage:\n\n"
      "dxf2scr FILE.DXF FILE.SCR Xorg Yorg\n\n"
      "Where FILE.DXF is the name of the DXF file, and FILE.SCR is the\n"
      "      output file. (Xorg,Yorg) is the origin of the output file.\n"
      "      Xorg and Yorg are in decimal inches.\n";
  if (argument_count != 5) {
    printf(help);
    exit(1);
  }
  if ((ifile = fopen(argument[1], "ra")) == NULL) {
    printf(help);
    exit(1);
  }
  if ((ofile = fopen(argument[2], "wa")) == NULL) {
    printf(help);
    exit(1);
  }
  xorg = atof(argument[3]) * 1000;
  yorg = atof(argument[4]) * 1000;
  fprintf(ofile, "# DXF2SCR generated script file.\n");
  fprintf(ofile, "Grid mil 1 off;\n");
  fprintf(ofile, "Set Wire_Bend 2;\n");
  fprintf(ofile, "Layer Dimension;\n");
  fprintf(ofile, "Change Font Vector;\n");
  state = 0;
  lines = arcs = circles = 0;
  while (!feof(ifile)) {
    *s = 0;
    if (fgets(s, sizeof(s) - 1, ifile) == NULL)
      break;
    switch (state) {
    case 0:
      if (strncmp(s, "SECTION", 7) == 0)
        state = 1;
      break;
    case 1:
      if (strncmp(s, "ENDSEC", 6) == 0)
        state = 0;
      if (strncmp(s, "ENTITIES", 8) == 0)
        state = 2;
      break;
    case 2:
      if (strncmp(s, "ENDSEC", 6) == 0)
        state = 0;
      if (strncmp(s, "LINE", 4) == 0) {
        state = 3;
        lines++;
      }
      if (strncmp(s, "ARC", 3) == 0) {
        state = 4;
        arcs++;
      }
      if (strncmp(s, "CIRCLE", 6) == 0) {
        state = 5;
        circles++;
      }
      break;
    case 3:
      if (strncmp(s, " 10", 3) == 0) {
        fgets(s, sizeof(s) - 1, ifile);
        x = 1000 * atof(s);
      }
      if (strncmp(s, " 20", 3) == 0) {
        fgets(s, sizeof(s) - 1, ifile);
        y = 1000 * atof(s);
      }
      if (strncmp(s, " 11", 3) == 0) {
        fgets(s, sizeof(s) - 1, ifile);
        x1 = 1000 * atof(s);
      }
      if (strncmp(s, " 21", 3) == 0) {
        fgets(s, sizeof(s) - 1, ifile);
        y1 = 1000 * atof(s);
        fprintf(ofile, "Wire %d (%0.0f %0.0f) (%0.0f %0.0f);\n", linewidth,
                x + xorg, y + yorg, x1 + xorg, y1 + yorg);
        state = 2;
      }
      break;
    case 4:
      if (strncmp(s, " 10", 3) == 0) {
        fgets(s, sizeof(s) - 1, ifile);
        x = 1000 * atof(s);
      }
      if (strncmp(s, " 20", 3) == 0) {
        fgets(s, sizeof(s) - 1, ifile);
        y = 1000 * atof(s);
      }
      if (strncmp(s, " 40", 3) == 0) {
        fgets(s, sizeof(s) - 1, ifile);
        r = 1000 * atof(s);
      }
      if (strncmp(s, " 50", 3) == 0) {
        fgets(s, sizeof(s) - 1, ifile);
        theta1 = atof(s);
        theta1 *= (M_PI / 180);
      }
      if (strncmp(s, " 51", 3) == 0) {
        fgets(s, sizeof(s) - 1, ifile);
        theta3 = atof(s);
        theta3 *= (M_PI / 180);
        x1 = r * cos(theta1) + x;
        y1 = r * sin(theta1) + y;
        x2 = x1 - 2 * r * cos(theta1);
        y2 = y1 - 2 * r * sin(theta1);
        x3 = r * cos(theta3) + x;
        y3 = r * sin(theta3) + y;
        fprintf(ofile,
                "Arc CCW %d (%0.0f %0.0f) (%0.0f %0.0f) (%0.0f %0.0f);\n",
                linewidth, x1 + xorg, y1 + yorg, x2 + xorg, y2 + yorg,
                x3 + xorg, y3 + yorg);
        state = 2;
      }
      break;
    case 5:
      if (strncmp(s, " 10", 3) == 0) {
        fgets(s, sizeof(s) - 1, ifile);
        x = 1000 * atof(s);
      }
      if (strncmp(s, " 20", 3) == 0) {
        fgets(s, sizeof(s) - 1, ifile);
        y = 1000 * atof(s);
      }
      if (strncmp(s, " 40", 3) == 0) {
        fgets(s, sizeof(s) - 1, ifile);
        y1 = 1000 * atof(s);
        fprintf(ofile, "Circle %d (%0.0f %0.0f) (%0.0f %0.0f);\n", linewidth,
                x + xorg, y + yorg, x + xorg, y + y1 + yorg);
        state = 2;
      }
      break;
    }
  }
  fprintf(ofile, "Window Fit;\n");
  fprintf(ofile, "# lines=%d, arcs=%d, circles=%d\n", lines, arcs, circles);
  fclose(ifile);
  fclose(ofile);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x9c(%rbp)
lea    0xe45(%rip),%rax
mov    %rax,-0xe8(%rbp)
cmpl   $0x5,-0x4(%rbp)
je     11fe <main+0x4e>
mov    -0xe8(%rbp),%rdi
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xf68(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0xd8(%rbp)
cmp    $0x0,%rax
jne    1239 <main+0x89>
mov    -0xe8(%rbp),%rdi
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xf30(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0xe0(%rbp)
cmp    $0x0,%rax
jne    1274 <main+0xc4>
mov    -0xe8(%rbp),%rdi
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atof@plt>
imul   $0x3e8,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xcc(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1040 <atof@plt>
imul   $0x3e8,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xd0(%rbp)
ff
mov    -0xe0(%rbp),%rdi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xe0(%rbp),%rdi
lea    0xec8(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xe0(%rbp),%rdi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xe0(%rbp),%rdi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xe0(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x8c(%rbp)
movl   $0x0,-0x98(%rbp)
movl   $0x0,-0x94(%rbp)
movl   $0x0,-0x90(%rbp)
mov    -0xd8(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1364 <main+0x1b4>
jmp    1c61 <main+0xab1>
movb   $0x0,-0x80(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
jne    138c <main+0x1dc>
jmp    1c61 <main+0xab1>
mov    -0x8c(%rbp),%eax
mov    %rax,-0xf0(%rbp)
sub    $0x5,%rax
ja     1c5c <main+0xaac>
mov    -0xf0(%rbp),%rax
lea    0xc53(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x80(%rbp),%rdi
lea    0xe22(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    13e2 <main+0x232>
movl   $0x1,-0x8c(%rbp)
jmp    1c5c <main+0xaac>
lea    -0x80(%rbp),%rdi
lea    0xdfd(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    140f <main+0x25f>
movl   $0x0,-0x8c(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xddc(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1437 <main+0x287>
movl   $0x2,-0x8c(%rbp)
jmp    1c5c <main+0xaac>
lea    -0x80(%rbp),%rdi
lea    0xda8(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1464 <main+0x2b4>
movl   $0x0,-0x8c(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xd90(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    149b <main+0x2eb>
movl   $0x3,-0x8c(%rbp)
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xd5e(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    14d2 <main+0x322>
movl   $0x4,-0x8c(%rbp)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xd2b(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1509 <main+0x359>
movl   $0x5,-0x8c(%rbp)
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1c5c <main+0xaac>
lea    -0x80(%rbp),%rdi
lea    0xcf6(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    155c <main+0x3ac>
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <atof@plt>
imul   $0x3e8,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xa0(%rbp)
ff
lea    -0x80(%rbp),%rdi
lea    0xcac(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    15aa <main+0x3fa>
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <atof@plt>
imul   $0x3e8,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xa4(%rbp)
ff
lea    -0x80(%rbp),%rdi
lea    0xc62(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    15f8 <main+0x448>
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <atof@plt>
imul   $0x3e8,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xa8(%rbp)
ff
lea    -0x80(%rbp),%rdi
lea    0xc18(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    16bb <main+0x50b>
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <atof@plt>
imul   $0x3e8,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xac(%rbp)
ff
mov    -0xe0(%rbp),%rdi
mov    -0x9c(%rbp),%edx
movss  -0xa0(%rbp),%xmm0
ff
addss  -0xcc(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0xa4(%rbp),%xmm1
ff
addss  -0xd0(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
movss  -0xa8(%rbp),%xmm2
ff
addss  -0xcc(%rbp),%xmm2
ff
cvtss2sd %xmm2,%xmm2
movss  -0xac(%rbp),%xmm3
ff
addss  -0xd0(%rbp),%xmm3
ff
cvtss2sd %xmm3,%xmm3
lea    0xb75(%rip),%rsi
mov    $0x4,%al
call   1080 <fprintf@plt>
movl   $0x2,-0x8c(%rbp)
jmp    1c5c <main+0xaac>
lea    -0x80(%rbp),%rdi
lea    0xb44(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    170e <main+0x55e>
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <atof@plt>
imul   $0x3e8,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xa0(%rbp)
ff
lea    -0x80(%rbp),%rdi
lea    0xafa(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    175c <main+0x5ac>
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <atof@plt>
imul   $0x3e8,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xa4(%rbp)
ff
lea    -0x80(%rbp),%rdi
lea    0xade(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    17aa <main+0x5fa>
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <atof@plt>
imul   $0x3e8,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc0(%rbp)
ff
lea    -0x80(%rbp),%rdi
lea    0xa94(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1817 <main+0x667>
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <atof@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc4(%rbp)
ff
mov    0x27ef(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
mulss  -0xc4(%rbp),%xmm0
ff
movss  %xmm0,-0xc4(%rbp)
ff
lea    -0x80(%rbp),%rdi
lea    0xa2b(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1aeb <main+0x93b>
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <atof@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc8(%rbp)
ff
mov    0x2782(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
mulss  -0xc8(%rbp),%xmm0
ff
movss  %xmm0,-0xc8(%rbp)
ff
movss  -0xc0(%rbp),%xmm0
ff
movss  %xmm0,-0x110(%rbp)
ff
movss  -0xc4(%rbp),%xmm0
ff
call   10b0 <cos@plt>
movaps %xmm0,%xmm2
movss  -0x110(%rbp),%xmm0
ff
movss  -0xa0(%rbp),%xmm1
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xa8(%rbp)
ff
movss  -0xc0(%rbp),%xmm0
ff
movss  %xmm0,-0x10c(%rbp)
ff
movss  -0xc4(%rbp),%xmm0
ff
call   10a0 <sin@plt>
movaps %xmm0,%xmm2
movss  -0x10c(%rbp),%xmm0
ff
movss  -0xa4(%rbp),%xmm1
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xac(%rbp)
ff
movss  -0xa8(%rbp),%xmm0
ff
movss  %xmm0,-0x108(%rbp)
ff
movss  0x6e4(%rip),%xmm0
mulss  -0xc0(%rbp),%xmm0
ff
movss  %xmm0,-0x104(%rbp)
ff
movss  -0xc4(%rbp),%xmm0
ff
call   10b0 <cos@plt>
movss  -0x108(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movss  -0x104(%rbp),%xmm0
ff
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xb0(%rbp)
ff
movss  -0xac(%rbp),%xmm0
ff
movss  %xmm0,-0x100(%rbp)
ff
movss  0x67f(%rip),%xmm0
mulss  -0xc0(%rbp),%xmm0
ff
movss  %xmm0,-0xfc(%rbp)
ff
movss  -0xc4(%rbp),%xmm0
ff
call   10a0 <sin@plt>
movss  -0x100(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movss  -0xfc(%rbp),%xmm0
ff
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xb4(%rbp)
ff
movss  -0xc0(%rbp),%xmm0
ff
movss  %xmm0,-0xf8(%rbp)
ff
movss  -0xc8(%rbp),%xmm0
ff
call   10b0 <cos@plt>
movaps %xmm0,%xmm2
movss  -0xf8(%rbp),%xmm0
ff
movss  -0xa0(%rbp),%xmm1
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xb8(%rbp)
ff
movss  -0xc0(%rbp),%xmm0
ff
movss  %xmm0,-0xf4(%rbp)
ff
movss  -0xc8(%rbp),%xmm0
ff
call   10a0 <sin@plt>
movaps %xmm0,%xmm2
movss  -0xf4(%rbp),%xmm0
ff
movss  -0xa4(%rbp),%xmm1
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xbc(%rbp)
ff
mov    -0xe0(%rbp),%rdi
mov    -0x9c(%rbp),%edx
movss  -0xa8(%rbp),%xmm0
ff
addss  -0xcc(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0xac(%rbp),%xmm1
ff
addss  -0xd0(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
movss  -0xb0(%rbp),%xmm2
ff
addss  -0xcc(%rbp),%xmm2
ff
cvtss2sd %xmm2,%xmm2
movss  -0xb4(%rbp),%xmm3
ff
addss  -0xd0(%rbp),%xmm3
ff
cvtss2sd %xmm3,%xmm3
movss  -0xb8(%rbp),%xmm4
ff
addss  -0xcc(%rbp),%xmm4
ff
cvtss2sd %xmm4,%xmm4
movss  -0xbc(%rbp),%xmm5
ff
addss  -0xd0(%rbp),%xmm5
ff
cvtss2sd %xmm5,%xmm5
lea    0x777(%rip),%rsi
mov    $0x6,%al
call   1080 <fprintf@plt>
movl   $0x2,-0x8c(%rbp)
jmp    1c5c <main+0xaac>
lea    -0x80(%rbp),%rdi
lea    0x714(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1b3e <main+0x98e>
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <atof@plt>
imul   $0x3e8,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xa0(%rbp)
ff
lea    -0x80(%rbp),%rdi
lea    0x6ca(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1b8c <main+0x9dc>
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <atof@plt>
imul   $0x3e8,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xa4(%rbp)
ff
lea    -0x80(%rbp),%rdi
lea    0x6ae(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1c57 <main+0xaa7>
lea    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x63,%esi
call   1070 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <atof@plt>
imul   $0x3e8,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xac(%rbp)
ff
mov    -0xe0(%rbp),%rdi
mov    -0x9c(%rbp),%edx
movss  -0xa0(%rbp),%xmm0
ff
addss  -0xcc(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0xa4(%rbp),%xmm1
ff
addss  -0xd0(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
movss  -0xa0(%rbp),%xmm2
ff
addss  -0xcc(%rbp),%xmm2
ff
cvtss2sd %xmm2,%xmm2
movss  -0xa4(%rbp),%xmm3
ff
addss  -0xac(%rbp),%xmm3
ff
addss  -0xd0(%rbp),%xmm3
ff
cvtss2sd %xmm3,%xmm3
lea    0x642(%rip),%rsi
mov    $0x4,%al
call   1080 <fprintf@plt>
movl   $0x2,-0x8c(%rbp)
jmp    1c5c <main+0xaac>
jmp    1343 <main+0x193>
mov    -0xe0(%rbp),%rdi
lea    0x641(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xe0(%rbp),%rdi
mov    -0x90(%rbp),%edx
mov    -0x94(%rbp),%ecx
mov    -0x98(%rbp),%r8d
lea    0x626(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xd8(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0xe0(%rbp),%rdi
call   1050 <fclose@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
cmp    $0x5,%edi
jne    1206 <main+0x46>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe38(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1206 <main+0x46>
mov    %rax,%r15
mov    0x10(%rbx),%rdi
lea    0xe23(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
jne    121c <main+0x5c>
lea    0xf78(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    %rax,%rbp
mov    0x18(%rbx),%rdi
call   1050 <atof@plt>
mov    %eax,%r13d
mov    0x20(%rbx),%rdi
call   1050 <atof@plt>
mov    %eax,%ebx
lea    0xde5(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10e0 <fwrite@plt>
lea    0xdee(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10e0 <fwrite@plt>
lea    0xde6(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10e0 <fwrite@plt>
lea    0xddf(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10e0 <fwrite@plt>
lea    0xdd8(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %rbp,0x30(%rsp)
mov    %rbp,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
call   1090 <feof@plt>
movl   $0x0,0x1c(%rsp)
mov    $0x0,%r12d
mov    $0x0,%r14d
test   %eax,%eax
jne    19c1 <main+0x801>
imul   $0x3e8,%r13d,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x24(%rsp)
imul   $0x3e8,%ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x20(%rsp)
xor    %ebp,%ebp
lea    0x40(%rsp),%rbx
lea    0xcf6(%rip),%r13
xor    %r14d,%r14d
xor    %r12d,%r12d
movl   $0x0,0x1c(%rsp)
jmp    13d0 <main+0x210>
mov    %rbx,%rdi
lea    0xd6b(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
setne  %bpl
add    %ebp,%ebp
mov    %rbx,%rdi
lea    0xd5d(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    $0x3,%eax
cmove  %eax,%ebp
add    %ecx,%r14d
mov    %rbx,%rdi
lea    0xd3c(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    $0x4,%eax
cmove  %eax,%ebp
add    %ecx,%r12d
mov    %rbx,%rdi
lea    0xd1a(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    $0x5,%eax
cmove  %eax,%ebp
add    %ecx,0x1c(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    19c1 <main+0x801>
movb   $0x0,0x40(%rsp)
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     19c1 <main+0x801>
cmp    $0x5,%ebp
ja     13c0 <main+0x200>
mov    %ebp,%eax
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
mov    %rbx,%rdi
lea    0xc85(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
jmp    13c0 <main+0x200>
mov    %rbx,%rdi
lea    0xc8f(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1460 <main+0x2a0>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atof@plt>
imul   $0x3e8,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
lea    0xc50(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    14a3 <main+0x2e3>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atof@plt>
imul   $0x3e8,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rsp)
mov    %rbx,%rdi
lea    0xc11(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    14e6 <main+0x326>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atof@plt>
imul   $0x3e8,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x10(%rsp)
mov    $0x3,%ebp
mov    %rbx,%rdi
lea    0xbcd(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    13c0 <main+0x200>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atof@plt>
imul   $0x3e8,%eax,%eax
xorps  %xmm3,%xmm3
cvtsi2ss %eax,%xmm3
movss  0x8(%rsp),%xmm0
movss  0x24(%rsp),%xmm4
addss  %xmm4,%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x4(%rsp),%xmm1
movss  0x20(%rsp),%xmm5
addss  %xmm5,%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x10(%rsp),%xmm2
addss  %xmm4,%xmm2
cvtss2sd %xmm2,%xmm2
addss  %xmm5,%xmm3
cvtss2sd %xmm3,%xmm3
mov    0x30(%rsp),%rdi
lea    0xb50(%rip),%rsi
mov    $0x1,%edx
jmp    19b0 <main+0x7f0>
mov    %rbx,%rdi
lea    0xb2c(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    15c3 <main+0x403>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atof@plt>
imul   $0x3e8,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
lea    0xaed(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1606 <main+0x446>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atof@plt>
imul   $0x3e8,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rsp)
mov    %rbx,%rdi
lea    0xadc(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1649 <main+0x489>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atof@plt>
imul   $0x3e8,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
lea    0xa9d(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    16af <main+0x4ef>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atof@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mov    0x2961(%rip),%rax
movslq (%rax),%rax
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x7,%ecx
add    %eax,%ecx
cvtsi2ss %ecx,%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x14(%rsp)
mov    %rbx,%rdi
lea    0xa3b(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
mov    $0x4,%ebp
test   %eax,%eax
jne    13c0 <main+0x200>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atof@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mov    0x28f2(%rip),%rax
movslq (%rax),%rax
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x7,%ecx
add    %eax,%ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x2c(%rsp)
movss  0x14(%rsp),%xmm0
call   10b0 <cos@plt>
mulss  0xc(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
movss  0x14(%rsp),%xmm0
call   10a0 <sin@plt>
mulss  0xc(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
movss  %xmm0,0x28(%rsp)
movss  0x14(%rsp),%xmm0
call   10b0 <cos@plt>
movss  0xc(%rsp),%xmm1
mulss  0x88c(%rip),%xmm1
movss  %xmm1,0x18(%rsp)
mulss  %xmm1,%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0x3c(%rsp)
movss  0x14(%rsp),%xmm0
call   10a0 <sin@plt>
mulss  0x18(%rsp),%xmm0
addss  0x28(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x2c(%rsp),%xmm0
call   10b0 <cos@plt>
mulss  0xc(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
movss  %xmm0,0x38(%rsp)
movss  0x2c(%rsp),%xmm0
call   10a0 <sin@plt>
mulss  0xc(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x24(%rsp),%xmm4
addss  %xmm4,%xmm1
cvtss2sd %xmm1,%xmm6
movss  0x20(%rsp),%xmm5
movss  0x28(%rsp),%xmm1
addss  %xmm5,%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x3c(%rsp),%xmm2
addss  %xmm4,%xmm2
cvtss2sd %xmm2,%xmm2
movss  0x18(%rsp),%xmm3
addss  %xmm5,%xmm3
cvtss2sd %xmm3,%xmm3
movss  0x38(%rsp),%xmm7
addss  %xmm4,%xmm7
xorps  %xmm4,%xmm4
cvtss2sd %xmm7,%xmm4
addss  %xmm5,%xmm0
xorps  %xmm5,%xmm5
cvtss2sd %xmm0,%xmm5
mov    0x30(%rsp),%rdi
lea    0x8b1(%rip),%rsi
mov    $0x1,%edx
movaps %xmm6,%xmm0
mov    $0x6,%al
call   1080 <fprintf@plt>
jmp    19b7 <main+0x7f7>
mov    %rbx,%rdi
lea    0x831(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
setne  %bpl
mov    %rbx,%rdi
lea    0x81c(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
mov    $0x2,%eax
cmove  %eax,%ebp
jmp    13c0 <main+0x200>
mov    %rbx,%rdi
lea    0x812(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    18dd <main+0x71d>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atof@plt>
imul   $0x3e8,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
lea    0x7d3(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1920 <main+0x760>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atof@plt>
imul   $0x3e8,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rsp)
mov    %rbx,%rdi
lea    0x7c2(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
mov    $0x5,%ebp
test   %eax,%eax
jne    13c0 <main+0x200>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atof@plt>
imul   $0x3e8,%eax,%eax
xorps  %xmm2,%xmm2
cvtsi2ss %eax,%xmm2
movss  0x8(%rsp),%xmm0
addss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x4(%rsp),%xmm4
movaps %xmm4,%xmm1
movss  0x20(%rsp),%xmm3
addss  %xmm3,%xmm1
cvtss2sd %xmm1,%xmm1
addss  %xmm4,%xmm2
addss  %xmm3,%xmm2
xorps  %xmm3,%xmm3
cvtss2sd %xmm2,%xmm3
mov    0x30(%rsp),%rdi
lea    0x787(%rip),%rsi
mov    $0x1,%edx
movaps %xmm0,%xmm2
mov    $0x4,%al
call   1080 <fprintf@plt>
mov    $0x2,%ebp
jmp    13c0 <main+0x200>
lea    0x78f(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    0x30(%rsp),%rbx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
lea    0x77e(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
mov    %r12d,%ecx
mov    0x1c(%rsp),%r8d
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [345 x i8] c"Program that crunches a DXF file with circles, arcs and lines\0Ainto an Eagle script file. Items are put on the dimension layer.\0AUsage:\0A\0Adxf2scr FILE.DXF FILE.SCR Xorg Yorg\0A\0AWhere FILE.DXF is the name of the DXF file, and FILE.SCR is the\0A output file. (Xorg,Yorg) is the origin of the output file.\0A Xorg and Yorg are in decimal inches.\0A\00"
@.str.1 = [3 x i8] c"ra\00"
@.str.2 = [3 x i8] c"wa\00"
@.str.3 = [34 x i8] c"# DXF2SCR generated script file.\0A\00"
@.str.4 = [17 x i8] c"Grid mil 1 off;\0A\00"
@.str.5 = [18 x i8] c"Set Wire_Bend 2;\0A\00"
@.str.6 = [18 x i8] c"Layer Dimension;\0A\00"
@.str.7 = [21 x i8] c"Change Font Vector;\0A\00"
@.str.8 = [8 x i8] c"SECTION\00"
@.str.9 = [7 x i8] c"ENDSEC\00"
@.str.10 = [9 x i8] c"ENTITIES\00"
@.str.11 = [5 x i8] c"LINE\00"
@.str.12 = [4 x i8] c"ARC\00"
@.str.13 = [7 x i8] c"CIRCLE\00"
@.str.14 = [4 x i8] c" 10\00"
@.str.15 = [4 x i8] c" 20\00"
@.str.16 = [4 x i8] c" 11\00"
@.str.17 = [4 x i8] c" 21\00"
@.str.18 = [38 x i8] c"Wire %d (%0.0f %0.0f) (%0.0f %0.0f);\0A\00"
@.str.19 = [4 x i8] c" 40\00"
@.str.20 = [4 x i8] c" 50\00"
@M_PI = global i32 0
@.str.21 = [4 x i8] c" 51\00"
@.str.22 = [55 x i8] c"Arc CCW %d (%0.0f %0.0f) (%0.0f %0.0f) (%0.0f %0.0f);\0A\00"
@.str.23 = [40 x i8] c"Circle %d (%0.0f %0.0f) (%0.0f %0.0f);\0A\00"
@.str.24 = [13 x i8] c"Window Fit;\0A\00"
@.str.25 = [33 x i8] c"# lines=%d, arcs=%d, circles=%d\0A\00"
define void @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca [100 x i8]
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
%27 = alloca float
%28 = alloca i32*
%29 = alloca i32*
%30 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
store i32 1, i32* %14
store i8* getelementptr inbounds ([345 x i8], [345 x i8]* @.str, i64 0, i64 0), i8** %30
%31 = load i32, i32* %4
%32 = icmp ne i32 %31, 5
br i1 %32, label %33, label %37
33: ; preds = %3
%34 = load i8*, i8** %30
%35 = call i32 @printf(i8* %34)
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %3
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i32* @fopen(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %41, i32** %28
%42 = icmp eq i32* %41, null
br i1 %42, label %43, label %47
43: ; preds = %37
%44 = load i8*, i8** %30
%45 = call i32 @printf(i8* %44)
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %37
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 2
%50 = load i8*, i8** %49
%51 = call i32* @fopen(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %51, i32** %29
%52 = icmp eq i32* %51, null
br i1 %52, label %53, label %57
53: ; preds = %47
%54 = load i8*, i8** %30
%55 = call i32 @printf(i8* %54)
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %47
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 3
%60 = load i8*, i8** %59
%61 = call i32 @atof(i8* %60)
%62 = mul nsw i32 %61, 1000
%63 = sitofp i32 %62 to float
store float %63, float* %26
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 4
%66 = load i8*, i8** %65
%67 = call i32 @atof(i8* %66)
%68 = mul nsw i32 %67, 1000
%69 = sitofp i32 %68 to float
store float %69, float* %27
%70 = load i32*, i32** %29
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %70, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%72 = load i32*, i32** %29
%73 = call i32 (i32*, i8*, ...) @fprintf(i32* %72, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%74 = load i32*, i32** %29
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %74, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%76 = load i32*, i32** %29
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%78 = load i32*, i32** %29
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %10
store i32 0, i32* %13
store i32 0, i32* %12
store i32 0, i32* %11
br label %80
80: ; preds = %394, %57
%81 = load i32*, i32** %28
%82 = call i32 @feof(i32* %81)
%83 = icmp ne i32 %82, 0
%84 = xor i1 %83, true
br i1 %84, label %85, label %395
85: ; preds = %80
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
store i8 0, i8* %86
%87 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%88 = load i32*, i32** %28
%89 = call i32* @fgets(i8* %87, i32 99, i32* %88)
%90 = icmp eq i32* %89, null
br i1 %90, label %91, label %92
91: ; preds = %85
br label %395
92: ; preds = %85
%93 = load i32, i32* %10
switch i32 %93, label %394 [
i32 0, label %94
i32 1, label %100
i32 2, label %111
i32 3, label %138
i32 4, label %206
i32 5, label %336
]
94: ; preds = %92
%95 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%96 = call i32 @strncmp(i8* %95, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 7)
%97 = icmp eq i32 %96, 0
br i1 %97, label %98, label %99
98: ; preds = %94
store i32 1, i32* %10
br label %99
99: ; preds = %98, %94
br label %394
100: ; preds = %92
%101 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%102 = call i32 @strncmp(i8* %101, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 6)
%103 = icmp eq i32 %102, 0
br i1 %103, label %104, label %105
104: ; preds = %100
store i32 0, i32* %10
br label %105
105: ; preds = %104, %100
%106 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%107 = call i32 @strncmp(i8* %106, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 8)
%108 = icmp eq i32 %107, 0
br i1 %108, label %109, label %110
109: ; preds = %105
store i32 2, i32* %10
br label %110
110: ; preds = %109, %105
br label %394
111: ; preds = %92
%112 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%113 = call i32 @strncmp(i8* %112, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 6)
%114 = icmp eq i32 %113, 0
br i1 %114, label %115, label %116
115: ; preds = %111
store i32 0, i32* %10
br label %116
116: ; preds = %115, %111
%117 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%118 = call i32 @strncmp(i8* %117, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 4)
%119 = icmp eq i32 %118, 0
br i1 %119, label %120, label %123
120: ; preds = %116
store i32 3, i32* %10
%121 = load i32, i32* %11
%122 = add nsw i32 %121, 1
store i32 %122, i32* %11
br label %123
123: ; preds = %120, %116
%124 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%125 = call i32 @strncmp(i8* %124, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 3)
%126 = icmp eq i32 %125, 0
br i1 %126, label %127, label %130
127: ; preds = %123
store i32 4, i32* %10
%128 = load i32, i32* %12
%129 = add nsw i32 %128, 1
store i32 %129, i32* %12
br label %130
130: ; preds = %127, %123
%131 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%132 = call i32 @strncmp(i8* %131, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 6)
%133 = icmp eq i32 %132, 0
br i1 %133, label %134, label %137
134: ; preds = %130
store i32 5, i32* %10
%135 = load i32, i32* %13
%136 = add nsw i32 %135, 1
store i32 %136, i32* %13
br label %137
137: ; preds = %134, %130
br label %394
138: ; preds = %92
%139 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%140 = call i32 @strncmp(i8* %139, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 3)
%141 = icmp eq i32 %140, 0
br i1 %141, label %142, label %150
142: ; preds = %138
%143 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%144 = load i32*, i32** %28
%145 = call i32* @fgets(i8* %143, i32 99, i32* %144)
%146 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%147 = call i32 @atof(i8* %146)
%148 = mul nsw i32 1000, %147
%149 = sitofp i32 %148 to float
store float %149, float* %15
br label %150
150: ; preds = %142, %138
%151 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%152 = call i32 @strncmp(i8* %151, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 3)
%153 = icmp eq i32 %152, 0
br i1 %153, label %154, label %162
154: ; preds = %150
%155 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%156 = load i32*, i32** %28
%157 = call i32* @fgets(i8* %155, i32 99, i32* %156)
%158 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%159 = call i32 @atof(i8* %158)
%160 = mul nsw i32 1000, %159
%161 = sitofp i32 %160 to float
store float %161, float* %16
br label %162
162: ; preds = %154, %150
%163 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%164 = call i32 @strncmp(i8* %163, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 3)
%165 = icmp eq i32 %164, 0
br i1 %165, label %166, label %174
166: ; preds = %162
%167 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%168 = load i32*, i32** %28
%169 = call i32* @fgets(i8* %167, i32 99, i32* %168)
%170 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%171 = call i32 @atof(i8* %170)
%172 = mul nsw i32 1000, %171
%173 = sitofp i32 %172 to float
store float %173, float* %17
br label %174
174: ; preds = %166, %162
%175 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%176 = call i32 @strncmp(i8* %175, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 3)
%177 = icmp eq i32 %176, 0
br i1 %177, label %178, label %205
178: ; preds = %174
%179 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%180 = load i32*, i32** %28
%181 = call i32* @fgets(i8* %179, i32 99, i32* %180)
%182 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%183 = call i32 @atof(i8* %182)
%184 = mul nsw i32 1000, %183
%185 = sitofp i32 %184 to float
store float %185, float* %18
%186 = load i32*, i32** %29
%187 = load i32, i32* %14
%188 = load float, float* %15
%189 = load float, float* %26
%190 = fadd float %188, %189
%191 = fpext float %190 to double
%192 = load float, float* %16
%193 = load float, float* %27
%194 = fadd float %192, %193
%195 = fpext float %194 to double
%196 = load float, float* %17
%197 = load float, float* %26
%198 = fadd float %196, %197
%199 = fpext float %198 to double
%200 = load float, float* %18
%201 = load float, float* %27
%202 = fadd float %200, %201
%203 = fpext float %202 to double
%204 = call i32 (i32*, i8*, ...) @fprintf(i32* %186, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.18, i64 0, i64 0), i32 %187, double %191, double %195, double %199, double %203)
store i32 2, i32* %10
br label %205
205: ; preds = %178, %174
br label %394
206: ; preds = %92
%207 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%208 = call i32 @strncmp(i8* %207, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 3)
%209 = icmp eq i32 %208, 0
br i1 %209, label %210, label %218
210: ; preds = %206
%211 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%212 = load i32*, i32** %28
%213 = call i32* @fgets(i8* %211, i32 99, i32* %212)
%214 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%215 = call i32 @atof(i8* %214)
%216 = mul nsw i32 1000, %215
%217 = sitofp i32 %216 to float
store float %217, float* %15
br label %218
218: ; preds = %210, %206
%219 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%220 = call i32 @strncmp(i8* %219, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 3)
%221 = icmp eq i32 %220, 0
br i1 %221, label %222, label %230
222: ; preds = %218
%223 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%224 = load i32*, i32** %28
%225 = call i32* @fgets(i8* %223, i32 99, i32* %224)
%226 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%227 = call i32 @atof(i8* %226)
%228 = mul nsw i32 1000, %227
%229 = sitofp i32 %228 to float
store float %229, float* %16
br label %230
230: ; preds = %222, %218
%231 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%232 = call i32 @strncmp(i8* %231, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i32 3)
%233 = icmp eq i32 %232, 0
br i1 %233, label %234, label %242
234: ; preds = %230
%235 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%236 = load i32*, i32** %28
%237 = call i32* @fgets(i8* %235, i32 99, i32* %236)
%238 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%239 = call i32 @atof(i8* %238)
%240 = mul nsw i32 1000, %239
%241 = sitofp i32 %240 to float
store float %241, float* %23
br label %242
242: ; preds = %234, %230
%243 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%244 = call i32 @strncmp(i8* %243, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i32 3)
%245 = icmp eq i32 %244, 0
br i1 %245, label %246, label %258
246: ; preds = %242
%247 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%248 = load i32*, i32** %28
%249 = call i32* @fgets(i8* %247, i32 99, i32* %248)
%250 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%251 = call i32 @atof(i8* %250)
%252 = sitofp i32 %251 to float
store float %252, float* %24
%253 = load i32, i32* @M_PI
%254 = sdiv i32 %253, 180
%255 = sitofp i32 %254 to float
%256 = load float, float* %24
%257 = fmul float %256, %255
store float %257, float* %24
br label %258
258: ; preds = %246, %242
%259 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%260 = call i32 @strncmp(i8* %259, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0), i32 3)
%261 = icmp eq i32 %260, 0
br i1 %261, label %262, label %335
262: ; preds = %258
%263 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%264 = load i32*, i32** %28
%265 = call i32* @fgets(i8* %263, i32 99, i32* %264)
%266 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%267 = call i32 @atof(i8* %266)
%268 = sitofp i32 %267 to float
store float %268, float* %25
%269 = load i32, i32* @M_PI
%270 = sdiv i32 %269, 180
%271 = sitofp i32 %270 to float
%272 = load float, float* %25
%273 = fmul float %272, %271
store float %273, float* %25
%274 = load float, float* %23
%275 = load float, float* %24
%276 = call float @cos(float %275)
%277 = load float, float* %15
%278 = call float @llvm.fmuladd.f32(float %274, float %276, float %277)
store float %278, float* %17
%279 = load float, float* %23
%280 = load float, float* %24
%281 = call float @sin(float %280)
%282 = load float, float* %16
%283 = call float @llvm.fmuladd.f32(float %279, float %281, float %282)
store float %283, float* %18
%284 = load float, float* %17
%285 = load float, float* %23
%286 = fmul float 2.000000e+00, %285
%287 = load float, float* %24
%288 = call float @cos(float %287)
%289 = fneg float %286
%290 = call float @llvm.fmuladd.f32(float %289, float %288, float %284)
store float %290, float* %19
%291 = load float, float* %18
%292 = load float, float* %23
%293 = fmul float 2.000000e+00, %292
%294 = load float, float* %24
%295 = call float @sin(float %294)
%296 = fneg float %293
%297 = call float @llvm.fmuladd.f32(float %296, float %295, float %291)
store float %297, float* %20
%298 = load float, float* %23
%299 = load float, float* %25
%300 = call float @cos(float %299)
%301 = load float, float* %15
%302 = call float @llvm.fmuladd.f32(float %298, float %300, float %301)
store float %302, float* %21
%303 = load float, float* %23
%304 = load float, float* %25
%305 = call float @sin(float %304)
%306 = load float, float* %16
%307 = call float @llvm.fmuladd.f32(float %303, float %305, float %306)
store float %307, float* %22
%308 = load i32*, i32** %29
%309 = load i32, i32* %14
%310 = load float, float* %17
%311 = load float, float* %26
%312 = fadd float %310, %311
%313 = fpext float %312 to double
%314 = load float, float* %18
%315 = load float, float* %27
%316 = fadd float %314, %315
%317 = fpext float %316 to double
%318 = load float, float* %19
%319 = load float, float* %26
%320 = fadd float %318, %319
%321 = fpext float %320 to double
%322 = load float, float* %20
%323 = load float, float* %27
%324 = fadd float %322, %323
%325 = fpext float %324 to double
%326 = load float, float* %21
%327 = load float, float* %26
%328 = fadd float %326, %327
%329 = fpext float %328 to double
%330 = load float, float* %22
%331 = load float, float* %27
%332 = fadd float %330, %331
%333 = fpext float %332 to double
%334 = call i32 (i32*, i8*, ...) @fprintf(i32* %308, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.22, i64 0, i64 0), i32 %309, double %313, double %317, double %321, double %325, double %329, double %333)
store i32 2, i32* %10
br label %335
335: ; preds = %262, %258
br label %394
336: ; preds = %92
%337 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%338 = call i32 @strncmp(i8* %337, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 3)
%339 = icmp eq i32 %338, 0
br i1 %339, label %340, label %348
340: ; preds = %336
%341 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%342 = load i32*, i32** %28
%343 = call i32* @fgets(i8* %341, i32 99, i32* %342)
%344 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%345 = call i32 @atof(i8* %344)
%346 = mul nsw i32 1000, %345
%347 = sitofp i32 %346 to float
store float %347, float* %15
br label %348
348: ; preds = %340, %336
%349 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%350 = call i32 @strncmp(i8* %349, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 3)
%351 = icmp eq i32 %350, 0
br i1 %351, label %352, label %360
352: ; preds = %348
%353 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%354 = load i32*, i32** %28
%355 = call i32* @fgets(i8* %353, i32 99, i32* %354)
%356 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%357 = call i32 @atof(i8* %356)
%358 = mul nsw i32 1000, %357
%359 = sitofp i32 %358 to float
store float %359, float* %16
br label %360
360: ; preds = %352, %348
%361 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%362 = call i32 @strncmp(i8* %361, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i32 3)
%363 = icmp eq i32 %362, 0
br i1 %363, label %364, label %393
364: ; preds = %360
%365 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%366 = load i32*, i32** %28
%367 = call i32* @fgets(i8* %365, i32 99, i32* %366)
%368 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%369 = call i32 @atof(i8* %368)
%370 = mul nsw i32 1000, %369
%371 = sitofp i32 %370 to float
store float %371, float* %18
%372 = load i32*, i32** %29
%373 = load i32, i32* %14
%374 = load float, float* %15
%375 = load float, float* %26
%376 = fadd float %374, %375
%377 = fpext float %376 to double
%378 = load float, float* %16
%379 = load float, float* %27
%380 = fadd float %378, %379
%381 = fpext float %380 to double
%382 = load float, float* %15
%383 = load float, float* %26
%384 = fadd float %382, %383
%385 = fpext float %384 to double
%386 = load float, float* %16
%387 = load float, float* %18
%388 = fadd float %386, %387
%389 = load float, float* %27
%390 = fadd float %388, %389
%391 = fpext float %390 to double
%392 = call i32 (i32*, i8*, ...) @fprintf(i32* %372, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.23, i64 0, i64 0), i32 %373, double %377, double %381, double %385, double %391)
store i32 2, i32* %10
br label %393
393: ; preds = %364, %360
br label %394
394: ; preds = %92, %393, %335, %205, %137, %110, %99
br label %80
395: ; preds = %91, %80
%396 = load i32*, i32** %29
%397 = call i32 (i32*, i8*, ...) @fprintf(i32* %396, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.24, i64 0, i64 0))
%398 = load i32*, i32** %29
%399 = load i32, i32* %11
%400 = load i32, i32* %12
%401 = load i32, i32* %13
%402 = call i32 (i32*, i8*, ...) @fprintf(i32* %398, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.25, i64 0, i64 0), i32 %399, i32 %400, i32 %401)
%403 = load i32*, i32** %28
%404 = call i32 @fclose(i32* %403)
%405 = load i32*, i32** %29
%406 = call i32 @fclose(i32* %405)
%407 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"ra\00"
@.str.2 = [3 x i8] c"wa\00"
@.str.3 = [34 x i8] c"# DXF2SCR generated script file.\0A\00"
@.str.4 = [17 x i8] c"Grid mil 1 off;\0A\00"
@.str.5 = [18 x i8] c"Set Wire_Bend 2;\0A\00"
@.str.6 = [18 x i8] c"Layer Dimension;\0A\00"
@.str.7 = [21 x i8] c"Change Font Vector;\0A\00"
@.str.8 = [8 x i8] c"SECTION\00"
@.str.9 = [7 x i8] c"ENDSEC\00"
@.str.10 = [9 x i8] c"ENTITIES\00"
@.str.11 = [5 x i8] c"LINE\00"
@.str.12 = [4 x i8] c"ARC\00"
@.str.13 = [7 x i8] c"CIRCLE\00"
@.str.14 = [4 x i8] c" 10\00"
@.str.15 = [4 x i8] c" 20\00"
@.str.16 = [4 x i8] c" 11\00"
@.str.17 = [4 x i8] c" 21\00"
@.str.18 = [38 x i8] c"Wire %d (%0.0f %0.0f) (%0.0f %0.0f);\0A\00"
@.str.19 = [4 x i8] c" 40\00"
@.str.20 = [4 x i8] c" 50\00"
@M_PI = global i32 0
@.str.21 = [4 x i8] c" 51\00"
@.str.22 = [55 x i8] c"Arc CCW %d (%0.0f %0.0f) (%0.0f %0.0f) (%0.0f %0.0f);\0A\00"
@.str.23 = [40 x i8] c"Circle %d (%0.0f %0.0f) (%0.0f %0.0f);\0A\00"
@.str.24 = [13 x i8] c"Window Fit;\0A\00"
@.str.25 = [33 x i8] c"# lines=%d, arcs=%d, circles=%d\0A\00"
@str.27 = [344 x i8] c"Program that crunches a DXF file with circles, arcs and lines\0Ainto an Eagle script file. Items are put on the dimension layer.\0AUsage:\0A\0Adxf2scr FILE.DXF FILE.SCR Xorg Yorg\0A\0AWhere FILE.DXF is the name of the DXF file, and FILE.SCR is the\0A output file. (Xorg,Yorg) is the origin of the output file.\0A Xorg and Yorg are in decimal inches.\00"
define void @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = icmp eq i32 %0, 5
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([344 x i8], [344 x i8]* @str.27, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([344 x i8], [344 x i8]* @str.27, i64 0, i64 0))
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %10
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = tail call i32* @fopen(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([344 x i8], [344 x i8]* @str.27, i64 0, i64 0))
%25 = tail call i32 @exit(i32 1)
unreachable
26: ; preds = %18
%27 = getelementptr inbounds i8*, i8** %1, i64 3
%28 = load i8*, i8** %27
%29 = tail call i32 @atof(i8* %28)
%30 = mul nsw i32 %29, 1000
%31 = sitofp i32 %30 to float
%32 = getelementptr inbounds i8*, i8** %1, i64 4
%33 = load i8*, i8** %32
%34 = tail call i32 @atof(i8* %33)
%35 = mul nsw i32 %34, 1000
%36 = sitofp i32 %35 to float
%37 = tail call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i64 33, i64 1, i32* %21)
%38 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i64 16, i64 1, i32* %21)
%39 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i64 17, i64 1, i32* %21)
%40 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i64 17, i64 1, i32* %21)
%41 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i64 20, i64 1, i32* %21)
%42 = call i32 @feof(i32* %13)
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %253
44: ; preds = %26, %241
%45 = phi i32 [ %250, %241 ], [ 0, %26 ]
%46 = phi i32 [ %249, %241 ], [ 0, %26 ]
%47 = phi i32 [ %248, %241 ], [ 0, %26 ]
%48 = phi i32 [ %247, %241 ], [ 0, %26 ]
%49 = phi float [ %246, %241 ], [ undef, %26 ]
%50 = phi float [ %245, %241 ], [ undef, %26 ]
%51 = phi float [ %244, %241 ], [ undef, %26 ]
%52 = phi float [ %243, %241 ], [ undef, %26 ]
%53 = phi float [ %242, %241 ], [ undef, %26 ]
store i8 0, i8* %5
%54 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%55 = icmp eq i32* %54, null
br i1 %55, label %253, label %56
56: ; preds = %44
switch i32 %45, label %241 [
i32 0, label %57
i32 1, label %61
i32 2, label %68
i32 3, label %87
i32 4, label %131
i32 5, label %207
]
57: ; preds = %56
%58 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 7)
%59 = icmp eq i32 %58, 0
%60 = zext i1 %59 to i32
br label %241
61: ; preds = %56
%62 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 6)
%63 = icmp ne i32 %62, 0
%64 = zext i1 %63 to i32
%65 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 8)
%66 = icmp eq i32 %65, 0
%67 = select i1 %66, i32 2, i32 %64
br label %241
68: ; preds = %56
%69 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 6)
%70 = icmp eq i32 %69, 0
%71 = select i1 %70, i32 0, i32 2
%72 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 4)
%73 = icmp eq i32 %72, 0
%74 = zext i1 %73 to i32
%75 = add nsw i32 %46, %74
%76 = select i1 %73, i32 3, i32 %71
%77 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 3)
%78 = icmp eq i32 %77, 0
%79 = zext i1 %78 to i32
%80 = add nsw i32 %47, %79
%81 = select i1 %78, i32 4, i32 %76
%82 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 6)
%83 = icmp eq i32 %82, 0
%84 = zext i1 %83 to i32
%85 = add nsw i32 %48, %84
%86 = select i1 %83, i32 5, i32 %81
br label %241
87: ; preds = %56
%88 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 3)
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %95
90: ; preds = %87
%91 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%92 = call i32 @atof(i8* %5)
%93 = mul nsw i32 %92, 1000
%94 = sitofp i32 %93 to float
br label %95
95: ; preds = %90, %87
%96 = phi float [ %94, %90 ], [ %49, %87 ]
%97 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 3)
%98 = icmp eq i32 %97, 0
br i1 %98, label %99, label %104
99: ; preds = %95
%100 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%101 = call i32 @atof(i8* %5)
%102 = mul nsw i32 %101, 1000
%103 = sitofp i32 %102 to float
br label %104
104: ; preds = %99, %95
%105 = phi float [ %103, %99 ], [ %50, %95 ]
%106 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 3)
%107 = icmp eq i32 %106, 0
br i1 %107, label %108, label %113
108: ; preds = %104
%109 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%110 = call i32 @atof(i8* %5)
%111 = mul nsw i32 %110, 1000
%112 = sitofp i32 %111 to float
br label %113
113: ; preds = %108, %104
%114 = phi float [ %112, %108 ], [ %53, %104 ]
%115 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 3)
%116 = icmp eq i32 %115, 0
br i1 %116, label %117, label %241
117: ; preds = %113
%118 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%119 = call i32 @atof(i8* %5)
%120 = mul nsw i32 %119, 1000
%121 = sitofp i32 %120 to float
%122 = fadd float %96, %31
%123 = fpext float %122 to double
%124 = fadd float %105, %36
%125 = fpext float %124 to double
%126 = fadd float %114, %31
%127 = fpext float %126 to double
%128 = fadd float %36, %121
%129 = fpext float %128 to double
%130 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.18, i64 0, i64 0), i32 1, double %123, double %125, double %127, double %129)
br label %241
131: ; preds = %56
%132 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 3)
%133 = icmp eq i32 %132, 0
br i1 %133, label %134, label %139
134: ; preds = %131
%135 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%136 = call i32 @atof(i8* %5)
%137 = mul nsw i32 %136, 1000
%138 = sitofp i32 %137 to float
br label %139
139: ; preds = %134, %131
%140 = phi float [ %138, %134 ], [ %49, %131 ]
%141 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 3)
%142 = icmp eq i32 %141, 0
br i1 %142, label %143, label %148
143: ; preds = %139
%144 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%145 = call i32 @atof(i8* %5)
%146 = mul nsw i32 %145, 1000
%147 = sitofp i32 %146 to float
br label %148
148: ; preds = %143, %139
%149 = phi float [ %147, %143 ], [ %50, %139 ]
%150 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i32 3)
%151 = icmp eq i32 %150, 0
br i1 %151, label %152, label %157
152: ; preds = %148
%153 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%154 = call i32 @atof(i8* %5)
%155 = mul nsw i32 %154, 1000
%156 = sitofp i32 %155 to float
br label %157
157: ; preds = %152, %148
%158 = phi float [ %156, %152 ], [ %52, %148 ]
%159 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i32 3)
%160 = icmp eq i32 %159, 0
br i1 %160, label %161, label %169
161: ; preds = %157
%162 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%163 = call i32 @atof(i8* %5)
%164 = sitofp i32 %163 to float
%165 = load i32, i32* @M_PI
%166 = sdiv i32 %165, 180
%167 = sitofp i32 %166 to float
%168 = fmul float %164, %167
br label %169
169: ; preds = %161, %157
%170 = phi float [ %168, %161 ], [ %51, %157 ]
%171 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0), i32 3)
%172 = icmp eq i32 %171, 0
br i1 %172, label %173, label %241
173: ; preds = %169
%174 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%175 = call i32 @atof(i8* %5)
%176 = sitofp i32 %175 to float
%177 = load i32, i32* @M_PI
%178 = sdiv i32 %177, 180
%179 = sitofp i32 %178 to float
%180 = fmul float %176, %179
%181 = call float @cos(float %170)
%182 = call float @llvm.fmuladd.f32(float %158, float %181, float %140)
%183 = call float @sin(float %170)
%184 = call float @llvm.fmuladd.f32(float %158, float %183, float %149)
%185 = call float @cos(float %170)
%186 = fmul float %158, -2.000000e+00
%187 = call float @llvm.fmuladd.f32(float %186, float %185, float %182)
%188 = call float @sin(float %170)
%189 = call float @llvm.fmuladd.f32(float %186, float %188, float %184)
%190 = call float @cos(float %180)
%191 = call float @llvm.fmuladd.f32(float %158, float %190, float %140)
%192 = call float @sin(float %180)
%193 = call float @llvm.fmuladd.f32(float %158, float %192, float %149)
%194 = fadd float %182, %31
%195 = fpext float %194 to double
%196 = fadd float %184, %36
%197 = fpext float %196 to double
%198 = fadd float %187, %31
%199 = fpext float %198 to double
%200 = fadd float %189, %36
%201 = fpext float %200 to double
%202 = fadd float %191, %31
%203 = fpext float %202 to double
%204 = fadd float %193, %36
%205 = fpext float %204 to double
%206 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.22, i64 0, i64 0), i32 1, double %195, double %197, double %199, double %201, double %203, double %205)
br label %241
207: ; preds = %56
%208 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 3)
%209 = icmp eq i32 %208, 0
br i1 %209, label %210, label %215
210: ; preds = %207
%211 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%212 = call i32 @atof(i8* %5)
%213 = mul nsw i32 %212, 1000
%214 = sitofp i32 %213 to float
br label %215
215: ; preds = %210, %207
%216 = phi float [ %214, %210 ], [ %49, %207 ]
%217 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 3)
%218 = icmp eq i32 %217, 0
br i1 %218, label %219, label %224
219: ; preds = %215
%220 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%221 = call i32 @atof(i8* %5)
%222 = mul nsw i32 %221, 1000
%223 = sitofp i32 %222 to float
br label %224
224: ; preds = %219, %215
%225 = phi float [ %223, %219 ], [ %50, %215 ]
%226 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i32 3)
%227 = icmp eq i32 %226, 0
br i1 %227, label %228, label %241
228: ; preds = %224
%229 = call i32* @fgets(i8* %5, i32 99, i32* %13)
%230 = call i32 @atof(i8* %5)
%231 = mul nsw i32 %230, 1000
%232 = sitofp i32 %231 to float
%233 = fadd float %216, %31
%234 = fpext float %233 to double
%235 = fadd float %225, %36
%236 = fpext float %235 to double
%237 = fadd float %225, %232
%238 = fadd float %237, %36
%239 = fpext float %238 to double
%240 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.23, i64 0, i64 0), i32 1, double %234, double %236, double %234, double %239)
br label %241
241: ; preds = %68, %61, %57, %224, %228, %169, %173, %113, %117, %56
%242 = phi float [ %53, %56 ], [ %53, %228 ], [ %53, %224 ], [ %182, %173 ], [ %53, %169 ], [ %114, %117 ], [ %114, %113 ], [ %53, %57 ], [ %53, %61 ], [ %53, %68 ]
%243 = phi float [ %52, %56 ], [ %52, %228 ], [ %52, %224 ], [ %158, %173 ], [ %158, %169 ], [ %52, %117 ], [ %52, %113 ], [ %52, %57 ], [ %52, %61 ], [ %52, %68 ]
%244 = phi float [ %51, %56 ], [ %51, %228 ], [ %51, %224 ], [ %170, %173 ], [ %170, %169 ], [ %51, %117 ], [ %51, %113 ], [ %51, %57 ], [ %51, %61 ], [ %51, %68 ]
%245 = phi float [ %50, %56 ], [ %225, %228 ], [ %225, %224 ], [ %149, %173 ], [ %149, %169 ], [ %105, %117 ], [ %105, %113 ], [ %50, %57 ], [ %50, %61 ], [ %50, %68 ]
%246 = phi float [ %49, %56 ], [ %216, %228 ], [ %216, %224 ], [ %140, %173 ], [ %140, %169 ], [ %96, %117 ], [ %96, %113 ], [ %49, %57 ], [ %49, %61 ], [ %49, %68 ]
%247 = phi i32 [ %48, %56 ], [ %48, %228 ], [ %48, %224 ], [ %48, %173 ], [ %48, %169 ], [ %48, %117 ], [ %48, %113 ], [ %48, %57 ], [ %48, %61 ], [ %85, %68 ]
%248 = phi i32 [ %47, %56 ], [ %47, %228 ], [ %47, %224 ], [ %47, %173 ], [ %47, %169 ], [ %47, %117 ], [ %47, %113 ], [ %47, %57 ], [ %47, %61 ], [ %80, %68 ]
%249 = phi i32 [ %46, %56 ], [ %46, %228 ], [ %46, %224 ], [ %46, %173 ], [ %46, %169 ], [ %46, %117 ], [ %46, %113 ], [ %46, %57 ], [ %46, %61 ], [ %75, %68 ]
%250 = phi i32 [ %45, %56 ], [ 2, %228 ], [ 5, %224 ], [ 2, %173 ], [ 4, %169 ], [ 2, %117 ], [ 3, %113 ], [ %60, %57 ], [ %67, %61 ], [ %86, %68 ]
%251 = call i32 @feof(i32* %13)
%252 = icmp eq i32 %251, 0
br i1 %252, label %44, label %253
253: ; preds = %241, %44, %26
%254 = phi i32 [ 0, %26 ], [ %48, %44 ], [ %247, %241 ]
%255 = phi i32 [ 0, %26 ], [ %47, %44 ], [ %248, %241 ]
%256 = phi i32 [ 0, %26 ], [ %46, %44 ], [ %249, %241 ]
%257 = call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.24, i64 0, i64 0), i64 12, i64 1, i32* %21)
%258 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.25, i64 0, i64 0), i32 %256, i32 %255, i32 %254)
%259 = call i32 @fclose(i32* %13)
%260 = call i32 @fclose(i32* %21)
%261 = call i32 @exit(i32 0)
unreachable
}