#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 calisma_saati;
  float saatlik_ucret, maas, i;
  printf("Cikmak icin -1 giriniz.\n");
  printf("Calisma saatini giriniz:");
  scanf("%d", &calisma_saati);
  while (calisma_saati != -1) {
    printf("Calisanin saat ucretini giriniz:(00.00) ");
    scanf("%f", &saatlik_ucret);
    if (calisma_saati <= 40) {
      maas = calisma_saati * saatlik_ucret;
    } else {
      i = (calisma_saati - 40) * saatlik_ucret * 1.5;
      maas = (saatlik_ucret * 40) + i;
    }
    printf("Calisanin maasi:%.3f Tl dir\n", maas);
    printf("Calisma saatini giriniz:");
    scanf("%d", &calisma_saati);
  }
  if (calisma_saati == -1) {
    printf("Programdan cikilmistir.");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
je     1228 <main+0x108>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x28,-0x8(%rbp)
jg     11a5 <main+0x85>
cvtsi2ssl -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11ec <main+0xcc>
mov    -0x8(%rbp),%eax
sub    $0x28,%eax
cvtsi2ss %eax,%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe48(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  0xe21(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe75(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe2a(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    115d <main+0x3d>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1240 <main+0x120>
lea    0xe55(%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
push   %rax
lea    0xf43(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0xffffffff,(%rsp)
je     1225 <main+0xf5>
lea    0xed6(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xecd(%rip),%r13
lea    0xe7e(%rip),%rbx
lea    0xe90(%rip),%rbp
mov    %rsp,%r14
jmp    11f3 <main+0xc3>
cs nopw 0x0(%rax,%rax,1)
add    $0xffffffd8,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  0x4(%rsp),%xmm0
mulss  %xmm0,%xmm1
mulss  0xe44(%rip),%xmm1
mulss  0xe40(%rip),%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%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     1225 <main+0xf5>
lea    0xe2a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    (%rsp),%eax
cmp    $0x28,%eax
jg     11a0 <main+0x70>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x4(%rsp),%xmm0
jmp    11c8 <main+0x98>
lea    0xe41(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Cikmak icin -1 giriniz.\0A\00"
@.str.1 = [25 x i8] c"Calisma saatini giriniz:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [41 x i8] c"Calisanin saat ucretini giriniz:(00.00) \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [29 x i8] c"Calisanin maasi:%.3f Tl dir\0A\00"
@.str.6 = [24 x i8] c"Programdan cikilmistir.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
br label %9
9: ; preds = %34, %0
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, -1
br i1 %11, label %12, label %40
12: ; preds = %9
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 40
br i1 %16, label %17, label %22
17: ; preds = %12
%18 = load i32, i32* %2
%19 = sitofp i32 %18 to float
%20 = load float, float* %3
%21 = fmul float %19, %20
store float %21, float* %4
br label %34
22: ; preds = %12
%23 = load i32, i32* %2
%24 = sub nsw i32 %23, 40
%25 = sitofp i32 %24 to float
%26 = load float, float* %3
%27 = fmul float %25, %26
%28 = fpext float %27 to double
%29 = fmul double %28, 1.500000e+00
%30 = fptrunc double %29 to float
store float %30, float* %5
%31 = load float, float* %3
%32 = load float, float* %5
%33 = call float @llvm.fmuladd.f32(float %31, float 4.000000e+01, float %32)
store float %33, float* %4
br label %34
34: ; preds = %22, %17
%35 = load float, float* %4
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), double %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%39 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
br label %9
40: ; preds = %9
%41 = load i32, i32* %2
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %45
45: ; preds = %43, %40
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"Calisma saatini giriniz:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [41 x i8] c"Calisanin saat ucretini giriniz:(00.00) \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [29 x i8] c"Calisanin maasi:%.3f Tl dir\0A\00"
@.str.6 = [24 x i8] c"Programdan cikilmistir.\00"
@str = [24 x i8] c"Cikmak icin -1 giriniz.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, -1
br i1 %9, label %34, label %10
10: ; preds = %0, %26
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %2)
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 41
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = sitofp i32 %13 to float
%17 = load float, float* %2
%18 = fmul float %17, %16
br label %26
19: ; preds = %10
%20 = add nsw i32 %13, -40
%21 = sitofp i32 %20 to float
%22 = load float, float* %2
%23 = fmul float %22, %21
%24 = fmul float %23, 1.500000e+00
%25 = call float @llvm.fmuladd.f32(float %22, float 4.000000e+01, float %24)
br label %26
26: ; preds = %19, %15
%27 = phi float [ %18, %15 ], [ %25, %19 ]
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), double %28)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%32 = load i32, i32* %1
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %10
34: ; preds = %26, %0
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}