#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*/ dd_draw_circle(char, char, char, int /*<<< orphan*/);
int /*<<< orphan*/ dd_setcolor(unsigned int);
int /*<<< orphan*/ update_dial(char, char, char, char *, char *, unsigned int,
                               int);
void init_dial(char *old_x, char *old_y, char cx, char cy, char radius,
               unsigned dialcolor, unsigned handcolor, int degrees) {
  if (!old_x || !old_y)
    return;
  dd_setcolor(dialcolor);
  if (radius >= 16) {
    dd_draw_circle(cx, cy, radius + 4, 0);
    dd_draw_circle(cx, cy, radius + 3, 0);
  } else {
    dd_draw_circle(cx, cy, radius + 3, 0);
  }
  *old_x = cx;
  *old_y = cy;
  update_dial(cx, cy, radius, old_x, old_y, handcolor, degrees);
}


x86 assembly (clang, -O0):
<init_dial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    0x18(%rbp),%r8d
mov    0x10(%rbp),%r8d
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %dl,-0x11(%rbp)
mov    %cl,-0x12(%rbp)
mov    %al,-0x13(%rbp)
mov    %r9d,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116e <init_dial+0x3e>
cmpq   $0x0,-0x10(%rbp)
jne    1173 <init_dial+0x43>
jmp    1229 <init_dial+0xf9>
mov    -0x18(%rbp),%edi
call   1050 <dd_setcolor@plt>
movsbl -0x13(%rbp),%eax
cmp    $0x10,%eax
jl     11cb <init_dial+0x9b>
mov    -0x11(%rbp),%sil
mov    -0x12(%rbp),%dl
movsbl -0x13(%rbp),%eax
add    $0x4,%eax
xor    %ecx,%ecx
movsbl %sil,%edi
movsbl %dl,%esi
movsbl %al,%edx
call   1040 <dd_draw_circle@plt>
mov    -0x11(%rbp),%sil
mov    -0x12(%rbp),%dl
movsbl -0x13(%rbp),%eax
add    $0x3,%eax
xor    %ecx,%ecx
movsbl %sil,%edi
movsbl %dl,%esi
movsbl %al,%edx
call   1040 <dd_draw_circle@plt>
jmp    11ea <init_dial+0xba>
mov    -0x11(%rbp),%sil
mov    -0x12(%rbp),%dl
movsbl -0x13(%rbp),%eax
add    $0x3,%eax
xor    %ecx,%ecx
movsbl %sil,%edi
movsbl %dl,%esi
movsbl %al,%edx
call   1040 <dd_draw_circle@plt>
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x12(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%dil
mov    -0x12(%rbp),%sil
mov    -0x13(%rbp),%dl
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    0x10(%rbp),%r9d
mov    0x18(%rbp),%eax
movsbl %dil,%edi
movsbl %sil,%esi
movsbl %dl,%edx
mov    %eax,(%rsp)
call   1030 <update_dial@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_dial>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     11b7 <init_dial+0x87>
mov    %rsi,%r14
test   %rsi,%rsi
je     11b7 <init_dial+0x87>
mov    %r8d,%r15d
mov    %ecx,%r13d
mov    %edx,%ebp
mov    %rdi,%rbx
mov    0x48(%rsp),%r12d
mov    %r9d,%edi
call   1050 <dd_setcolor@plt>
movsbl %bpl,%ebp
movsbl %r13b,%r13d
cmp    $0x10,%r15b
jl     1181 <init_dial+0x51>
lea    0x4(%r15),%eax
movsbl %al,%edx
mov    %ebp,%edi
mov    %r13d,%esi
xor    %ecx,%ecx
call   1040 <dd_draw_circle@plt>
lea    0x3(%r15),%eax
movsbl %al,%edx
mov    %ebp,%edi
mov    %r13d,%esi
xor    %ecx,%ecx
call   1040 <dd_draw_circle@plt>
mov    %bpl,(%rbx)
mov    %r13b,(%r14)
mov    %r12d,(%rsp)
movsbl %r15b,%edx
mov    %ebp,%edi
mov    %r13d,%esi
mov    %rbx,%rcx
mov    %r14,%r8
mov    0x40(%rsp),%r9d
call   1030 <update_dial@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @init_dial(i8* %0, i8* %1, i8 signext %2, i8 signext %3, i8 signext %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8 %2, i8* %11
store i8 %3, i8* %12
store i8 %4, i8* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i8*, i8** %9
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %8
%20 = load i8*, i8** %10
%21 = icmp ne i8* %20, null
br i1 %21, label %23, label %22
22: ; preds = %19, %8
br label %65
23: ; preds = %19
%24 = load i32, i32* %14
%25 = call i32 @dd_setcolor(i32 %24)
%26 = load i8, i8* %13
%27 = sext i8 %26 to i32
%28 = icmp sge i32 %27, 16
br i1 %28, label %29, label %44
29: ; preds = %23
%30 = load i8, i8* %11
%31 = load i8, i8* %12
%32 = load i8, i8* %13
%33 = sext i8 %32 to i32
%34 = add nsw i32 %33, 4
%35 = trunc i32 %34 to i8
%36 = call i32 @dd_draw_circle(i8 signext %30, i8 signext %31, i8 signext %35, i32 0)
%37 = load i8, i8* %11
%38 = load i8, i8* %12
%39 = load i8, i8* %13
%40 = sext i8 %39 to i32
%41 = add nsw i32 %40, 3
%42 = trunc i32 %41 to i8
%43 = call i32 @dd_draw_circle(i8 signext %37, i8 signext %38, i8 signext %42, i32 0)
br label %52
44: ; preds = %23
%45 = load i8, i8* %11
%46 = load i8, i8* %12
%47 = load i8, i8* %13
%48 = sext i8 %47 to i32
%49 = add nsw i32 %48, 3
%50 = trunc i32 %49 to i8
%51 = call i32 @dd_draw_circle(i8 signext %45, i8 signext %46, i8 signext %50, i32 0)
br label %52
52: ; preds = %44, %29
%53 = load i8, i8* %11
%54 = load i8*, i8** %9
store i8 %53, i8* %54
%55 = load i8, i8* %12
%56 = load i8*, i8** %10
store i8 %55, i8* %56
%57 = load i8, i8* %11
%58 = load i8, i8* %12
%59 = load i8, i8* %13
%60 = load i8*, i8** %9
%61 = load i8*, i8** %10
%62 = load i32, i32* %15
%63 = load i32, i32* %16
%64 = call i32 @update_dial(i8 signext %57, i8 signext %58, i8 signext %59, i8* %60, i8* %61, i32 %62, i32 %63)
br label %65
65: ; preds = %52, %22
ret void
}

LLVM IR (-O2):
define void @init_dial(i8* %0, i8* %1, i8 signext %2, i8 signext %3, i8 signext %4, i32 %5, i32 %6, i32 %7) {
%9 = icmp ne i8* %0, null
%10 = icmp ne i8* %1, null
%11 = and i1 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = tail call i32 @dd_setcolor(i32 %5)
%14 = icmp sgt i8 %4, 15
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = add nuw i8 %4, 4
%17 = tail call i32 @dd_draw_circle(i8 signext %2, i8 signext %3, i8 signext %16, i32 0)
br label %18
18: ; preds = %12, %15
%19 = add i8 %4, 3
%20 = tail call i32 @dd_draw_circle(i8 signext %2, i8 signext %3, i8 signext %19, i32 0)
store i8 %2, i8* %0
store i8 %3, i8* %1
%21 = tail call i32 @update_dial(i8 signext %2, i8 signext %3, i8 signext %4, i8* %0, i8* %1, i32 %6, i32 %7)
br label %22
22: ; preds = %8, %18
ret void
}