#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 rand();
int main() {
  int x;
  int y;
  printf("circles\n");
  printf("elastic\n");
  printf("frames 200\n");
  for (x = 10; x < 630; x += 50)
    for (y = 10; y < 300; y += 50)
      printf("shape %d %d 10 %d %d random\n", x, y, (rand() % 6 - 3),
             (rand() % 6 - 3));
  printf("run");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x8(%rbp)
cmpl   $0x276,-0x8(%rbp)
jge    11f0 <main+0xd0>
movl   $0xa,-0xc(%rbp)
cmpl   $0x12c,-0xc(%rbp)
jge    11dd <main+0xbd>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
sub    $0x3,%edx
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%ecx
mov    $0x6,%edi
cltd
idiv   %edi
mov    %edx,%r8d
mov    -0x10(%rbp),%edx
sub    $0x3,%r8d
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x32,%eax
mov    %eax,-0xc(%rbp)
jmp    1174 <main+0x54>
jmp    11e2 <main+0xc2>
mov    -0x8(%rbp),%eax
add    $0x32,%eax
mov    %eax,-0x8(%rbp)
jmp    1160 <main+0x40>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%ebx
lea    0xe9c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0xfffffffd,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r8d
add    $0xfffffffd,%r8d
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0xa,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0xfffffffd,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r8d
add    $0xfffffffd,%r8d
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3c,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0xfffffffd,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r8d
add    $0xfffffffd,%r8d
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x6e,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0xfffffffd,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r8d
add    $0xfffffffd,%r8d
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0xa0,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0xfffffffd,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r8d
add    $0xfffffffd,%r8d
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0xd2,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0xfffffffd,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r8d
add    $0xfffffffd,%r8d
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x104,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x32(%rbx),%eax
cmp    $0x244,%ebx
mov    %eax,%ebx
jb     1170 <main+0x40>
lea    0xc1f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"circles\0A\00"
@.str.1 = [9 x i8] c"elastic\0A\00"
@.str.2 = [12 x i8] c"frames 200\0A\00"
@.str.3 = [29 x i8] c"shape %d %d 10 %d %d random\0A\00"
@.str.4 = [4 x i8] c"run\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
store i32 10, i32* %2
br label %7
7: ; preds = %28, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 630
br i1 %9, label %10, label %31
10: ; preds = %7
store i32 10, i32* %3
br label %11
11: ; preds = %24, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 300
br i1 %13, label %14, label %27
14: ; preds = %11
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = call i32 (...) @rand()
%18 = srem i32 %17, 6
%19 = sub nsw i32 %18, 3
%20 = call i32 (...) @rand()
%21 = srem i32 %20, 6
%22 = sub nsw i32 %21, 3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %16, i32 %19, i32 %22)
br label %24
24: ; preds = %14
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 50
store i32 %26, i32* %3
br label %11
27: ; preds = %11
br label %28
28: ; preds = %27
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 50
store i32 %30, i32* %2
br label %7
31: ; preds = %7
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str.3 = [29 x i8] c"shape %d %d 10 %d %d random\0A\00"
@.str.4 = [4 x i8] c"run\00"
@str = [8 x i8] c"circles\00"
@str.5 = [8 x i8] c"elastic\00"
@str.6 = [11 x i8] c"frames 200\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.6, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 10, %0 ], [ %48, %4 ]
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 6
%8 = add nsw i32 %7, -3
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 6
%11 = add nsw i32 %10, -3
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %5, i32 10, i32 %8, i32 %11)
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 6
%15 = add nsw i32 %14, -3
%16 = tail call i32 (...) @rand()
%17 = srem i32 %16, 6
%18 = add nsw i32 %17, -3
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %5, i32 60, i32 %15, i32 %18)
%20 = tail call i32 (...) @rand()
%21 = srem i32 %20, 6
%22 = add nsw i32 %21, -3
%23 = tail call i32 (...) @rand()
%24 = srem i32 %23, 6
%25 = add nsw i32 %24, -3
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %5, i32 110, i32 %22, i32 %25)
%27 = tail call i32 (...) @rand()
%28 = srem i32 %27, 6
%29 = add nsw i32 %28, -3
%30 = tail call i32 (...) @rand()
%31 = srem i32 %30, 6
%32 = add nsw i32 %31, -3
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %5, i32 160, i32 %29, i32 %32)
%34 = tail call i32 (...) @rand()
%35 = srem i32 %34, 6
%36 = add nsw i32 %35, -3
%37 = tail call i32 (...) @rand()
%38 = srem i32 %37, 6
%39 = add nsw i32 %38, -3
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %5, i32 210, i32 %36, i32 %39)
%41 = tail call i32 (...) @rand()
%42 = srem i32 %41, 6
%43 = add nsw i32 %42, -3
%44 = tail call i32 (...) @rand()
%45 = srem i32 %44, 6
%46 = add nsw i32 %45, -3
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %5, i32 260, i32 %43, i32 %46)
%48 = add nuw nsw i32 %5, 50
%49 = icmp ult i32 %5, 580
br i1 %49, label %4, label %50
50: ; preds = %4
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}