#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*/ draw_rectangle(float *, int, int, int, int /*<<< orphan*/,
                                  int, int, float);
void stopnice(float *sl, int w, int h) {
  int j, n;
  float s;
  n = 8;
  for (j = 0; j < n; j++) {
    s = (float)j / (float)(n - 1);
    draw_rectangle(sl, w, h, j * w / n, 0, w / n, h, s);
  }
}


x86 assembly (clang, -O0):
<stopnice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x8,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    119c <stopnice+0x8c>
cvtsi2ssl -0x14(%rbp),%xmm0
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
imul   -0xc(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    -0x20(%rbp),%edx
mov    %eax,%r9d
mov    -0x10(%rbp),%eax
movss  -0x1c(%rbp),%xmm0
xor    %r8d,%r8d
mov    %eax,(%rsp)
call   1030 <draw_rectangle@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <stopnice+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopnice>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r12d
mov    %esi,%r13d
mov    %rdi,%r14
lea    0x7(%r13),%r15d
test   %esi,%esi
cmovns %esi,%r15d
sar    $0x3,%r15d
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
divss  0xeb1(%rip),%xmm0
lea    0x7(%rbp),%ecx
test   %ebp,%ebp
cmovns %ebp,%ecx
sar    $0x3,%ecx
mov    %r12d,(%rsp)
mov    %r14,%rdi
mov    %r13d,%esi
mov    %r12d,%edx
xor    %r8d,%r8d
mov    %r15d,%r9d
call   1030 <draw_rectangle@plt>
add    $0x1,%ebx
add    %r13d,%ebp
cmp    $0x8,%ebx
jne    1140 <stopnice+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @stopnice(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 8, i32* %8
store i32 0, i32* %7
br label %10
10: ; preds = %35, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %38
14: ; preds = %10
%15 = load i32, i32* %7
%16 = sitofp i32 %15 to float
%17 = load i32, i32* %8
%18 = sub nsw i32 %17, 1
%19 = sitofp i32 %18 to float
%20 = fdiv float %16, %19
store float %20, float* %9
%21 = load float*, float** %4
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = load i32, i32* %5
%26 = mul nsw i32 %24, %25
%27 = load i32, i32* %8
%28 = sdiv i32 %26, %27
%29 = load i32, i32* %5
%30 = load i32, i32* %8
%31 = sdiv i32 %29, %30
%32 = load i32, i32* %6
%33 = load float, float* %9
%34 = call i32 @draw_rectangle(float* %21, i32 %22, i32 %23, i32 %28, i32 0, i32 %31, i32 %32, float %33)
br label %35
35: ; preds = %14
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %10
38: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @stopnice(float* %0, i32 %1, i32 %2) {
%4 = sdiv i32 %1, 8
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ 0, %3 ], [ %12, %5 ]
%7 = sitofp i32 %6 to float
%8 = fdiv float %7, 7.000000e+00
%9 = mul nsw i32 %6, %1
%10 = sdiv i32 %9, 8
%11 = tail call i32 @draw_rectangle(float* %0, i32 %1, i32 %2, i32 %10, i32 0, i32 %4, i32 %2, float %8)
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, 8
br i1 %13, label %14, label %5
14: ; preds = %5
ret void
}