#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*/ Temperatures(double);
int /*<<< orphan*/ printf(char *);
int scanf(char *, double *);
int main(void) {
  double fah;
  int flag;
  printf("Enter a Fahrenheit temperature: ");
  flag = scanf("%lf", &fah);
  while (flag == 1) {
    Temperatures(fah);
    printf("Enter the next Fahrenheit temperature: ");
    flag = scanf("%lf", &fah);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1196 <main+0x66>
movsd  -0x10(%rbp),%xmm0
call   1050 <Temperatures@plt>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9c(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x14(%rbp)
jmp    115e <main+0x2e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1193 <main+0x63>
lea    0xec3(%rip),%r14
lea    0xeb8(%rip),%r15
lea    0x8(%rsp),%rbx
xchg   %ax,%ax
movsd  0x8(%rsp),%xmm0
call   1050 <Temperatures@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter a Fahrenheit temperature: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [40 x i8] c"Enter the next Fahrenheit temperature: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
store i32 %5, i32* %3
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load double, double* %2
%11 = call i32 @Temperatures(double %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
store i32 %13, i32* %3
br label %6
14: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter a Fahrenheit temperature: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [40 x i8] c"Enter the next Fahrenheit temperature: \00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = load double, double* %1
%8 = call i32 @Temperatures(double %7)
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%11 = icmp eq i32 %10, 1
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}