#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*/ getch();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  float a;
  float b;
  float c;
  int secim;
  scanf("%d", &a);
  scanf("%d", &b);
  printf("ne yapayim sahip ?\n");
  printf("toplama icin 1\n");
  printf("cikarma icin 2\n");
  printf("carpma icin 3\n");
  printf("bolme icin 4\n");
  scanf("%d", &secim);
  switch (secim) {
  case 1:
    c = a + b;
    break;
  case 2:
    c = a - b;
    break;
  case 3:
    c = a * b;
    break;
  case 4:
    c = a / b;
    break;
  default:
    printf("Yanlış bir seçim yaptınız.");
    break;
  }
  printf("sonuc : %f ", c);
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    %rdi,-0x30(%rbp)
xor    %eax,%eax
mov    %al,-0x21(%rbp)
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x21(%rbp),%al
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x21(%rbp),%al
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x21(%rbp),%al
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x21(%rbp),%al
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x21(%rbp),%al
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x21(%rbp),%al
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x21(%rbp),%al
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x3,%eax
ja     123c <main+0x10c>
mov    -0x20(%rbp),%rax
lea    0xe1d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    124a <main+0x11a>
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    124a <main+0x11a>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    124a <main+0x11a>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    124a <main+0x11a>
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe2a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     11df <main+0x9f>
lea    0xe38(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  0x8(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
jmp    1217 <main+0xd7>
lea    0xe2d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1217 <main+0xd7>
movss  0x8(%rsp),%xmm0
subss  0x4(%rsp),%xmm0
jmp    1217 <main+0xd7>
movss  0x8(%rsp),%xmm0
mulss  0x4(%rsp),%xmm0
jmp    1217 <main+0xd7>
movss  0x8(%rsp),%xmm0
divss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe11(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [20 x i8] c"ne yapayim sahip ?\0A\00"
@.str.2 = [16 x i8] c"toplama icin 1\0A\00"
@.str.3 = [16 x i8] c"cikarma icin 2\0A\00"
@.str.4 = [15 x i8] c"carpma icin 3\0A\00"
@.str.5 = [14 x i8] c"bolme icin 4\0A\00"
@.str.6 = [32 x i8] c"Yanl\C4\B1\C5\9F bir se\C3\A7im yapt\C4\B1n\C4\B1z.\00"
@.str.7 = [12 x i8] c"sonuc : %f \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%14 = load i32, i32* %5
switch i32 %14, label %31 [
i32 1, label %15
i32 2, label %19
i32 3, label %23
i32 4, label %27
]
15: ; preds = %0
%16 = load float, float* %2
%17 = load float, float* %3
%18 = fadd float %16, %17
store float %18, float* %4
br label %33
19: ; preds = %0
%20 = load float, float* %2
%21 = load float, float* %3
%22 = fsub float %20, %21
store float %22, float* %4
br label %33
23: ; preds = %0
%24 = load float, float* %2
%25 = load float, float* %3
%26 = fmul float %24, %25
store float %26, float* %4
br label %33
27: ; preds = %0
%28 = load float, float* %2
%29 = load float, float* %3
%30 = fdiv float %28, %29
store float %30, float* %4
br label %33
31: ; preds = %0
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
br label %33
33: ; preds = %31, %27, %23, %19, %15
%34 = load float, float* %4
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), double %35)
%37 = call i32 (...) @getch()
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.6 = [32 x i8] c"Yanl\C4\B1\C5\9F bir se\C3\A7im yapt\C4\B1n\C4\B1z.\00"
@.str.7 = [12 x i8] c"sonuc : %f \00"
@str = [19 x i8] c"ne yapayim sahip ?\00"
@str.8 = [15 x i8] c"toplama icin 1\00"
@str.9 = [15 x i8] c"cikarma icin 2\00"
@str.10 = [14 x i8] c"carpma icin 3\00"
@str.11 = [13 x i8] c"bolme icin 4\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca i32
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.8, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.9, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.10, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.11, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%15 = load i32, i32* %3
switch i32 %15, label %32 [
i32 1, label %16
i32 2, label %20
i32 3, label %24
i32 4, label %28
]
16: ; preds = %0
%17 = load float, float* %1
%18 = load float, float* %2
%19 = fadd float %17, %18
br label %34
20: ; preds = %0
%21 = load float, float* %1
%22 = load float, float* %2
%23 = fsub float %21, %22
br label %34
24: ; preds = %0
%25 = load float, float* %1
%26 = load float, float* %2
%27 = fmul float %25, %26
br label %34
28: ; preds = %0
%29 = load float, float* %1
%30 = load float, float* %2
%31 = fdiv float %29, %30
br label %34
32: ; preds = %0
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
br label %34
34: ; preds = %32, %28, %24, %20, %16
%35 = phi float [ undef, %32 ], [ %31, %28 ], [ %27, %24 ], [ %23, %20 ], [ %19, %16 ]
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), double %36)
%38 = call i32 (...) @getch()
ret i32 0
}