#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 */
scalar_t__ vax_to_ieee_float_(float *);
void vaxf_to_local_(float *val, const int *n, int *errcode) {
  int i;
  *errcode = 0;
  for (i = 0; i < *n; i++) {
    if (vax_to_ieee_float_(i + val) != 0) {
      *errcode = 1;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<vaxf_to_local_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    1180 <vaxf_to_local_+0x70>
mov    -0x1c(%rbp),%eax
mov    -0x8(%rbp),%rdi
cltq
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <vax_to_ieee_float_@plt>
cmp    $0x0,%rax
je     116d <vaxf_to_local_+0x5d>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
jmp    1172 <vaxf_to_local_+0x62>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1135 <vaxf_to_local_+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vaxf_to_local_>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movl   $0x0,(%rdx)
cmpl   $0x0,(%rsi)
jle    1156 <vaxf_to_local_+0x46>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
jmp    1140 <vaxf_to_local_+0x30>
add    $0x1,%rbx
movslq (%r15),%rax
add    $0x4,%r12
cmp    %rax,%rbx
jge    1156 <vaxf_to_local_+0x46>
mov    %r12,%rdi
call   1030 <vax_to_ieee_float_@plt>
test   %rax,%rax
je     1130 <vaxf_to_local_+0x20>
movl   $0x1,(%r14)
jmp    1130 <vaxf_to_local_+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @vaxf_to_local_(float* %0, i32* %1, i32* %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store float* %0, float** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
store i32 0, i32* %8
store i32 0, i32* %7
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %7
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %27
14: ; preds = %9
%15 = load i32, i32* %7
%16 = load float*, float** %4
%17 = sext i32 %15 to i64
%18 = getelementptr inbounds float, float* %16, i64 %17
%19 = call i64 @vax_to_ieee_float_(float* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %14
%22 = load i32*, i32** %6
store i32 1, i32* %22
br label %23
23: ; preds = %21, %14
br label %24
24: ; preds = %23
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %9
27: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @vaxf_to_local_(float* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
store i32 0, i32* %2
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %3, %12
%7 = phi i64 [ %13, %12 ], [ 0, %3 ]
%8 = getelementptr inbounds float, float* %0, i64 %7
%9 = tail call i64 @vax_to_ieee_float_(float* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %6
store i32 1, i32* %2
br label %12
12: ; preds = %6, %11
%13 = add nuw nsw i64 %7, 1
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = icmp slt i64 %13, %15
br i1 %16, label %6, label %17
17: ; preds = %12, %3
ret void
}