#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 cos(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ set_array(char *, int);
int sin(double);
int main(int argc, char const *argv[]) {
  double pi = 3.14159265359;
  double theta;
  char sqaure[50 + 1][50];
  int length = 50 * 50;
  set_array((char *)sqaure, length);
  int x, y;
  for (int i = 0; i <= 100; i++) {
    theta = pi / (double)50 * i;
    x = (50 / 2) + (50 / 2) * cos(theta);
    y = (50 / 2) + (50 / 2) * sin(theta);
    sqaure[x][y] = '*';
  }
  for (int i = 0; i < 50; i += 2) {
    for (int j = 0; j < 50; j++) {
      printf("%c", sqaure[i][j]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x9c4,-0xa24(%rbp)
lea    -0xa20(%rbp),%rdi
mov    -0xa24(%rbp),%esi
call   1060 <set_array@plt>
movl   $0x0,-0xa30(%rbp)
cmpl   $0x64,-0xa30(%rbp)
jg     121b <main+0xdb>
movsd  -0x18(%rbp),%xmm0
movsd  0xe62(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0xa30(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <cos@plt>
imul   $0x19,%eax,%eax
add    $0x19,%eax
mov    %eax,-0xa28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <sin@plt>
imul   $0x19,%eax,%eax
add    $0x19,%eax
mov    %eax,-0xa2c(%rbp)
movslq -0xa28(%rbp),%rcx
lea    -0xa20(%rbp),%rax
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
movslq -0xa2c(%rbp),%rcx
movb   $0x2a,(%rax,%rcx,1)
mov    -0xa30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa30(%rbp)
jmp    118c <main+0x4c>
movl   $0x0,-0xa34(%rbp)
cmpl   $0x32,-0xa34(%rbp)
jge    12ad <main+0x16d>
movl   $0x0,-0xa38(%rbp)
cmpl   $0x32,-0xa38(%rbp)
jge    128b <main+0x14b>
movslq -0xa34(%rbp),%rcx
lea    -0xa20(%rbp),%rax
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
movslq -0xa38(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xda0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xa38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa38(%rbp)
jmp    123c <main+0xfc>
lea    0xd81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xa34(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xa34(%rbp)
jmp    1225 <main+0xe5>
xor    %eax,%eax
add    $0xa40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0xa10,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x9c4,%esi
call   1060 <set_array@plt>
xorpd  %xmm0,%xmm0
mov    $0x65,%ebp
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
mulsd  0xe82(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   1050 <cos@plt>
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,4),%r14d
add    $0x19,%r14d
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
movsd  0x8(%rsp),%xmm0
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,4),%eax
movslq %r14d,%rcx
cltq
imul   $0x32,%rcx,%rcx
add    %rsp,%rcx
add    $0x10,%rcx
movb   $0x2a,0x19(%rax,%rcx,1)
addsd  0xe42(%rip),%xmm0
add    $0xffffffff,%ebp
jne    1170 <main+0x30>
xor    %r14d,%r14d
xchg   %ax,%ax
mov    $0xffffffffffffffce,%rbp
nopw   0x0(%rax,%rax,1)
movsbl 0x32(%rbx,%rbp,1),%edi
call   1030 <putchar@plt>
inc    %rbp
jne    11e0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x2(%r14),%rax
add    $0x64,%rbx
cmp    $0x30,%r14
mov    %rax,%r14
jb     11d0 <main+0x90>
xor    %eax,%eax
add    $0xa10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca [51 x [50 x i8]]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0x400921FB54442EEA, double* %6
store i32 2500, i32* %9
%15 = getelementptr inbounds [51 x [50 x i8]], [51 x [50 x i8]]* %8, i64 0, i64 0
%16 = bitcast [50 x i8]* %15 to i8*
%17 = load i32, i32* %9
%18 = call i32 @set_array(i8* %16, i32 %17)
store i32 0, i32* %12
br label %19
19: ; preds = %42, %2
%20 = load i32, i32* %12
%21 = icmp sle i32 %20, 100
br i1 %21, label %22, label %45
22: ; preds = %19
%23 = load double, double* %6
%24 = fdiv double %23, 5.000000e+01
%25 = load i32, i32* %12
%26 = sitofp i32 %25 to double
%27 = fmul double %24, %26
store double %27, double* %7
%28 = load double, double* %7
%29 = call i32 @cos(double %28)
%30 = mul nsw i32 25, %29
%31 = add nsw i32 25, %30
store i32 %31, i32* %10
%32 = load double, double* %7
%33 = call i32 @sin(double %32)
%34 = mul nsw i32 25, %33
%35 = add nsw i32 25, %34
store i32 %35, i32* %11
%36 = load i32, i32* %10
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [51 x [50 x i8]], [51 x [50 x i8]]* %8, i64 0, i64 %37
%39 = load i32, i32* %11
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [50 x i8], [50 x i8]* %38, i64 0, i64 %40
store i8 42, i8* %41
br label %42
42: ; preds = %22
%43 = load i32, i32* %12
%44 = add nsw i32 %43, 1
store i32 %44, i32* %12
br label %19
45: ; preds = %19
store i32 0, i32* %13
br label %46
46: ; preds = %68, %45
%47 = load i32, i32* %13
%48 = icmp slt i32 %47, 50
br i1 %48, label %49, label %71
49: ; preds = %46
store i32 0, i32* %14
br label %50
50: ; preds = %63, %49
%51 = load i32, i32* %14
%52 = icmp slt i32 %51, 50
br i1 %52, label %53, label %66
53: ; preds = %50
%54 = load i32, i32* %13
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [51 x [50 x i8]], [51 x [50 x i8]]* %8, i64 0, i64 %55
%57 = load i32, i32* %14
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [50 x i8], [50 x i8]* %56, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %53
%64 = load i32, i32* %14
%65 = add nsw i32 %64, 1
store i32 %65, i32* %14
br label %50
66: ; preds = %50
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %68
68: ; preds = %66
%69 = load i32, i32* %13
%70 = add nsw i32 %69, 2
store i32 %70, i32* %13
br label %46
71: ; preds = %46
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [51 x [50 x i8]]
%4 = getelementptr inbounds [51 x [50 x i8]], [51 x [50 x i8]]* %3, i64 0, i64 0, i64 0
%5 = call i32 @set_array(i8* %4, i32 2500)
br label %6
6: ; preds = %2, %6
%7 = phi i32 [ 0, %2 ], [ %19, %6 ]
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 0x3FB015BF92172844
%10 = call i32 @cos(double %9)
%11 = mul nsw i32 %10, 25
%12 = add nsw i32 %11, 25
%13 = call i32 @sin(double %9)
%14 = mul nsw i32 %13, 25
%15 = add nsw i32 %14, 25
%16 = sext i32 %12 to i64
%17 = sext i32 %15 to i64
%18 = getelementptr inbounds [51 x [50 x i8]], [51 x [50 x i8]]* %3, i64 0, i64 %16, i64 %17
store i8 42, i8* %18
%19 = add nuw nsw i32 %7, 1
%20 = icmp eq i32 %19, 101
br i1 %20, label %21, label %6
21: ; preds = %6, %24
%22 = phi i64 [ %26, %24 ], [ 0, %6 ]
br label %28
23: ; preds = %24
ret i32 0
24: ; preds = %28
%25 = call i32 @putchar(i32 10)
%26 = add nuw nsw i64 %22, 2
%27 = icmp ult i64 %22, 48
br i1 %27, label %21, label %23
28: ; preds = %21, %28
%29 = phi i64 [ 0, %21 ], [ %34, %28 ]
%30 = getelementptr inbounds [51 x [50 x i8]], [51 x [50 x i8]]* %3, i64 0, i64 %22, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = call i32 @putchar(i32 %32)
%34 = add nuw nsw i64 %29, 1
%35 = icmp eq i64 %34, 50
br i1 %35, label %24, label %28
}