#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*/ SetColor(int);
int /*<<< orphan*/ lineTo(int, int);
int /*<<< orphan*/ moveTo(int, int);
int /*<<< orphan*/ penSize(int, int);
int DrawCurvesBackground() {
  register int j;
  SetColor(0x08404040L);
  for (j = 0; j <= 20; j++) {
    if (j == 10)
      penSize(2, 2);
    else
      penSize(1, 1);
    moveTo(20 + (-160 + 160), 20 + (j * 10));
    lineTo(20 + (160 + 160), 20 + (j * 10));
  }
  for (j = -16 + 16; j <= 16 + 16; j++) {
    if (j % 8 == 0) {
      SetColor(0x01FF0000L);
    } else {
      SetColor(0x08404040L);
    }
    moveTo(20 + (j * 10), 20);
    lineTo(20 + (j * 10), 20 + 200);
  }
  SetColor(0x07000000L);
  moveTo(-140 + 160, 240);
  return (1);
}


x86 assembly (clang, -O0):
<DrawCurvesBackground>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8404040,%edi
call   1030 <SetColor@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jg     11ba <DrawCurvesBackground+0x7a>
cmpl   $0xa,-0x4(%rbp)
jne    117e <DrawCurvesBackground+0x3e>
mov    $0x2,%esi
mov    %esi,%edi
call   1040 <penSize@plt>
jmp    118a <DrawCurvesBackground+0x4a>
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <penSize@plt>
imul   $0xa,-0x4(%rbp),%esi
add    $0x14,%esi
mov    $0x14,%edi
call   1060 <moveTo@plt>
imul   $0xa,-0x4(%rbp),%esi
add    $0x14,%esi
mov    $0x154,%edi
call   1050 <lineTo@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <DrawCurvesBackground+0x19>
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jg     1228 <DrawCurvesBackground+0xe8>
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ee <DrawCurvesBackground+0xae>
mov    $0x1ff0000,%edi
call   1030 <SetColor@plt>
jmp    11f8 <DrawCurvesBackground+0xb8>
mov    $0x8404040,%edi
call   1030 <SetColor@plt>
imul   $0xa,-0x4(%rbp),%edi
add    $0x14,%edi
mov    $0x14,%esi
call   1060 <moveTo@plt>
imul   $0xa,-0x4(%rbp),%edi
add    $0x14,%edi
mov    $0xdc,%esi
call   1050 <lineTo@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11c1 <DrawCurvesBackground+0x81>
mov    $0x7000000,%edi
call   1030 <SetColor@plt>
mov    $0x14,%edi
mov    $0xf0,%esi
call   1060 <moveTo@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawCurvesBackground>:
push   %rbp
push   %r14
push   %rbx
mov    $0x8404040,%edi
call   1030 <SetColor@plt>
mov    $0x14,%ebx
jmp    1192 <DrawCurvesBackground+0x52>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <penSize@plt>
mov    $0x14,%edi
mov    %ebx,%esi
call   1060 <moveTo@plt>
mov    $0x154,%edi
mov    %ebx,%esi
call   1050 <lineTo@plt>
add    $0xa,%ebx
cmp    $0xe6,%ebx
je     11a3 <DrawCurvesBackground+0x63>
cmp    $0x78,%ebx
jne    1160 <DrawCurvesBackground+0x20>
mov    $0x2,%edi
mov    $0x2,%esi
jmp    116a <DrawCurvesBackground+0x2a>
xor    %ebp,%ebp
mov    $0x14,%ebx
mov    $0x1ff0000,%r14d
test   $0x7,%bpl
mov    $0x8404040,%edi
cmove  %r14d,%edi
call   1030 <SetColor@plt>
mov    %ebx,%edi
mov    $0x14,%esi
call   1060 <moveTo@plt>
mov    %ebx,%edi
mov    $0xdc,%esi
call   1050 <lineTo@plt>
add    $0x1,%ebp
add    $0xa,%ebx
cmp    $0x15e,%ebx
jne    11b0 <DrawCurvesBackground+0x70>
mov    $0x7000000,%edi
call   1030 <SetColor@plt>
mov    $0x14,%edi
mov    $0xf0,%esi
call   1060 <moveTo@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @DrawCurvesBackground() {
%1 = alloca i32
%2 = call i32 @SetColor(i32 138428480)
store i32 0, i32* %1
br label %3
3: ; preds = %22, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 20
br i1 %5, label %6, label %25
6: ; preds = %3
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @penSize(i32 2, i32 2)
br label %13
11: ; preds = %6
%12 = call i32 @penSize(i32 1, i32 1)
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %1
%15 = mul nsw i32 %14, 10
%16 = add nsw i32 20, %15
%17 = call i32 @moveTo(i32 20, i32 %16)
%18 = load i32, i32* %1
%19 = mul nsw i32 %18, 10
%20 = add nsw i32 20, %19
%21 = call i32 @lineTo(i32 340, i32 %20)
br label %22
22: ; preds = %13
%23 = load i32, i32* %1
%24 = add nsw i32 %23, 1
store i32 %24, i32* %1
br label %3
25: ; preds = %3
store i32 0, i32* %1
br label %26
26: ; preds = %46, %25
%27 = load i32, i32* %1
%28 = icmp sle i32 %27, 32
br i1 %28, label %29, label %49
29: ; preds = %26
%30 = load i32, i32* %1
%31 = srem i32 %30, 8
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 @SetColor(i32 33488896)
br label %37
35: ; preds = %29
%36 = call i32 @SetColor(i32 138428480)
br label %37
37: ; preds = %35, %33
%38 = load i32, i32* %1
%39 = mul nsw i32 %38, 10
%40 = add nsw i32 20, %39
%41 = call i32 @moveTo(i32 %40, i32 20)
%42 = load i32, i32* %1
%43 = mul nsw i32 %42, 10
%44 = add nsw i32 20, %43
%45 = call i32 @lineTo(i32 %44, i32 220)
br label %46
46: ; preds = %37
%47 = load i32, i32* %1
%48 = add nsw i32 %47, 1
store i32 %48, i32* %1
br label %26
49: ; preds = %26
%50 = call i32 @SetColor(i32 117440512)
%51 = call i32 @moveTo(i32 20, i32 240)
ret i32 1
}

