int main() {
  system("clear");
  int sayi;
  printf("Sayiyi giriniz: ");
  scanf("%d", &sayi);
  if (asalbul(&sayi)) {
    printf("%d sayisi asal sayidir\n", sayi);
  } else {
    printf("%d sayisi asal sayi degildir\n", sayi);
  }
  int sayi2 = sayi + 2;
  if (asalbul(&sayi2)) {
    printf("%d sayisi asal sayidir\n", sayi2);
    printf("%d sayisi Chen asalidir\n", sayi);
    printf("%d Chen asal sayisinin bellekteki adresi:%X\n", sayi, &sayi);
  } else {
    printf("%d sayisi asal sayi degildir\n", sayi2);
    printf("%d sayisi Chen asali degildir\n", sayi);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <system@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea5(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <asalbul@plt>
cmp    $0x0,%eax
je     11a7 <main+0x67>
mov    -0x8(%rbp),%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b8 <main+0x78>
mov    -0x8(%rbp),%esi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x0,%al
call   1050 <asalbul@plt>
cmp    $0x0,%eax
je     1211 <main+0xd1>
mov    -0xc(%rbp),%esi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe68(%rip),%rdi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1233 <main+0xf3>
mov    -0xc(%rbp),%esi
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <system@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <asalbul@plt>
test   %eax,%eax
mov    0x8(%rsp),%esi
lea    0xea4(%rip),%rax
lea    0xe85(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
add    $0x2,%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
xor    %eax,%eax
call   1050 <asalbul@plt>
mov    0xc(%rsp),%esi
test   %eax,%eax
je     11f8 <main+0xb8>
lea    0xe54(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xe78(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xe7f(%rip),%rdi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1218 <main+0xd8>
lea    0xe33(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [17 x i8] c"Sayiyi giriniz: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [24 x i8] c"%d sayisi asal sayidir\0A\00"
@.str.4 = [30 x i8] c"%d sayisi asal sayi degildir\0A\00"
@.str.5 = [25 x i8] c"%d sayisi Chen asalidir\0A\00"
@.str.6 = [45 x i8] c"%d Chen asal sayisinin bellekteki adresi:%X\0A\00"
@.str.7 = [31 x i8] c"%d sayisi Chen asali degildir\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @asalbul to i32 (i32*, ...)*)(i32* %2)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %10)
br label %15
12: ; preds = %0
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 2
store i32 %17, i32* %3
%18 = call i32 (i32*, ...) bitcast (i32 (...)* @asalbul to i32 (i32*, ...)*)(i32* %3)
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %15
%21 = load i32, i32* %3
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %2
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i32 %25, i32* %2)
br label %32
27: ; preds = %15
%28 = load i32, i32* %3
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %2
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %27, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [17 x i8] c"Sayiyi giriniz: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [24 x i8] c"%d sayisi asal sayidir\0A\00"
@.str.4 = [30 x i8] c"%d sayisi asal sayi degildir\0A\00"
@.str.5 = [25 x i8] c"%d sayisi Chen asalidir\0A\00"
@.str.6 = [45 x i8] c"%d Chen asal sayisinin bellekteki adresi:%X\0A\00"
@.str.7 = [31 x i8] c"%d sayisi Chen asali degildir\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @asalbul to i32 (i32*, ...)*)(i32* %1)
%8 = icmp eq i32 %7, 0
%9 = load i32, i32* %1
%10 = select i1 %8, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %10, i32 %9)
%12 = bitcast i32* %2 to i8*
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 2
store i32 %14, i32* %2
%15 = call i32 (i32*, ...) bitcast (i32 (...)* @asalbul to i32 (i32*, ...)*)(i32* %2)
%16 = icmp eq i32 %15, 0
%17 = load i32, i32* %2
br i1 %16, label %24, label %18
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%20 = load i32, i32* %1
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %1
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i32 %22, i32* %1)
br label %28
24: ; preds = %0
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%26 = load i32, i32* %1
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %24, %18
ret i32 0
}