#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*/ celsius_to_fahrenheit();
int /*<<< orphan*/ fahrenheit_to_celsius();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  printf("1-Celsius'tan Fahrenheit'a ceviri\n");
  printf("2-Fahrenheit'tan Celsius'a ceviri\n");
  int numara;
  printf("Hangi ceviriciyi kullanmak istiyorsaniz numarasini giriniz: ");
  scanf("%d", &numara);
  switch (numara) {
  case 1: {
    celsius_to_fahrenheit();
    break;
  }
  case 2: {
    fahrenheit_to_celsius();
    break;
  }
  default: {
    break;
  }
  }
  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    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xf09(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11a8 <main+0x68>
jmp    1197 <main+0x57>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11b4 <main+0x74>
jmp    11c0 <main+0x80>
mov    $0x0,%al
call   1030 <celsius_to_fahrenheit@plt>
jmp    11c5 <main+0x85>
mov    $0x0,%al
call   1050 <fahrenheit_to_celsius@plt>
jmp    11c5 <main+0x85>
jmp    11c5 <main+0x85>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
call   1050 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     119d <main+0x4d>
cmp    $0x1,%eax
jne    11a4 <main+0x54>
xor    %eax,%eax
call   1040 <celsius_to_fahrenheit@plt>
jmp    11a4 <main+0x54>
xor    %eax,%eax
call   1060 <fahrenheit_to_celsius@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"1-Celsius'tan Fahrenheit'a ceviri\0A\00"
@.str.1 = [35 x i8] c"2-Fahrenheit'tan Celsius'a ceviri\0A\00"
@.str.2 = [61 x i8] c"Hangi ceviriciyi kullanmak istiyorsaniz numarasini giriniz: \00"
@.str.3 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
switch i32 %7, label %12 [
i32 1, label %8
i32 2, label %10
]
8: ; preds = %0
%9 = call i32 (...) @celsius_to_fahrenheit()
br label %13
10: ; preds = %0
%11 = call i32 (...) @fahrenheit_to_celsius()
br label %13
12: ; preds = %0
br label %13
13: ; preds = %12, %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [61 x i8] c"Hangi ceviriciyi kullanmak istiyorsaniz numarasini giriniz: \00"
@.str.3 = [3 x i8] c"%d\00"
@str = [34 x i8] c"1-Celsius'tan Fahrenheit'a ceviri\00"
@str.4 = [34 x i8] c"2-Fahrenheit'tan Celsius'a ceviri\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
switch i32 %7, label %12 [
i32 1, label %8
i32 2, label %10
]
8: ; preds = %0
%9 = call i32 (...) @celsius_to_fahrenheit()
br label %12
10: ; preds = %0
%11 = call i32 (...) @fahrenheit_to_celsius()
br label %12
12: ; preds = %0, %10, %8
ret i32 0
}