#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*/ *PS_dot_common(char *, char *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
double sqrt(float);
int strlen(char *);
int PS_dot_plot_list(char *seq, char *wastlfile, float *matrix, char *comment) {
  FILE *wastl;
  int length;
  int i, j;
  length = strlen(seq);
  wastl = PS_dot_common(seq, wastlfile, comment);
  if (wastl == NULL)
    return 0;
  fprintf(wastl, "%%data starts here\n");
  for (i = 1; i < length; i++) {
    for (j = 1; j <= length; j++) {
      if (j <= i)
        continue;
      if (matrix[(i - 1) * length + j - 1] > 0.) {
        fprintf(wastl, "%d %d %1.9f ubox\n", i, j,
                sqrt(matrix[(i - 1) * length + j - 1]));
      }
    }
  }
  fprintf(wastl, "showpage\n"
                 "end\n"
                 "%%%%EOF\n");
  fclose(wastl);
  return 1;
}


x86 assembly (clang, -O0):
<PS_dot_plot_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1050 <PS_dot_common@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11a0 <PS_dot_plot_list+0x50>
movl   $0x0,-0x4(%rbp)
jmp    12ab <PS_dot_plot_list+0x15b>
mov    -0x30(%rbp),%rdi
lea    0xe55(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1289 <PS_dot_plot_list+0x139>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     1276 <PS_dot_plot_list+0x126>
mov    -0x3c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     11e9 <PS_dot_plot_list+0x99>
jmp    1268 <PS_dot_plot_list+0x118>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x34(%rbp),%ecx
add    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1263 <PS_dot_plot_list+0x113>
mov    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x34(%rbp),%ecx
add    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
call   1070 <sqrt@plt>
mov    -0x50(%rbp),%rdi
mov    -0x44(%rbp),%edx
mov    -0x40(%rbp),%ecx
lea    0xdb8(%rip),%rsi
mov    $0x1,%al
call   1060 <fprintf@plt>
jmp    1268 <PS_dot_plot_list+0x118>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11cc <PS_dot_plot_list+0x7c>
jmp    127b <PS_dot_plot_list+0x12b>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11b9 <PS_dot_plot_list+0x69>
mov    -0x30(%rbp),%rdi
lea    0xd92(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PS_dot_plot_list>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
call   1050 <PS_dot_common@plt>
test   %rax,%rax
je     123f <PS_dot_plot_list+0xef>
mov    %rax,%r14
lea    0xe70(%rip),%rsi
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
cmp    $0x2,%r12d
jl     121f <PS_dot_plot_list+0xcf>
mov    %r12d,%eax
mov    %rax,(%rsp)
add    $0x1,%r12d
mov    $0x1,%ebx
xor    %r13d,%r13d
xorps  %xmm1,%xmm1
jmp    11d0 <PS_dot_plot_list+0x80>
nopl   0x0(%rax)
add    $0x1,%rbx
mov    (%rsp),%rax
add    %rax,%r13
cmp    %rax,%rbx
je     121f <PS_dot_plot_list+0xcf>
mov    $0x1,%ebp
jmp    11e9 <PS_dot_plot_list+0x99>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r12
je     11c0 <PS_dot_plot_list+0x70>
cmp    %rbx,%rbp
jbe    11e0 <PS_dot_plot_list+0x90>
lea    -0x1(%r13,%rbp,1),%eax
cltq
movss  (%r15,%rax,4),%xmm0
ucomiss %xmm1,%xmm0
jbe    11e0 <PS_dot_plot_list+0x90>
call   1070 <sqrt@plt>
mov    %r14,%rdi
lea    0xe05(%rip),%rsi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    $0x1,%al
call   1060 <fprintf@plt>
xorps  %xmm1,%xmm1
jmp    11e0 <PS_dot_plot_list+0x90>
lea    0xe00(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
jmp    1241 <PS_dot_plot_list+0xf1>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%%data starts here\0A\00"
@.str.1 = [18 x i8] c"%d %d %1.9f ubox\0A\00"
@.str.2 = [22 x i8] c"showpage\0Aend\0A%%%%EOF\0A\00"
define i32 @PS_dot_plot_list(i8* %0, i8* %1, float* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca float*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store float* %2, float** %8
store i8* %3, i8** %9
%14 = load i8*, i8** %6
%15 = call i32 @strlen(i8* %14)
store i32 %15, i32* %11
%16 = load i8*, i8** %6
%17 = load i8*, i8** %7
%18 = load i8*, i8** %9
%19 = call i32* @PS_dot_common(i8* %16, i8* %17, i8* %18)
store i32* %19, i32** %10
%20 = load i32*, i32** %10
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %23
22: ; preds = %4
store i32 0, i32* %5
br label %84
23: ; preds = %4
%24 = load i32*, i32** %10
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %12
br label %26
26: ; preds = %76, %23
%27 = load i32, i32* %12
%28 = load i32, i32* %11
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %79
30: ; preds = %26
store i32 1, i32* %13
br label %31
31: ; preds = %72, %30
%32 = load i32, i32* %13
%33 = load i32, i32* %11
%34 = icmp sle i32 %32, %33
br i1 %34, label %35, label %75
35: ; preds = %31
%36 = load i32, i32* %13
%37 = load i32, i32* %12
%38 = icmp sle i32 %36, %37
br i1 %38, label %39, label %40
39: ; preds = %35
br label %72
40: ; preds = %35
%41 = load float*, float** %8
%42 = load i32, i32* %12
%43 = sub nsw i32 %42, 1
%44 = load i32, i32* %11
%45 = mul nsw i32 %43, %44
%46 = load i32, i32* %13
%47 = add nsw i32 %45, %46
%48 = sub nsw i32 %47, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds float, float* %41, i64 %49
%51 = load float, float* %50
%52 = fpext float %51 to double
%53 = fcmp ogt double %52, 0.000000e+00
br i1 %53, label %54, label %71
54: ; preds = %40
%55 = load i32*, i32** %10
%56 = load i32, i32* %12
%57 = load i32, i32* %13
%58 = load float*, float** %8
%59 = load i32, i32* %12
%60 = sub nsw i32 %59, 1
%61 = load i32, i32* %11
%62 = mul nsw i32 %60, %61
%63 = load i32, i32* %13
%64 = add nsw i32 %62, %63
%65 = sub nsw i32 %64, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds float, float* %58, i64 %66
%68 = load float, float* %67
%69 = call double @sqrt(float %68)
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %55, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %56, i32 %57, double %69)
br label %71
71: ; preds = %54, %40
br label %72
72: ; preds = %71, %39
%73 = load i32, i32* %13
%74 = add nsw i32 %73, 1
store i32 %74, i32* %13
br label %31
75: ; preds = %31
br label %76
76: ; preds = %75
%77 = load i32, i32* %12
%78 = add nsw i32 %77, 1
store i32 %78, i32* %12
br label %26
79: ; preds = %26
%80 = load i32*, i32** %10
%81 = call i32 (i32*, i8*, ...) @fprintf(i32* %80, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%82 = load i32*, i32** %10
%83 = call i32 @fclose(i32* %82)
store i32 1, i32* %5
br label %84
84: ; preds = %79, %22
%85 = load i32, i32* %5
ret i32 %85
}

LLVM IR (-O2):
@.str = [20 x i8] c"%%data starts here\0A\00"
@.str.1 = [18 x i8] c"%d %d %1.9f ubox\0A\00"
@.str.2 = [22 x i8] c"showpage\0Aend\0A%%%%EOF\0A\00"
define i32 @PS_dot_plot_list(i8* %0, i8* %1, float* nocapture %2, i8* %3) {
%5 = tail call i32 @strlen(i8* %0)
%6 = tail call i32* @PS_dot_common(i8* %0, i8* %1, i8* %3)
%7 = icmp eq i32* %6, null
br i1 %7, label %44, label %8
8: ; preds = %4
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = icmp sgt i32 %5, 1
br i1 %10, label %11, label %41
11: ; preds = %8
%12 = add nuw i32 %5, 1
%13 = zext i32 %5 to i64
%14 = zext i32 %12 to i64
br label %15
15: ; preds = %38, %11
%16 = phi i64 [ 1, %11 ], [ %39, %38 ]
%17 = trunc i64 %16 to i32
%18 = add i32 %17, -1
%19 = mul i32 %18, %5
%20 = add i32 %19, -1
%21 = trunc i64 %16 to i32
br label %22
22: ; preds = %15, %35
%23 = phi i64 [ 1, %15 ], [ %36, %35 ]
%24 = icmp ugt i64 %23, %16
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = trunc i64 %23 to i32
%27 = add i32 %20, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds float, float* %2, i64 %28
%30 = load float, float* %29
%31 = fcmp ogt float %30, 0.000000e+00
br i1 %31, label %32, label %35
32: ; preds = %25
%33 = tail call double @sqrt(float %30)
%34 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %21, i32 %26, double %33)
br label %35
35: ; preds = %25, %32, %22
%36 = add nuw nsw i64 %23, 1
%37 = icmp eq i64 %36, %14
br i1 %37, label %38, label %22
38: ; preds = %35
%39 = add nuw nsw i64 %16, 1
%40 = icmp eq i64 %39, %13
br i1 %40, label %41, label %15
41: ; preds = %38, %8
%42 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%43 = tail call i32 @fclose(i32* %6)
br label %44
44: ; preds = %4, %41
%45 = phi i32 [ 1, %41 ], [ 0, %4 ]
ret i32 %45
}