#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*/ Widget;
typedef int /*<<< orphan*/ Boolean;

/* Variables and functions */
int /*<<< orphan*/ False;
int /*<<< orphan*/ ShapeEllipseOrRoundedRectangle(int /*<<< orphan*/, int, int,
                                                  int);
int /*<<< orphan*/ ShapeError(int /*<<< orphan*/);
int /*<<< orphan*/ ShapeOval(int /*<<< orphan*/);
int /*<<< orphan*/ ShapeRectangle(int /*<<< orphan*/);
int /*<<< orphan*/ True;
Boolean XmuReshapeWidget(Widget w, int shape_style, int corner_width,
                         int corner_height) {
  switch (shape_style) {
  case 1:
    ShapeRectangle(w);
    break;
  case 2:
    ShapeOval(w);
    break;
  case 3:
  case 4:
    ShapeEllipseOrRoundedRectangle(w, shape_style == 3, corner_width,
                                   corner_height);
    break;
  default:
    ShapeError(w);
    return (False);
  }
  return (True);
}


x86 assembly (clang, -O0):
<XmuReshapeWidget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     118d <XmuReshapeWidget+0x4d>
jmp    1168 <XmuReshapeWidget+0x28>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     119a <XmuReshapeWidget+0x5a>
jmp    1179 <XmuReshapeWidget+0x39>
mov    -0x18(%rbp),%eax
add    $0xfffffffd,%eax
sub    $0x2,%eax
jb     11a7 <XmuReshapeWidget+0x67>
jmp    11c6 <XmuReshapeWidget+0x86>
mov    -0x8(%rbp),%edi
call   1060 <ShapeRectangle@plt>
jmp    11df <XmuReshapeWidget+0x9f>
mov    -0x8(%rbp),%edi
call   1050 <ShapeOval@plt>
jmp    11df <XmuReshapeWidget+0x9f>
mov    -0x8(%rbp),%edi
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <ShapeEllipseOrRoundedRectangle@plt>
jmp    11df <XmuReshapeWidget+0x9f>
mov    -0x8(%rbp),%edi
call   1030 <ShapeError@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11eb <XmuReshapeWidget+0xab>
mov    0x2dfa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XmuReshapeWidget>:
push   %rax
lea    -0x3(%rsi),%eax
cmp    $0x2,%eax
jb     1161 <XmuReshapeWidget+0x21>
cmp    $0x2,%esi
je     1179 <XmuReshapeWidget+0x39>
cmp    $0x1,%esi
jne    1187 <XmuReshapeWidget+0x47>
call   1060 <ShapeRectangle@plt>
mov    0x2e81(%rip),%rax
jmp    1193 <XmuReshapeWidget+0x53>
xor    %eax,%eax
cmp    $0x3,%esi
sete   %al
mov    %eax,%esi
call   1040 <ShapeEllipseOrRoundedRectangle@plt>
mov    0x2e69(%rip),%rax
jmp    1193 <XmuReshapeWidget+0x53>
call   1050 <ShapeOval@plt>
mov    0x2e5b(%rip),%rax
jmp    1193 <XmuReshapeWidget+0x53>
call   1030 <ShapeError@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@False = global i32 0
@True = global i32 0
define i32 @XmuReshapeWidget(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %7
switch i32 %10, label %25 [
i32 1, label %11
i32 2, label %14
i32 3, label %17
i32 4, label %17
]
11: ; preds = %4
%12 = load i32, i32* %6
%13 = call i32 @ShapeRectangle(i32 %12)
br label %29
14: ; preds = %4
%15 = load i32, i32* %6
%16 = call i32 @ShapeOval(i32 %15)
br label %29
17: ; preds = %4, %4
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = icmp eq i32 %19, 3
%21 = zext i1 %20 to i32
%22 = load i32, i32* %8
%23 = load i32, i32* %9
%24 = call i32 @ShapeEllipseOrRoundedRectangle(i32 %18, i32 %21, i32 %22, i32 %23)
br label %29
25: ; preds = %4
%26 = load i32, i32* %6
%27 = call i32 @ShapeError(i32 %26)
%28 = load i32, i32* @False
store i32 %28, i32* %5
br label %31
29: ; preds = %17, %14, %11
%30 = load i32, i32* @True
store i32 %30, i32* %5
br label %31
31: ; preds = %29, %25
%32 = load i32, i32* %5
ret i32 %32
}

LLVM IR (-O2):
@False = global i32 0
@True = global i32 0
define i32 @XmuReshapeWidget(i32 %0, i32 %1, i32 %2, i32 %3) {
switch i32 %1, label %13 [
i32 1, label %5
i32 2, label %7
i32 3, label %9
i32 4, label %9
]
5: ; preds = %4
%6 = tail call i32 @ShapeRectangle(i32 %0)
br label %15
7: ; preds = %4
%8 = tail call i32 @ShapeOval(i32 %0)
br label %15
9: ; preds = %4, %4
%10 = icmp eq i32 %1, 3
%11 = zext i1 %10 to i32
%12 = tail call i32 @ShapeEllipseOrRoundedRectangle(i32 %0, i32 %11, i32 %2, i32 %3)
br label %15
13: ; preds = %4
%14 = tail call i32 @ShapeError(i32 %0)
br label %15
15: ; preds = %5, %7, %9, %13
%16 = phi i32* [ @False, %13 ], [ @True, %9 ], [ @True, %7 ], [ @True, %5 ]
%17 = load i32, i32* %16
ret i32 %17
}