#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*/ celsiustofahr();
int /*<<< orphan*/ fahrtocelsius();
int getchar();
int /*<<< orphan*/ printf(char *);
int main(void) {
  int c;
  printf("Temperature Conversion Table\n");
  printf("1 - Fahrenheit to Celsius Conversion\n");
  printf("2 - Celsius to Fahrenheit Converion\n");
  printf("- Enter your Choice\n");
  c = getchar();
  if (c == '1')
    fahrtocelsius();
  else if (c == '2')
    celsiustofahr();
  else
    printf("Invalid Choice\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
lea    0xeef(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x31,-0x8(%rbp)
jne    119f <main+0x5f>
mov    $0x0,%al
call   1060 <fahrtocelsius@plt>
jmp    11c6 <main+0x86>
cmpl   $0x32,-0x8(%rbp)
jne    11b5 <main+0x75>
mov    $0x0,%al
call   1030 <celsiustofahr@plt>
jmp    11c1 <main+0x81>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
jmp    11c6 <main+0x86>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x32,%eax
je     118b <main+0x4b>
cmp    $0x31,%eax
jne    1194 <main+0x54>
xor    %eax,%eax
call   1060 <fahrtocelsius@plt>
jmp    11a0 <main+0x60>
xor    %eax,%eax
call   1040 <celsiustofahr@plt>
jmp    11a0 <main+0x60>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Temperature Conversion Table\0A\00"
@.str.1 = [38 x i8] c"1 - Fahrenheit to Celsius Conversion\0A\00"
@.str.2 = [37 x i8] c"2 - Celsius to Fahrenheit Converion\0A\00"
@.str.3 = [21 x i8] c"- Enter your Choice\0A\00"
@.str.4 = [16 x i8] c"Invalid Choice\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (...) @getchar()
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 49
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @fahrtocelsius()
br label %20
12: ; preds = %0
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 50
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (...) @celsiustofahr()
br label %19
17: ; preds = %12
%18 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
br label %20
20: ; preds = %19, %10
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"Temperature Conversion Table\00"
@str.5 = [37 x i8] c"1 - Fahrenheit to Celsius Conversion\00"
@str.6 = [36 x i8] c"2 - Celsius to Fahrenheit Converion\00"
@str.7 = [20 x i8] c"- Enter your Choice\00"
@str.8 = [15 x i8] c"Invalid Choice\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 (...) @getchar()
switch i32 %5, label %10 [
i32 49, label %6
i32 50, label %8
]
6: ; preds = %0
%7 = tail call i32 (...) @fahrtocelsius()
br label %12
8: ; preds = %0
%9 = tail call i32 (...) @celsiustofahr()
br label %12
10: ; preds = %0
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.8, i64 0, i64 0))
br label %12
12: ; preds = %8, %10, %6
ret i32 0
}