#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() {
  int i, k;
  float j, c;
  char b[50];
  char a[50][31];
  for (i = 0; i < 50; i++)
    for (k = 0; k < 31; k++)
      a[i][k] = ' ';
  for (i = 0; i < 50; i++) {
    j = i * 0.3;
    c = 15 * sin(j);
    k = round(c);
    a[i][k + 15] = 'X';
  }
  for (i = 0; i < 50; i++) {
    for (k = 0; k < 31; k++) {
      b[k] = a[i][k];
    }
    printid(b);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x660,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    1198 <main+0x68>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jge    1185 <main+0x55>
movslq -0x4(%rbp),%rcx
lea    -0x660(%rbp),%rax
imul   $0x1f,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <main+0x23>
jmp    118a <main+0x5a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <main+0x12>
movl   $0x0,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    1213 <main+0xe3>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xe4a(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <sin@plt>
imul   $0xf,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
call   1050 <round@plt>
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rcx
lea    -0x660(%rbp),%rax
imul   $0x1f,%rcx,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
add    $0xf,%ecx
movslq %ecx,%rcx
movb   $0x58,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    119f <main+0x6f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    127b <main+0x14b>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jge    1264 <main+0x134>
movslq -0x4(%rbp),%rcx
lea    -0x660(%rbp),%rax
imul   $0x1f,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x50(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    122b <main+0xfb>
lea    -0x50(%rbp),%rdi
call   1040 <printid@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    121a <main+0xea>
add    $0x660,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x658,%rsp
lea    0x40(%rsp),%r14
mov    $0x60e,%edx
mov    %r14,%rdi
mov    $0x20,%esi
call   1030 <memset@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  0xe81(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <sin@plt>
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1060 <round@plt>
mov    %ebx,%ecx
or     $0x1,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
cltq
movb   $0x58,0xf(%rax,%r14,1)
mulsd  0xe46(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <sin@plt>
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1060 <round@plt>
cltq
movb   $0x58,0x2e(%rax,%r14,1)
add    $0x2,%rbx
add    $0x3e,%r14
cmp    $0x32,%rbx
jne    1170 <main+0x30>
xor    %ebx,%ebx
mov    %rsp,%r14
movups 0x40(%rsp,%rbx,1),%xmm0
movupd 0x4f(%rsp,%rbx,1),%xmm1
movupd %xmm1,0xf(%rsp)
movaps %xmm0,(%rsp)
mov    %r14,%rdi
call   1050 <printid@plt>
add    $0x1f,%rbx
cmp    $0x60e,%rbx
jne    11f0 <main+0xb0>
add    $0x658,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca [50 x i8]
%6 = alloca [50 x [31 x i8]]
store i32 0, i32* %1
br label %7
7: ; preds = %25, %0
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 50
br i1 %9, label %10, label %28
10: ; preds = %7
store i32 0, i32* %2
br label %11
11: ; preds = %21, %10
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 31
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32, i32* %1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [50 x [31 x i8]], [50 x [31 x i8]]* %6, i64 0, i64 %16
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [31 x i8], [31 x i8]* %17, i64 0, i64 %19
store i8 32, i8* %20
br label %21
21: ; preds = %14
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %11
24: ; preds = %11
br label %25
25: ; preds = %24
%26 = load i32, i32* %1
%27 = add nsw i32 %26, 1
store i32 %27, i32* %1
br label %7
28: ; preds = %7
store i32 0, i32* %1
br label %29
29: ; preds = %50, %28
%30 = load i32, i32* %1
%31 = icmp slt i32 %30, 50
br i1 %31, label %32, label %53
32: ; preds = %29
%33 = load i32, i32* %1
%34 = sitofp i32 %33 to double
%35 = fmul double %34, 3.000000e-01
%36 = fptrunc double %35 to float
store float %36, float* %3
%37 = load float, float* %3
%38 = call i32 @sin(float %37)
%39 = mul nsw i32 15, %38
%40 = sitofp i32 %39 to float
store float %40, float* %4
%41 = load float, float* %4
%42 = call i32 @round(float %41)
store i32 %42, i32* %2
%43 = load i32, i32* %1
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [50 x [31 x i8]], [50 x [31 x i8]]* %6, i64 0, i64 %44
%46 = load i32, i32* %2
%47 = add nsw i32 %46, 15
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [31 x i8], [31 x i8]* %45, i64 0, i64 %48
store i8 88, i8* %49
br label %50
50: ; preds = %32
%51 = load i32, i32* %1
%52 = add nsw i32 %51, 1
store i32 %52, i32* %1
br label %29
53: ; preds = %29
store i32 0, i32* %1
br label %54
54: ; preds = %78, %53
%55 = load i32, i32* %1
%56 = icmp slt i32 %55, 50
br i1 %56, label %57, label %81
57: ; preds = %54
store i32 0, i32* %2
br label %58
58: ; preds = %72, %57
%59 = load i32, i32* %2
%60 = icmp slt i32 %59, 31
br i1 %60, label %61, label %75
61: ; preds = %58
%62 = load i32, i32* %1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [50 x [31 x i8]], [50 x [31 x i8]]* %6, i64 0, i64 %63
%65 = load i32, i32* %2
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [31 x i8], [31 x i8]* %64, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = load i32, i32* %2
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 %70
store i8 %68, i8* %71
br label %72
72: ; preds = %61
%73 = load i32, i32* %2
%74 = add nsw i32 %73, 1
store i32 %74, i32* %2
br label %58
75: ; preds = %58
%76 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%77 = call i32 @printid(i8* %76)
br label %78
78: ; preds = %75
%79 = load i32, i32* %1
%80 = add nsw i32 %79, 1
store i32 %80, i32* %1
br label %54
81: ; preds = %54
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = alloca [50 x [31 x i8]]
%4 = getelementptr inbounds [50 x [31 x i8]], [50 x [31 x i8]]* %3, i64 0, i64 0, i64 0
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [50 x [31 x i8]], [50 x [31 x i8]]* %3, i64 0, i64 0, i64 0
br label %7
7: ; preds = %7, %0
%8 = phi i64 [ 0, %0 ], [ %32, %7 ]
%9 = trunc i64 %8 to i32
%10 = sitofp i32 %9 to double
%11 = fmul double %10, 3.000000e-01
%12 = fptrunc double %11 to float
%13 = tail call i32 @sin(float %12)
%14 = mul nsw i32 %13, 15
%15 = sitofp i32 %14 to float
%16 = tail call i32 @round(float %15)
%17 = add nsw i32 %16, 15
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [50 x [31 x i8]], [50 x [31 x i8]]* %3, i64 0, i64 %8, i64 %18
store i8 88, i8* %19
%20 = or i64 %8, 1
%21 = trunc i64 %20 to i32
%22 = sitofp i32 %21 to double
%23 = fmul double %22, 3.000000e-01
%24 = fptrunc double %23 to float
%25 = tail call i32 @sin(float %24)
%26 = mul nsw i32 %25, 15
%27 = sitofp i32 %26 to float
%28 = tail call i32 @round(float %27)
%29 = add nsw i32 %28, 15
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [50 x [31 x i8]], [50 x [31 x i8]]* %3, i64 0, i64 %20, i64 %30
store i8 88, i8* %31
%32 = add nuw nsw i64 %8, 2
%33 = icmp eq i64 %32, 50
br i1 %33, label %34, label %7
34: ; preds = %7, %34
%35 = phi i64 [ %38, %34 ], [ 0, %7 ]
%36 = getelementptr [50 x [31 x i8]], [50 x [31 x i8]]* %3, i64 0, i64 %35, i64 0
%37 = call i32 @printid(i8* %5)
%38 = add nuw nsw i64 %35, 1
%39 = icmp eq i64 %38, 50
br i1 %39, label %40, label %34
40: ; preds = %34
ret void
}