#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, ...);
void print_result_phase_I(double **T, int no_of_eqns, int no_of_variables,
                          int *column, int *row) {
  int i;
  printf("The maximum solution occurs at Z=%lf with\n",
         T[no_of_eqns][no_of_variables]);
  for (i = 0; i < no_of_eqns; i++) {
    if (row[i] / 10 == 2) {
      printf("Z%d=%lf\t", (row[i] % 10) + 1, T[i][no_of_variables]);
    }
  }
  for (i = 0; i < no_of_eqns; i++) {
    if (column[i] / 10 == 2) {
      printf("Z%d=%lf\t", (column[i] % 10) + 1, 0.00);
    }
  }
}


x86 assembly (clang, -O0):
<print_result_phase_I>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
cvttsd2si (%rax,%rcx,8),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ca <print_result_phase_I+0xba>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x2,%eax
jne    11b7 <print_result_phase_I+0xa7>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1,%esi
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe7b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11bc <print_result_phase_I+0xac>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1154 <print_result_phase_I+0x44>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1235 <print_result_phase_I+0x125>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x2,%eax
jne    1222 <print_result_phase_I+0x112>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1,%esi
lea    0xe13(%rip),%rdi
xorps  %xmm0,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1227 <print_result_phase_I+0x117>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11d1 <print_result_phase_I+0xc1>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_result_phase_I>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%rbx
mov    %rcx,%r14
mov    %esi,%r12d
mov    %rdi,%r13
movslq %esi,%rbp
mov    (%rdi,%rbp,8),%rax
movslq %edx,%r15
cvttsd2si (%rax,%r15,8),%esi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebp,%ebp
jle    11fd <print_result_phase_I+0xed>
mov    %r12d,0x4(%rsp)
mov    %r12d,%ebp
xor    %r12d,%r12d
jmp    1169 <print_result_phase_I+0x59>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    %r12,%rbp
je     11a9 <print_result_phase_I+0x99>
mov    (%rbx,%r12,4),%eax
lea    -0x14(%rax),%ecx
cmp    $0x9,%ecx
ja     1160 <print_result_phase_I+0x50>
movzbl %al,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
add    $0x1,%al
movzbl %al,%esi
mov    0x0(%r13,%r12,8),%rax
movsd  (%rax,%r15,8),%xmm0
lea    0xe8b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1160 <print_result_phase_I+0x50>
cmpl   $0x0,0x4(%rsp)
jle    11fd <print_result_phase_I+0xed>
xor    %ebx,%ebx
lea    0xe72(%rip),%r15
jmp    11c9 <print_result_phase_I+0xb9>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%rbp
je     11fd <print_result_phase_I+0xed>
mov    (%r14,%rbx,4),%eax
lea    -0x14(%rax),%ecx
cmp    $0x9,%ecx
ja     11c0 <print_result_phase_I+0xb0>
movzbl %al,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
add    $0x1,%al
movzbl %al,%esi
xorps  %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11c0 <print_result_phase_I+0xb0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"The maximum solution occurs at Z=%lf with\0A\00"
@.str.1 = [9 x i8] c"Z%d=%lf\09\00"
define void @print_result_phase_I(double** %0, i32 %1, i32 %2, i32* %3, i32* %4) {
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
store double** %0, double*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%12 = load double**, double*** %6
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double*, double** %12, i64 %14
%16 = load double*, double** %15
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
%20 = load double, double* %19
%21 = fptosi double %20 to i32
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %21)
store i32 0, i32* %11
br label %23
23: ; preds = %54, %5
%24 = load i32, i32* %11
%25 = load i32, i32* %7
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %57
27: ; preds = %23
%28 = load i32*, i32** %10
%29 = load i32, i32* %11
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = sdiv i32 %32, 10
%34 = icmp eq i32 %33, 2
br i1 %34, label %35, label %53
35: ; preds = %27
%36 = load i32*, i32** %10
%37 = load i32, i32* %11
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %36, i64 %38
%40 = load i32, i32* %39
%41 = srem i32 %40, 10
%42 = add nsw i32 %41, 1
%43 = load double**, double*** %6
%44 = load i32, i32* %11
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double*, double** %43, i64 %45
%47 = load double*, double** %46
%48 = load i32, i32* %8
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %47, i64 %49
%51 = load double, double* %50
%52 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %42, double %51)
br label %53
53: ; preds = %35, %27
br label %54
54: ; preds = %53
%55 = load i32, i32* %11
%56 = add nsw i32 %55, 1
store i32 %56, i32* %11
br label %23
57: ; preds = %23
store i32 0, i32* %11
br label %58
58: ; preds = %80, %57
%59 = load i32, i32* %11
%60 = load i32, i32* %7
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %83
62: ; preds = %58
%63 = load i32*, i32** %9
%64 = load i32, i32* %11
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i32, i32* %63, i64 %65
%67 = load i32, i32* %66
%68 = sdiv i32 %67, 10
%69 = icmp eq i32 %68, 2
br i1 %69, label %70, label %79
70: ; preds = %62
%71 = load i32*, i32** %9
%72 = load i32, i32* %11
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i32, i32* %71, i64 %73
%75 = load i32, i32* %74
%76 = srem i32 %75, 10
%77 = add nsw i32 %76, 1
%78 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %77, double 0.000000e+00)
br label %79
79: ; preds = %70, %62
br label %80
80: ; preds = %79
%81 = load i32, i32* %11
%82 = add nsw i32 %81, 1
store i32 %82, i32* %11
br label %58
83: ; preds = %58
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"The maximum solution occurs at Z=%lf with\0A\00"
@.str.1 = [9 x i8] c"Z%d=%lf\09\00"
define void @print_result_phase_I(double** nocapture %0, i32 %1, i32 %2, i32* nocapture %3, i32* nocapture %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double*, double** %0, i64 %6
%8 = load double*, double** %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds double, double* %8, i64 %9
%11 = load double, double* %10
%12 = fptosi double %11 to i32
%13 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = icmp sgt i32 %1, 0
br i1 %14, label %15, label %54
15: ; preds = %5
%16 = zext i32 %1 to i64
br label %20
17: ; preds = %36
br i1 %14, label %18, label %54
18: ; preds = %17
%19 = zext i32 %1 to i64
br label %39
20: ; preds = %15, %36
%21 = phi i64 [ 0, %15 ], [ %37, %36 ]
%22 = getelementptr inbounds i32, i32* %4, i64 %21
%23 = load i32, i32* %22
%24 = add i32 %23, -20
%25 = icmp ult i32 %24, 10
br i1 %25, label %26, label %36
26: ; preds = %20
%27 = trunc i32 %23 to i8
%28 = urem i8 %27, 10
%29 = add nuw nsw i8 %28, 1
%30 = zext i8 %29 to i32
%31 = getelementptr inbounds double*, double** %0, i64 %21
%32 = load double*, double** %31
%33 = getelementptr inbounds double, double* %32, i64 %9
%34 = load double, double* %33
%35 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %30, double %34)
br label %36
36: ; preds = %20, %26
%37 = add nuw nsw i64 %21, 1
%38 = icmp eq i64 %37, %16
br i1 %38, label %17, label %20
39: ; preds = %18, %51
%40 = phi i64 [ 0, %18 ], [ %52, %51 ]
%41 = getelementptr inbounds i32, i32* %3, i64 %40
%42 = load i32, i32* %41
%43 = add i32 %42, -20
%44 = icmp ult i32 %43, 10
br i1 %44, label %45, label %51
45: ; preds = %39
%46 = trunc i32 %42 to i8
%47 = urem i8 %46, 10
%48 = add nuw nsw i8 %47, 1
%49 = zext i8 %48 to i32
%50 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %49, double 0.000000e+00)
br label %51
51: ; preds = %39, %45
%52 = add nuw nsw i64 %40, 1
%53 = icmp eq i64 %52, %19
br i1 %53, label %54, label %39
54: ; preds = %51, %5, %17
ret void
}