#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 */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int i, j, n, m, choice, maxindex;
  double maximum, summation;
  printf("Enter the number of inequations (m):\n");
  scanf("%d", &m);
  printf("Enter the number of variables (n):\n");
  scanf("%d", &n);
  int isBasic[n + m];
  for (i = 0; i < n; ++i)
    isBasic[i] = 0;
  for (i = n; i < n + m; ++i)
    isBasic[i] = 1;
  double a[m][n + m];
  double b[m];
  printf("Enter the Inequations : \n");
  for (i = 0; i < m; ++i) {
    for (j = 0; j < n; ++j)
      scanf("%lf", &a[i][j]);
    for (j = n; j < n + m; ++j) {
      if ((j - n) == i) {
        a[i][j] = 1;
      } else {
        a[i][j] = 0;
      }
    }
  }
  printf("Enter the values of RHS : \n");
  for (i = 0; i < m; ++i)
    scanf("%lf", &b[i]);
  printf("LPP:\n\nEnter the coefficeients of the objective function:\n");
  double c[n + m];
  for (i = 0; i < n; ++i)
    scanf("%lf", &c[i]);
  for (i = m; i < n + m; ++i)
    c[i] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    %rdi,-0x78(%rbp)
xor    %eax,%eax
mov    %al,-0x69(%rbp)
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x78(%rbp),%rdi
mov    -0x69(%rbp),%al
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    %ecx,%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11cf <main+0xaf>
mov    -0x68(%rbp),%rax
movslq -0x8(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a6 <main+0x86>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    1203 <main+0xe3>
mov    -0x68(%rbp),%rax
movslq -0x8(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d5 <main+0xb5>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
mov    %ecx,%edx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %rax,-0x90(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,8),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x88(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x48(%rbp)
mov    %rax,-0x50(%rbp)
mov    -0x14(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x58(%rbp)
lea    0xded(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    137f <main+0x25f>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    12d7 <main+0x1b7>
mov    -0x88(%rbp),%rsi
mov    -0x90(%rbp),%rcx
movslq -0x8(%rbp),%rax
imul   %rcx,%rax
shl    $0x3,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1287 <main+0x167>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    136c <main+0x24c>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1330 <main+0x210>
mov    -0x88(%rbp),%rax
mov    -0x90(%rbp),%rdx
movslq -0x8(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsd  0xcda(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1359 <main+0x239>
mov    -0x88(%rbp),%rax
mov    -0x90(%rbp),%rdx
movslq -0x8(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    135e <main+0x23e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12dd <main+0x1bd>
jmp    1371 <main+0x251>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1274 <main+0x154>
lea    0xced(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13c9 <main+0x2a9>
mov    -0x80(%rbp),%rsi
movslq -0x8(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xcbb(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1392 <main+0x272>
lea    0xcbf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    %ecx,%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x98(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    143e <main+0x31e>
mov    -0x98(%rbp),%rsi
movslq -0x8(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xc46(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1404 <main+0x2e4>
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    1476 <main+0x356>
mov    -0x98(%rbp),%rax
movslq -0x8(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1444 <main+0x324>
movl   $0x0,-0x4(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rbx
lea    -0x2c(%rbp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    -0x30(%rbp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rsp,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x30(%rbp),%ecx
add    %eax,%ecx
mov    %rcx,-0x38(%rbp)
imul   %rax,%rcx
lea    0xf(,%rcx,8),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%r12
sub    %rcx,%r12
mov    %r12,%rsp
mov    %rsp,%rcx
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
mov    -0x2c(%rbp),%ecx
test   %ecx,%ecx
jle    127d <main+0x14d>
mov    -0x30(%rbp),%eax
shlq   $0x3,-0x38(%rbp)
lea    0xe27(%rip),%r15
movsd  0xe14(%rip),%xmm1
xor    %r13d,%r13d
jmp    1210 <main+0xe0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13
movslq %ecx,%rdx
add    -0x38(%rbp),%r12
cmp    %rdx,%r13
jge    127d <main+0x14d>
test   %eax,%eax
jle    1249 <main+0x119>
mov    %r12,%rbx
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%r14
movslq -0x30(%rbp),%rax
add    $0x8,%rbx
cmp    %rax,%r14
jl     1220 <main+0xf0>
mov    -0x2c(%rbp),%ecx
movsd  0xdb7(%rip),%xmm1
test   %ecx,%ecx
jle    1200 <main+0xd0>
lea    (%rcx,%rax,1),%esi
movslq %eax,%rdx
movslq %esi,%rsi
mov    %r13,%rdi
jmp    126f <main+0x13f>
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%r12,%rdx,8)
add    $0x1,%rdx
cmp    %rsi,%rdx
jge    1200 <main+0xd0>
movaps %xmm1,%xmm0
sub    $0x1,%rdi
jb     1260 <main+0x130>
xorps  %xmm0,%xmm0
jmp    1260 <main+0x130>
lea    0xdec(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,-0x2c(%rbp)
mov    -0x40(%rbp),%r15
jle    12be <main+0x18e>
lea    0xd71(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
add    $0x8,%r15
cmp    %rax,%rbx
jl     12a0 <main+0x170>
lea    0xdc6(%rip),%rdi
call   1030 <puts@plt>
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    %eax,%ecx
mov    %rsp,%r15
lea    0xf(,%rcx,8),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r15
mov    %r15,%rsp
test   %eax,%eax
jle    1347 <main+0x217>
lea    0xd19(%rip),%r14
mov    %r15,%r12
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq -0x30(%rbp),%rax
add    $0x8,%r12
cmp    %rax,%rbx
jl     1300 <main+0x1d0>
test   %eax,%eax
jle    1347 <main+0x217>
movslq -0x2c(%rbp),%rcx
add    %ecx,%eax
lea    0x1(%rcx),%edx
cmp    %edx,%eax
cmovle %edx,%eax
lea    (%r15,%rcx,8),%rdi
not    %ecx
add    %eax,%ecx
lea    0x8(,%rcx,8),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x48(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Enter the number of inequations (m):\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"Enter the number of variables (n):\0A\00"
@.str.3 = [26 x i8] c"Enter the Inequations : \0A\00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [28 x i8] c"Enter the values of RHS : \0A\00"
@.str.6 = [58 x i8] c"LPP:\0A\0AEnter the coefficeients of the objective function:\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 double
%9 = alloca double
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
store i32 0, i32* %1
%16 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%18 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = add nsw i32 %20, %21
%23 = zext i32 %22 to i64
%24 = call i8* @llvm.stacksave()
store i8* %24, i8** %10
%25 = alloca i32, i64 %23
store i64 %23, i64* %11
store i32 0, i32* %2
br label %26
26: ; preds = %34, %0
%27 = load i32, i32* %2
%28 = load i32, i32* %4
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %37
30: ; preds = %26
%31 = load i32, i32* %2
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %25, i64 %32
store i32 0, i32* %33
br label %34
34: ; preds = %30
%35 = load i32, i32* %2
%36 = add nsw i32 %35, 1
store i32 %36, i32* %2
br label %26
37: ; preds = %26
%38 = load i32, i32* %4
store i32 %38, i32* %2
br label %39
39: ; preds = %49, %37
%40 = load i32, i32* %2
%41 = load i32, i32* %4
%42 = load i32, i32* %5
%43 = add nsw i32 %41, %42
%44 = icmp slt i32 %40, %43
br i1 %44, label %45, label %52
45: ; preds = %39
%46 = load i32, i32* %2
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %25, i64 %47
store i32 1, i32* %48
br label %49
49: ; preds = %45
%50 = load i32, i32* %2
%51 = add nsw i32 %50, 1
store i32 %51, i32* %2
br label %39
52: ; preds = %39
%53 = load i32, i32* %5
%54 = zext i32 %53 to i64
%55 = load i32, i32* %4
%56 = load i32, i32* %5
%57 = add nsw i32 %55, %56
%58 = zext i32 %57 to i64
%59 = mul nuw i64 %54, %58
%60 = alloca double, i64 %59
store i64 %54, i64* %12
store i64 %58, i64* %13
%61 = load i32, i32* %5
%62 = zext i32 %61 to i64
%63 = alloca double, i64 %62
store i64 %62, i64* %14
%64 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %65
65: ; preds = %121, %52
%66 = load i32, i32* %2
%67 = load i32, i32* %5
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %124
69: ; preds = %65
store i32 0, i32* %3
br label %70
70: ; preds = %83, %69
%71 = load i32, i32* %3
%72 = load i32, i32* %4
%73 = icmp slt i32 %71, %72
br i1 %73, label %74, label %86
74: ; preds = %70
%75 = load i32, i32* %2
%76 = sext i32 %75 to i64
%77 = mul nsw i64 %76, %58
%78 = getelementptr inbounds double, double* %60, i64 %77
%79 = load i32, i32* %3
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %78, i64 %80
%82 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %81)
br label %83
83: ; preds = %74
%84 = load i32, i32* %3
%85 = add nsw i32 %84, 1
store i32 %85, i32* %3
br label %70
86: ; preds = %70
%87 = load i32, i32* %4
store i32 %87, i32* %3
br label %88
88: ; preds = %117, %86
%89 = load i32, i32* %3
%90 = load i32, i32* %4
%91 = load i32, i32* %5
%92 = add nsw i32 %90, %91
%93 = icmp slt i32 %89, %92
br i1 %93, label %94, label %120
94: ; preds = %88
%95 = load i32, i32* %3
%96 = load i32, i32* %4
%97 = sub nsw i32 %95, %96
%98 = load i32, i32* %2
%99 = icmp eq i32 %97, %98
br i1 %99, label %100, label %108
100: ; preds = %94
%101 = load i32, i32* %2
%102 = sext i32 %101 to i64
%103 = mul nsw i64 %102, %58
%104 = getelementptr inbounds double, double* %60, i64 %103
%105 = load i32, i32* %3
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double, double* %104, i64 %106
store double 1.000000e+00, double* %107
br label %116
108: ; preds = %94
%109 = load i32, i32* %2
%110 = sext i32 %109 to i64
%111 = mul nsw i64 %110, %58
%112 = getelementptr inbounds double, double* %60, i64 %111
%113 = load i32, i32* %3
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %112, i64 %114
store double 0.000000e+00, double* %115
br label %116
116: ; preds = %108, %100
br label %117
117: ; preds = %116
%118 = load i32, i32* %3
%119 = add nsw i32 %118, 1
store i32 %119, i32* %3
br label %88
120: ; preds = %88
br label %121
121: ; preds = %120
%122 = load i32, i32* %2
%123 = add nsw i32 %122, 1
store i32 %123, i32* %2
br label %65
124: ; preds = %65
%125 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %2
br label %126
126: ; preds = %135, %124
%127 = load i32, i32* %2
%128 = load i32, i32* %5
%129 = icmp slt i32 %127, %128
br i1 %129, label %130, label %138
130: ; preds = %126
%131 = load i32, i32* %2
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds double, double* %63, i64 %132
%134 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %133)
br label %135
135: ; preds = %130
%136 = load i32, i32* %2
%137 = add nsw i32 %136, 1
store i32 %137, i32* %2
br label %126
138: ; preds = %126
%139 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
%140 = load i32, i32* %4
%141 = load i32, i32* %5
%142 = add nsw i32 %140, %141
%143 = zext i32 %142 to i64
%144 = alloca double, i64 %143
store i64 %143, i64* %15
store i32 0, i32* %2
br label %145
145: ; preds = %154, %138
%146 = load i32, i32* %2
%147 = load i32, i32* %4
%148 = icmp slt i32 %146, %147
br i1 %148, label %149, label %157
149: ; preds = %145
%150 = load i32, i32* %2
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds double, double* %144, i64 %151
%153 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %152)
br label %154
154: ; preds = %149
%155 = load i32, i32* %2
%156 = add nsw i32 %155, 1
store i32 %156, i32* %2
br label %145
157: ; preds = %145
%158 = load i32, i32* %5
store i32 %158, i32* %2
br label %159
159: ; preds = %169, %157
%160 = load i32, i32* %2
%161 = load i32, i32* %4
%162 = load i32, i32* %5
%163 = add nsw i32 %161, %162
%164 = icmp slt i32 %160, %163
br i1 %164, label %165, label %172
165: ; preds = %159
%166 = load i32, i32* %2
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %144, i64 %167
store double 0.000000e+00, double* %168
br label %169
169: ; preds = %165
%170 = load i32, i32* %2
%171 = add nsw i32 %170, 1
store i32 %171, i32* %2
br label %159
172: ; preds = %159
store i32 0, i32* %1
%173 = load i8*, i8** %10
%174 = load i32, i32* %1
ret i32 %174
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [4 x i8] c"%lf\00"
@str = [37 x i8] c"Enter the number of inequations (m):\00"
@str.7 = [35 x i8] c"Enter the number of variables (n):\00"
@str.8 = [25 x i8] c"Enter the Inequations : \00"
@str.9 = [27 x i8] c"Enter the values of RHS : \00"
@str.10 = [57 x i8] c"LPP:\0A\0AEnter the coefficeients of the objective function:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.7, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i8* @llvm.stacksave()
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = add nsw i32 %11, %10
%13 = zext i32 %11 to i64
%14 = zext i32 %12 to i64
%15 = mul nuw i64 %14, %13
%16 = alloca double, i64 %15
%17 = alloca double, i64 %13
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.8, i64 0, i64 0))
%19 = load i32, i32* %2
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %63
21: ; preds = %0
%22 = load i32, i32* %1
br label %23
23: ; preds = %21, %59
%24 = phi i32 [ %19, %21 ], [ %34, %59 ]
%25 = phi i32 [ %22, %21 ], [ %35, %59 ]
%26 = phi i64 [ 0, %21 ], [ %60, %59 ]
%27 = icmp sgt i32 %25, 0
br i1 %27, label %28, label %33
28: ; preds = %23
%29 = mul nuw nsw i64 %26, %14
%30 = getelementptr inbounds double, double* %16, i64 %29
br label %43
31: ; preds = %43
%32 = load i32, i32* %2
br label %33
33: ; preds = %31, %23
%34 = phi i32 [ %24, %23 ], [ %32, %31 ]
%35 = phi i32 [ %25, %23 ], [ %48, %31 ]
%36 = icmp sgt i32 %34, 0
br i1 %36, label %37, label %59
37: ; preds = %33
%38 = add nsw i32 %34, %35
%39 = mul nuw nsw i64 %26, %14
%40 = getelementptr inbounds double, double* %16, i64 %39
%41 = sext i32 %35 to i64
%42 = sext i32 %38 to i64
br label %51
43: ; preds = %28, %43
%44 = phi i64 [ 0, %28 ], [ %47, %43 ]
%45 = getelementptr inbounds double, double* %30, i64 %44
%46 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %45)
%47 = add nuw nsw i64 %44, 1
%48 = load i32, i32* %1
%49 = sext i32 %48 to i64
%50 = icmp slt i64 %47, %49
br i1 %50, label %43, label %31
51: ; preds = %37, %51
%52 = phi i64 [ %41, %37 ], [ %57, %51 ]
%53 = sub nsw i64 %52, %41
%54 = icmp eq i64 %53, %26
%55 = getelementptr inbounds double, double* %40, i64 %52
%56 = select i1 %54, double 1.000000e+00, double 0.000000e+00
store double %56, double* %55
%57 = add nsw i64 %52, 1
%58 = icmp slt i64 %57, %42
br i1 %58, label %51, label %59
59: ; preds = %51, %33
%60 = add nuw nsw i64 %26, 1
%61 = sext i32 %34 to i64
%62 = icmp slt i64 %60, %61
br i1 %62, label %23, label %63
63: ; preds = %59, %0
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.9, i64 0, i64 0))
%65 = load i32, i32* %2
%66 = icmp sgt i32 %65, 0
br i1 %66, label %67, label %75
67: ; preds = %63, %67
%68 = phi i64 [ %71, %67 ], [ 0, %63 ]
%69 = getelementptr inbounds double, double* %17, i64 %68
%70 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %69)
%71 = add nuw nsw i64 %68, 1
%72 = load i32, i32* %2
%73 = sext i32 %72 to i64
%74 = icmp slt i64 %71, %73
br i1 %74, label %67, label %75
75: ; preds = %67, %63
%76 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.10, i64 0, i64 0))
%77 = load i32, i32* %1
%78 = load i32, i32* %2
%79 = add i32 %78, %77
%80 = zext i32 %79 to i64
%81 = alloca double, i64 %80
%82 = icmp sgt i32 %77, 0
br i1 %82, label %83, label %106
83: ; preds = %75, %83
%84 = phi i64 [ %87, %83 ], [ 0, %75 ]
%85 = getelementptr inbounds double, double* %81, i64 %84
%86 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %85)
%87 = add nuw nsw i64 %84, 1
%88 = load i32, i32* %1
%89 = sext i32 %88 to i64
%90 = icmp slt i64 %87, %89
br i1 %90, label %83, label %91
91: ; preds = %83
%92 = load i32, i32* %2
%93 = icmp sgt i32 %88, 0
br i1 %93, label %94, label %106
94: ; preds = %91
%95 = add i32 %92, %88
%96 = sext i32 %92 to i64
%97 = getelementptr double, double* %81, i64 %96
%98 = bitcast double* %97 to i8*
%99 = add i32 %92, 1
%100 = call i32 @llvm.smax.i32(i32 %95, i32 %99)
%101 = xor i32 %92, -1
%102 = add i32 %100, %101
%103 = zext i32 %102 to i64
%104 = shl nuw nsw i64 %103, 3
%105 = add nuw nsw i64 %104, 8
br label %106
106: ; preds = %75, %94, %91
ret i32 0
}