#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
double toCelc(float);
double toFaren(float);
int main(void) {
  float deg = 0.0f;
  printf("Wyścietlanie zmiennych %d-calkowite -%fzmienno przecinkowe\n", 1,
         1.0f);
  printf("Konwerter Farenheit ne Celcjusz\nPodaj stopnie:");
  scanf("%f", &deg);
  printf("%fF -> %fC", deg, toCelc(deg));
  printf("Konwerter Celcjiusz na Farenheit\nPodaj stopnie:");
  scanf("%f", &deg);
  printf("%fC -> %fF", deg, toFaren(deg));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x1,%esi
movsd  0xe95(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeed(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <toCelc@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
lea    0xec0(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <toFaren@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
lea    0xeaf(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
lea    0xeb2(%rip),%rdi
movsd  0xea2(%rip),%xmm0
mov    $0x1,%esi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef5(%rip),%rbx
lea    0xc(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
call   1030 <toCelc@plt>
movaps %xmm0,%xmm1
lea    0xec9(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
call   1050 <toFaren@plt>
movaps %xmm0,%xmm1
lea    0xebc(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [61 x i8] c"Wy\C5\9Bcietlanie zmiennych %d-calkowite -%fzmienno przecinkowe\0A\00"
@.str.1 = [47 x i8] c"Konwerter Farenheit ne Celcjusz\0APodaj stopnie:\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [11 x i8] c"%fF -> %fC\00"
@.str.4 = [48 x i8] c"Konwerter Celcjiusz na Farenheit\0APodaj stopnie:\00"
@.str.5 = [11 x i8] c"%fC -> %fF\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 1, double 1.000000e+00)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = load float, float* %2
%9 = call double @toCelc(float %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %7, double %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%13 = load float, float* %2
%14 = fpext float %13 to double
%15 = load float, float* %2
%16 = call double @toFaren(float %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), double %14, double %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [61 x i8] c"Wy\C5\9Bcietlanie zmiennych %d-calkowite -%fzmienno przecinkowe\0A\00"
@.str.1 = [47 x i8] c"Konwerter Farenheit ne Celcjusz\0APodaj stopnie:\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [11 x i8] c"%fF -> %fC\00"
@.str.4 = [48 x i8] c"Konwerter Celcjiusz na Farenheit\0APodaj stopnie:\00"
@.str.5 = [11 x i8] c"%fC -> %fF\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 1, double 1.000000e+00)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = call double @toCelc(float %6)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %7, double %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%12 = load float, float* %1
%13 = fpext float %12 to double
%14 = call double @toFaren(float %12)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), double %13, double %14)
ret i32 0
}