#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*/ FILE;

/* Variables and functions */
scalar_t__ AreLinesCrossing(int, int, int, int, int, int, int, int);
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *, int *, int *,
                          int *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
main() {
  FILE *OutputFile = fopen("wynik4.txt", "w");
  if (OutputFile == NULL) {
    exit(255);
  }
  FILE *InputFile = fopen("pary.txt", "r");
  if (InputFile == NULL) {
    exit(254);
  }
  int LineCount = 0;
  int FirstStartX = 0, FirstStartY = 0, FirstEndX = 0, FirstEndY = 0;
  int SecondStartX = 0, SecondStartY = 0, SecondEndX = 0, SecondEndY = 0;
  fprintf(OutputFile, "Zadanie 4.1:\n");
  while (!feof(InputFile)) {
    fscanf(InputFile, "%d %d %d %d", &FirstStartX, &FirstStartY, &FirstEndX,
           &FirstEndY);
    fscanf(InputFile, "%d %d %d %d", &SecondStartX, &SecondStartY, &SecondEndX,
           &SecondEndY);
    if ((((FirstStartX == 0) && (FirstEndX == 0)) ||
         ((FirstStartY == 0) && (FirstEndY == 0))) &&
        (((SecondStartX == 0) && (SecondEndX == 0)) ||
         ((SecondStartY == 0) && (SecondEndY == 0)))) {
      fprintf(OutputFile, "%d %d %d %d ", FirstStartX, FirstStartY, FirstEndX,
              FirstEndY);
      fprintf(OutputFile, "%d %d %d %d\n", SecondStartX, SecondStartY,
              SecondEndX, SecondEndY);
      LineCount = LineCount + 1;
    }
  }
  fprintf(OutputFile, "Liczba par odcinkow: %d\n\n", LineCount);
  LineCount = 0;
  fseek(InputFile, 0, SEEK_SET);
  fprintf(OutputFile, "Zadanie 4.2:\n");
  while (!feof(InputFile)) {
    fscanf(InputFile, "%d %d %d %d", &FirstStartX, &FirstStartY, &FirstEndX,
           &FirstEndY);
    fscanf(InputFile, "%d %d %d %d", &SecondStartX, &SecondStartY, &SecondEndX,
           &SecondEndY);
    if ((((FirstStartX >= 0) && (FirstEndX >= 0)) &&
         ((FirstStartY >= 0) && (FirstEndY >= 0))) &&
        (((SecondStartX >= 0) && (SecondStartY >= 0)) &&
         ((SecondEndX >= 0) && (SecondEndY >= 0)))) {
      fprintf(OutputFile, "%d %d %d %d ", FirstStartX, FirstStartY, FirstEndX,
              FirstEndY);
      fprintf(OutputFile, "%d %d %d %d\n", SecondStartX, SecondStartY,
              SecondEndX, SecondEndY);
      LineCount = LineCount + 1;
    }
  }
  fprintf(OutputFile, "Liczba par odcinkow: %d\n\n", LineCount);
  LineCount = 0;
  fseek(InputFile, 0, SEEK_SET);
  fprintf(OutputFile, "Zadanie 4.3:\n");
  while (!feof(InputFile)) {
    fscanf(InputFile, "%d %d %d %d", &FirstStartX, &FirstStartY, &FirstEndX,
           &FirstEndY);
    fscanf(InputFile, "%d %d %d %d", &SecondStartX, &SecondStartY, &SecondEndX,
           &SecondEndY);
    if ((FirstStartY != FirstEndY) || (SecondStartX != SecondEndX)) {
      fprintf(OutputFile, "%d %d %d %d ", FirstStartX, FirstStartY, FirstEndX,
              FirstEndY);
      fprintf(OutputFile, "%d %d %d %d\n", SecondStartX, SecondStartY,
              SecondEndX, SecondEndY);
      LineCount = LineCount + 1;
    }
  }
  fprintf(OutputFile, "Liczba par odcinkow: %d\n\n", LineCount);
  LineCount = 0;
  fseek(InputFile, 0, SEEK_SET);
  fprintf(OutputFile, "Zadanie 4.4:\n");
  while (!feof(InputFile)) {
    fscanf(InputFile, "%d %d %d %d", &FirstStartX, &FirstStartY, &FirstEndX,
           &FirstEndY);
    fscanf(InputFile, "%d %d %d %d", &SecondStartX, &SecondStartY, &SecondEndX,
           &SecondEndY);
    if (AreLinesCrossing(FirstStartX, FirstStartY, FirstEndX, FirstEndY,
                         SecondStartX, SecondStartY, SecondEndX, SecondEndY)) {
      if (LineCount < 10) {
        fprintf(OutputFile, "%d %d %d %d ", FirstStartX, FirstStartY, FirstEndX,
                FirstEndY);
        fprintf(OutputFile, "%d %d %d %d\n", SecondStartX, SecondStartY,
                SecondEndX, SecondEndY);
      }
      LineCount = LineCount + 1;
    }
  }
  fprintf(OutputFile, "Liczba par odcinkow: %d\n\n", LineCount);
  fclose(InputFile);
  fclose(OutputFile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe6a(%rip),%rdi
lea    0xe6e(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11bb <main+0x3b>
mov    $0xff,%edi
call   10a0 <exit@plt>
lea    0xe4b(%rip),%rdi
lea    0xe4d(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11e7 <main+0x67>
mov    $0xfe,%edi
call   10a0 <exit@plt>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xde7(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1256 <main+0xd6>
jmp    1334 <main+0x1b4>
mov    -0x18(%rbp),%rdi
lea    0xdc5(%rip),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x2c(%rbp),%r9
call   1050 <fscanf@plt>
mov    -0x18(%rbp),%rdi
lea    0xda5(%rip),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
lea    -0x38(%rbp),%r8
lea    -0x3c(%rbp),%r9
call   1050 <fscanf@plt>
cmpl   $0x0,-0x20(%rbp)
jne    12aa <main+0x12a>
cmpl   $0x0,-0x28(%rbp)
je     12be <main+0x13e>
cmpl   $0x0,-0x24(%rbp)
jne    132f <main+0x1af>
cmpl   $0x0,-0x2c(%rbp)
jne    132f <main+0x1af>
cmpl   $0x0,-0x30(%rbp)
jne    12d2 <main+0x152>
cmpl   $0x0,-0x38(%rbp)
je     12e6 <main+0x166>
cmpl   $0x0,-0x34(%rbp)
jne    132f <main+0x1af>
cmpl   $0x0,-0x3c(%rbp)
jne    132f <main+0x1af>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x2c(%rbp),%r9d
lea    0xd33(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
lea    0xd20(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1238 <main+0xb8>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xd0a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2c85(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1080 <fseek@plt>
mov    -0x10(%rbp),%rdi
lea    0xcf7(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1394 <main+0x214>
jmp    1472 <main+0x2f2>
mov    -0x18(%rbp),%rdi
lea    0xc87(%rip),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x2c(%rbp),%r9
call   1050 <fscanf@plt>
mov    -0x18(%rbp),%rdi
lea    0xc67(%rip),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
lea    -0x38(%rbp),%r8
lea    -0x3c(%rbp),%r9
call   1050 <fscanf@plt>
cmpl   $0x0,-0x20(%rbp)
jl     146d <main+0x2ed>
cmpl   $0x0,-0x28(%rbp)
jl     146d <main+0x2ed>
cmpl   $0x0,-0x24(%rbp)
jl     146d <main+0x2ed>
cmpl   $0x0,-0x2c(%rbp)
jl     146d <main+0x2ed>
cmpl   $0x0,-0x30(%rbp)
jl     146d <main+0x2ed>
cmpl   $0x0,-0x34(%rbp)
jl     146d <main+0x2ed>
cmpl   $0x0,-0x38(%rbp)
jl     146d <main+0x2ed>
cmpl   $0x0,-0x3c(%rbp)
jl     146d <main+0x2ed>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x2c(%rbp),%r9d
lea    0xbf5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
lea    0xbe2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1376 <main+0x1f6>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xbcc(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2b47(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1080 <fseek@plt>
mov    -0x10(%rbp),%rdi
lea    0xbc7(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    14d2 <main+0x352>
jmp    1578 <main+0x3f8>
mov    -0x18(%rbp),%rdi
lea    0xb49(%rip),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x2c(%rbp),%r9
call   1050 <fscanf@plt>
mov    -0x18(%rbp),%rdi
lea    0xb29(%rip),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
lea    -0x38(%rbp),%r8
lea    -0x3c(%rbp),%r9
call   1050 <fscanf@plt>
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jne    152a <main+0x3aa>
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
je     1573 <main+0x3f3>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x2c(%rbp),%r9d
lea    0xaef(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
lea    0xadc(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    14b4 <main+0x334>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xac6(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2a41(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1080 <fseek@plt>
mov    -0x10(%rbp),%rdi
lea    0xacf(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    15d8 <main+0x458>
jmp    16a2 <main+0x522>
mov    -0x18(%rbp),%rdi
lea    0xa43(%rip),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x2c(%rbp),%r9
call   1050 <fscanf@plt>
mov    -0x18(%rbp),%rdi
lea    0xa23(%rip),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
lea    -0x38(%rbp),%r8
lea    -0x3c(%rbp),%r9
call   1050 <fscanf@plt>
mov    -0x20(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
mov    -0x34(%rbp),%r9d
mov    -0x38(%rbp),%r10d
mov    -0x3c(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <AreLinesCrossing@plt>
cmp    $0x0,%rax
je     169d <main+0x51d>
cmpl   $0xa,-0x1c(%rbp)
jge    1694 <main+0x514>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x2c(%rbp),%r9d
lea    0x9c5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
lea    0x9b2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    15ba <main+0x43a>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0x99c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xe5b(%rip),%rdi
lea    0xe5f(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     16e7 <main+0x557>
mov    %rax,%r14
lea    0xe49(%rip),%rdi
lea    0xe4b(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     16f1 <main+0x561>
mov    %rax,%rbx
movl   $0x0,0x20(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xdf5(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    %rbx,%rdi
call   1070 <feof@plt>
movl   $0x0,0x24(%rsp)
mov    $0x0,%ebp
test   %eax,%eax
je     1379 <main+0x1e9>
lea    0xdf3(%rip),%rsi
mov    %r14,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2d74(%rip),%r15
mov    (%r15),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <fseek@plt>
lea    0xde6(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
je     1455 <main+0x2c5>
lea    0xda3(%rip),%rsi
xor    %r12d,%r12d
mov    %r14,%rdi
mov    0x24(%rsp),%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <fseek@plt>
lea    0xda6(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    %rbx,%rdi
call   1070 <feof@plt>
mov    $0x0,%ebp
test   %eax,%eax
je     1540 <main+0x3b0>
lea    0xd50(%rip),%rsi
mov    %r14,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2cd1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <fseek@plt>
lea    0xd60(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
je     15fe <main+0x46e>
lea    0xd01(%rip),%rsi
mov    %r14,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xca6(%rip),%r12
lea    0x4(%rsp),%r15
lea    0xc(%rsp),%r13
xor    %ebp,%ebp
jmp    13e0 <main+0x250>
xchg   %ax,%ax
mov    0x18(%rsp),%ecx
mov    0x14(%rsp),%r9d
mov    %r14,%rdi
lea    0xc8f(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x8(%rsp),%edx
mov    0x10(%rsp),%ecx
mov    0x4(%rsp),%r8d
mov    0xc(%rsp),%r9d
mov    %r14,%rdi
lea    0xc79(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
jne    1252 <main+0xc2>
mov    %rbx,%rdi
mov    %r12,%rsi
lea    0x20(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x14(%rsp),%r9
call   1050 <fscanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %r15,%r8
mov    %r13,%r9
call   1050 <fscanf@plt>
mov    0x20(%rsp),%edx
mov    0x1c(%rsp),%r8d
mov    %edx,%eax
or     %r8d,%eax
je     1434 <main+0x2a4>
mov    0x18(%rsp),%eax
or     0x14(%rsp),%eax
jne    13d0 <main+0x240>
mov    0x8(%rsp),%eax
or     0x4(%rsp),%eax
je     1390 <main+0x200>
mov    0x10(%rsp),%eax
or     0xc(%rsp),%eax
je     1390 <main+0x200>
jmp    13d0 <main+0x240>
lea    0xbca(%rip),%rbp
lea    0x4(%rsp),%r12
lea    0xc(%rsp),%r13
movl   $0x0,0x24(%rsp)
jmp    1480 <main+0x2f0>
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
jne    12a2 <main+0x112>
mov    %rbx,%rdi
mov    %rbp,%rsi
lea    0x20(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x14(%rsp),%r9
call   1050 <fscanf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %r12,%r8
mov    %r13,%r9
call   1050 <fscanf@plt>
mov    0x20(%rsp),%edx
test   %edx,%edx
js     1470 <main+0x2e0>
mov    0x1c(%rsp),%r8d
test   %r8d,%r8d
js     1470 <main+0x2e0>
mov    0x18(%rsp),%ecx
test   %ecx,%ecx
js     1470 <main+0x2e0>
mov    0x14(%rsp),%r9d
test   %r9d,%r9d
js     1470 <main+0x2e0>
cmpl   $0x0,0x8(%rsp)
js     1470 <main+0x2e0>
cmpl   $0x0,0x10(%rsp)
js     1470 <main+0x2e0>
cmpl   $0x0,0x4(%rsp)
js     1470 <main+0x2e0>
cmpl   $0x0,0xc(%rsp)
js     1470 <main+0x2e0>
mov    %r14,%rdi
lea    0xb26(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x8(%rsp),%edx
mov    0x10(%rsp),%ecx
mov    0x4(%rsp),%r8d
mov    0xc(%rsp),%r9d
mov    %r14,%rdi
lea    0xb10(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
addl   $0x1,0x24(%rsp)
jmp    1470 <main+0x2e0>
lea    0xadf(%rip),%r13
lea    0xc(%rsp),%r15
xor    %ebp,%ebp
jmp    15a0 <main+0x410>
mov    0x20(%rsp),%edx
mov    0x1c(%rsp),%r8d
mov    %r14,%rdi
lea    0xacf(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x8(%rsp),%edx
mov    0x10(%rsp),%ecx
mov    0x4(%rsp),%r8d
mov    0xc(%rsp),%r9d
mov    %r14,%rdi
lea    0xab9(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
jne    12f5 <main+0x165>
mov    %rbx,%rdi
mov    %r13,%rsi
lea    0x20(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x14(%rsp),%r9
call   1050 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x4(%rsp),%r8
mov    %r15,%r9
call   1050 <fscanf@plt>
mov    0x18(%rsp),%ecx
mov    0x14(%rsp),%r9d
cmp    %r9d,%ecx
jne    1550 <main+0x3c0>
mov    0x8(%rsp),%eax
cmp    0x4(%rsp),%eax
jne    1550 <main+0x3c0>
jmp    1590 <main+0x400>
lea    0xa21(%rip),%r15
lea    0xc(%rsp),%r13
xor    %r12d,%r12d
jmp    1624 <main+0x494>
nop
add    $0x1,%r12d
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
jne    1344 <main+0x1b4>
mov    %rbx,%rdi
mov    %r15,%rsi
lea    0x20(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x14(%rsp),%r9
call   1050 <fscanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x4(%rsp),%r8
mov    %r13,%r9
call   1050 <fscanf@plt>
mov    0x20(%rsp),%edi
mov    0x18(%rsp),%esi
mov    0x1c(%rsp),%edx
mov    0x14(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    0x10(%rsp),%r9d
mov    0x4(%rsp),%eax
mov    0xc(%rsp),%ebp
push   %rbp
push   %rax
call   1030 <AreLinesCrossing@plt>
add    $0x10,%rsp
test   %rax,%rax
je     1614 <main+0x484>
cmp    $0x9,%r12d
jg     1610 <main+0x480>
mov    0x20(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x1c(%rsp),%r8d
mov    0x14(%rsp),%r9d
mov    %r14,%rdi
lea    0x97a(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x8(%rsp),%edx
mov    0x10(%rsp),%ecx
mov    0x4(%rsp),%r8d
mov    0xc(%rsp),%r9d
mov    %r14,%rdi
lea    0x964(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1610 <main+0x480>
mov    $0xff,%edi
call   10a0 <exit@plt>
mov    $0xfe,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"wynik4.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [9 x i8] c"pary.txt\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [14 x i8] c"Zadanie 4.1:\0A\00"
@.str.5 = [12 x i8] c"%d %d %d %d\00"
@.str.6 = [13 x i8] c"%d %d %d %d \00"
@.str.7 = [13 x i8] c"%d %d %d %d\0A\00"
@.str.8 = [26 x i8] c"Liczba par odcinkow: %d\0A\0A\00"
@SEEK_SET = global i32 0
@.str.9 = [14 x i8] c"Zadanie 4.2:\0A\00"
@.str.10 = [14 x i8] c"Zadanie 4.3:\0A\00"
@.str.11 = [14 x i8] c"Zadanie 4.4:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
%13 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %13, i32** %2
%14 = load i32*, i32** %2
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 @exit(i32 255)
unreachable
18: ; preds = %0
%19 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %19, i32** %3
%20 = load i32*, i32** %3
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @exit(i32 254)
unreachable
24: ; preds = %18
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
%25 = load i32*, i32** %2
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %75, %24
%28 = load i32*, i32** %3
%29 = call i32 @feof(i32* %28)
%30 = icmp ne i32 %29, 0
%31 = xor i1 %30, true
br i1 %31, label %32, label %76
32: ; preds = %27
%33 = load i32*, i32** %3
%34 = call i32 @fscanf(i32* %33, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8)
%35 = load i32*, i32** %3
%36 = call i32 @fscanf(i32* %35, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %9, i32* %10, i32* %11, i32* %12)
%37 = load i32, i32* %5
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %32
%40 = load i32, i32* %7
%41 = icmp eq i32 %40, 0
br i1 %41, label %48, label %42
42: ; preds = %39, %32
%43 = load i32, i32* %6
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %75
45: ; preds = %42
%46 = load i32, i32* %8
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %75
48: ; preds = %45, %39
%49 = load i32, i32* %9
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = load i32, i32* %11
%53 = icmp eq i32 %52, 0
br i1 %53, label %60, label %54
54: ; preds = %51, %48
%55 = load i32, i32* %10
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %75
57: ; preds = %54
%58 = load i32, i32* %12
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %75
60: ; preds = %57, %51
%61 = load i32*, i32** %2
%62 = load i32, i32* %5
%63 = load i32, i32* %6
%64 = load i32, i32* %7
%65 = load i32, i32* %8
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %62, i32 %63, i32 %64, i32 %65)
%67 = load i32*, i32** %2
%68 = load i32, i32* %9
%69 = load i32, i32* %10
%70 = load i32, i32* %11
%71 = load i32, i32* %12
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %67, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %68, i32 %69, i32 %70, i32 %71)
%73 = load i32, i32* %4
%74 = add nsw i32 %73, 1
store i32 %74, i32* %4
br label %75
75: ; preds = %60, %57, %54, %45, %42
br label %27
76: ; preds = %27
%77 = load i32*, i32** %2
%78 = load i32, i32* %4
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %78)
store i32 0, i32* %4
%80 = load i32*, i32** %3
%81 = load i32, i32* @SEEK_SET
%82 = call i32 @fseek(i32* %80, i32 0, i32 %81)
%83 = load i32*, i32** %2
%84 = call i32 (i32*, i8*, ...) @fprintf(i32* %83, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %85
85: ; preds = %133, %76
%86 = load i32*, i32** %3
%87 = call i32 @feof(i32* %86)
%88 = icmp ne i32 %87, 0
%89 = xor i1 %88, true
br i1 %89, label %90, label %134
90: ; preds = %85
%91 = load i32*, i32** %3
%92 = call i32 @fscanf(i32* %91, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8)
%93 = load i32*, i32** %3
%94 = call i32 @fscanf(i32* %93, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %9, i32* %10, i32* %11, i32* %12)
%95 = load i32, i32* %5
%96 = icmp sge i32 %95, 0
br i1 %96, label %97, label %133
97: ; preds = %90
%98 = load i32, i32* %7
%99 = icmp sge i32 %98, 0
br i1 %99, label %100, label %133
100: ; preds = %97
%101 = load i32, i32* %6
%102 = icmp sge i32 %101, 0
br i1 %102, label %103, label %133
103: ; preds = %100
%104 = load i32, i32* %8
%105 = icmp sge i32 %104, 0
br i1 %105, label %106, label %133
106: ; preds = %103
%107 = load i32, i32* %9
%108 = icmp sge i32 %107, 0
br i1 %108, label %109, label %133
109: ; preds = %106
%110 = load i32, i32* %10
%111 = icmp sge i32 %110, 0
br i1 %111, label %112, label %133
112: ; preds = %109
%113 = load i32, i32* %11
%114 = icmp sge i32 %113, 0
br i1 %114, label %115, label %133
115: ; preds = %112
%116 = load i32, i32* %12
%117 = icmp sge i32 %116, 0
br i1 %117, label %118, label %133
118: ; preds = %115
%119 = load i32*, i32** %2
%120 = load i32, i32* %5
%121 = load i32, i32* %6
%122 = load i32, i32* %7
%123 = load i32, i32* %8
%124 = call i32 (i32*, i8*, ...) @fprintf(i32* %119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %120, i32 %121, i32 %122, i32 %123)
%125 = load i32*, i32** %2
%126 = load i32, i32* %9
%127 = load i32, i32* %10
%128 = load i32, i32* %11
%129 = load i32, i32* %12
%130 = call i32 (i32*, i8*, ...) @fprintf(i32* %125, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %126, i32 %127, i32 %128, i32 %129)
%131 = load i32, i32* %4
%132 = add nsw i32 %131, 1
store i32 %132, i32* %4
br label %133
133: ; preds = %118, %115, %112, %109, %106, %103, %100, %97, %90
br label %85
134: ; preds = %85
%135 = load i32*, i32** %2
%136 = load i32, i32* %4
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %135, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %136)
store i32 0, i32* %4
%138 = load i32*, i32** %3
%139 = load i32, i32* @SEEK_SET
%140 = call i32 @fseek(i32* %138, i32 0, i32 %139)
%141 = load i32*, i32** %2
%142 = call i32 (i32*, i8*, ...) @fprintf(i32* %141, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
br label %143
143: ; preds = %175, %134
%144 = load i32*, i32** %3
%145 = call i32 @feof(i32* %144)
%146 = icmp ne i32 %145, 0
%147 = xor i1 %146, true
br i1 %147, label %148, label %176
148: ; preds = %143
%149 = load i32*, i32** %3
%150 = call i32 @fscanf(i32* %149, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8)
%151 = load i32*, i32** %3
%152 = call i32 @fscanf(i32* %151, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %9, i32* %10, i32* %11, i32* %12)
%153 = load i32, i32* %6
%154 = load i32, i32* %8
%155 = icmp ne i32 %153, %154
br i1 %155, label %160, label %156
156: ; preds = %148
%157 = load i32, i32* %9
%158 = load i32, i32* %11
%159 = icmp ne i32 %157, %158
br i1 %159, label %160, label %175
160: ; preds = %156, %148
%161 = load i32*, i32** %2
%162 = load i32, i32* %5
%163 = load i32, i32* %6
%164 = load i32, i32* %7
%165 = load i32, i32* %8
%166 = call i32 (i32*, i8*, ...) @fprintf(i32* %161, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %162, i32 %163, i32 %164, i32 %165)
%167 = load i32*, i32** %2
%168 = load i32, i32* %9
%169 = load i32, i32* %10
%170 = load i32, i32* %11
%171 = load i32, i32* %12
%172 = call i32 (i32*, i8*, ...) @fprintf(i32* %167, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %168, i32 %169, i32 %170, i32 %171)
%173 = load i32, i32* %4
%174 = add nsw i32 %173, 1
store i32 %174, i32* %4
br label %175
175: ; preds = %160, %156
br label %143
176: ; preds = %143
%177 = load i32*, i32** %2
%178 = load i32, i32* %4
%179 = call i32 (i32*, i8*, ...) @fprintf(i32* %177, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %178)
store i32 0, i32* %4
%180 = load i32*, i32** %3
%181 = load i32, i32* @SEEK_SET
%182 = call i32 @fseek(i32* %180, i32 0, i32 %181)
%183 = load i32*, i32** %2
%184 = call i32 (i32*, i8*, ...) @fprintf(i32* %183, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
br label %185
185: ; preds = %224, %176
%186 = load i32*, i32** %3
%187 = call i32 @feof(i32* %186)
%188 = icmp ne i32 %187, 0
%189 = xor i1 %188, true
br i1 %189, label %190, label %225
190: ; preds = %185
%191 = load i32*, i32** %3
%192 = call i32 @fscanf(i32* %191, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8)
%193 = load i32*, i32** %3
%194 = call i32 @fscanf(i32* %193, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %9, i32* %10, i32* %11, i32* %12)
%195 = load i32, i32* %5
%196 = load i32, i32* %6
%197 = load i32, i32* %7
%198 = load i32, i32* %8
%199 = load i32, i32* %9
%200 = load i32, i32* %10
%201 = load i32, i32* %11
%202 = load i32, i32* %12
%203 = call i64 @AreLinesCrossing(i32 %195, i32 %196, i32 %197, i32 %198, i32 %199, i32 %200, i32 %201, i32 %202)
%204 = icmp ne i64 %203, 0
br i1 %204, label %205, label %224
205: ; preds = %190
%206 = load i32, i32* %4
%207 = icmp slt i32 %206, 10
br i1 %207, label %208, label %221
208: ; preds = %205
%209 = load i32*, i32** %2
%210 = load i32, i32* %5
%211 = load i32, i32* %6
%212 = load i32, i32* %7
%213 = load i32, i32* %8
%214 = call i32 (i32*, i8*, ...) @fprintf(i32* %209, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %210, i32 %211, i32 %212, i32 %213)
%215 = load i32*, i32** %2
%216 = load i32, i32* %9
%217 = load i32, i32* %10
%218 = load i32, i32* %11
%219 = load i32, i32* %12
%220 = call i32 (i32*, i8*, ...) @fprintf(i32* %215, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %216, i32 %217, i32 %218, i32 %219)
br label %221
221: ; preds = %208, %205
%222 = load i32, i32* %4
%223 = add nsw i32 %222, 1
store i32 %223, i32* %4
br label %224
224: ; preds = %221, %190
br label %185
225: ; preds = %185
%226 = load i32*, i32** %2
%227 = load i32, i32* %4
%228 = call i32 (i32*, i8*, ...) @fprintf(i32* %226, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %227)
%229 = load i32*, i32** %3
%230 = call i32 @fclose(i32* %229)
%231 = load i32*, i32** %2
%232 = call i32 @fclose(i32* %231)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"wynik4.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [9 x i8] c"pary.txt\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [14 x i8] c"Zadanie 4.1:\0A\00"
@.str.5 = [12 x i8] c"%d %d %d %d\00"
@.str.6 = [13 x i8] c"%d %d %d %d \00"
@.str.7 = [13 x i8] c"%d %d %d %d\0A\00"
@.str.8 = [26 x i8] c"Liczba par odcinkow: %d\0A\0A\00"
@SEEK_SET = global i32 0
@.str.9 = [14 x i8] c"Zadanie 4.2:\0A\00"
@.str.10 = [14 x i8] c"Zadanie 4.3:\0A\00"
@.str.11 = [14 x i8] c"Zadanie 4.4:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = tail call i32 @exit(i32 255)
unreachable
13: ; preds = %0
%14 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = tail call i32 @exit(i32 254)
unreachable
18: ; preds = %13
%19 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%20 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%21 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%22 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%23 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%24 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%25 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%26 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%27 = tail call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i64 13, i64 1, i32* %9)
%28 = call i32 @feof(i32* %14)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %71
30: ; preds = %18, %67
%31 = phi i32 [ %68, %67 ], [ 0, %18 ]
%32 = call i32 @fscanf(i32* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%33 = call i32 @fscanf(i32* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8)
%34 = load i32, i32* %1
%35 = icmp eq i32 %34, 0
%36 = load i32, i32* %3
%37 = icmp eq i32 %36, 0
%38 = select i1 %35, i1 %37, i1 false
br i1 %38, label %45, label %39
39: ; preds = %30
%40 = load i32, i32* %2
%41 = icmp eq i32 %40, 0
%42 = load i32, i32* %4
%43 = icmp eq i32 %42, 0
%44 = select i1 %41, i1 %43, i1 false
br i1 %44, label %45, label %67
45: ; preds = %39, %30
%46 = load i32, i32* %5
%47 = icmp eq i32 %46, 0
%48 = load i32, i32* %7
%49 = icmp eq i32 %48, 0
%50 = select i1 %47, i1 %49, i1 false
br i1 %50, label %57, label %51
51: ; preds = %45
%52 = load i32, i32* %6
%53 = icmp eq i32 %52, 0
%54 = load i32, i32* %8
%55 = icmp eq i32 %54, 0
%56 = select i1 %53, i1 %55, i1 false
br i1 %56, label %57, label %67
57: ; preds = %51, %45
%58 = load i32, i32* %2
%59 = load i32, i32* %4
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %34, i32 %58, i32 %36, i32 %59)
%61 = load i32, i32* %5
%62 = load i32, i32* %6
%63 = load i32, i32* %7
%64 = load i32, i32* %8
%65 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %61, i32 %62, i32 %63, i32 %64)
%66 = add nsw i32 %31, 1
br label %67
67: ; preds = %57, %51, %39
%68 = phi i32 [ %66, %57 ], [ %31, %51 ], [ %31, %39 ]
%69 = call i32 @feof(i32* %14)
%70 = icmp eq i32 %69, 0
br i1 %70, label %30, label %71
71: ; preds = %67, %18
%72 = phi i32 [ 0, %18 ], [ %68, %67 ]
%73 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %72)
%74 = load i32, i32* @SEEK_SET
%75 = call i32 @fseek(i32* %14, i32 0, i32 %74)
%76 = call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i64 13, i64 1, i32* %9)
%77 = call i32 @feof(i32* %14)
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %118
79: ; preds = %71, %114
%80 = phi i32 [ %115, %114 ], [ 0, %71 ]
%81 = call i32 @fscanf(i32* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%82 = call i32 @fscanf(i32* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8)
%83 = load i32, i32* %1
%84 = icmp sgt i32 %83, -1
%85 = load i32, i32* %3
%86 = icmp sgt i32 %85, -1
%87 = select i1 %84, i1 %86, i1 false
%88 = load i32, i32* %2
%89 = icmp sgt i32 %88, -1
%90 = select i1 %87, i1 %89, i1 false
%91 = load i32, i32* %4
%92 = icmp sgt i32 %91, -1
%93 = select i1 %90, i1 %92, i1 false
%94 = load i32, i32* %5
%95 = icmp sgt i32 %94, -1
%96 = select i1 %93, i1 %95, i1 false
%97 = load i32, i32* %6
%98 = icmp sgt i32 %97, -1
%99 = select i1 %96, i1 %98, i1 false
%100 = load i32, i32* %7
%101 = icmp sgt i32 %100, -1
%102 = select i1 %99, i1 %101, i1 false
%103 = load i32, i32* %8
%104 = icmp sgt i32 %103, -1
%105 = select i1 %102, i1 %104, i1 false
br i1 %105, label %106, label %114
106: ; preds = %79
%107 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %83, i32 %88, i32 %85, i32 %91)
%108 = load i32, i32* %5
%109 = load i32, i32* %6
%110 = load i32, i32* %7
%111 = load i32, i32* %8
%112 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %108, i32 %109, i32 %110, i32 %111)
%113 = add nsw i32 %80, 1
br label %114
114: ; preds = %106, %79
%115 = phi i32 [ %113, %106 ], [ %80, %79 ]
%116 = call i32 @feof(i32* %14)
%117 = icmp eq i32 %116, 0
br i1 %117, label %79, label %118
118: ; preds = %114, %71
%119 = phi i32 [ 0, %71 ], [ %115, %114 ]
%120 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %119)
%121 = load i32, i32* @SEEK_SET
%122 = call i32 @fseek(i32* %14, i32 0, i32 %121)
%123 = call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i64 13, i64 1, i32* %9)
%124 = call i32 @feof(i32* %14)
%125 = icmp eq i32 %124, 0
br i1 %125, label %126, label %151
126: ; preds = %118, %147
%127 = phi i32 [ %148, %147 ], [ 0, %118 ]
%128 = call i32 @fscanf(i32* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%129 = call i32 @fscanf(i32* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8)
%130 = load i32, i32* %2
%131 = load i32, i32* %4
%132 = icmp eq i32 %130, %131
br i1 %132, label %133, label %137
133: ; preds = %126
%134 = load i32, i32* %5
%135 = load i32, i32* %7
%136 = icmp eq i32 %134, %135
br i1 %136, label %147, label %137
137: ; preds = %133, %126
%138 = load i32, i32* %1
%139 = load i32, i32* %3
%140 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %138, i32 %130, i32 %139, i32 %131)
%141 = load i32, i32* %5
%142 = load i32, i32* %6
%143 = load i32, i32* %7
%144 = load i32, i32* %8
%145 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %141, i32 %142, i32 %143, i32 %144)
%146 = add nsw i32 %127, 1
br label %147
147: ; preds = %137, %133
%148 = phi i32 [ %146, %137 ], [ %127, %133 ]
%149 = call i32 @feof(i32* %14)
%150 = icmp eq i32 %149, 0
br i1 %150, label %126, label %151
151: ; preds = %147, %118
%152 = phi i32 [ 0, %118 ], [ %148, %147 ]
%153 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %152)
%154 = load i32, i32* @SEEK_SET
%155 = call i32 @fseek(i32* %14, i32 0, i32 %154)
%156 = call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), i64 13, i64 1, i32* %9)
%157 = call i32 @feof(i32* %14)
%158 = icmp eq i32 %157, 0
br i1 %158, label %159, label %192
159: ; preds = %151, %188
%160 = phi i32 [ %189, %188 ], [ 0, %151 ]
%161 = call i32 @fscanf(i32* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%162 = call i32 @fscanf(i32* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8)
%163 = load i32, i32* %1
%164 = load i32, i32* %2
%165 = load i32, i32* %3
%166 = load i32, i32* %4
%167 = load i32, i32* %5
%168 = load i32, i32* %6
%169 = load i32, i32* %7
%170 = load i32, i32* %8
%171 = call i64 @AreLinesCrossing(i32 %163, i32 %164, i32 %165, i32 %166, i32 %167, i32 %168, i32 %169, i32 %170)
%172 = icmp eq i64 %171, 0
br i1 %172, label %188, label %173
173: ; preds = %159
%174 = icmp slt i32 %160, 10
br i1 %174, label %175, label %186
175: ; preds = %173
%176 = load i32, i32* %1
%177 = load i32, i32* %2
%178 = load i32, i32* %3
%179 = load i32, i32* %4
%180 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %176, i32 %177, i32 %178, i32 %179)
%181 = load i32, i32* %5
%182 = load i32, i32* %6
%183 = load i32, i32* %7
%184 = load i32, i32* %8
%185 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %181, i32 %182, i32 %183, i32 %184)
br label %186
186: ; preds = %175, %173
%187 = add nsw i32 %160, 1
br label %188
188: ; preds = %186, %159
%189 = phi i32 [ %187, %186 ], [ %160, %159 ]
%190 = call i32 @feof(i32* %14)
%191 = icmp eq i32 %190, 0
br i1 %191, label %159, label %192
192: ; preds = %188, %151
%193 = phi i32 [ 0, %151 ], [ %189, %188 ]
%194 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %193)
%195 = call i32 @fclose(i32* %14)
%196 = call i32 @fclose(i32* %9)
ret i32 0
}