#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 *, ...);
int main() {
  int hesap_numarasi;
  float yeni_bakiye, ilk_bakiye, musterinin_harcamasi, aktarilan_kredi,
      kredi_limiti, bakiye = 0;
  printf("Cikis icin -1 giriniz.\n");
  printf("Hesap numarasini girin:");
  scanf("%d", &hesap_numarasi);
  while (hesap_numarasi != -1) {
    printf("Ilk bakiyeyi giriniz:");
    scanf("%f", &ilk_bakiye);
    printf("Toplam harcamalari giriniz:");
    scanf("%f", &musterinin_harcamasi);
    printf("Toplam kredileri girin:");
    scanf("%f", &aktarilan_kredi);
    printf("Kredi limitini giriniz:");
    scanf("%f", &kredi_limiti);
    yeni_bakiye = musterinin_harcamasi + ilk_bakiye - aktarilan_kredi;
    if (yeni_bakiye > kredi_limiti) {
      bakiye = ilk_bakiye + aktarilan_kredi;
      printf("Hesap numarasi:%d\n", hesap_numarasi);
      printf("Kredi limiti:%.2f\n", kredi_limiti);
      printf("Bakiye:%.2f\n", bakiye);
      printf("Kredi limiti asildi.\n");
    }
    printf("Hesap numarasini girin:");
    scanf("%d", &hesap_numarasi);
  }
  if (hesap_numarasi == -1) {
    printf("Program sonlandirilmistir.");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
je     1293 <main+0x173>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe85(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe65(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x14(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    126e <main+0x14e>
movss  -0x10(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe69(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe65(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdad(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    1165 <main+0x45>
cmpl   $0xffffffff,-0x8(%rbp)
jne    12ab <main+0x18b>
lea    0xe3d(%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
lea    0xf89(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0xffffffff,(%rsp)
je     12b0 <main+0x180>
lea    0xeb7(%rip),%rbx
lea    0xee7(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xe73(%rip),%r13
lea    0xe84(%rip),%rbp
mov    %rsp,%r14
jmp    11c1 <main+0x91>
nopl   0x0(%rax)
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0xffffffff,(%rsp)
je     12b0 <main+0x180>
lea    0xe53(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe4f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe4e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm2
movss  0x10(%rsp),%xmm1
addss  %xmm2,%xmm1
movss  0xc(%rsp),%xmm0
subss  %xmm0,%xmm1
ucomiss 0x4(%rsp),%xmm1
jbe    11a0 <main+0x70>
addss  %xmm0,%xmm2
movss  %xmm2,0x8(%rsp)
mov    (%rsp),%esi
lea    0xe18(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe13(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe0e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe3f(%rip),%rdi
call   1030 <puts@plt>
jmp    11a0 <main+0x70>
lea    0xdfc(%rip),%rdi
xor    %eax,%eax
call   1040 <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 = [24 x i8] c"Cikis icin -1 giriniz.\0A\00"
@.str.1 = [24 x i8] c"Hesap numarasini girin:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [22 x i8] c"Ilk bakiyeyi giriniz:\00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [28 x i8] c"Toplam harcamalari giriniz:\00"
@.str.6 = [24 x i8] c"Toplam kredileri girin:\00"
@.str.7 = [24 x i8] c"Kredi limitini giriniz:\00"
@.str.8 = [19 x i8] c"Hesap numarasi:%d\0A\00"
@.str.9 = [19 x i8] c"Kredi limiti:%.2f\0A\00"
@.str.10 = [13 x i8] c"Bakiye:%.2f\0A\00"
@.str.11 = [22 x i8] c"Kredi limiti asildi.\0A\00"
@.str.12 = [27 x i8] c"Program sonlandirilmistir.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
br label %12
12: ; preds = %45, %0
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %48
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %4)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %5)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %6)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %7)
%24 = load float, float* %5
%25 = load float, float* %4
%26 = fadd float %24, %25
%27 = load float, float* %6
%28 = fsub float %26, %27
store float %28, float* %3
%29 = load float, float* %3
%30 = load float, float* %7
%31 = fcmp ogt float %29, %30
br i1 %31, label %32, label %45
32: ; preds = %15
%33 = load float, float* %4
%34 = load float, float* %6
%35 = fadd float %33, %34
store float %35, float* %8
%36 = load i32, i32* %2
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %36)
%38 = load float, float* %7
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), double %39)
%41 = load float, float* %8
%42 = fpext float %41 to double
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), double %42)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0))
br label %45
45: ; preds = %32, %15
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%47 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
br label %12
48: ; preds = %12
%49 = load i32, i32* %2
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
br label %53
53: ; preds = %51, %48
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"Hesap numarasini girin:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [22 x i8] c"Ilk bakiyeyi giriniz:\00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [28 x i8] c"Toplam harcamalari giriniz:\00"
@.str.6 = [24 x i8] c"Toplam kredileri girin:\00"
@.str.7 = [24 x i8] c"Kredi limitini giriniz:\00"
@.str.8 = [19 x i8] c"Hesap numarasi:%d\0A\00"
@.str.9 = [19 x i8] c"Kredi limiti:%.2f\0A\00"
@.str.10 = [13 x i8] c"Bakiye:%.2f\0A\00"
@.str.12 = [27 x i8] c"Program sonlandirilmistir.\00"
@str = [23 x i8] c"Cikis icin -1 giriniz.\00"
@str.13 = [21 x i8] c"Kredi limiti asildi.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = bitcast i32* %1 to i8*
%7 = bitcast float* %2 to i8*
%8 = bitcast float* %3 to i8*
%9 = bitcast float* %4 to i8*
%10 = bitcast float* %5 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, -1
br i1 %15, label %47, label %16
16: ; preds = %0, %42
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %2)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %4)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %5)
%25 = load float, float* %3
%26 = load float, float* %2
%27 = fadd float %25, %26
%28 = load float, float* %4
%29 = fsub float %27, %28
%30 = load float, float* %5
%31 = fcmp ogt float %29, %30
br i1 %31, label %32, label %42
32: ; preds = %16
%33 = fadd float %26, %28
%34 = load i32, i32* %1
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %34)
%36 = load float, float* %5
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), double %37)
%39 = fpext float %33 to double
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), double %39)
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.13, i64 0, i64 0))
br label %42
42: ; preds = %32, %16
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%44 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%45 = load i32, i32* %1
%46 = icmp eq i32 %45, -1
br i1 %46, label %47, label %16
47: ; preds = %42, %0
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
ret i32 0
}