#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double bDeltaForParallelLine(double, double);
scalar_t__ isinf(double);
void adjustBForParallelLine(int cw, double m, double x1, double y1, double x2,
                            double y2, double *b) {
  if (isinf(m)) {
    if ((cw && (y2 < y1)) || (!cw && (y2 > y1)))
      *b += 1;
    else
      *b -= 1;
  } else {
    double bDelta = bDeltaForParallelLine(1.0, m);
    if ((cw && (x2 > x1)) || (!cw && (x2 < x1)))
      *b += bDelta;
    else
      *b -= bDelta;
  }
}


x86 assembly (clang, -O0):
<adjustBForParallelLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <isinf@plt>
cmp    $0x0,%rax
je     11ca <adjustBForParallelLine+0xaa>
cmpl   $0x0,-0x4(%rbp)
je     117a <adjustBForParallelLine+0x5a>
movsd  -0x30(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     1194 <adjustBForParallelLine+0x74>
cmpl   $0x0,-0x4(%rbp)
jne    11ad <adjustBForParallelLine+0x8d>
movsd  -0x30(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11ad <adjustBForParallelLine+0x8d>
mov    -0x38(%rbp),%rax
movsd  0xe60(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    11c5 <adjustBForParallelLine+0xa5>
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe43(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    1249 <adjustBForParallelLine+0x129>
movsd  -0x10(%rbp),%xmm1
movsd  0xe29(%rip),%xmm0
call   1030 <bDeltaForParallelLine@plt>
movsd  %xmm0,-0x40(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11fb <adjustBForParallelLine+0xdb>
movsd  -0x28(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     1219 <adjustBForParallelLine+0xf9>
cmpl   $0x0,-0x4(%rbp)
jne    122f <adjustBForParallelLine+0x10f>
movsd  -0x28(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    122f <adjustBForParallelLine+0x10f>
movsd  -0x40(%rbp),%xmm0
mov    -0x38(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1244 <adjustBForParallelLine+0x124>
movsd  -0x40(%rbp),%xmm1
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    1249 <adjustBForParallelLine+0x129>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjustBForParallelLine>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
movsd  %xmm4,0x20(%rsp)
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x8(%rsp)
mov    %edi,%ebp
movsd  %xmm0,(%rsp)
call   1040 <isinf@plt>
test   %rax,%rax
je     1187 <adjustBForParallelLine+0x67>
xor    %eax,%eax
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
test   %ebp,%ebp
cmove  %ecx,%eax
movsd  (%rbx),%xmm0
cmp    $0x1,%al
jne    11ce <adjustBForParallelLine+0xae>
addsd  0xe83(%rip),%xmm0
jmp    11d6 <adjustBForParallelLine+0xb6>
movsd  0xe79(%rip),%xmm0
movsd  (%rsp),%xmm1
call   1030 <bDeltaForParallelLine@plt>
xor    %eax,%eax
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
ucomisd %xmm2,%xmm1
seta   %al
xor    %ecx,%ecx
ucomisd %xmm1,%xmm2
seta   %cl
test   %ebp,%ebp
cmove  %ecx,%eax
test   %al,%al
jne    11c8 <adjustBForParallelLine+0xa8>
xorpd  0xe48(%rip),%xmm0
addsd  (%rbx),%xmm0
jmp    11d6 <adjustBForParallelLine+0xb6>
addsd  0xe2a(%rip),%xmm0
movsd  %xmm0,(%rbx)
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @adjustBForParallelLine(i32 %0, double %1, double %2, double %3, double %4, double %5, double* %6) {
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double*
%15 = alloca double
store i32 %0, i32* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double* %6, double** %14
%16 = load double, double* %9
%17 = call i64 @isinf(double %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %42
19: ; preds = %7
%20 = load i32, i32* %8
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load double, double* %13
%24 = load double, double* %11
%25 = fcmp olt double %23, %24
br i1 %25, label %33, label %26
26: ; preds = %22, %19
%27 = load i32, i32* %8
%28 = icmp ne i32 %27, 0
br i1 %28, label %37, label %29
29: ; preds = %26
%30 = load double, double* %13
%31 = load double, double* %11
%32 = fcmp ogt double %30, %31
br i1 %32, label %33, label %37
33: ; preds = %29, %22
%34 = load double*, double** %14
%35 = load double, double* %34
%36 = fadd double %35, 1.000000e+00
store double %36, double* %34
br label %41
37: ; preds = %29, %26
%38 = load double*, double** %14
%39 = load double, double* %38
%40 = fsub double %39, 1.000000e+00
store double %40, double* %38
br label %41
41: ; preds = %37, %33
br label %69
42: ; preds = %7
%43 = load double, double* %9
%44 = call double @bDeltaForParallelLine(double 1.000000e+00, double %43)
store double %44, double* %15
%45 = load i32, i32* %8
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %51
47: ; preds = %42
%48 = load double, double* %12
%49 = load double, double* %10
%50 = fcmp ogt double %48, %49
br i1 %50, label %58, label %51
51: ; preds = %47, %42
%52 = load i32, i32* %8
%53 = icmp ne i32 %52, 0
br i1 %53, label %63, label %54
54: ; preds = %51
%55 = load double, double* %12
%56 = load double, double* %10
%57 = fcmp olt double %55, %56
br i1 %57, label %58, label %63
58: ; preds = %54, %47
%59 = load double, double* %15
%60 = load double*, double** %14
%61 = load double, double* %60
%62 = fadd double %61, %59
store double %62, double* %60
br label %68
63: ; preds = %54, %51
%64 = load double, double* %15
%65 = load double*, double** %14
%66 = load double, double* %65
%67 = fsub double %66, %64
store double %67, double* %65
br label %68
68: ; preds = %63, %58
br label %69
69: ; preds = %68, %41
ret void
}

LLVM IR (-O2):
define void @adjustBForParallelLine(i32 %0, double %1, double %2, double %3, double %4, double %5, double* nocapture %6) {
%8 = tail call i64 @isinf(double %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %20, label %10
10: ; preds = %7
%11 = icmp eq i32 %0, 0
%12 = fcmp olt double %5, %3
%13 = fcmp ogt double %5, %3
%14 = select i1 %11, i1 %13, i1 %12
%15 = load double, double* %6
br i1 %14, label %16, label %18
16: ; preds = %10
%17 = fadd double %15, 1.000000e+00
br label %30
18: ; preds = %10
%19 = fadd double %15, -1.000000e+00
br label %30
20: ; preds = %7
%21 = tail call double @bDeltaForParallelLine(double 1.000000e+00, double %1)
%22 = icmp eq i32 %0, 0
%23 = fcmp ogt double %4, %2
%24 = fcmp olt double %4, %2
%25 = select i1 %22, i1 %24, i1 %23
%26 = load double, double* %6
%27 = fneg double %21
%28 = select i1 %25, double %21, double %27
%29 = fadd double %26, %28
br label %30
30: ; preds = %16, %18, %20
%31 = phi double [ %17, %16 ], [ %19, %18 ], [ %29, %20 ]
store double %31, double* %6
ret void
}