#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 *);
int /*<<< orphan*/ printf(char *);
void one_tstp_ascii(FILE *fppp, FILE *fpta, FILE *fpti, float *precip,
                    float *tempmax, float *tempmin, int cl) {
  int i;
  float ttemp;
  for (i = 0; i < cl; i++) {
    if (fscanf(fppp, "%f", &precip[i]) != 1)
      printf("Error prcp\n");
    if (fscanf(fpta, "%f", &tempmax[i]) != 1)
      printf("Error tmax\n");
    if (fscanf(fpti, "%f", &tempmin[i]) != 1)
      printf("Error tmin\n");
    if (tempmax[i] < tempmin[i]) {
      ttemp = tempmax[i];
      tempmax[i] = tempmin[i];
      tempmin[i] = ttemp;
    }
  }
}


x86 assembly (clang, -O0):
<one_tstp_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1266 <one_tstp_ascii+0x146>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe90(%rip),%rsi
call   1040 <fscanf@plt>
cmp    $0x1,%eax
je     118a <one_tstp_ascii+0x6a>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rdx
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe5c(%rip),%rsi
call   1040 <fscanf@plt>
cmp    $0x1,%eax
je     11be <one_tstp_ascii+0x9e>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rdx
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe28(%rip),%rsi
call   1040 <fscanf@plt>
cmp    $0x1,%eax
je     11f2 <one_tstp_ascii+0xd2>
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
ucomiss %xmm1,%xmm0
jbe    1253 <one_tstp_ascii+0x133>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x38(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    1258 <one_tstp_ascii+0x138>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    114a <one_tstp_ascii+0x2a>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_tstp_ascii>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,0x10(%rsp)
mov    %rsi,0x8(%rsp)
mov    0x50(%rsp),%eax
test   %eax,%eax
jle    11f7 <one_tstp_ascii+0xd7>
mov    %r9,%r14
mov    %r8,%rbx
mov    %rcx,%r15
mov    %rdi,%rbp
mov    %eax,%r13d
lea    0xea6(%rip),%r12
jmp    1176 <one_tstp_ascii+0x56>
nopl   0x0(%rax)
add    $0x4,%r14
add    $0x4,%rbx
add    $0x4,%r15
add    $0xffffffffffffffff,%r13
je     11f7 <one_tstp_ascii+0xd7>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1040 <fscanf@plt>
cmp    $0x1,%eax
je     1195 <one_tstp_ascii+0x75>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <fscanf@plt>
cmp    $0x1,%eax
je     11b6 <one_tstp_ascii+0x96>
lea    0xe5d(%rip),%rdi
call   1030 <puts@plt>
mov    0x10(%rsp),%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1040 <fscanf@plt>
cmp    $0x1,%eax
je     11d7 <one_tstp_ascii+0xb7>
lea    0xe31(%rip),%rdi
call   1030 <puts@plt>
movss  (%rbx),%xmm0
movss  (%r14),%xmm1
ucomiss %xmm0,%xmm1
jbe    1160 <one_tstp_ascii+0x40>
movss  %xmm1,(%rbx)
movss  %xmm0,(%r14)
jmp    1160 <one_tstp_ascii+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [12 x i8] c"Error prcp\0A\00"
@.str.2 = [12 x i8] c"Error tmax\0A\00"
@.str.3 = [12 x i8] c"Error tmin\0A\00"
define void @one_tstp_ascii(i32* %0, i32* %1, i32* %2, float* %3, float* %4, float* %5, i32 %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
%14 = alloca i32
%15 = alloca i32
%16 = alloca float
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store float* %3, float** %11
store float* %4, float** %12
store float* %5, float** %13
store i32 %6, i32* %14
store i32 0, i32* %15
br label %17
17: ; preds = %84, %7
%18 = load i32, i32* %15
%19 = load i32, i32* %14
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %87
21: ; preds = %17
%22 = load i32*, i32** %8
%23 = load float*, float** %11
%24 = load i32, i32* %15
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds float, float* %23, i64 %25
%27 = call i32 @fscanf(i32* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %26)
%28 = icmp ne i32 %27, 1
br i1 %28, label %29, label %31
29: ; preds = %21
%30 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %29, %21
%32 = load i32*, i32** %9
%33 = load float*, float** %12
%34 = load i32, i32* %15
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds float, float* %33, i64 %35
%37 = call i32 @fscanf(i32* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %36)
%38 = icmp ne i32 %37, 1
br i1 %38, label %39, label %41
39: ; preds = %31
%40 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %41
41: ; preds = %39, %31
%42 = load i32*, i32** %10
%43 = load float*, float** %13
%44 = load i32, i32* %15
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds float, float* %43, i64 %45
%47 = call i32 @fscanf(i32* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %46)
%48 = icmp ne i32 %47, 1
br i1 %48, label %49, label %51
49: ; preds = %41
%50 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %51
51: ; preds = %49, %41
%52 = load float*, float** %12
%53 = load i32, i32* %15
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds float, float* %52, i64 %54
%56 = load float, float* %55
%57 = load float*, float** %13
%58 = load i32, i32* %15
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds float, float* %57, i64 %59
%61 = load float, float* %60
%62 = fcmp olt float %56, %61
br i1 %62, label %63, label %83
63: ; preds = %51
%64 = load float*, float** %12
%65 = load i32, i32* %15
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds float, float* %64, i64 %66
%68 = load float, float* %67
store float %68, float* %16
%69 = load float*, float** %13
%70 = load i32, i32* %15
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds float, float* %69, i64 %71
%73 = load float, float* %72
%74 = load float*, float** %12
%75 = load i32, i32* %15
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds float, float* %74, i64 %76
store float %73, float* %77
%78 = load float, float* %16
%79 = load float*, float** %13
%80 = load i32, i32* %15
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds float, float* %79, i64 %81
store float %78, float* %82
br label %83
83: ; preds = %63, %51
br label %84
84: ; preds = %83
%85 = load i32, i32* %15
%86 = add nsw i32 %85, 1
store i32 %86, i32* %15
br label %17
87: ; preds = %17
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@str = [11 x i8] c"Error tmin\00"
@str.4 = [11 x i8] c"Error tmax\00"
@str.5 = [11 x i8] c"Error prcp\00"
define void @one_tstp_ascii(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, float* %3, float* %4, float* %5, i32 %6) {
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %38
9: ; preds = %7
%10 = zext i32 %6 to i64
br label %11
11: ; preds = %9, %35
%12 = phi i64 [ 0, %9 ], [ %36, %35 ]
%13 = getelementptr inbounds float, float* %3, i64 %12
%14 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %13)
%15 = icmp eq i32 %14, 1
br i1 %15, label %18, label %16
16: ; preds = %11
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.5, i64 0, i64 0))
br label %18
18: ; preds = %16, %11
%19 = getelementptr inbounds float, float* %4, i64 %12
%20 = tail call i32 @fscanf(i32* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %19)
%21 = icmp eq i32 %20, 1
br i1 %21, label %24, label %22
22: ; preds = %18
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0))
br label %24
24: ; preds = %22, %18
%25 = getelementptr inbounds float, float* %5, i64 %12
%26 = tail call i32 @fscanf(i32* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %25)
%27 = icmp eq i32 %26, 1
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %30
30: ; preds = %28, %24
%31 = load float, float* %19
%32 = load float, float* %25
%33 = fcmp olt float %31, %32
br i1 %33, label %34, label %35
34: ; preds = %30
store float %32, float* %19
store float %31, float* %25
br label %35
35: ; preds = %30, %34
%36 = add nuw nsw i64 %12, 1
%37 = icmp eq i64 %36, %10
br i1 %37, label %38, label %11
38: ; preds = %35, %7
ret void
}