#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void probplot(int **prob, int lena, int lenb, int n, int cutoff, FILE *OUTPUT) {
  int i, j;
  float Pij;
  for (i = 0; i < lena; i++) {
    for (j = 0; j < lenb; j++) {
      Pij = (float)prob[i + 1][j + 1] / (float)n;
      if (i == j)
        fprintf(OUTPUT, "D");
      else if (Pij > (float)cutoff)
        fprintf(OUTPUT, "1");
      else
        fprintf(OUTPUT, "0");
    }
    fprintf(OUTPUT, "\n");
  }
}


x86 assembly (clang, -O0):
<probplot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    120f <probplot+0xff>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11f1 <probplot+0xe1>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cvtsi2ssl (%rax,%rcx,4),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jne    11a1 <probplot+0x91>
mov    -0x20(%rbp),%rdi
lea    0xe69(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11de <probplot+0xce>
movss  -0x2c(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
ucomiss %xmm1,%xmm0
jbe    11c9 <probplot+0xb9>
mov    -0x20(%rbp),%rdi
lea    0xe43(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11d9 <probplot+0xc9>
mov    -0x20(%rbp),%rdi
lea    0xe30(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11de <probplot+0xce>
jmp    11e3 <probplot+0xd3>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1147 <probplot+0x37>
mov    -0x20(%rbp),%rdi
lea    0xe0a(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1134 <probplot+0x24>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<probplot>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,0x4(%rsp)
test   %esi,%esi
jle    11d1 <probplot+0xc1>
mov    %r9,%r13
mov    %rdi,%r12
cvtsi2ss %ecx,%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %r8d,%xmm0
movss  %xmm0,0x8(%rsp)
mov    %esi,%eax
mov    %rax,0x10(%rsp)
mov    0x4(%rsp),%ebp
xor    %ebx,%ebx
jmp    1177 <probplot+0x67>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %r13,%rsi
call   1030 <fputc@plt>
mov    %r14,%rbx
cmp    0x10(%rsp),%r14
je     11d1 <probplot+0xc1>
lea    0x1(%rbx),%r14
cmpl   $0x0,0x4(%rsp)
jle    1160 <probplot+0x50>
xor    %eax,%eax
jmp    11a0 <probplot+0x90>
cs nopw 0x0(%rax,%rax,1)
mov    %r13,%rsi
call   1030 <fputc@plt>
mov    %r15,%rax
cmp    %r15,%rbp
je     1160 <probplot+0x50>
lea    0x1(%rax),%r15
mov    $0x44,%edi
cmp    %rax,%rbx
je     1190 <probplot+0x80>
mov    (%r12,%r14,8),%rcx
xorps  %xmm0,%xmm0
cvtsi2ssl 0x4(%rcx,%rax,4),%xmm0
divss  0xc(%rsp),%xmm0
xor    %edi,%edi
ucomiss 0x8(%rsp),%xmm0
seta   %dil
or     $0x30,%edi
jmp    1190 <probplot+0x80>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @probplot(i32** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* nocapture %5) {
%7 = icmp sgt i32 %1, 0
br i1 %7, label %8, label %38
8: ; preds = %6
%9 = icmp sgt i32 %2, 0
%10 = sitofp i32 %3 to float
%11 = sitofp i32 %4 to float
%12 = zext i32 %1 to i64
%13 = zext i32 %2 to i64
br label %14
14: ; preds = %8, %35
%15 = phi i64 [ 0, %8 ], [ %16, %35 ]
%16 = add nuw nsw i64 %15, 1
br i1 %9, label %17, label %35
17: ; preds = %14
%18 = getelementptr inbounds i32*, i32** %0, i64 %16
br label %19
19: ; preds = %17, %31
%20 = phi i64 [ 0, %17 ], [ %21, %31 ]
%21 = add nuw nsw i64 %20, 1
%22 = icmp eq i64 %15, %20
br i1 %22, label %31, label %23
23: ; preds = %19
%24 = load i32*, i32** %18
%25 = getelementptr inbounds i32, i32* %24, i64 %21
%26 = load i32, i32* %25
%27 = sitofp i32 %26 to float
%28 = fdiv float %27, %10
%29 = fcmp ogt float %28, %11
%30 = select i1 %29, i32 49, i32 48
br label %31
31: ; preds = %23, %19
%32 = phi i32 [ 68, %19 ], [ %30, %23 ]
%33 = tail call i32 @fputc(i32 %32, i32* %5)
%34 = icmp eq i64 %21, %13
br i1 %34, label %35, label %19
35: ; preds = %31, %14
%36 = tail call i32 @fputc(i32 10, i32* %5)
%37 = icmp eq i64 %16, %12
br i1 %37, label %38, label %14
38: ; preds = %35, %6
ret void
}