#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 */
double atof(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  double deg_f, deg_c;
  if (argc < 2) {
    printf("Usage: ftoc temperature\n");
    exit(1);
  }
  deg_f = atof(argv[1]);
  deg_c = (5. / 9.) * (deg_f - 32.);
  printf("%f degrees Fahrenheit equals %f degrees Celsius\n", deg_f, deg_c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1168 <main+0x38>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  0xe81(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe6d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe7c(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1175 <main+0x35>
mov    0x8(%rsi),%rdi
call   1040 <atof@plt>
movsd  0xea9(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  0xea5(%rip),%xmm1
lea    0xea6(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: ftoc temperature\0A\00"
@.str.1 = [49 x i8] c"%f degrees Fahrenheit equals %f degrees Celsius\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call double @atof(i8* %16)
store double %17, double* %6
%18 = load double, double* %6
%19 = fsub double %18, 3.200000e+01
%20 = fmul double 0x3FE1C71C71C71C72, %19
store double %20, double* %7
%21 = load double, double* %6
%22 = load double, double* %7
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), double %21, double %22)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [49 x i8] c"%f degrees Fahrenheit equals %f degrees Celsius\0A\00"
@str = [24 x i8] c"Usage: ftoc temperature\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call double @atof(i8* %9)
%11 = fadd double %10, -3.200000e+01
%12 = fmul double %11, 0x3FE1C71C71C71C72
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), double %10, double %12)
ret i32 0
}