#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 */
float fromTo(char, char, float);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main(int argc, char *argv[]) {
  char in, out;
  float parIn;
  float parOut;
  printf("Ihre möglichen Temperatureinheiten: \n (C)elsius \n (D)elisle \n "
         "(F)ahrenheit \n (K)elvin \n (R)ankine \n");
  printf("Bitte geben Sie die Einheit der Temperatur ein: ");
  do {
    scanf("%c", &in);
  } while (getchar() != '\n');
  printf("Bitte geben Sie die gewünschte Einheit der Temperatur ein: ");
  do {
    scanf("%c", &out);
  } while (getchar() != '\n');
  printf("Bitte geben Sie die Temperatur ein: ");
  do {
    scanf("%f", &parIn);
  } while (getchar() != '\n');
  parOut = fromTo(in, out, parIn);
  printf("Die Temperatur lautet: %f %c. \n", parOut, out);
  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)
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
jne    1172 <main+0x32>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    -0x12(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
jne    11a5 <main+0x65>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
jne    11d8 <main+0x98>
mov    -0x11(%rbp),%cl
mov    -0x12(%rbp),%al
movss  -0x18(%rbp),%xmm0
movsbl %cl,%edi
movsbl %al,%esi
call   1050 <fromTo@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsbl -0x12(%rbp),%esi
lea    0xed2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf5e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebc(%rip),%r14
lea    0x3(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    1180 <main+0x30>
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe84(%rip),%r14
lea    0x2(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    11c0 <main+0x70>
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea9(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    1200 <main+0xb0>
movsbl 0x3(%rsp),%edi
movsbl 0x2(%rsp),%esi
movss  0x4(%rsp),%xmm0
call   1060 <fromTo@plt>
cvtss2sd %xmm0,%xmm0
movsbl 0x2(%rsp),%esi
lea    0xe5c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [101 x i8] c"Ihre m\C3\B6glichen Temperatureinheiten: \0A (C)elsius \0A (D)elisle \0A (F)ahrenheit \0A (K)elvin \0A (R)ankine \0A\00"
@.str.1 = [49 x i8] c"Bitte geben Sie die Einheit der Temperatur ein: \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [61 x i8] c"Bitte geben Sie die gew\C3\BCnschte Einheit der Temperatur ein: \00"
@.str.4 = [37 x i8] c"Bitte geben Sie die Temperatur ein: \00"
@.str.5 = [3 x i8] c"%f\00"
@.str.6 = [32 x i8] c"Die Temperatur lautet: %f %c. \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8
%8 = alloca float
%9 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %14, %2
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %14
14: ; preds = %12
%15 = call signext i8 (...) @getchar()
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 10
br i1 %17, label %12, label %18
18: ; preds = %14
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %22, %18
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %7)
br label %22
22: ; preds = %20
%23 = call signext i8 (...) @getchar()
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 10
br i1 %25, label %20, label %26
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
br label %28
28: ; preds = %30, %26
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %8)
br label %30
30: ; preds = %28
%31 = call signext i8 (...) @getchar()
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 10
br i1 %33, label %28, label %34
34: ; preds = %30
%35 = load i8, i8* %6
%36 = load i8, i8* %7
%37 = load float, float* %8
%38 = call float @fromTo(i8 signext %35, i8 signext %36, float %37)
store float %38, float* %9
%39 = load float, float* %9
%40 = fpext float %39 to double
%41 = load i8, i8* %7
%42 = sext i8 %41 to i32
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), double %40, i32 %42)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [49 x i8] c"Bitte geben Sie die Einheit der Temperatur ein: \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [61 x i8] c"Bitte geben Sie die gew\C3\BCnschte Einheit der Temperatur ein: \00"
@.str.4 = [37 x i8] c"Bitte geben Sie die Temperatur ein: \00"
@.str.5 = [3 x i8] c"%f\00"
@.str.6 = [32 x i8] c"Die Temperatur lautet: %f %c. \0A\00"
@str = [100 x i8] c"Ihre m\C3\B6glichen Temperatureinheiten: \0A (C)elsius \0A (D)elisle \0A (F)ahrenheit \0A (K)elvin \0A (R)ankine \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca float
%6 = bitcast float* %5 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %9, %2
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%11 = call signext i8 (...) @getchar()
%12 = icmp eq i8 %11, 10
br i1 %12, label %13, label %9
13: ; preds = %9
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %15, %13
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%17 = call signext i8 (...) @getchar()
%18 = icmp eq i8 %17, 10
br i1 %18, label %19, label %15
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
br label %21
21: ; preds = %21, %19
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %5)
%23 = call signext i8 (...) @getchar()
%24 = icmp eq i8 %23, 10
br i1 %24, label %25, label %21
25: ; preds = %21
%26 = load i8, i8* %3
%27 = load i8, i8* %4
%28 = load float, float* %5
%29 = call float @fromTo(i8 signext %26, i8 signext %27, float %28)
%30 = fpext float %29 to double
%31 = load i8, i8* %4
%32 = sext i8 %31 to i32
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), double %30, i32 %32)
ret i32 0
}