#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_gradient(float *, int, int, int, int /*<<< orphan*/,
                                 int, int, double, double, int /*<<< orphan*/);
int /*<<< orphan*/ draw_rectangle(float *, int, int, int, int /*<<< orphan*/,
                                  int, int, double);
void sivi_klin(float *sl, int w, int h) {
  draw_rectangle(sl, w, h, 0, 0, w / 7, h, 0.5);
  draw_rectangle(sl, w, h, 6 * w / 7, 0, w / 7, h, 0.5);
  draw_gradient(sl, w, h, w / 8, 0, 3 * w / 4, h, 0.0, 1.0, 0);
}


x86 assembly (clang, -O0):
<sivi_klin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%r9d
mov    -0x10(%rbp),%eax
xor    %r8d,%r8d
movsd  0xeaa(%rip),%xmm0
mov    %r8d,%ecx
mov    %eax,(%rsp)
call   1030 <draw_rectangle@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
imul   $0x6,-0xc(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
mov    $0x7,%r8d
cltd
idiv   %r8d
mov    -0x18(%rbp),%edx
mov    %eax,%r9d
mov    -0x10(%rbp),%eax
xor    %r8d,%r8d
movsd  0xe63(%rip),%xmm0
mov    %eax,(%rsp)
call   1030 <draw_rectangle@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
imul   $0x3,-0xc(%rbp),%eax
mov    $0x4,%r8d
cltd
idiv   %r8d
mov    -0x14(%rbp),%edx
mov    %eax,%r9d
mov    -0x10(%rbp),%eax
xor    %r8d,%r8d
xorps  %xmm0,%xmm0
movsd  0xe14(%rip),%xmm1
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1040 <draw_gradient@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sivi_klin>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r15d
mov    %rdi,%r14
movslq %esi,%rbx
imul   $0xffffffff92492493,%rbx,%rbp
shr    $0x20,%rbp
add    %ebx,%ebp
mov    %ebp,%eax
shr    $0x1f,%eax
sar    $0x2,%ebp
add    %eax,%ebp
mov    %edx,(%rsp)
movsd  0xeab(%rip),%xmm0
mov    %ebx,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    %ebp,%r9d
call   1030 <draw_rectangle@plt>
lea    (%rbx,%rbx,1),%eax
lea    (%rax,%rax,2),%eax
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x2,%ecx
add    %eax,%ecx
mov    %r15d,(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
xor    %r8d,%r8d
mov    %ebp,%r9d
movsd  0xe62(%rip),%xmm0
call   1030 <draw_rectangle@plt>
lea    0x7(%rbx),%ecx
test   %ebx,%ebx
cmovns %ebx,%ecx
sar    $0x3,%ecx
lea    (%rbx,%rbx,2),%eax
lea    (%rbx,%rbx,2),%r9d
add    $0x3,%r9d
test   %eax,%eax
cmovns %eax,%r9d
sar    $0x2,%r9d
mov    %r15d,(%rsp)
movl   $0x0,0x8(%rsp)
movsd  0xe31(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
xor    %r8d,%r8d
call   1040 <draw_gradient@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @sivi_klin(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 7
%12 = load i32, i32* %6
%13 = call i32 @draw_rectangle(float* %7, i32 %8, i32 %9, i32 0, i32 0, i32 %11, i32 %12, double 5.000000e-01)
%14 = load float*, float** %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32, i32* %5
%18 = mul nsw i32 6, %17
%19 = sdiv i32 %18, 7
%20 = load i32, i32* %5
%21 = sdiv i32 %20, 7
%22 = load i32, i32* %6
%23 = call i32 @draw_rectangle(float* %14, i32 %15, i32 %16, i32 %19, i32 0, i32 %21, i32 %22, double 5.000000e-01)
%24 = load float*, float** %4
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = load i32, i32* %5
%28 = sdiv i32 %27, 8
%29 = load i32, i32* %5
%30 = mul nsw i32 3, %29
%31 = sdiv i32 %30, 4
%32 = load i32, i32* %6
%33 = call i32 @draw_gradient(float* %24, i32 %25, i32 %26, i32 %28, i32 0, i32 %31, i32 %32, double 0.000000e+00, double 1.000000e+00, i32 0)
ret void
}

LLVM IR (-O2):
define void @sivi_klin(float* %0, i32 %1, i32 %2) {
%4 = sdiv i32 %1, 7
%5 = tail call i32 @draw_rectangle(float* %0, i32 %1, i32 %2, i32 0, i32 0, i32 %4, i32 %2, double 5.000000e-01)
%6 = mul nsw i32 %1, 6
%7 = sdiv i32 %6, 7
%8 = tail call i32 @draw_rectangle(float* %0, i32 %1, i32 %2, i32 %7, i32 0, i32 %4, i32 %2, double 5.000000e-01)
%9 = sdiv i32 %1, 8
%10 = mul nsw i32 %1, 3
%11 = sdiv i32 %10, 4
%12 = tail call i32 @draw_gradient(float* %0, i32 %1, i32 %2, i32 %9, i32 0, i32 %11, i32 %2, double 0.000000e+00, double 1.000000e+00, i32 0)
ret void
}