#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);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  int i;
  int x[31];
  int y[31];
  int islemtop = 0;
  int islembol = 0;
  int islem1 = 0;
  int islem2 = 0;
  int random;
  for (i = 0; i <= 30; i++) {
    random = 1 + rand() % 35;
    x[i] = random;
    random = 1 + rand() % 35;
    y[i] = random;
    islemtop = (x[i] + y[i]);
    islembol = (x[i] * 2);
    islem1 = (islemtop / islembol);
    islem2 += islem1 + x[i] + y[i];
  }
  printf("%d\n", islem2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x114(%rbp)
movl   $0x0,-0x118(%rbp)
movl   $0x0,-0x11c(%rbp)
movl   $0x0,-0x120(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jg     1266 <main+0x126>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x23,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x124(%rbp)
mov    -0x124(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x90(%rbp,%rax,4)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x23,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x124(%rbp)
mov    -0x124(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x110(%rbp,%rax,4)
movslq -0x8(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
movslq -0x8(%rbp),%rcx
add    -0x110(%rbp,%rcx,4),%eax
mov    %eax,-0x114(%rbp)
movslq -0x8(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
shl    $0x1,%eax
mov    %eax,-0x118(%rbp)
mov    -0x114(%rbp),%eax
cltd
idivl  -0x118(%rbp)
mov    %eax,-0x11c(%rbp)
mov    -0x11c(%rbp),%eax
movslq -0x8(%rbp),%rcx
add    -0x90(%rbp,%rcx,4),%eax
movslq -0x8(%rbp),%rcx
add    -0x110(%rbp,%rcx,4),%eax
add    -0x120(%rbp),%eax
mov    %eax,-0x120(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1191 <main+0x51>
mov    -0x120(%rbp),%esi
lea    0xd8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x1f,%r14d
xor    %ebx,%ebx
nopl   (%rax)
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0xffffffffea0ea0eb,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x23,%ecx,%ecx
mov    %eax,%ebp
sub    %ecx,%ebp
neg    %ecx
lea    (%rax,%rcx,1),%r15d
add    $0x1,%r15d
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0xffffffffea0ea0eb,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x23,%ecx,%ecx
sub    %ecx,%eax
lea    (%rax,%r15,1),%ecx
add    %r15d,%eax
add    $0x1,%eax
lea    0x2(%rbp,%rbp,1),%esi
cltd
idiv   %esi
add    %ecx,%ebx
add    $0x1,%ebx
add    %eax,%ebx
add    $0xffffffff,%r14d
jne    1160 <main+0x20>
lea    0xe25(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [31 x i32]
%4 = alloca [31 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 @time(i32* null)
%11 = call i32 @srand(i32 %10)
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %2
br label %12
12: ; preds = %60, %0
%13 = load i32, i32* %2
%14 = icmp sle i32 %13, 30
br i1 %14, label %15, label %63
15: ; preds = %12
%16 = call i32 (...) @rand()
%17 = srem i32 %16, 35
%18 = add nsw i32 1, %17
store i32 %18, i32* %9
%19 = load i32, i32* %9
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [31 x i32], [31 x i32]* %3, i64 0, i64 %21
store i32 %19, i32* %22
%23 = call i32 (...) @rand()
%24 = srem i32 %23, 35
%25 = add nsw i32 1, %24
store i32 %25, i32* %9
%26 = load i32, i32* %9
%27 = load i32, i32* %2
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [31 x i32], [31 x i32]* %4, i64 0, i64 %28
store i32 %26, i32* %29
%30 = load i32, i32* %2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [31 x i32], [31 x i32]* %3, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = load i32, i32* %2
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [31 x i32], [31 x i32]* %4, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = add nsw i32 %33, %37
store i32 %38, i32* %5
%39 = load i32, i32* %2
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [31 x i32], [31 x i32]* %3, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = mul nsw i32 %42, 2
store i32 %43, i32* %6
%44 = load i32, i32* %5
%45 = load i32, i32* %6
%46 = sdiv i32 %44, %45
store i32 %46, i32* %7
%47 = load i32, i32* %7
%48 = load i32, i32* %2
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [31 x i32], [31 x i32]* %3, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = add nsw i32 %47, %51
%53 = load i32, i32* %2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [31 x i32], [31 x i32]* %4, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = add nsw i32 %52, %56
%58 = load i32, i32* %8
%59 = add nsw i32 %58, %57
store i32 %59, i32* %8
br label %60
60: ; preds = %15
%61 = load i32, i32* %2
%62 = add nsw i32 %61, 1
store i32 %62, i32* %2
br label %12
63: ; preds = %12
%64 = load i32, i32* %8
%65 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %64)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %17, %3 ]
%5 = phi i32 [ 0, %0 ], [ %16, %3 ]
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 35
%8 = add nsw i32 %7, 1
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 35
%11 = add nsw i32 %10, 1
%12 = add nsw i32 %11, %8
%13 = shl nsw i32 %8, 1
%14 = sdiv i32 %12, %13
%15 = add i32 %12, %5
%16 = add i32 %15, %14
%17 = add nuw nsw i32 %4, 1
%18 = icmp eq i32 %17, 31
br i1 %18, label %19, label %3
19: ; preds = %3
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}