#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 /*<<< orphan*/ clear();
int /*<<< orphan*/ error();
int /*<<< orphan*/ printf(char *);
int scanf(char *, float *, float *, char *, char *);
void getDailyData(float *high, float *low, char *condition) {
  float highFunction2;
  float lowFunction2;
  char conditionFunction2;
  char endInput;
  int exitLoop = 0;
  int validateInput;
  while (exitLoop == 0) {
    printf("\nEnter today's high, low and condition (c = cloudy, s = sunny, p "
           "= precipitation) \nseparated by commas: ");
    validateInput = scanf("%f, %f, %c%c", &highFunction2, &lowFunction2,
                          &conditionFunction2, &endInput);
    if (validateInput != 4) {
      error();
      clear();
    } else if (endInput != '\n') {
      error();
      clear();
    } else if (lowFunction2 > highFunction2) {
      error();
    } else if (conditionFunction2 != 'c' && conditionFunction2 != 's' &&
               conditionFunction2 != 'p') {
      error();
    } else {
      *high = highFunction2;
      *low = lowFunction2;
      *condition = conditionFunction2;
      exitLoop++;
    }
  }
}


x86 assembly (clang, -O0):
<getDailyData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jne    125b <getDailyData+0x11b>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x21(%rbp),%rcx
lea    -0x22(%rbp),%r8
call   1040 <scanf@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
je     11ad <getDailyData+0x6d>
mov    $0x0,%al
call   1050 <error@plt>
mov    $0x0,%al
call   1060 <clear@plt>
jmp    1256 <getDailyData+0x116>
movsbl -0x22(%rbp),%eax
cmp    $0xa,%eax
je     11cd <getDailyData+0x8d>
mov    $0x0,%al
call   1050 <error@plt>
mov    $0x0,%al
call   1060 <clear@plt>
jmp    1251 <getDailyData+0x111>
movss  -0x20(%rbp),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    11e8 <getDailyData+0xa8>
mov    $0x0,%al
call   1050 <error@plt>
jmp    124c <getDailyData+0x10c>
movsbl -0x21(%rbp),%eax
cmp    $0x63,%eax
je     121b <getDailyData+0xdb>
movsbl -0x21(%rbp),%eax
cmp    $0x73,%eax
je     121b <getDailyData+0xdb>
movsbl -0x21(%rbp),%eax
cmp    $0x70,%eax
je     121b <getDailyData+0xdb>
mov    $0x0,%al
call   1050 <error@plt>
jmp    1247 <getDailyData+0x107>
movss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x21(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    124c <getDailyData+0x10c>
jmp    1251 <getDailyData+0x111>
jmp    1256 <getDailyData+0x116>
jmp    115b <getDailyData+0x1b>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDailyData>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,0x20(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rdi,0x10(%rsp)
lea    0xe9c(%rip),%r13
lea    0xefe(%rip),%rbx
lea    0xc(%rsp),%rbp
lea    0x8(%rsp),%r14
lea    0x7(%rsp),%r15
lea    0x6(%rsp),%r12
jmp    119e <getDailyData+0x5e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <error@plt>
xor    %eax,%eax
call   1060 <clear@plt>
mov    %r13,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r12,%r8
call   1040 <scanf@plt>
cmp    $0x4,%eax
jne    1190 <getDailyData+0x50>
cmpb   $0xa,0x6(%rsp)
jne    1190 <getDailyData+0x50>
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
ucomiss %xmm1,%xmm0
ja     11f2 <getDailyData+0xb2>
movzbl 0x7(%rsp),%eax
lea    -0x63(%rax),%ecx
cmp    $0x10,%cl
ja     11f2 <getDailyData+0xb2>
movzbl %cl,%ecx
mov    $0x12001,%edx
bt     %rcx,%rdx
jb     11fb <getDailyData+0xbb>
xor    %eax,%eax
call   1050 <error@plt>
jmp    119e <getDailyData+0x5e>
mov    0x10(%rsp),%rcx
movss  %xmm1,(%rcx)
mov    0x18(%rsp),%rcx
movss  %xmm0,(%rcx)
mov    0x20(%rsp),%rcx
mov    %al,(%rcx)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [105 x i8] c"\0AEnter today's high, low and condition (c = cloudy, s = sunny, p = precipitation) \0Aseparated by commas: \00"
@.str.1 = [13 x i8] c"%f, %f, %c%c\00"
define void @getDailyData(float* %0, float* %1, i8* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i8*
%7 = alloca float
%8 = alloca float
%9 = alloca i8
%10 = alloca i8
%11 = alloca i32
%12 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store i8* %2, i8** %6
store i32 0, i32* %11
br label %13
13: ; preds = %63, %3
%14 = load i32, i32* %11
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %64
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), float* %7, float* %8, i8* %9, i8* %10)
store i32 %18, i32* %12
%19 = load i32, i32* %12
%20 = icmp ne i32 %19, 4
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = call i32 (...) @error()
%23 = call i32 (...) @clear()
br label %63
24: ; preds = %16
%25 = load i8, i8* %10
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 10
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = call i32 (...) @error()
%30 = call i32 (...) @clear()
br label %62
31: ; preds = %24
%32 = load float, float* %8
%33 = load float, float* %7
%34 = fcmp ogt float %32, %33
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 (...) @error()
br label %61
37: ; preds = %31
%38 = load i8, i8* %9
%39 = sext i8 %38 to i32
%40 = icmp ne i32 %39, 99
br i1 %40, label %41, label %51
41: ; preds = %37
%42 = load i8, i8* %9
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %43, 115
br i1 %44, label %45, label %51
45: ; preds = %41
%46 = load i8, i8* %9
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 112
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = call i32 (...) @error()
br label %60
51: ; preds = %45, %41, %37
%52 = load float, float* %7
%53 = load float*, float** %4
store float %52, float* %53
%54 = load float, float* %8
%55 = load float*, float** %5
store float %54, float* %55
%56 = load i8, i8* %9
%57 = load i8*, i8** %6
store i8 %56, i8* %57
%58 = load i32, i32* %11
%59 = add nsw i32 %58, 1
store i32 %59, i32* %11
br label %60
60: ; preds = %51, %49
br label %61
61: ; preds = %60, %35
br label %62
62: ; preds = %61, %28
br label %63
63: ; preds = %62, %21
br label %13
64: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [105 x i8] c"\0AEnter today's high, low and condition (c = cloudy, s = sunny, p = precipitation) \0Aseparated by commas: \00"
@.str.1 = [13 x i8] c"%f, %f, %c%c\00"
define void @getDailyData(float* nocapture writeonly %0, float* nocapture writeonly %1, i8* nocapture writeonly %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i8
%7 = alloca i8
%8 = bitcast float* %4 to i8*
%9 = bitcast float* %5 to i8*
br label %10
10: ; preds = %23, %3
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), float* %4, float* %5, i8* %6, i8* %7)
%13 = icmp eq i32 %12, 4
br i1 %13, label %17, label %14
14: ; preds = %10
%15 = call i32 (...) @error()
%16 = call i32 (...) @clear()
br label %23
17: ; preds = %10
%18 = load i8, i8* %7
%19 = icmp eq i8 %18, 10
br i1 %19, label %24, label %20
20: ; preds = %17
%21 = call i32 (...) @error()
%22 = call i32 (...) @clear()
br label %23
23: ; preds = %20, %32, %28, %14
br label %10
24: ; preds = %17
%25 = load float, float* %5
%26 = load float, float* %4
%27 = fcmp ogt float %25, %26
br i1 %27, label %28, label %30
28: ; preds = %24
%29 = call i32 (...) @error()
br label %23
30: ; preds = %24
%31 = load i8, i8* %6
switch i8 %31, label %32 [
i8 115, label %34
i8 112, label %34
i8 99, label %34
]
32: ; preds = %30
%33 = call i32 (...) @error()
br label %23
34: ; preds = %30, %30, %30
store float %26, float* %0
store float %25, float* %1
store i8 %31, i8* %2
ret void
}