#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*/ bar(int, int, int, int);
int /*<<< orphan*/ hidemouseptr();
int /*<<< orphan*/ monitor_color(int);
int /*<<< orphan*/ setfillstyle(int, int);
int /*<<< orphan*/ showmouseptr();
int /*<<< orphan*/ top_panel_background();
int /*<<< orphan*/ user_pattern();
void draw_color() {
  int n;
  top_panel_background();
  hidemouseptr();
  for (n = 1; n <= 16; n++) {
    setfillstyle(1, 15);
    bar((3 + n * 20), 3, (17 + n * 20), 17);
    setfillstyle(1, n);
    bar((4 + n * 20), 4, (16 + n * 20), 16);
  }
  user_pattern();
  showmouseptr();
  monitor_color(16);
}


x86 assembly (clang, -O0):
<draw_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <top_panel_background@plt>
mov    $0x0,%al
call   1080 <hidemouseptr@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jg     11fb <draw_color+0x8b>
mov    $0x1,%edi
mov    $0xf,%esi
call   1050 <setfillstyle@plt>
imul   $0x14,-0x4(%rbp),%edi
add    $0x3,%edi
imul   $0x14,-0x4(%rbp),%edx
add    $0x11,%edx
mov    $0x3,%esi
mov    $0x11,%ecx
call   1040 <bar@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1050 <setfillstyle@plt>
imul   $0x14,-0x4(%rbp),%edi
add    $0x4,%edi
imul   $0x14,-0x4(%rbp),%edx
add    $0x10,%edx
mov    $0x4,%esi
mov    $0x10,%ecx
call   1040 <bar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    118d <draw_color+0x1d>
mov    $0x0,%al
call   1090 <user_pattern@plt>
mov    $0x0,%al
call   1070 <showmouseptr@plt>
mov    $0x10,%edi
call   1030 <monitor_color@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_color>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <top_panel_background@plt>
xor    %eax,%eax
call   1080 <hidemouseptr@plt>
mov    $0x1,%ebp
mov    $0x25,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    $0xf,%esi
call   1050 <setfillstyle@plt>
lea    -0xe(%rbx),%edi
mov    $0x3,%esi
mov    %ebx,%edx
mov    $0x11,%ecx
call   1040 <bar@plt>
mov    $0x1,%edi
mov    %ebp,%esi
call   1050 <setfillstyle@plt>
lea    -0xd(%rbx),%edi
lea    -0x1(%rbx),%edx
mov    $0x4,%esi
mov    $0x10,%ecx
call   1040 <bar@plt>
add    $0x1,%ebp
add    $0x14,%ebx
cmp    $0x165,%ebx
jne    1190 <draw_color+0x20>
xor    %eax,%eax
call   1090 <user_pattern@plt>
xor    %eax,%eax
call   1070 <showmouseptr@plt>
mov    $0x10,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <monitor_color@plt>

LLVM IR (-O0):
define void @draw_color() {
%1 = alloca i32
%2 = call i32 (...) @top_panel_background()
%3 = call i32 (...) @hidemouseptr()
store i32 1, i32* %1
br label %4
4: ; preds = %25, %0
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 16
br i1 %6, label %7, label %28
7: ; preds = %4
%8 = call i32 @setfillstyle(i32 1, i32 15)
%9 = load i32, i32* %1
%10 = mul nsw i32 %9, 20
%11 = add nsw i32 3, %10
%12 = load i32, i32* %1
%13 = mul nsw i32 %12, 20
%14 = add nsw i32 17, %13
%15 = call i32 @bar(i32 %11, i32 3, i32 %14, i32 17)
%16 = load i32, i32* %1
%17 = call i32 @setfillstyle(i32 1, i32 %16)
%18 = load i32, i32* %1
%19 = mul nsw i32 %18, 20
%20 = add nsw i32 4, %19
%21 = load i32, i32* %1
%22 = mul nsw i32 %21, 20
%23 = add nsw i32 16, %22
%24 = call i32 @bar(i32 %20, i32 4, i32 %23, i32 16)
br label %25
25: ; preds = %7
%26 = load i32, i32* %1
%27 = add nsw i32 %26, 1
store i32 %27, i32* %1
br label %4
28: ; preds = %4
%29 = call i32 (...) @user_pattern()
%30 = call i32 (...) @showmouseptr()
%31 = call i32 @monitor_color(i32 16)
ret void
}

LLVM IR (-O2):
define void @draw_color() {
%1 = tail call i32 (...) @top_panel_background()
%2 = tail call i32 (...) @hidemouseptr()
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 1, %0 ], [ %14, %3 ]
%5 = tail call i32 @setfillstyle(i32 1, i32 15)
%6 = mul nuw nsw i32 %4, 20
%7 = or i32 %6, 3
%8 = add nuw nsw i32 %6, 17
%9 = tail call i32 @bar(i32 %7, i32 3, i32 %8, i32 17)
%10 = tail call i32 @setfillstyle(i32 1, i32 %4)
%11 = add nuw nsw i32 %6, 4
%12 = add nuw nsw i32 %6, 16
%13 = tail call i32 @bar(i32 %11, i32 4, i32 %12, i32 16)
%14 = add nuw nsw i32 %4, 1
%15 = icmp eq i32 %14, 17
br i1 %15, label %16, label %3
16: ; preds = %3
%17 = tail call i32 (...) @user_pattern()
%18 = tail call i32 (...) @showmouseptr()
%19 = tail call i32 @monitor_color(i32 16)
ret void
}