#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*/ clock_set_content(char *, double, int, double, char);
void draw_line(char *clock, double degrees, double radius, char c,
               double length) {
  int i;
  int size = radius * 2;
  for (i = 0; i < radius * length; i++) {
    clock_set_content(clock, degrees, i, radius, c);
  }
}


x86 assembly (clang, -O0):
<draw_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  0xec7(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
cvtsi2sdl -0x2c(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    118d <draw_line+0x7d>
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    -0x2c(%rbp),%esi
movsd  -0x18(%rbp),%xmm1
movsbl -0x19(%rbp),%edx
call   1030 <clock_set_content@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    114c <draw_line+0x3c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_line>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mulsd  %xmm1,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jbe    117e <draw_line+0x6e>
mov    %rdi,%r14
xor    %ebp,%ebp
movsbl %sil,%ebx
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
movsd  0x10(%rsp),%xmm1
mov    %ebx,%edx
call   1030 <clock_set_content@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm2
add    $0x1,%ebp
xorps  %xmm3,%xmm3
cvtsi2sd %ebp,%xmm3
ucomisd %xmm3,%xmm2
ja     1150 <draw_line+0x40>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @draw_line(i8* %0, double %1, double %2, i8 signext %3, double %4) {
%6 = alloca i8*
%7 = alloca double
%8 = alloca double
%9 = alloca i8
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %6
store double %1, double* %7
store double %2, double* %8
store i8 %3, i8* %9
store double %4, double* %10
%13 = load double, double* %8
%14 = fmul double %13, 2.000000e+00
%15 = fptosi double %14 to i32
store i32 %15, i32* %12
store i32 0, i32* %11
br label %16
16: ; preds = %30, %5
%17 = load i32, i32* %11
%18 = sitofp i32 %17 to double
%19 = load double, double* %8
%20 = load double, double* %10
%21 = fmul double %19, %20
%22 = fcmp olt double %18, %21
br i1 %22, label %23, label %33
23: ; preds = %16
%24 = load i8*, i8** %6
%25 = load double, double* %7
%26 = load i32, i32* %11
%27 = load double, double* %8
%28 = load i8, i8* %9
%29 = call i32 @clock_set_content(i8* %24, double %25, i32 %26, double %27, i8 signext %28)
br label %30
30: ; preds = %23
%31 = load i32, i32* %11
%32 = add nsw i32 %31, 1
store i32 %32, i32* %11
br label %16
33: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @draw_line(i8* %0, double %1, double %2, i8 signext %3, double %4) {
%6 = fmul double %2, %4
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %14
8: ; preds = %5, %8
%9 = phi i32 [ %11, %8 ], [ 0, %5 ]
%10 = tail call i32 @clock_set_content(i8* %0, double %1, i32 %9, double %2, i8 signext %3)
%11 = add nuw nsw i32 %9, 1
%12 = sitofp i32 %11 to double
%13 = fcmp ogt double %6, %12
br i1 %13, label %8, label %14
14: ; preds = %8, %5
ret void
}