#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 */
struct matrix23 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ matrix23Set(struct matrix23 *, int, int, int, int, int, int);
void matrix23Rotate(struct matrix23 *m, int width, int height, int angle) {
  switch (angle) {
  case 0:
    matrix23Set(m, 1, 0, 0, 0, 1, 0);
    break;
  case 90:
    matrix23Set(m, 0, 1, 0, -1, 0, width);
    break;
  case 180:
    matrix23Set(m, -1, 0, width, 0, -1, height);
    break;
  case 270:
    matrix23Set(m, 0, -1, height, 1, 0, 0);
    break;
  default:;
  }
}


x86 assembly (clang, -O0):
<matrix23Rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     116f <matrix23Rotate+0x5f>
jmp    1138 <matrix23Rotate+0x28>
mov    -0x18(%rbp),%eax
sub    $0x5a,%eax
je     1196 <matrix23Rotate+0x86>
jmp    1149 <matrix23Rotate+0x39>
mov    -0x18(%rbp),%eax
sub    $0xb4,%eax
je     11be <matrix23Rotate+0xae>
jmp    115c <matrix23Rotate+0x4c>
mov    -0x18(%rbp),%eax
sub    $0x10e,%eax
je     11e4 <matrix23Rotate+0xd4>
jmp    120d <matrix23Rotate+0xfd>
mov    -0x8(%rbp),%rdi
mov    $0x1,%r9d
xor    %r8d,%r8d
mov    %r9d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
movl   $0x0,(%rsp)
call   1030 <matrix23Set@plt>
jmp    1212 <matrix23Rotate+0x102>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
xor    %r9d,%r9d
mov    $0x1,%edx
mov    $0xffffffff,%r8d
mov    %r9d,%esi
mov    %r9d,%ecx
mov    %eax,(%rsp)
call   1030 <matrix23Set@plt>
jmp    1212 <matrix23Rotate+0x102>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
mov    $0xffffffff,%r9d
xor    %r8d,%r8d
mov    %r9d,%esi
mov    %r8d,%edx
mov    %eax,(%rsp)
call   1030 <matrix23Set@plt>
jmp    1212 <matrix23Rotate+0x102>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
xor    %r9d,%r9d
mov    $0xffffffff,%edx
mov    $0x1,%r8d
mov    %r9d,%esi
movl   $0x0,(%rsp)
call   1030 <matrix23Set@plt>
jmp    1212 <matrix23Rotate+0x102>
jmp    1212 <matrix23Rotate+0x102>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix23Rotate>:
push   %rax
mov    %esi,%r8d
cmp    $0xb3,%ecx
jg     113d <matrix23Rotate+0x2d>
test   %ecx,%ecx
je     116c <matrix23Rotate+0x5c>
cmp    $0x5a,%ecx
jne    116a <matrix23Rotate+0x5a>
mov    %r8d,(%rsp)
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
jmp    119d <matrix23Rotate+0x8d>
mov    %edx,%eax
cmp    $0xb4,%ecx
je     1187 <matrix23Rotate+0x77>
cmp    $0x10e,%ecx
jne    116a <matrix23Rotate+0x5a>
movl   $0x0,(%rsp)
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    %eax,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
jmp    119d <matrix23Rotate+0x8d>
pop    %rax
ret
movl   $0x0,(%rsp)
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
jmp    119d <matrix23Rotate+0x8d>
mov    %eax,(%rsp)
mov    $0xffffffff,%esi
xor    %edx,%edx
mov    %r8d,%ecx
xor    %r8d,%r8d
mov    $0xffffffff,%r9d
call   1030 <matrix23Set@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.matrix23 = type { i32 }
define void @matrix23Rotate(%struct.matrix23* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.matrix23*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.matrix23* %0, %struct.matrix23** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
switch i32 %9, label %26 [
i32 0, label %10
i32 90, label %13
i32 180, label %17
i32 270, label %22
]
10: ; preds = %4
%11 = load %struct.matrix23*, %struct.matrix23** %5
%12 = call i32 @matrix23Set(%struct.matrix23* %11, i32 1, i32 0, i32 0, i32 0, i32 1, i32 0)
br label %27
13: ; preds = %4
%14 = load %struct.matrix23*, %struct.matrix23** %5
%15 = load i32, i32* %6
%16 = call i32 @matrix23Set(%struct.matrix23* %14, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 %15)
br label %27
17: ; preds = %4
%18 = load %struct.matrix23*, %struct.matrix23** %5
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = call i32 @matrix23Set(%struct.matrix23* %18, i32 -1, i32 0, i32 %19, i32 0, i32 -1, i32 %20)
br label %27
22: ; preds = %4
%23 = load %struct.matrix23*, %struct.matrix23** %5
%24 = load i32, i32* %7
%25 = call i32 @matrix23Set(%struct.matrix23* %23, i32 0, i32 -1, i32 %24, i32 1, i32 0, i32 0)
br label %27
26: ; preds = %4
br label %27
27: ; preds = %26, %22, %17, %13, %10
ret void
}

LLVM IR (-O2):
%struct.matrix23 = type { i32 }
define void @matrix23Rotate(%struct.matrix23* %0, i32 %1, i32 %2, i32 %3) {
switch i32 %3, label %13 [
i32 0, label %5
i32 90, label %7
i32 180, label %9
i32 270, label %11
]
5: ; preds = %4
%6 = tail call i32 @matrix23Set(%struct.matrix23* %0, i32 1, i32 0, i32 0, i32 0, i32 1, i32 0)
br label %13
7: ; preds = %4
%8 = tail call i32 @matrix23Set(%struct.matrix23* %0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 %1)
br label %13
9: ; preds = %4
%10 = tail call i32 @matrix23Set(%struct.matrix23* %0, i32 -1, i32 0, i32 %1, i32 0, i32 -1, i32 %2)
br label %13
11: ; preds = %4
%12 = tail call i32 @matrix23Set(%struct.matrix23* %0, i32 0, i32 -1, i32 %2, i32 1, i32 0, i32 0)
br label %13
13: ; preds = %4, %11, %9, %7, %5
ret void
}