#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 */
typedef int /*<<< orphan*/ GC;
typedef int /*<<< orphan*/ Drawable;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int XDrawArc(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/, int,
             int, unsigned int, unsigned int, int, int);
int /*<<< orphan*/ assert(int);
int DrawCenteredArc(Display *display, Drawable d, GC gc, int x, int y,
                    unsigned int width, unsigned int height, int angle1,
                    int angle2) {
  assert(width > 0);
  assert(height > 0);
  int actual_x = x - (int)width;
  int actual_y = y - (int)height;
  unsigned int actual_width = 2 * width;
  unsigned int actual_height = 2 * height;
  return XDrawArc(display, d, gc, actual_x, actual_y, actual_width,
                  actual_height, angle1, angle2);
}


x86 assembly (clang, -O0):
<DrawCenteredArc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x0,0x10(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x14(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
sub    0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    -0x2c(%rbp),%r11d
mov    0x18(%rbp),%r10d
mov    0x20(%rbp),%eax
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <XDrawArc@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawCenteredArc>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%ebx
mov    %r8d,%r14d
mov    %ecx,%ebp
mov    %edx,0x4(%rsp)
mov    %esi,%r12d
mov    %rdi,%r13
mov    0x40(%rsp),%r15d
xor    %edi,%edi
test   %r9d,%r9d
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   %r15d,%r15d
setne  %dil
call   1040 <assert@plt>
sub    %ebx,%ebp
sub    %r15d,%r14d
add    %ebx,%ebx
add    %r15d,%r15d
sub    $0x8,%rsp
mov    %r13,%rdi
mov    %r12d,%esi
mov    0xc(%rsp),%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
mov    %ebx,%r9d
mov    0x58(%rsp),%eax
push   %rax
mov    0x58(%rsp),%eax
push   %rax
push   %r15
call   1030 <XDrawArc@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @DrawCenteredArc(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32* %0, i32** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%23 = load i32, i32* %15
%24 = icmp ugt i32 %23, 0
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = load i32, i32* %16
%28 = icmp ugt i32 %27, 0
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = load i32, i32* %13
%32 = load i32, i32* %15
%33 = sub nsw i32 %31, %32
store i32 %33, i32* %19
%34 = load i32, i32* %14
%35 = load i32, i32* %16
%36 = sub nsw i32 %34, %35
store i32 %36, i32* %20
%37 = load i32, i32* %15
%38 = mul i32 2, %37
store i32 %38, i32* %21
%39 = load i32, i32* %16
%40 = mul i32 2, %39
store i32 %40, i32* %22
%41 = load i32*, i32** %10
%42 = load i32, i32* %11
%43 = load i32, i32* %12
%44 = load i32, i32* %19
%45 = load i32, i32* %20
%46 = load i32, i32* %21
%47 = load i32, i32* %22
%48 = load i32, i32* %17
%49 = load i32, i32* %18
%50 = call i32 @XDrawArc(i32* %41, i32 %42, i32 %43, i32 %44, i32 %45, i32 %46, i32 %47, i32 %48, i32 %49)
ret i32 %50
}

LLVM IR (-O2):
define i32 @DrawCenteredArc(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = icmp ne i32 %5, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = icmp ne i32 %6, 0
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = sub nsw i32 %3, %5
%17 = sub nsw i32 %4, %6
%18 = shl i32 %5, 1
%19 = shl i32 %6, 1
%20 = tail call i32 @XDrawArc(i32* %0, i32 %1, i32 %2, i32 %16, i32 %17, i32 %18, i32 %19, i32 %7, i32 %8)
ret i32 %20
}