#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);
int rand();
int /*<<< orphan*/ sleep(int);
void xboard_send_ics_seeks() {
  int t, inc, i;
  for (i = 0; i < 3; i++) {
    t = rand() % 18 + 1;
    inc = rand() % 18 + 1;
    printf("tellics seek %i %i f\n", t, inc);
    if (i != 2)
      sleep(1);
  }
}


x86 assembly (clang, -O0):
<xboard_send_ics_seeks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    11ac <xboard_send_ics_seeks+0x7c>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x12,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x12,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x2,-0xc(%rbp)
je     1199 <xboard_send_ics_seeks+0x69>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    119e <xboard_send_ics_seeks+0x6e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <xboard_send_ics_seeks+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xboard_send_ics_seeks>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,8),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,8),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x1,%edx
lea    0xe72(%rip),%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,8),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,8),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x1,%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,8),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,8),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x1,%edx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"tellics seek %i %i f\0A\00"
define void @xboard_send_ics_seeks() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
br label %4
4: ; preds = %22, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %25
7: ; preds = %4
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 18
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 18
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 2
br i1 %18, label %19, label %21
19: ; preds = %7
%20 = call i32 @sleep(i32 1)
br label %21
21: ; preds = %19, %7
br label %22
22: ; preds = %21
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %4
25: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"tellics seek %i %i f\0A\00"
define void @xboard_send_ics_seeks() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 18
%3 = add nsw i32 %2, 1
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 18
%6 = add nsw i32 %5, 1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %6)
%8 = tail call i32 @sleep(i32 1)
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 18
%11 = add nsw i32 %10, 1
%12 = tail call i32 (...) @rand()
%13 = srem i32 %12, 18
%14 = add nsw i32 %13, 1
%15 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %14)
%16 = tail call i32 @sleep(i32 1)
%17 = tail call i32 (...) @rand()
%18 = srem i32 %17, 18
%19 = add nsw i32 %18, 1
%20 = tail call i32 (...) @rand()
%21 = srem i32 %20, 18
%22 = add nsw i32 %21, 1
%23 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %22)
ret void
}