#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*/ printid(char **);
int round(float);
int sin(float);
void main() {
  char scr[50][50];
  int i, j;
  int n;
  float y;
  for (i = 0; i < 50; i++)
    for (j = 0; j < 50; j++)
      scr[i][j] = 'a';
  for (i = 0; i < 50; i++) {
    y = i;
    y = sin(y / 50) * 50;
    n = round(y);
    scr[i][n] = '*';
  }
  printid(scr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9e0,%rsp
movl   $0x0,-0x9d4(%rbp)
cmpl   $0x32,-0x9d4(%rbp)
jge    11b6 <main+0x86>
movl   $0x0,-0x9d8(%rbp)
cmpl   $0x32,-0x9d8(%rbp)
jge    119d <main+0x6d>
movslq -0x9d4(%rbp),%rcx
lea    -0x9d0(%rbp),%rax
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
movslq -0x9d8(%rbp),%rcx
movb   $0x61,(%rax,%rcx,1)
mov    -0x9d8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9d8(%rbp)
jmp    115c <main+0x2c>
jmp    11a2 <main+0x72>
mov    -0x9d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9d4(%rbp)
jmp    1145 <main+0x15>
movl   $0x0,-0x9d4(%rbp)
cmpl   $0x32,-0x9d4(%rbp)
jge    124c <main+0x11c>
cvtsi2ssl -0x9d4(%rbp),%xmm0
ff
movss  %xmm0,-0x9e0(%rbp)
ff
movss  -0x9e0(%rbp),%xmm0
ff
movss  0xe13(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <sin@plt>
imul   $0x32,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x9e0(%rbp)
ff
movss  -0x9e0(%rbp),%xmm0
ff
call   1050 <round@plt>
mov    %eax,-0x9dc(%rbp)
movslq -0x9d4(%rbp),%rcx
lea    -0x9d0(%rbp),%rax
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
movslq -0x9dc(%rbp),%rcx
movb   $0x2a,(%rax,%rcx,1)
mov    -0x9d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9d4(%rbp)
jmp    11c0 <main+0x90>
lea    -0x9d0(%rbp),%rdi
call   1040 <printid@plt>
add    $0x9e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x9c8,%rsp
mov    %rsp,%r14
mov    $0x9c4,%edx
mov    %r14,%rdi
mov    $0x61,%esi
call   1030 <memset@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
divss  0xe81(%rip),%xmm0
call   1040 <sin@plt>
imul   $0x32,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1060 <round@plt>
cltq
movb   $0x2a,(%r14,%rax,1)
add    $0x1,%rbx
add    $0x32,%r14
cmp    $0x32,%rbx
jne    1170 <main+0x30>
mov    %rsp,%rdi
call   1050 <printid@plt>
add    $0x9c8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca [50 x [50 x i8]]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %2
br label %6
6: ; preds = %24, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 50
br i1 %8, label %9, label %27
9: ; preds = %6
store i32 0, i32* %3
br label %10
10: ; preds = %20, %9
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 50
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %1, i64 0, i64 %15
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [50 x i8], [50 x i8]* %16, i64 0, i64 %18
store i8 97, i8* %19
br label %20
20: ; preds = %13
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %10
23: ; preds = %10
br label %24
24: ; preds = %23
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %6
27: ; preds = %6
store i32 0, i32* %2
br label %28
28: ; preds = %47, %27
%29 = load i32, i32* %2
%30 = icmp slt i32 %29, 50
br i1 %30, label %31, label %50
31: ; preds = %28
%32 = load i32, i32* %2
%33 = sitofp i32 %32 to float
store float %33, float* %5
%34 = load float, float* %5
%35 = fdiv float %34, 5.000000e+01
%36 = call i32 @sin(float %35)
%37 = mul nsw i32 %36, 50
%38 = sitofp i32 %37 to float
store float %38, float* %5
%39 = load float, float* %5
%40 = call i32 @round(float %39)
store i32 %40, i32* %4
%41 = load i32, i32* %2
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %1, i64 0, i64 %42
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [50 x i8], [50 x i8]* %43, i64 0, i64 %45
store i8 42, i8* %46
br label %47
47: ; preds = %31
%48 = load i32, i32* %2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %2
br label %28
50: ; preds = %28
%51 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %1, i64 0, i64 0
%52 = bitcast [50 x i8]* %51 to i8**
%53 = call i32 @printid(i8** %52)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [50 x [50 x i8]]
%2 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %1, i64 0, i64 0, i64 0
%3 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %1, i64 0, i64 0, i64 0
br label %4
4: ; preds = %0, %4
%5 = phi i64 [ 0, %0 ], [ %15, %4 ]
%6 = trunc i64 %5 to i32
%7 = sitofp i32 %6 to float
%8 = fdiv float %7, 5.000000e+01
%9 = tail call i32 @sin(float %8)
%10 = mul nsw i32 %9, 50
%11 = sitofp i32 %10 to float
%12 = tail call i32 @round(float %11)
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %1, i64 0, i64 %5, i64 %13
store i8 42, i8* %14
%15 = add nuw nsw i64 %5, 1
%16 = icmp eq i64 %15, 50
br i1 %16, label %17, label %4
17: ; preds = %4
%18 = bitcast [50 x [50 x i8]]* %1 to i8**
%19 = call i32 @printid(i8** %18)
ret void
}