#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_II(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 == 1) {
      printf("X%d=%lf\t", (row[i] % 10) + 1, T[i][no_of_variables]);
    }
  }
  for (i = 0; i < no_of_variables; i++) {
    if (column[i] / 10 == 1) {
      printf("X%d=%lf\t", (column[i] % 10) + 1, 0.00);
    }
  }
}


x86 assembly (clang, -O0):
<print_result_phase_II>:
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_II+0xba>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x1,%eax
jne    11b7 <print_result_phase_II+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_II+0xac>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1154 <print_result_phase_II+0x44>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1235 <print_result_phase_II+0x125>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x1,%eax
jne    1222 <print_result_phase_II+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_II+0x117>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11d1 <print_result_phase_II+0xc1>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_result_phase_II>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%rbp
mov    %rcx,%r15
mov    %esi,%r12d
mov    %rdi,%rbx
movslq %esi,%r14
mov    (%rdi,%r14,8),%rax
mov    %edx,0x4(%rsp)
movslq %edx,%r13
cvttsd2si (%rax,%r13,8),%esi
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %r14d,%r14d
jle    11a9 <print_result_phase_II+0x99>
mov    %r12d,%r14d
xor    %r12d,%r12d
jmp    1169 <print_result_phase_II+0x59>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    %r12,%r14
je     11a9 <print_result_phase_II+0x99>
mov    0x0(%rbp,%r12,4),%eax
lea    -0xa(%rax),%ecx
cmp    $0x9,%ecx
ja     1160 <print_result_phase_II+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    (%rbx,%r12,8),%rax
movsd  (%rax,%r13,8),%xmm0
lea    0xe8b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1160 <print_result_phase_II+0x50>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11fd <print_result_phase_II+0xed>
mov    %eax,%ebp
xor    %ebx,%ebx
lea    0xe6f(%rip),%r14
jmp    11c9 <print_result_phase_II+0xb9>
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %rbx,%rbp
je     11fd <print_result_phase_II+0xed>
mov    (%r15,%rbx,4),%eax
lea    -0xa(%rax),%ecx
cmp    $0x9,%ecx
ja     11c0 <print_result_phase_II+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    %r14,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11c0 <print_result_phase_II+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"X%d=%lf\09\00"
define void @print_result_phase_II(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, 1
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* %8
%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, 1
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"X%d=%lf\09\00"
define void @print_result_phase_II(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 %17
15: ; preds = %5
%16 = zext i32 %1 to i64
br label %21
17: ; preds = %37, %5
%18 = icmp sgt i32 %2, 0
br i1 %18, label %19, label %55
19: ; preds = %17
%20 = zext i32 %2 to i64
br label %40
21: ; preds = %15, %37
%22 = phi i64 [ 0, %15 ], [ %38, %37 ]
%23 = getelementptr inbounds i32, i32* %4, i64 %22
%24 = load i32, i32* %23
%25 = add i32 %24, -10
%26 = icmp ult i32 %25, 10
br i1 %26, label %27, label %37
27: ; preds = %21
%28 = trunc i32 %24 to i8
%29 = urem i8 %28, 10
%30 = add nuw nsw i8 %29, 1
%31 = zext i8 %30 to i32
%32 = getelementptr inbounds double*, double** %0, i64 %22
%33 = load double*, double** %32
%34 = getelementptr inbounds double, double* %33, i64 %9
%35 = load double, double* %34
%36 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %31, double %35)
br label %37
37: ; preds = %21, %27
%38 = add nuw nsw i64 %22, 1
%39 = icmp eq i64 %38, %16
br i1 %39, label %17, label %21
40: ; preds = %19, %52
%41 = phi i64 [ 0, %19 ], [ %53, %52 ]
%42 = getelementptr inbounds i32, i32* %3, i64 %41
%43 = load i32, i32* %42
%44 = add i32 %43, -10
%45 = icmp ult i32 %44, 10
br i1 %45, label %46, label %52
46: ; preds = %40
%47 = trunc i32 %43 to i8
%48 = urem i8 %47, 10
%49 = add nuw nsw i8 %48, 1
%50 = zext i8 %49 to i32
%51 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %50, double 0.000000e+00)
br label %52
52: ; preds = %40, %46
%53 = add nuw nsw i64 %41, 1
%54 = icmp eq i64 %53, %20
br i1 %54, label %55, label %40
55: ; preds = %52, %17
ret void
}