#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, float *);
int main(void) {
  float fahrenheit, celsius;
  printf("Enter Fahrenheit temperature: ");
  if (scanf("%f", &fahrenheit) == 1) {
    celsius = (fahrenheit - 32.0f) * (5.0f / 9.0f);
    printf("Celsius equivalent: %.1f\n", celsius);
  } else {
    printf("Invalid input\n");
    exit(EXIT_FAILURE);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11a4 <main+0x74>
movss  -0x8(%rbp),%xmm0
movss  0xe91(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe81(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe92(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11c0 <main+0x90>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1191 <main+0x51>
movss  0x4(%rsp),%xmm0
addss  0xe8d(%rip),%xmm0
mulss  0xe89(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea4(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Enter Fahrenheit temperature: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [26 x i8] c"Celsius equivalent: %.1f\0A\00"
@.str.3 = [15 x i8] c"Invalid input\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %14
7: ; preds = %0
%8 = load float, float* %2
%9 = fsub float %8, 3.200000e+01
%10 = fmul float %9, 0x3FE1C71C80000000
store float %10, float* %3
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %12)
br label %18
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Enter Fahrenheit temperature: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [26 x i8] c"Celsius equivalent: %.1f\0A\00"
@EXIT_FAILURE = global i32 0
@str = [14 x i8] c"Invalid input\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load float, float* %1
%8 = fadd float %7, -3.200000e+01
%9 = fmul float %8, 0x3FE1C71C80000000
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
12: ; preds = %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
}