#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 fabs(float);
int /*<<< orphan*/ printf(char *, ...);
void Print_Real_1f(int n, float *array, char *title) {
  int i;
  printf("\n%s:\n", title);
  for (i = 0; i < n; i++) {
    printf("   %4d", i);
    if (fabs(array[i]) < 1e-12)
      printf(": 0\n");
    else
      printf(": %.5g\n", array[i]);
  }
}


x86 assembly (clang, -O0):
<Print_Real_1f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11d6 <Print_Real_1f+0xb6>
mov    -0x1c(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe79(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a4 <Print_Real_1f+0x84>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c3 <Print_Real_1f+0xa3>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11c8 <Print_Real_1f+0xa8>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <Print_Real_1f+0x2c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print_Real_1f>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    %edi,%ebx
lea    0xeb9(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
jle    11b4 <Print_Real_1f+0x84>
mov    %ebx,%ebp
lea    0xea8(%rip),%r14
lea    0xeb0(%rip),%r15
lea    0xea1(%rip),%r12
xor    %ebx,%ebx
jmp    118e <Print_Real_1f+0x5e>
movss  0x0(%r13,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
je     11b4 <Print_Real_1f+0x84>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x0(%r13,%rbx,4),%xmm0
call   1050 <fabs@plt>
test   %eax,%eax
jg     1170 <Print_Real_1f+0x40>
mov    %r15,%rdi
call   1030 <puts@plt>
jmp    1185 <Print_Real_1f+0x55>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\0A%s:\0A\00"
@.str.1 = [7 x i8] c" %4d\00"
@.str.2 = [5 x i8] c": 0\0A\00"
@.str.3 = [8 x i8] c": %.5g\0A\00"
define void @Print_Real_1f(i32 %0, float* %1, i8* %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store float* %1, float** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %8)
store i32 0, i32* %7
br label %10
10: ; preds = %36, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %39
14: ; preds = %10
%15 = load i32, i32* %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = load float*, float** %5
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds float, float* %17, i64 %19
%21 = load float, float* %20
%22 = call i32 @fabs(float %21)
%23 = sitofp i32 %22 to double
%24 = fcmp olt double %23, 0x3D719799812DEA11
br i1 %24, label %25, label %27
25: ; preds = %14
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %35
27: ; preds = %14
%28 = load float*, float** %5
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds float, float* %28, i64 %30
%32 = load float, float* %31
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %33)
br label %35
35: ; preds = %27, %25
br label %36
36: ; preds = %35
%37 = load i32, i32* %7
%38 = add nsw i32 %37, 1
store i32 %38, i32* %7
br label %10
39: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\0A%s:\0A\00"
@.str.1 = [7 x i8] c" %4d\00"
@.str.3 = [8 x i8] c": %.5g\0A\00"
@str = [4 x i8] c": 0\00"
define void @Print_Real_1f(i32 %0, float* nocapture %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %25
6: ; preds = %3
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %22
%9 = phi i64 [ 0, %6 ], [ %23, %22 ]
%10 = trunc i64 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds float, float* %1, i64 %9
%13 = load float, float* %12
%14 = tail call i32 @fabs(float %13)
%15 = icmp slt i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %8
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %22
18: ; preds = %8
%19 = load float, float* %12
%20 = fpext float %19 to double
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %20)
br label %22
22: ; preds = %16, %18
%23 = add nuw nsw i64 %9, 1
%24 = icmp eq i64 %23, %7
br i1 %24, label %25, label %8
25: ; preds = %22, %3
ret void
}