#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 */
typedef int /*<<< orphan*/ miles;
typedef int /*<<< orphan*/ kilometers;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
char getchar();
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float kilometers, miles;
  float *pmiles;
  float *k_adress;
  printf("Enter a value in miles %c ", 16);
  scanf("%f", &miles);
  while (getchar() != '\n')
    continue;
  puts("\n\n\t");
  kilometers = miles * 1.609344;
  printf("%.2f miles works out to %.2f kilometers.\n", miles, kilometers);
  puts("\n\n");
  pmiles = &miles;
  k_adress = &kilometers;
  printf("Variable 'miles' is %d bytes long at %p adress.\n", sizeof(miles),
         pmiles);
  printf("Variable 'kilometers' is %d bytes long at %p adress.",
         sizeof(kilometers), k_adress);
  getchar();
  exit(67890);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea2(%rip),%rdi
mov    $0x10,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     119a <main+0x4a>
jmp    1182 <main+0x32>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe49(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
cvttss2si -0xc(%rbp),%esi
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe51(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdx
lea    0xe50(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdx
lea    0xe6a(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x10932,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb0(%rip),%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    1180 <main+0x30>
lea    0xe94(%rip),%rdi
call   1030 <puts@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm1
mulsd  0xe58(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x4(%rsp)
cvttss2si %xmm0,%esi
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe66(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe82(%rip),%rdi
call   1030 <puts@plt>
lea    0xe79(%rip),%rdi
mov    %rsp,%rdx
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe94(%rip),%rdi
lea    0x4(%rsp),%rdx
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    $0x10932,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Enter a value in miles %c \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [4 x i8] c"\0A\0A\09\00"
@.str.3 = [42 x i8] c"%.2f miles works out to %.2f kilometers.\0A\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
@.str.5 = [49 x i8] c"Variable 'miles' is %d bytes long at %p adress.\0A\00"
@.str.6 = [53 x i8] c"Variable 'kilometers' is %d bytes long at %p adress.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float*
%5 = alloca float*
store i32 0, i32* %1
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 16)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
br label %8
8: ; preds = %12, %0
%9 = call signext i8 (...) @getchar()
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
%14 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%15 = load float, float* %3
%16 = fpext float %15 to double
%17 = fmul double %16, 0x3FF9BFDF7E8038A0
%18 = fptrunc double %17 to float
store float %18, float* %2
%19 = load float, float* %3
%20 = fptosi float %19 to i32
%21 = load float, float* %2
%22 = fpext float %21 to double
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %20, double %22)
%24 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store float* %3, float** %4
store float* %2, float** %5
%25 = load float*, float** %4
%26 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i32 4, float* %25)
%27 = load float*, float** %5
%28 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i32 4, float* %27)
%29 = call signext i8 (...) @getchar()
%30 = call i32 @exit(i32 67890)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter a value in miles %c \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [4 x i8] c"\0A\0A\09\00"
@.str.3 = [42 x i8] c"%.2f miles works out to %.2f kilometers.\0A\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
@.str.5 = [49 x i8] c"Variable 'miles' is %d bytes long at %p adress.\0A\00"
@.str.6 = [53 x i8] c"Variable 'kilometers' is %d bytes long at %p adress.\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 16)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
br label %7
7: ; preds = %7, %0
%8 = call signext i8 (...) @getchar()
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %7
10: ; preds = %7
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = fmul double %13, 0x3FF9BFDF7E8038A0
%15 = fptrunc double %14 to float
store float %15, float* %1
%16 = fptosi float %12 to i32
%17 = fpext float %15 to double
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %16, double %17)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i32 4, float* %2)
%21 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i32 4, float* %1)
%22 = call signext i8 (...) @getchar()
%23 = call i32 @exit(i32 67890)
unreachable
}