#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 fscanf(int /*<<< orphan*/ *, char *, float *, float *, float *, float *);
int t4_read1(FILE *fp, float *t4) {
  int i, m;
  for (i = 0; i < 4; i++) {
    m = fscanf(fp, " %f %f %f %f", t4 + i + 0, t4 + i + 4, t4 + i + 8,
               t4 + i + 12);
    if (m != 4)
      return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<t4_read1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    11b5 <t4_read1+0xa5>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
add    $0x10,%rcx
mov    -0x18(%rbp),%r8
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%r8
add    $0x20,%r8
mov    -0x18(%rbp),%r9
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%r9
add    $0x30,%r9
lea    0xe7c(%rip),%rsi
call   1030 <fscanf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x4,-0x20(%rbp)
je     11a2 <t4_read1+0x92>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bc <t4_read1+0xac>
jmp    11a7 <t4_read1+0x97>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1127 <t4_read1+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t4_read1>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x10(%rsi),%rcx
lea    0x20(%rsi),%r8
lea    0x30(%rsi),%r9
lea    0xed3(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fscanf@plt>
mov    $0xffffffff,%ebp
cmp    $0x4,%eax
jne    11b4 <t4_read1+0xa4>
lea    0x4(%rbx),%rdx
lea    0x14(%rbx),%rcx
lea    0x24(%rbx),%r8
lea    0x34(%rbx),%r9
lea    0xeaa(%rip),%rsi
mov    %r14,%rdi
call   1030 <fscanf@plt>
cmp    $0x4,%eax
jne    11b4 <t4_read1+0xa4>
lea    0x8(%rbx),%rdx
lea    0x18(%rbx),%rcx
lea    0x28(%rbx),%r8
lea    0x38(%rbx),%r9
lea    0xe86(%rip),%rsi
mov    %r14,%rdi
call   1030 <fscanf@plt>
cmp    $0x4,%eax
jne    11b4 <t4_read1+0xa4>
lea    0xc(%rbx),%rdx
lea    0x1c(%rbx),%rcx
lea    0x2c(%rbx),%r8
add    $0x3c,%rbx
lea    0xe62(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%r9
call   1030 <fscanf@plt>
xor    %ebp,%ebp
cmp    $0x4,%eax
setne  %bpl
neg    %ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c" %f %f %f %f\00"
define i32 @t4_read1(i32* %0, float* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca float*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store float* %1, float** %5
store i32 0, i32* %6
br label %8
8: ; preds = %38, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 4
br i1 %10, label %11, label %41
11: ; preds = %8
%12 = load i32*, i32** %4
%13 = load float*, float** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %13, i64 %15
%17 = getelementptr inbounds float, float* %16, i64 0
%18 = load float*, float** %5
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %18, i64 %20
%22 = getelementptr inbounds float, float* %21, i64 4
%23 = load float*, float** %5
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds float, float* %23, i64 %25
%27 = getelementptr inbounds float, float* %26, i64 8
%28 = load float*, float** %5
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds float, float* %28, i64 %30
%32 = getelementptr inbounds float, float* %31, i64 12
%33 = call i32 @fscanf(i32* %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float* %17, float* %22, float* %27, float* %32)
store i32 %33, i32* %7
%34 = load i32, i32* %7
%35 = icmp ne i32 %34, 4
br i1 %35, label %36, label %37
36: ; preds = %11
store i32 -1, i32* %3
br label %42
37: ; preds = %11
br label %38
38: ; preds = %37
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %8
41: ; preds = %8
store i32 0, i32* %3
br label %42
42: ; preds = %41, %36
%43 = load i32, i32* %3
ret i32 %43
}

LLVM IR (-O2):
@.str = [13 x i8] c" %f %f %f %f\00"
define i32 @t4_read1(i32* nocapture %0, float* %1) {
%3 = getelementptr inbounds float, float* %1, i64 4
%4 = getelementptr inbounds float, float* %1, i64 8
%5 = getelementptr inbounds float, float* %1, i64 12
%6 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float* %1, float* %3, float* %4, float* %5)
%7 = icmp eq i32 %6, 4
br i1 %7, label %8, label %30
8: ; preds = %2
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = getelementptr inbounds float, float* %1, i64 5
%11 = getelementptr inbounds float, float* %1, i64 9
%12 = getelementptr inbounds float, float* %1, i64 13
%13 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float* %9, float* %10, float* %11, float* %12)
%14 = icmp eq i32 %13, 4
br i1 %14, label %15, label %30
15: ; preds = %8
%16 = getelementptr inbounds float, float* %1, i64 2
%17 = getelementptr inbounds float, float* %1, i64 6
%18 = getelementptr inbounds float, float* %1, i64 10
%19 = getelementptr inbounds float, float* %1, i64 14
%20 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float* %16, float* %17, float* %18, float* %19)
%21 = icmp eq i32 %20, 4
br i1 %21, label %22, label %30
22: ; preds = %15
%23 = getelementptr inbounds float, float* %1, i64 3
%24 = getelementptr inbounds float, float* %1, i64 7
%25 = getelementptr inbounds float, float* %1, i64 11
%26 = getelementptr inbounds float, float* %1, i64 15
%27 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float* %23, float* %24, float* %25, float* %26)
%28 = icmp ne i32 %27, 4
%29 = sext i1 %28 to i32
br label %30
30: ; preds = %22, %15, %8, %2
%31 = phi i32 [ -1, %2 ], [ -1, %8 ], [ -1, %15 ], [ %29, %22 ]
ret i32 %31
}