#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 *, ...);
void tangle(int size, int fill) {
  int bsize;
  bsize = (int)(0.8 * size);
  printf("%d %d RMT\n", (0), (bsize));
  printf("%d %d RLT\n", (size), (-2 * bsize));
  printf("%d %d RLT\n", (-2 * size), (0));
  printf("closepath\n");
  if (fill)
    printf("fill\n");
  printf("ST\n");
}


x86 assembly (clang, -O0):
<tangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
lea    0xec8(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
imul   $0xfffffffe,-0xc(%rbp),%edx
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0xfffffffe,-0x4(%rbp),%esi
lea    0xea4(%rip),%rdi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
je     119e <tangle+0x8e>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tangle>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebp
cvtsi2sd %edi,%xmm0
mulsd  0xec8(%rip),%xmm0
cvttsd2si %xmm0,%ebx
lea    0xec5(%rip),%rdi
xor    %esi,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebx,%ebx
neg    %ebx
lea    0xeba(%rip),%r15
mov    %r15,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebp,%ebp
neg    %ebp
mov    %r15,%rdi
mov    %ebp,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
test   %r14d,%r14d
je     1196 <tangle+0x76>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8b(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%d %d RMT\0A\00"
@.str.1 = [11 x i8] c"%d %d RLT\0A\00"
@.str.2 = [11 x i8] c"closepath\0A\00"
@.str.3 = [6 x i8] c"fill\0A\00"
@.str.4 = [4 x i8] c"ST\0A\00"
define void @tangle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = fmul double 8.000000e-01, %7
%9 = fptosi double %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0, i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = mul nsw i32 -2, %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %14)
%16 = load i32, i32* %3
%17 = mul nsw i32 -2, %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 0)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %24
24: ; preds = %22, %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d %d RMT\0A\00"
@.str.1 = [11 x i8] c"%d %d RLT\0A\00"
@str = [10 x i8] c"closepath\00"
@str.5 = [3 x i8] c"ST\00"
@str.6 = [5 x i8] c"fill\00"
define void @tangle(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 8.000000e-01
%5 = fptosi double %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0, i32 %5)
%7 = mul nsw i32 %5, -2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %7)
%9 = mul nsw i32 %0, -2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 0)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%12 = icmp eq i32 %1, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.6, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.5, i64 0, i64 0))
ret void
}