#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(int);
scalar_t__ fabs(double);
double floor(int);
int /*<<< orphan*/ printf(char *, int, int, ...);
int sin(int);
int main() {
  int height = 200;
  int width = 200;
  int col = 0;
  int i, j;
  printf("P3\n%d %d\n255\n", width, height);
  for (i = 1; i <= width; i++) {
    for (j = 1; j <= height; j++) {
      col = (int)fabs(255.0 * sin(i / 10.0) * floor(cos(j / 10.0)));
      printf("%d\n%d\n%d\n", col, col * 2 * sin(i), col * 3 * cos(i));
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc8,-0x8(%rbp)
movl   $0xc8,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     127e <main+0x12e>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     126b <main+0x11b>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xe45(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sin@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe34(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xe16(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <cos@plt>
mov    %eax,%edi
call   1070 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <fabs@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <sin@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x1c(%rbp)
imul   $0x3,-0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <cos@plt>
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
imul   %eax,%ecx
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a2 <main+0x52>
jmp    1270 <main+0x120>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118f <main+0x3f>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeb3(%rip),%rdi
mov    $0xc8,%esi
mov    $0xc8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%r12d
movsd  0xe7c(%rip),%xmm0
movsd  0xe7c(%rip),%xmm1
lea    0xe93(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  %xmm0,0x8(%rsp)
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r15d
mov    $0xc8,%ebx
movsd  0xe44(%rip),%xmm0
movsd  %xmm0,(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15d,%edi
call   1050 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe29(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
divsd  0xe0e(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <cos@plt>
mov    %eax,%edi
call   1070 <floor@plt>
mulsd  0x10(%rsp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rbp
mov    %r12d,%edi
call   1050 <sin@plt>
imul   %ebp,%eax
lea    (%rax,%rax,1),%r13d
mov    %r12d,%edi
call   1060 <cos@plt>
imul   %ebp,%eax
lea    (%rax,%rax,2),%ecx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xdaf(%rip),%xmm0
movsd  %xmm0,(%rsp)
add    $0xffffffff,%ebx
jne    11d0 <main+0x80>
movsd  0x8(%rsp),%xmm0
addsd  0xd93(%rip),%xmm0
add    $0x1,%r12d
cmp    $0xc9,%r12d
movsd  0xd88(%rip),%xmm1
jne    11a0 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"P3\0A%d %d\0A255\0A\00"
@.str.1 = [10 x i8] c"%d\0A%d\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 200, i32* %2
store i32 200, i32* %3
store i32 0, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
store i32 1, i32* %5
br label %10
10: ; preds = %52, %0
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %55
14: ; preds = %10
store i32 1, i32* %6
br label %15
15: ; preds = %48, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %2
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %51
19: ; preds = %15
%20 = load i32, i32* %5
%21 = sitofp i32 %20 to double
%22 = fdiv double %21, 1.000000e+01
%23 = fptosi double %22 to i32
%24 = call i32 @sin(i32 %23)
%25 = sitofp i32 %24 to double
%26 = fmul double 2.550000e+02, %25
%27 = load i32, i32* %6
%28 = sitofp i32 %27 to double
%29 = fdiv double %28, 1.000000e+01
%30 = fptosi double %29 to i32
%31 = call i32 @cos(i32 %30)
%32 = call double @floor(i32 %31)
%33 = fmul double %26, %32
%34 = call i64 @fabs(double %33)
%35 = trunc i64 %34 to i32
store i32 %35, i32* %4
%36 = load i32, i32* %4
%37 = load i32, i32* %4
%38 = mul nsw i32 %37, 2
%39 = load i32, i32* %5
%40 = call i32 @sin(i32 %39)
%41 = mul nsw i32 %38, %40
%42 = load i32, i32* %4
%43 = mul nsw i32 %42, 3
%44 = load i32, i32* %5
%45 = call i32 @cos(i32 %44)
%46 = mul nsw i32 %43, %45
%47 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %36, i32 %41, i32 %46)
br label %48
48: ; preds = %19
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %15
51: ; preds = %15
br label %52
52: ; preds = %51
%53 = load i32, i32* %5
%54 = add nsw i32 %53, 1
store i32 %54, i32* %5
br label %10
55: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"P3\0A%d %d\0A255\0A\00"
@.str.1 = [10 x i8] c"%d\0A%d\0A%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 200, i32 200)
br label %2
2: ; preds = %0, %29
%3 = phi i32 [ 1, %0 ], [ %30, %29 ]
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+01
%6 = fptosi double %5 to i32
br label %7
7: ; preds = %2, %7
%8 = phi i32 [ 1, %2 ], [ %27, %7 ]
%9 = tail call i32 @sin(i32 %6)
%10 = sitofp i32 %9 to double
%11 = fmul double %10, 2.550000e+02
%12 = sitofp i32 %8 to double
%13 = fdiv double %12, 1.000000e+01
%14 = fptosi double %13 to i32
%15 = tail call i32 @cos(i32 %14)
%16 = tail call double @floor(i32 %15)
%17 = fmul double %11, %16
%18 = tail call i64 @fabs(double %17)
%19 = trunc i64 %18 to i32
%20 = shl nsw i32 %19, 1
%21 = tail call i32 @sin(i32 %3)
%22 = mul nsw i32 %20, %21
%23 = mul nsw i32 %19, 3
%24 = tail call i32 @cos(i32 %3)
%25 = mul nsw i32 %23, %24
%26 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %22, i32 %25)
%27 = add nuw nsw i32 %8, 1
%28 = icmp eq i32 %27, 201
br i1 %28, label %29, label %7
29: ; preds = %7
%30 = add nuw nsw i32 %3, 1
%31 = icmp eq i32 %30, 201
br i1 %31, label %32, label %2
32: ; preds = %29
ret i32 0
}