#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 */
double DBL_EPSILON;
int /*<<< orphan*/ printf(char *, ...);
void PrintMatrixAsSign(double *m, int n) {
  int i, j;
  char c;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (m[i * n + j] < -DBL_EPSILON)
        c = '-';
      else if (m[i * n + j] > DBL_EPSILON)
        c = '+';
      else
        c = '0';
      printf("%c ", c);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<PrintMatrixAsSign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1205 <PrintMatrixAsSign+0xf5>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e9 <PrintMatrixAsSign+0xd9>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x2e86(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jbe    1190 <PrintMatrixAsSign+0x80>
movb   $0x2d,-0x15(%rbp)
jmp    11c9 <PrintMatrixAsSign+0xb9>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x2e3b(%rip),%rax
ucomisd (%rax),%xmm0
jbe    11c0 <PrintMatrixAsSign+0xb0>
movb   $0x2b,-0x15(%rbp)
jmp    11c4 <PrintMatrixAsSign+0xb4>
movb   $0x30,-0x15(%rbp)
jmp    11c9 <PrintMatrixAsSign+0xb9>
movsbl -0x15(%rbp),%esi
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <PrintMatrixAsSign+0x29>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <PrintMatrixAsSign+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintMatrixAsSign>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    11c5 <PrintMatrixAsSign+0xa5>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0x0(,%r15,8),%rax
mov    %rax,(%rsp)
mov    0x2e9c(%rip),%r13
lea    0xebd(%rip),%r14
xor    %ebp,%ebp
jmp    1177 <PrintMatrixAsSign+0x57>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
add    (%rsp),%rbx
cmp    %r15,%rbp
je     11c5 <PrintMatrixAsSign+0xa5>
xor    %r12d,%r12d
jmp    1193 <PrintMatrixAsSign+0x73>
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r12
cmp    %r12,%r15
je     1160 <PrintMatrixAsSign+0x40>
movsd  (%rbx,%r12,8),%xmm0
movsd  0x0(%r13),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setbe  %cl
xorpd  0xe50(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    $0x2d,%esi
ja     1180 <PrintMatrixAsSign+0x60>
mov    %cl,%al
lea    (%rax,%rax,4),%esi
add    $0x2b,%esi
jmp    1180 <PrintMatrixAsSign+0x60>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@DBL_EPSILON = global double 0.000000e+00
@.str = [4 x i8] c"%c \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @PrintMatrixAsSign(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %55, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %58
12: ; preds = %8
store i32 0, i32* %6
br label %13
13: ; preds = %50, %12
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %53
17: ; preds = %13
%18 = load double*, double** %3
%19 = load i32, i32* %5
%20 = load i32, i32* %4
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %6
%23 = add nsw i32 %21, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %18, i64 %24
%26 = load double, double* %25
%27 = load double, double* @DBL_EPSILON
%28 = fneg double %27
%29 = fcmp olt double %26, %28
br i1 %29, label %30, label %31
30: ; preds = %17
store i8 45, i8* %7
br label %46
31: ; preds = %17
%32 = load double*, double** %3
%33 = load i32, i32* %5
%34 = load i32, i32* %4
%35 = mul nsw i32 %33, %34
%36 = load i32, i32* %6
%37 = add nsw i32 %35, %36
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %32, i64 %38
%40 = load double, double* %39
%41 = load double, double* @DBL_EPSILON
%42 = fcmp ogt double %40, %41
br i1 %42, label %43, label %44
43: ; preds = %31
store i8 43, i8* %7
br label %45
44: ; preds = %31
store i8 48, i8* %7
br label %45
45: ; preds = %44, %43
br label %46
46: ; preds = %45, %30
%47 = load i8, i8* %7
%48 = sext i8 %47 to i32
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %46
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 1
store i32 %52, i32* %6
br label %13
53: ; preds = %13
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %55
55: ; preds = %53
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
br label %8
58: ; preds = %8
ret void
}

LLVM IR (-O2):
@DBL_EPSILON = global double 0.000000e+00
@.str = [4 x i8] c"%c \00"
define void @PrintMatrixAsSign(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %28
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %24, %4
%8 = phi i64 [ 0, %4 ], [ %26, %24 ]
%9 = mul nsw i64 %8, %5
br label %10
10: ; preds = %7, %10
%11 = phi i64 [ 0, %7 ], [ %22, %10 ]
%12 = add nuw nsw i64 %11, %9
%13 = getelementptr inbounds double, double* %0, i64 %12
%14 = load double, double* %13
%15 = load double, double* @DBL_EPSILON
%16 = fneg double %15
%17 = fcmp olt double %14, %16
%18 = fcmp ogt double %14, %15
%19 = select i1 %18, i32 43, i32 48
%20 = select i1 %17, i32 45, i32 %19
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = add nuw nsw i64 %11, 1
%23 = icmp eq i64 %22, %6
br i1 %23, label %24, label %10
24: ; preds = %10
%25 = tail call i32 @putchar(i32 10)
%26 = add nuw nsw i64 %8, 1
%27 = icmp eq i64 %26, %6
br i1 %27, label %28, label %7
28: ; preds = %24, %2
ret void
}