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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc8,-0x8(%rbp)
movl   $0xc8,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%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     1249 <main+0xf9>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1236 <main+0xe6>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xe45(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xe35(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xe17(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <cos@plt>
mov    %eax,%edi
call   1070 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <fabs@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xdfd(%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    123b <main+0xeb>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118f <main+0x3f>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xeb7(%rip),%rdi
mov    $0xc8,%esi
mov    $0xc8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%r14d
movsd  0xe80(%rip),%xmm0
movsd  0xe80(%rip),%xmm1
lea    0xe97(%rip),%r15
nop
movsd  %xmm0,0x8(%rsp)
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ebp
mov    $0xc8,%ebx
movsd  0xe55(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    %ebp,%edi
call   1050 <sin@plt>
mulsd  0xe51(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
divsd  0xe36(%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    %r15,%rdi
mov    %eax,%esi
mov    %eax,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xdf6(%rip),%xmm0
movsd  %xmm0,(%rsp)
add    $0xffffffff,%ebx
jne    11b0 <main+0x60>
movsd  0x8(%rsp),%xmm0
addsd  0xdde(%rip),%xmm0
add    $0x1,%r14d
cmp    $0xc9,%r14d
movsd  0xdd3(%rip),%xmm1
jne    1190 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
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* %2
%8 = load i32, i32* %3
%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 = %43, %0
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %46
14: ; preds = %10
store i32 1, i32* %6
br label %15
15: ; preds = %39, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %2
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %42
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 double @sin(i32 %23)
%25 = fmul double 2.550000e+02, %24
%26 = load i32, i32* %6
%27 = sitofp i32 %26 to double
%28 = fdiv double %27, 1.000000e+01
%29 = fptosi double %28 to i32
%30 = call i32 @cos(i32 %29)
%31 = call double @floor(i32 %30)
%32 = fmul double %25, %31
%33 = call i64 @fabs(double %32)
%34 = trunc i64 %33 to i32
store i32 %34, i32* %4
%35 = load i32, i32* %4
%36 = load i32, i32* %4
%37 = load i32, i32* %4
%38 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %35, i32 %36, i32 %37)
br label %39
39: ; preds = %19
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %15
42: ; preds = %15
br label %43
43: ; preds = %42
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %10
46: ; preds = %10
%47 = load i32, i32* %1
ret i32 %47
}

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, %22
%3 = phi i32 [ 1, %0 ], [ %23, %22 ]
%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 ], [ %20, %7 ]
%9 = tail call double @sin(i32 %6)
%10 = fmul double %9, 2.550000e+02
%11 = sitofp i32 %8 to double
%12 = fdiv double %11, 1.000000e+01
%13 = fptosi double %12 to i32
%14 = tail call i32 @cos(i32 %13)
%15 = tail call double @floor(i32 %14)
%16 = fmul double %10, %15
%17 = tail call i64 @fabs(double %16)
%18 = trunc i64 %17 to i32
%19 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %18, i32 %18)
%20 = add nuw nsw i32 %8, 1
%21 = icmp eq i32 %20, 201
br i1 %21, label %22, label %7
22: ; preds = %7
%23 = add nuw nsw i32 %3, 1
%24 = icmp eq i32 %23, 201
br i1 %24, label %25, label %2
25: ; preds = %22
ret i32 0
}