#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 sin(double);
int main(int argc, char *argv[]) {
  int i;
  int j;
  for (i = 0; i < 20; i++) {
    j = 18 + (int)(18 * sin(3.1415926538979323846 * i / 5));
    if (j) {
      printf("%*c@\n", j, ' ');
    } else {
      printf("@");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    11b8 <main+0x98>
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xeb4(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sin@plt>
imul   $0x12,%eax,%eax
add    $0x12,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1197 <main+0x77>
mov    -0x18(%rbp),%esi
lea    0xe8a(%rip),%rdi
mov    $0x20,%edx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a5 <main+0x85>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11aa <main+0x8a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xorpd  %xmm0,%xmm0
mov    $0x14,%ebp
lea    0xed5(%rip),%rbx
jmp    116c <main+0x3c>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x40,%edi
call   1030 <putchar@plt>
movsd  (%rsp),%xmm0
addsd  0xea9(%rip),%xmm0
add    $0xffffffff,%ebp
je     11a1 <main+0x71>
movsd  %xmm0,(%rsp)
mulsd  0xe87(%rip),%xmm0
divsd  0xe87(%rip),%xmm0
call   1050 <sin@plt>
lea    (%rax,%rax,8),%esi
add    %esi,%esi
add    $0x12,%esi
je     1150 <main+0x20>
mov    %rbx,%rdi
mov    $0x20,%edx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    115a <main+0x2a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%*c@\0A\00"
@.str.1 = [2 x i8] c"@\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %8
8: ; preds = %27, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 20
br i1 %10, label %11, label %30
11: ; preds = %8
%12 = load i32, i32* %6
%13 = sitofp i32 %12 to double
%14 = fmul double 0x400921FB544EC384, %13
%15 = fdiv double %14, 5.000000e+00
%16 = call i32 @sin(double %15)
%17 = mul nsw i32 18, %16
%18 = add nsw i32 18, %17
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %11
%22 = load i32, i32* %7
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %22, i32 32)
br label %26
24: ; preds = %11
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %24, %21
br label %27
27: ; preds = %26
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %8
30: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%*c@\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %16
%4 = phi i32 [ 0, %2 ], [ %17, %16 ]
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 0x400921FB544EC384
%7 = fdiv double %6, 5.000000e+00
%8 = tail call i32 @sin(double %7)
%9 = mul nsw i32 %8, 18
%10 = add nsw i32 %9, 18
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %3
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10, i32 32)
br label %16
14: ; preds = %3
%15 = tail call i32 @putchar(i32 64)
br label %16
16: ; preds = %12, %14
%17 = add nuw nsw i32 %4, 1
%18 = icmp eq i32 %17, 20
br i1 %18, label %19, label %3
19: ; preds = %16
ret i32 0
}