LLVM IR (-O2):
define i32 @DrawCurvesBackground() {
%1 = tail call i32 @SetColor(i32 138428480)
br label %2
2: ; preds = %0, %9
%3 = phi i32 [ 0, %0 ], [ %14, %9 ]
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @penSize(i32 2, i32 2)
br label %9
7: ; preds = %2
%8 = tail call i32 @penSize(i32 1, i32 1)
br label %9
9: ; preds = %7, %5
%10 = mul nuw nsw i32 %3, 10
%11 = add nuw nsw i32 %10, 20
%12 = tail call i32 @moveTo(i32 20, i32 %11)
%13 = tail call i32 @lineTo(i32 340, i32 %11)
%14 = add nuw nsw i32 %3, 1
%15 = icmp eq i32 %14, 21
br i1 %15, label %16, label %2
16: ; preds = %9, %16
%17 = phi i32 [ %26, %16 ], [ 0, %9 ]
%18 = and i32 %17, 7
%19 = icmp eq i32 %18, 0
%20 = select i1 %19, i32 33488896, i32 138428480
%21 = tail call i32 @SetColor(i32 %20)
%22 = mul nuw nsw i32 %17, 10
%23 = add nuw nsw i32 %22, 20
%24 = tail call i32 @moveTo(i32 %23, i32 20)
%25 = tail call i32 @lineTo(i32 %23, i32 220)
%26 = add nuw nsw i32 %17, 1
%27 = icmp eq i32 %26, 33
br i1 %27, label %28, label %16
28: ; preds = %16
%29 = tail call i32 @SetColor(i32 117440512)
%30 = tail call i32 @moveTo(i32 20, i32 240)
ret i32 1
}