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

/* Variables and functions */
double difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void mukemmel_sayi_yazdir(int sayi) {
  printf("Sayi = %d \n", sayi);
  printf("Sayinin bolenleri = ");
  int bolen_sayi;
  time_t baslangic;
  time_t son;
  time(&baslangic);
  for (bolen_sayi = 1; bolen_sayi <= (sayi / 2); bolen_sayi++) {
    if (sayi % bolen_sayi == 0) {
      printf("%d ", bolen_sayi);
    }
  }
  printf("\n");
  time(&son);
  printf("Sure = %.5f \n", difftime(son, baslangic));
}


x86 assembly (clang, -O0):
<mukemmel_sayi_yazdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1050 <time@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jg     11bc <mukemmel_sayi_yazdir+0x8c>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    11a9 <mukemmel_sayi_yazdir+0x79>
mov    -0x8(%rbp),%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ae <mukemmel_sayi_yazdir+0x7e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116a <mukemmel_sayi_yazdir+0x3a>
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1050 <time@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <difftime@plt>
lea    0xe40(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mukemmel_sayi_yazdir>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r15d
lea    0xeaf(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
call   1060 <time@plt>
cmp    $0x2,%r15d
jge    11b0 <mukemmel_sayi_yazdir+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
call   1060 <time@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
call   1050 <difftime@plt>
lea    0xe87(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r15d,%ebp
shr    %ebp
neg    %ebp
mov    $0x1,%ebx
lea    0xe5e(%rip),%r14
jmp    11e2 <mukemmel_sayi_yazdir+0xa2>
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
je     1179 <mukemmel_sayi_yazdir+0x39>
mov    %r15d,%eax
cltd
idiv   %ebx
test   %edx,%edx
jne    11d0 <mukemmel_sayi_yazdir+0x90>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11d0 <mukemmel_sayi_yazdir+0x90>

LLVM IR (-O0):
@.str = [12 x i8] c"Sayi = %d \0A\00"
@.str.1 = [21 x i8] c"Sayinin bolenleri = \00"
@.str.2 = [4 x i8] c"%d \00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [14 x i8] c"Sure = %.5f \0A\00"
define void @mukemmel_sayi_yazdir(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @time(i32* %4)
store i32 1, i32* %3
br label %10
10: ; preds = %24, %1
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = sdiv i32 %12, 2
%14 = icmp sle i32 %11, %13
br i1 %14, label %15, label %27
15: ; preds = %10
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = srem i32 %16, %17
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i32, i32* %3
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20, %15
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %10
27: ; preds = %10
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%29 = call i32 @time(i32* %5)
%30 = load i32, i32* %5
%31 = load i32, i32* %4
%32 = call double @difftime(i32 %30, i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %32)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Sayi = %d \0A\00"
@.str.1 = [21 x i8] c"Sayinin bolenleri = \00"
@.str.2 = [4 x i8] c"%d \00"
@.str.4 = [14 x i8] c"Sure = %.5f \0A\00"
define void @mukemmel_sayi_yazdir(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = call i32 @time(i32* %2)
%9 = icmp slt i32 %0, 2
br i1 %9, label %21, label %10
10: ; preds = %1
%11 = lshr i32 %0, 1
br label %12
12: ; preds = %10, %18
%13 = phi i32 [ %19, %18 ], [ 1, %10 ]
%14 = srem i32 %0, %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %13)
br label %18
18: ; preds = %12, %16
%19 = add nuw nsw i32 %13, 1
%20 = icmp eq i32 %13, %11
br i1 %20, label %21, label %12
21: ; preds = %18, %1
%22 = call i32 @putchar(i32 10)
%23 = call i32 @time(i32* %3)
%24 = load i32, i32* %3
%25 = load i32, i32* %2
%26 = call double @difftime(i32 %24, i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %26)
ret void
}