#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 HUGE_VAL;
double fabs(double);
double mchpr1();
void setConstraints(int n, double x[], int pivot[], double xscale[],
                    double xoffset[], double low[], double up[]) {
  int i;
  double epsmch;
  epsmch = mchpr1();
  for (i = 0; i < n; i++) {
    if (xscale[i] == 0.0) {
      pivot[i] = 2;
    } else {
      if (low[i] != -HUGE_VAL && (x[i] * xscale[i] + xoffset[i] - low[i] <=
                                  epsmch * 10.0 * (fabs(low[i]) + 1.0)))
        pivot[i] = -1;
      else {
        if (up[i] != HUGE_VAL && (x[i] * xscale[i] + xoffset[i] - up[i] >=
                                  epsmch * 10.0 * (fabs(up[i]) + 1.0)))
          pivot[i] = 1;
        else
          pivot[i] = 0;
      }
    }
  }
}


x86 assembly (clang, -O0):
<setConstraints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x0,%al
call   1030 <mchpr1@plt>
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    133d <setConstraints+0x22d>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1186 <setConstraints+0x76>
jp     1186 <setConstraints+0x76>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
jmp    132a <setConstraints+0x21a>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x2e4e(%rip),%rax
movsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
ucomisd %xmm1,%xmm0
jne    11ca <setConstraints+0xba>
jp     11ca <setConstraints+0xba>
jmp    1259 <setConstraints+0x149>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
movsd  0xdfa(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movaps 0xde9(%rip),%xmm3
pand   %xmm3,%xmm2
movsd  0xdcd(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jb     1259 <setConstraints+0x149>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
jmp    1325 <setConstraints+0x215>
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x2d7b(%rip),%rax
ucomisd (%rax),%xmm0
jne    1282 <setConstraints+0x172>
jp     1282 <setConstraints+0x172>
jmp    1311 <setConstraints+0x201>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xd42(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movaps 0xd31(%rip),%xmm3
pand   %xmm3,%xmm2
movsd  0xd15(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     1311 <setConstraints+0x201>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
jmp    1320 <setConstraints+0x210>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    1325 <setConstraints+0x215>
jmp    132a <setConstraints+0x21a>
jmp    132f <setConstraints+0x21f>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1146 <setConstraints+0x36>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setConstraints>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %rsi,%r13
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <mchpr1@plt>
test   %ebp,%ebp
jle    121d <setConstraints+0x10d>
mov    0x40(%rsp),%rax
mov    0x2ea1(%rip),%rcx
movsd  (%rcx),%xmm1
movapd 0xead(%rip),%xmm2
xorpd  %xmm1,%xmm2
mulsd  0xec1(%rip),%xmm0
mov    %ebp,%ecx
xor    %edx,%edx
xorpd  %xmm3,%xmm3
movapd 0xea0(%rip),%xmm8
movsd  0xeb0(%rip),%xmm5
jmp    1190 <setConstraints+0x80>
xor    %esi,%esi
nopl   0x0(%rax)
mov    %esi,(%rbx,%rdx,4)
add    $0x1,%rdx
cmp    %rdx,%rcx
je     121d <setConstraints+0x10d>
movsd  (%r12,%rdx,8),%xmm6
mov    $0x2,%esi
ucomisd %xmm3,%xmm6
jne    11a3 <setConstraints+0x93>
jnp    1180 <setConstraints+0x70>
movsd  (%r14,%rdx,8),%xmm7
ucomisd %xmm2,%xmm7
jne    11b1 <setConstraints+0xa1>
jnp    11de <setConstraints+0xce>
movsd  0x0(%r13,%rdx,8),%xmm4
mulsd  %xmm6,%xmm4
addsd  (%r15,%rdx,8),%xmm4
subsd  %xmm7,%xmm4
andpd  %xmm8,%xmm7
addsd  %xmm5,%xmm7
mulsd  %xmm0,%xmm7
mov    $0xffffffff,%esi
ucomisd %xmm4,%xmm7
jae    1180 <setConstraints+0x70>
movsd  (%rax,%rdx,8),%xmm7
ucomisd %xmm1,%xmm7
jne    11eb <setConstraints+0xdb>
jnp    117a <setConstraints+0x6a>
mulsd  0x0(%r13,%rdx,8),%xmm6
addsd  (%r15,%rdx,8),%xmm6
subsd  %xmm7,%xmm6
andpd  %xmm8,%xmm7
addsd  %xmm5,%xmm7
mulsd  %xmm0,%xmm7
mov    $0x1,%esi
ucomisd %xmm7,%xmm6
jb     117a <setConstraints+0x6a>
jmp    1180 <setConstraints+0x70>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@HUGE_VAL = global double 0.000000e+00
define void @setConstraints(i32 %0, double* %1, i32* %2, double* %3, double* %4, double* %5, double* %6) {
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32
%16 = alloca double
store i32 %0, i32* %8
store double* %1, double** %9
store i32* %2, i32** %10
store double* %3, double** %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
%17 = call double (...) @mchpr1()
store double %17, double* %16
store i32 0, i32* %15
br label %18
18: ; preds = %137, %7
%19 = load i32, i32* %15
%20 = load i32, i32* %8
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %140
22: ; preds = %18
%23 = load double*, double** %11
%24 = load i32, i32* %15
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double, double* %26
%28 = fcmp oeq double %27, 0.000000e+00
br i1 %28, label %29, label %34
29: ; preds = %22
%30 = load i32*, i32** %10
%31 = load i32, i32* %15
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
store i32 2, i32* %33
br label %136
34: ; preds = %22
%35 = load double*, double** %13
%36 = load i32, i32* %15
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
%39 = load double, double* %38
%40 = load double, double* @HUGE_VAL
%41 = fneg double %40
%42 = fcmp une double %39, %41
br i1 %42, label %43, label %82
43: ; preds = %34
%44 = load double*, double** %9
%45 = load i32, i32* %15
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
%48 = load double, double* %47
%49 = load double*, double** %11
%50 = load i32, i32* %15
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
%53 = load double, double* %52
%54 = load double*, double** %12
%55 = load i32, i32* %15
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
%58 = load double, double* %57
%59 = call double @llvm.fmuladd.f64(double %48, double %53, double %58)
%60 = load double*, double** %13
%61 = load i32, i32* %15
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = fsub double %59, %64
%66 = load double, double* %16
%67 = fmul double %66, 1.000000e+01
%68 = load double*, double** %13
%69 = load i32, i32* %15
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %68, i64 %70
%72 = load double, double* %71
%73 = call double @llvm.fabs.f64(double %72)
%74 = fadd double %73, 1.000000e+00
%75 = fmul double %67, %74
%76 = fcmp ole double %65, %75
br i1 %76, label %77, label %82
77: ; preds = %43
%78 = load i32*, i32** %10
%79 = load i32, i32* %15
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i32, i32* %78, i64 %80
store i32 -1, i32* %81
br label %135
82: ; preds = %43, %34
%83 = load double*, double** %14
%84 = load i32, i32* %15
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %83, i64 %85
%87 = load double, double* %86
%88 = load double, double* @HUGE_VAL
%89 = fcmp une double %87, %88
br i1 %89, label %90, label %129
90: ; preds = %82
%91 = load double*, double** %9
%92 = load i32, i32* %15
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %91, i64 %93
%95 = load double, double* %94
%96 = load double*, double** %11
%97 = load i32, i32* %15
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %96, i64 %98
%100 = load double, double* %99
%101 = load double*, double** %12
%102 = load i32, i32* %15
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds double, double* %101, i64 %103
%105 = load double, double* %104
%106 = call double @llvm.fmuladd.f64(double %95, double %100, double %105)
%107 = load double*, double** %14
%108 = load i32, i32* %15
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %107, i64 %109
%111 = load double, double* %110
%112 = fsub double %106, %111
%113 = load double, double* %16
%114 = fmul double %113, 1.000000e+01
%115 = load double*, double** %14
%116 = load i32, i32* %15
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %115, i64 %117
%119 = load double, double* %118
%120 = call double @llvm.fabs.f64(double %119)
%121 = fadd double %120, 1.000000e+00
%122 = fmul double %114, %121
%123 = fcmp oge double %112, %122
br i1 %123, label %124, label %129
124: ; preds = %90
%125 = load i32*, i32** %10
%126 = load i32, i32* %15
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i32, i32* %125, i64 %127
store i32 1, i32* %128
br label %134
129: ; preds = %90, %82
%130 = load i32*, i32** %10
%131 = load i32, i32* %15
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i32, i32* %130, i64 %132
store i32 0, i32* %133
br label %134
134: ; preds = %129, %124
br label %135
135: ; preds = %134, %77
br label %136
136: ; preds = %135, %29
br label %137
137: ; preds = %136
%138 = load i32, i32* %15
%139 = add nsw i32 %138, 1
store i32 %139, i32* %15
br label %18
140: ; preds = %18
ret void
}

LLVM IR (-O2):
@HUGE_VAL = global double 0.000000e+00
define void @setConstraints(i32 %0, double* nocapture %1, i32* nocapture writeonly %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, double* nocapture %6) {
%8 = tail call double (...) @mchpr1()
%9 = icmp sgt i32 %0, 0
br i1 %9, label %10, label %56
10: ; preds = %7
%11 = load double, double* @HUGE_VAL
%12 = fneg double %11
%13 = fmul double %8, 1.000000e+01
%14 = zext i32 %0 to i64
br label %15
15: ; preds = %10, %51
%16 = phi i64 [ 0, %10 ], [ %54, %51 ]
%17 = getelementptr inbounds double, double* %3, i64 %16
%18 = load double, double* %17
%19 = fcmp oeq double %18, 0.000000e+00
br i1 %19, label %51, label %20
20: ; preds = %15
%21 = getelementptr inbounds double, double* %5, i64 %16
%22 = load double, double* %21
%23 = fcmp une double %22, %12
br i1 %23, label %24, label %35
24: ; preds = %20
%25 = getelementptr inbounds double, double* %1, i64 %16
%26 = load double, double* %25
%27 = getelementptr inbounds double, double* %4, i64 %16
%28 = load double, double* %27
%29 = tail call double @llvm.fmuladd.f64(double %26, double %18, double %28)
%30 = fsub double %29, %22
%31 = tail call double @llvm.fabs.f64(double %22)
%32 = fadd double %31, 1.000000e+00
%33 = fmul double %13, %32
%34 = fcmp ugt double %30, %33
br i1 %34, label %35, label %51
35: ; preds = %24, %20
%36 = getelementptr inbounds double, double* %6, i64 %16
%37 = load double, double* %36
%38 = fcmp une double %37, %11
br i1 %38, label %39, label %50
39: ; preds = %35
%40 = getelementptr inbounds double, double* %1, i64 %16
%41 = load double, double* %40
%42 = getelementptr inbounds double, double* %4, i64 %16
%43 = load double, double* %42
%44 = tail call double @llvm.fmuladd.f64(double %41, double %18, double %43)
%45 = fsub double %44, %37
%46 = tail call double @llvm.fabs.f64(double %37)
%47 = fadd double %46, 1.000000e+00
%48 = fmul double %13, %47
%49 = fcmp ult double %45, %48
br i1 %49, label %50, label %51
50: ; preds = %39, %35
br label %51
51: ; preds = %39, %24, %15, %50
%52 = phi i32 [ 0, %50 ], [ 2, %15 ], [ -1, %24 ], [ 1, %39 ]
%53 = getelementptr inbounds i32, i32* %2, i64 %16
store i32 %52, i32* %53
%54 = add nuw nsw i64 %16, 1
%55 = icmp eq i64 %54, %14
br i1 %55, label %56, label %15
56: ; preds = %51, %7
ret void
}