#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 get_temprature(int *, int *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int high[3] = {0x00};
  int low[3] = {0x00};
  int i = 0;
  while (i < 3) {
    printf("Enter the Temprature for day 1: ");
    if (get_temprature(&high[i], &low[i]) != -1) {
      i++;
    } else {
      printf("Try again");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1c(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1050 <memset@plt>
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1050 <memset@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jge    11ce <main+0x9e>
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
movslq -0x2c(%rbp),%rax
lea    -0x1c(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
movslq -0x2c(%rbp),%rax
lea    -0x28(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
call   1030 <get_temprature@plt>
cmp    $0xffffffff,%eax
je     11bd <main+0x8d>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11c9 <main+0x99>
lea    0xe5d(%rip),%rdi
call   1040 <printf@plt>
jmp    116d <main+0x3d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
movl   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
movl   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
xor    %ebp,%ebp
lea    0xeae(%rip),%rbx
lea    0xec8(%rip),%r14
jmp    116d <main+0x4d>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printf@plt>
cmp    $0x3,%ebp
jge    1196 <main+0x76>
mov    %rbx,%rdi
call   1040 <printf@plt>
movslq %ebp,%rax
lea    (%rsp,%rax,4),%rdi
add    $0x10,%rdi
lea    (%rsp,%rax,4),%rsi
call   1030 <get_temprature@plt>
cmp    $0xffffffff,%eax
je     1160 <main+0x40>
add    $0x1,%ebp
cmp    $0x3,%ebp
jl     116d <main+0x4d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter the Temprature for day 1: \00"
@.str.1 = [10 x i8] c"Try again\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i32]
%7 = alloca [3 x i32]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [3 x i32]* %6 to i8*
%10 = bitcast [3 x i32]* %7 to i8*
store i32 0, i32* %8
br label %11
11: ; preds = %29, %2
%12 = load i32, i32* %8
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %30
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 %17
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 %20
%22 = call i32 @get_temprature(i32* %18, i32* %21)
%23 = icmp ne i32 %22, -1
br i1 %23, label %24, label %27
24: ; preds = %14
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %29
27: ; preds = %14
%28 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %29
29: ; preds = %27, %24
br label %11
30: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter the Temprature for day 1: \00"
@.str.1 = [10 x i8] c"Try again\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = alloca [3 x i32]
%5 = bitcast [3 x i32]* %3 to i8*
%6 = bitcast [3 x i32]* %4 to i8*
br label %7
7: ; preds = %2, %19
%8 = phi i32 [ 0, %2 ], [ %20, %19 ]
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 %10
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 %10
%13 = call i32 @get_temprature(i32* %11, i32* %12)
%14 = icmp eq i32 %13, -1
br i1 %14, label %17, label %15
15: ; preds = %7
%16 = add nsw i32 %8, 1
br label %19
17: ; preds = %7
%18 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
%20 = phi i32 [ %16, %15 ], [ %8, %17 ]
%21 = icmp slt i32 %20, 3
br i1 %21, label %7, label %22
22: ; preds = %19
ret i32 0
}