#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 uzaklik_hesapla(float, float, float, float);
int main() {
  char devam_edilme_durumu = 'e';
  while (devam_edilme_durumu != 'h') {
    float x1_noktasi;
    printf("x1 noktasini giriniz: ");
    scanf("%f", &x1_noktasi);
    float y1_noktasi;
    printf("y1 noktasini giriniz: ");
    scanf("%f", &y1_noktasi);
    float x2_noktasi;
    printf("x2 noktasini giriniz: ");
    scanf("%f", &x2_noktasi);
    float y2_noktasi;
    printf("y2 noktasini giriniz: ");
    scanf("%f", &y2_noktasi);
    float uzaklik;
    uzaklik = uzaklik_hesapla(x1_noktasi, x2_noktasi, y1_noktasi, y2_noktasi);
    printf("Iki nokta arasindaki uzaklik %.2f\n", uzaklik);
    printf("Baska uzaklik hesaplamak istiyormusunuz(e veya h): ");
    scanf(" %c", &devam_edilme_durumu);
  }
  printf("Programdan ciktiniz :)");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x65,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x68,%eax
je     122a <main+0xfa>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe72(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe52(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
call   1050 <uzaklik_hesapla@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe61(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9c(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    1143 <main+0x13>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movb   $0x65,0x7(%rsp)
lea    0xecd(%rip),%rbx
lea    0x8(%rsp),%r12
lea    0xf09(%rip),%r13
lea    0xf25(%rip),%rbp
lea    0xf52(%rip),%r14
lea    0x7(%rsp),%r15
nopl   0x0(%rax)
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe86(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe80(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe7a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
movss  0x10(%rsp),%xmm2
movss  0x8(%rsp),%xmm3
call   1050 <uzaklik_hesapla@plt>
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpb   $0x68,0x7(%rsp)
jne    1170 <main+0x40>
lea    0xe84(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"x1 noktasini giriniz: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [23 x i8] c"y1 noktasini giriniz: \00"
@.str.3 = [23 x i8] c"x2 noktasini giriniz: \00"
@.str.4 = [23 x i8] c"y2 noktasini giriniz: \00"
@.str.5 = [35 x i8] c"Iki nokta arasindaki uzaklik %.2f\0A\00"
@.str.6 = [52 x i8] c"Baska uzaklik hesaplamak istiyormusunuz(e veya h): \00"
@.str.7 = [4 x i8] c" %c\00"
@.str.8 = [23 x i8] c"Programdan ciktiniz :)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store i8 101, i8* %2
br label %8
8: ; preds = %12, %0
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 104
br i1 %11, label %12, label %31
12: ; preds = %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
%21 = load float, float* %3
%22 = load float, float* %5
%23 = load float, float* %4
%24 = load float, float* %6
%25 = call float @uzaklik_hesapla(float %21, float %22, float %23, float %24)
store float %25, float* %7
%26 = load float, float* %7
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), double %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0))
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %2)
br label %8
31: ; preds = %8
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"x1 noktasini giriniz: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [23 x i8] c"y1 noktasini giriniz: \00"
@.str.3 = [23 x i8] c"x2 noktasini giriniz: \00"
@.str.4 = [23 x i8] c"y2 noktasini giriniz: \00"
@.str.5 = [35 x i8] c"Iki nokta arasindaki uzaklik %.2f\0A\00"
@.str.6 = [52 x i8] c"Baska uzaklik hesaplamak istiyormusunuz(e veya h): \00"
@.str.7 = [4 x i8] c" %c\00"
@.str.8 = [23 x i8] c"Programdan ciktiniz :)\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i8 101, i8* %1
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = bitcast float* %5 to i8*
br label %10
10: ; preds = %0, %10
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%19 = load float, float* %2
%20 = load float, float* %4
%21 = load float, float* %3
%22 = load float, float* %5
%23 = call float @uzaklik_hesapla(float %19, float %20, float %21, float %22)
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), double %24)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0))
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %1)
%28 = load i8, i8* %1
%29 = icmp eq i8 %28, 104
br i1 %29, label %30, label %10
30: ; preds = %10
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}