#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 *, ...);
void printBFS(float **T1, int m, int n1, int *x, int *z) {
  int i;
  printf("Basic Feasible Solutions :");
  for (i = 0; i < n1; i++) {
    if (x[i] > 0)
      printf("X%d=0.0000 ", x[i]);
  }
  for (i = 0; i < m; i++) {
    if (z[i] > 0)
      printf("X%d=%.4f ", z[i], T1[i][n1]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printBFS>:
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)
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1189 <printBFS+0x79>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    1176 <printBFS+0x66>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117b <printBFS+0x6b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113f <printBFS+0x2f>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f3 <printBFS+0xe3>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    11e0 <printBFS+0xd0>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11e5 <printBFS+0xd5>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1190 <printBFS+0x80>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBFS>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r12
mov    %rcx,%rbp
mov    %edx,%ebx
mov    %esi,0x4(%rsp)
mov    %rdi,%r14
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,(%rsp)
test   %ebx,%ebx
jle    117d <printBFS+0x5d>
mov    (%rsp),%r15d
lea    0xec1(%rip),%r13
xor    %ebx,%ebx
jmp    1169 <printBFS+0x49>
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %rbx,%r15
je     117d <printBFS+0x5d>
mov    0x0(%rbp,%rbx,4),%esi
test   %esi,%esi
jle    1160 <printBFS+0x40>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1160 <printBFS+0x40>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11cb <printBFS+0xab>
movslq (%rsp),%r13
mov    %eax,%ebx
xor    %ebp,%ebp
lea    0xe93(%rip),%r15
jmp    11a9 <printBFS+0x89>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%rbx
je     11cb <printBFS+0xab>
mov    (%r12,%rbp,4),%esi
test   %esi,%esi
jle    11a0 <printBFS+0x80>
mov    (%r14,%rbp,8),%rax
movss  (%rax,%r13,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11a0 <printBFS+0x80>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Basic Feasible Solutions :\00"
@.str.1 = [12 x i8] c"X%d=0.0000 \00"
@.str.2 = [10 x i8] c"X%d=%.4f \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @printBFS(float** %0, i32 %1, i32 %2, i32* %3, i32* %4) {
%6 = alloca float**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
store float** %0, float*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %11
br label %13
13: ; preds = %32, %5
%14 = load i32, i32* %11
%15 = load i32, i32* %8
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %35
17: ; preds = %13
%18 = load i32*, i32** %9
%19 = load i32, i32* %11
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %31
24: ; preds = %17
%25 = load i32*, i32** %9
%26 = load i32, i32* %11
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %24, %17
br label %32
32: ; preds = %31
%33 = load i32, i32* %11
%34 = add nsw i32 %33, 1
store i32 %34, i32* %11
br label %13
35: ; preds = %13
store i32 0, i32* %11
br label %36
36: ; preds = %65, %35
%37 = load i32, i32* %11
%38 = load i32, i32* %7
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %68
40: ; preds = %36
%41 = load i32*, i32** %10
%42 = load i32, i32* %11
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32, i32* %41, i64 %43
%45 = load i32, i32* %44
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %64
47: ; preds = %40
%48 = load i32*, i32** %10
%49 = load i32, i32* %11
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i32, i32* %48, i64 %50
%52 = load i32, i32* %51
%53 = load float**, float*** %6
%54 = load i32, i32* %11
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds float*, float** %53, i64 %55
%57 = load float*, float** %56
%58 = load i32, i32* %8
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds float, float* %57, i64 %59
%61 = load float, float* %60
%62 = fpext float %61 to double
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %52, double %62)
br label %64
64: ; preds = %47, %40
br label %65
65: ; preds = %64
%66 = load i32, i32* %11
%67 = add nsw i32 %66, 1
store i32 %67, i32* %11
br label %36
68: ; preds = %36
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Basic Feasible Solutions :\00"
@.str.1 = [12 x i8] c"X%d=0.0000 \00"
@.str.2 = [10 x i8] c"X%d=%.4f \00"
define void @printBFS(float** nocapture %0, i32 %1, i32 %2, i32* nocapture %3, i32* nocapture %4) {
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = icmp sgt i32 %2, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = zext i32 %2 to i64
br label %15
10: ; preds = %22, %5
%11 = icmp sgt i32 %1, 0
br i1 %11, label %12, label %40
12: ; preds = %10
%13 = sext i32 %2 to i64
%14 = zext i32 %1 to i64
br label %25
15: ; preds = %8, %22
%16 = phi i64 [ 0, %8 ], [ %23, %22 ]
%17 = getelementptr inbounds i32, i32* %3, i64 %16
%18 = load i32, i32* %17
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %22
22: ; preds = %15, %20
%23 = add nuw nsw i64 %16, 1
%24 = icmp eq i64 %23, %9
br i1 %24, label %10, label %15
25: ; preds = %12, %37
%26 = phi i64 [ 0, %12 ], [ %38, %37 ]
%27 = getelementptr inbounds i32, i32* %4, i64 %26
%28 = load i32, i32* %27
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %37
30: ; preds = %25
%31 = getelementptr inbounds float*, float** %0, i64 %26
%32 = load float*, float** %31
%33 = getelementptr inbounds float, float* %32, i64 %13
%34 = load float, float* %33
%35 = fpext float %34 to double
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %28, double %35)
br label %37
37: ; preds = %25, %30
%38 = add nuw nsw i64 %26, 1
%39 = icmp eq i64 %38, %14
br i1 %39, label %40, label %25
40: ; preds = %37, %10
%41 = tail call i32 @putchar(i32 10)
ret void
}