#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*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, float);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, float *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int /*<<< orphan*/ system(char *);
int main() {
  system("clear");
  float kur;
  printf("USD-TL kur giriniz: 1 USD = ");
  scanf("%f", &kur);
  FILE *dosya_usd;
  FILE *dosya_tl;
  if ((dosya_usd = fopen("/home/delta/my_sandbox/USD.txt", "r")) == NULL) {
    printf("dosya acilamadi!");
    exit(1);
  }
  if ((dosya_tl = fopen("/home/delta/my_sandbox/TL.txt", "w")) == NULL) {
    printf("dosya acilamadi!");
    exit(1);
  }
  float usd;
  printf("USD.txt > TL.txt\n");
  while (fscanf(dosya_usd, "%f", &usd) != EOF) {
    fprintf(dosya_tl, "%.2f\n", usd * kur);
  }
  printf("cevirme islemi tamamlandi.\n\n");
  fclose(dosya_usd);
  fclose(dosya_tl);
  int i;
  float tl;
  for (i = 0; i < 20; i++) {
    printf("-");
  }
  printf("\n");
  if ((dosya_tl = fopen("/home/delta/my_sandbox/TL.txt", "r")) == NULL) {
    printf("dosya acilamadi!");
    exit(1);
  }
  while (fscanf(dosya_tl, "%f", &tl) != EOF) {
    printf("%.2f\n", tl);
  }
  fclose(dosya_tl);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe6a(%rip),%rdi
call   1040 <system@plt>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe73(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1080 <scanf@plt>
lea    0xe66(%rip),%rdi
lea    0xe3d(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    11f2 <main+0x72>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
lea    0xe5d(%rip),%rdi
lea    0xe74(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    122b <main+0xab>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xddf(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1060 <fscanf@plt>
mov    0x2d94(%rip),%rcx
cmp    (%rcx),%rax
je     127c <main+0xfc>
mov    -0x18(%rbp),%rdi
movss  -0x1c(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
lea    0xe16(%rip),%rsi
call   1070 <fprintf@plt>
jmp    1239 <main+0xb9>
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x14,-0x20(%rbp)
jge    12c9 <main+0x149>
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12a3 <main+0x123>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd78(%rip),%rdi
lea    0xd1f(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1310 <main+0x190>
lea    0xd46(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    1315 <main+0x195>
mov    -0x18(%rbp),%rdi
lea    0xd03(%rip),%rsi
lea    -0x24(%rbp),%rdx
call   1060 <fscanf@plt>
mov    0x2cb8(%rip),%rcx
cmp    (%rcx),%rax
je     1355 <main+0x1d5>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd3f(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    1315 <main+0x195>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe4b(%rip),%rdi
call   1060 <system@plt>
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe54(%rip),%rdi
lea    0x14(%rsp),%rsi
call   10a0 <scanf@plt>
lea    0xe46(%rip),%rdi
lea    0xe1d(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1411 <main+0x271>
mov    %rax,%r14
lea    0xe57(%rip),%rdi
lea    0xe6e(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1411 <main+0x271>
mov    %rax,%rbx
lea    0xe5e(%rip),%rdi
call   1040 <puts@plt>
lea    0xdf9(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %r14,%rdi
call   1080 <fscanf@plt>
mov    0x2daa(%rip),%rbp
cmp    0x0(%rbp),%rax
je     128b <main+0xeb>
lea    0xe2b(%rip),%r15
lea    0xdd1(%rip),%r12
lea    0x10(%rsp),%r13
nopw   0x0(%rax,%rax,1)
movss  0x10(%rsp),%xmm0
mulss  0x14(%rsp),%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
call   1090 <fprintf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1080 <fscanf@plt>
cmp    0x0(%rbp),%rax
jne    1260 <main+0xc0>
lea    0xdfb(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcd6(%rip),%rdi
lea    0xc7d(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1411 <main+0x271>
mov    %rax,%rbx
lea    0xc84(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1080 <fscanf@plt>
cmp    0x0(%rbp),%rax
je     13f8 <main+0x258>
lea    0xcbd(%rip),%r14
lea    0xc63(%rip),%r15
lea    0xc(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nop
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1080 <fscanf@plt>
cmp    0x0(%rbp),%rax
jne    13d0 <main+0x230>
mov    %rbx,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc2d(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [29 x i8] c"USD-TL kur giriniz: 1 USD = \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [31 x i8] c"/home/delta/my_sandbox/USD.txt\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [17 x i8] c"dosya acilamadi!\00"
@.str.6 = [30 x i8] c"/home/delta/my_sandbox/TL.txt\00"
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [18 x i8] c"USD.txt > TL.txt\0A\00"
@EOF = global i64 0
@.str.9 = [6 x i8] c"%.2f\0A\00"
@.str.10 = [29 x i8] c"cevirme islemi tamamlandi.\0A\0A\00"
@.str.11 = [2 x i8] c"-\00"
@.str.12 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca float
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%11 = call i32* @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %11, i32** %3
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %0
%17 = call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %17, i32** %4
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %16
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
br label %24
24: ; preds = %29, %22
%25 = load i32*, i32** %3
%26 = call i64 @fscanf(i32* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %5)
%27 = load i64, i64* @EOF
%28 = icmp ne i64 %26, %27
br i1 %28, label %29, label %35
29: ; preds = %24
%30 = load i32*, i32** %4
%31 = load float, float* %5
%32 = load float, float* %2
%33 = fmul float %31, %32
%34 = call i32 @fprintf(i32* %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), float %33)
br label %24
35: ; preds = %24
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%37 = load i32*, i32** %3
%38 = call i32 @fclose(i32* %37)
%39 = load i32*, i32** %4
%40 = call i32 @fclose(i32* %39)
store i32 0, i32* %6
br label %41
41: ; preds = %46, %35
%42 = load i32, i32* %6
%43 = icmp slt i32 %42, 20
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %46
46: ; preds = %44
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
br label %41
49: ; preds = %41
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%51 = call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %51, i32** %4
%52 = icmp eq i32* %51, null
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%55 = call i32 @exit(i32 1)
unreachable
56: ; preds = %49
br label %57
57: ; preds = %62, %56
%58 = load i32*, i32** %4
%59 = call i64 @fscanf(i32* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %7)
%60 = load i64, i64* @EOF
%61 = icmp ne i64 %59, %60
br i1 %61, label %62, label %66
62: ; preds = %57
%63 = load float, float* %7
%64 = fpext float %63 to double
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), double %64)
br label %57
66: ; preds = %57
%67 = load i32*, i32** %4
%68 = call i32 @fclose(i32* %67)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [29 x i8] c"USD-TL kur giriniz: 1 USD = \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [31 x i8] c"/home/delta/my_sandbox/USD.txt\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [17 x i8] c"dosya acilamadi!\00"
@.str.6 = [30 x i8] c"/home/delta/my_sandbox/TL.txt\00"
@.str.7 = [2 x i8] c"w\00"
@EOF = global i64 0
@.str.9 = [6 x i8] c"%.2f\0A\00"
@str = [17 x i8] c"USD.txt > TL.txt\00"
@str.13 = [28 x i8] c"cevirme islemi tamamlandi.\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = bitcast float* %1 to i8*
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%8 = call i32* @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %0
%14 = call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %13
%20 = bitcast float* %2 to i8*
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%22 = call i64 @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%23 = load i64, i64* @EOF
%24 = icmp eq i64 %22, %23
br i1 %24, label %33, label %25
25: ; preds = %19, %25
%26 = load float, float* %2
%27 = load float, float* %1
%28 = fmul float %26, %27
%29 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), float %28)
%30 = call i64 @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%31 = load i64, i64* @EOF
%32 = icmp eq i64 %30, %31
br i1 %32, label %33, label %25
33: ; preds = %25, %19
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.13, i64 0, i64 0))
%35 = call i32 @fclose(i32* %8)
%36 = call i32 @fclose(i32* %14)
%37 = bitcast float* %3 to i8*
%38 = call i32 @putchar(i32 45)
%39 = call i32 @putchar(i32 45)
%40 = call i32 @putchar(i32 45)
%41 = call i32 @putchar(i32 45)
%42 = call i32 @putchar(i32 45)
%43 = call i32 @putchar(i32 45)
%44 = call i32 @putchar(i32 45)
%45 = call i32 @putchar(i32 45)
%46 = call i32 @putchar(i32 45)
%47 = call i32 @putchar(i32 45)
%48 = call i32 @putchar(i32 45)
%49 = call i32 @putchar(i32 45)
%50 = call i32 @putchar(i32 45)
%51 = call i32 @putchar(i32 45)
%52 = call i32 @putchar(i32 45)
%53 = call i32 @putchar(i32 45)
%54 = call i32 @putchar(i32 45)
%55 = call i32 @putchar(i32 45)
%56 = call i32 @putchar(i32 45)
%57 = call i32 @putchar(i32 45)
%58 = call i32 @putchar(i32 10)
%59 = call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%60 = icmp eq i32* %59, null
br i1 %60, label %65, label %61
61: ; preds = %33
%62 = call i64 @fscanf(i32* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%63 = load i64, i64* @EOF
%64 = icmp eq i64 %62, %63
br i1 %64, label %75, label %68
65: ; preds = %33
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%67 = call i32 @exit(i32 1)
unreachable
68: ; preds = %61, %68
%69 = load float, float* %3
%70 = fpext float %69 to double
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), double %70)
%72 = call i64 @fscanf(i32* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%73 = load i64, i64* @EOF
%74 = icmp eq i64 %72, %73
br i1 %74, label %75, label %68
75: ; preds = %68, %61
%76 = call i32 @fclose(i32* %59)
ret i32 0
}