#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*/ memcpy(float *, float *, int);
int nsvg__parseTransformArgs(char const *, float *, int, int *);
int /*<<< orphan*/ nsvg__xformIdentity(float *);
int /*<<< orphan*/ nsvg__xformMultiply(float *, float *);
int /*<<< orphan*/ nsvg__xformSetRotation(float *, float);
int /*<<< orphan*/ nsvg__xformSetTranslation(float *, float, float);
int nsvg__parseRotate(float *xform, const char *str) {
  float args[3];
  int na = 0;
  float m[6];
  float t[6];
  int len = nsvg__parseTransformArgs(str, args, 3, &na);
  if (na == 1)
    args[1] = args[2] = 0.0f;
  nsvg__xformIdentity(m);
  if (na > 1) {
    nsvg__xformSetTranslation(t, -args[1], -args[2]);
    nsvg__xformMultiply(m, t);
  }
  nsvg__xformSetRotation(t,
                         args[0] / 180.0f * (3.14159265358979323846264338327f));
  nsvg__xformMultiply(m, t);
  if (na > 1) {
    nsvg__xformSetTranslation(t, args[1], args[2]);
    nsvg__xformMultiply(m, t);
  }
  memcpy(xform, m, sizeof(float) * 6);
  return len;
}


x86 assembly (clang, -O0):
<nsvg__parseRotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x3,%edx
lea    -0x20(%rbp),%rcx
call   1070 <nsvg__parseTransformArgs@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    11aa <nsvg__parseRotate+0x4a>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
call   1080 <nsvg__xformIdentity@plt>
cmpl   $0x1,-0x20(%rbp)
jle    11f7 <nsvg__parseRotate+0x97>
lea    -0x60(%rbp),%rdi
movss  -0x18(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x14(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
call   1060 <nsvg__xformSetTranslation@plt>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1050 <nsvg__xformMultiply@plt>
lea    -0x60(%rbp),%rdi
movss  -0x1c(%rbp),%xmm0
movss  0xdfc(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xdec(%rip),%xmm1
mulss  %xmm1,%xmm0
call   1030 <nsvg__xformSetRotation@plt>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1050 <nsvg__xformMultiply@plt>
cmpl   $0x1,-0x20(%rbp)
jle    1254 <nsvg__parseRotate+0xf4>
lea    -0x60(%rbp),%rdi
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1060 <nsvg__xformSetTranslation@plt>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1050 <nsvg__xformMultiply@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x18,%edx
call   1040 <memcpy@plt>
mov    -0x64(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__parseRotate>:
push   %rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%rax
mov    %rdi,%r14
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rcx
mov    %rax,%rdi
mov    $0x3,%edx
call   1070 <nsvg__parseTransformArgs@plt>
mov    %eax,%ebp
cmpl   $0x1,(%rsp)
jne    119b <nsvg__parseRotate+0x3b>
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdi
call   1080 <nsvg__xformIdentity@plt>
cmpl   $0x2,(%rsp)
jl     11de <nsvg__parseRotate+0x7e>
movaps 0xe4e(%rip),%xmm2
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
xorps  %xmm2,%xmm0
xorps  %xmm2,%xmm1
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <nsvg__xformSetTranslation@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1050 <nsvg__xformMultiply@plt>
movss  0x4(%rsp),%xmm0
divss  0xe24(%rip),%xmm0
mulss  0xe20(%rip),%xmm0
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <nsvg__xformSetRotation@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1050 <nsvg__xformMultiply@plt>
cmpl   $0x2,(%rsp)
jl     123a <nsvg__parseRotate+0xda>
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <nsvg__xformSetTranslation@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1050 <nsvg__xformMultiply@plt>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
mov    $0x18,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nsvg__parseRotate(float* %0, i8* %1) {
%3 = alloca float*
%4 = alloca i8*
%5 = alloca [3 x float]
%6 = alloca i32
%7 = alloca [6 x float]
%8 = alloca [6 x float]
%9 = alloca i32
store float* %0, float** %3
store i8* %1, i8** %4
store i32 0, i32* %6
%10 = load i8*, i8** %4
%11 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%12 = call i32 @nsvg__parseTransformArgs(i8* %10, float* %11, i32 3, i32* %6)
store i32 %12, i32* %9
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 2
store float 0.000000e+00, float* %16
%17 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 1
store float 0.000000e+00, float* %17
br label %18
18: ; preds = %15, %2
%19 = getelementptr inbounds [6 x float], [6 x float]* %7, i64 0, i64 0
%20 = call i32 @nsvg__xformIdentity(float* %19)
%21 = load i32, i32* %6
%22 = icmp sgt i32 %21, 1
br i1 %22, label %23, label %35
23: ; preds = %18
%24 = getelementptr inbounds [6 x float], [6 x float]* %8, i64 0, i64 0
%25 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 1
%26 = load float, float* %25
%27 = fneg float %26
%28 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 2
%29 = load float, float* %28
%30 = fneg float %29
%31 = call i32 @nsvg__xformSetTranslation(float* %24, float %27, float %30)
%32 = getelementptr inbounds [6 x float], [6 x float]* %7, i64 0, i64 0
%33 = getelementptr inbounds [6 x float], [6 x float]* %8, i64 0, i64 0
%34 = call i32 @nsvg__xformMultiply(float* %32, float* %33)
br label %35
35: ; preds = %23, %18
%36 = getelementptr inbounds [6 x float], [6 x float]* %8, i64 0, i64 0
%37 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%38 = load float, float* %37
%39 = fdiv float %38, 1.800000e+02
%40 = fmul float %39, 0x400921FB60000000
%41 = call i32 @nsvg__xformSetRotation(float* %36, float %40)
%42 = getelementptr inbounds [6 x float], [6 x float]* %7, i64 0, i64 0
%43 = getelementptr inbounds [6 x float], [6 x float]* %8, i64 0, i64 0
%44 = call i32 @nsvg__xformMultiply(float* %42, float* %43)
%45 = load i32, i32* %6
%46 = icmp sgt i32 %45, 1
br i1 %46, label %47, label %57
47: ; preds = %35
%48 = getelementptr inbounds [6 x float], [6 x float]* %8, i64 0, i64 0
%49 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 1
%50 = load float, float* %49
%51 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 2
%52 = load float, float* %51
%53 = call i32 @nsvg__xformSetTranslation(float* %48, float %50, float %52)
%54 = getelementptr inbounds [6 x float], [6 x float]* %7, i64 0, i64 0
%55 = getelementptr inbounds [6 x float], [6 x float]* %8, i64 0, i64 0
%56 = call i32 @nsvg__xformMultiply(float* %54, float* %55)
br label %57
57: ; preds = %47, %35
%58 = load float*, float** %3
%59 = getelementptr inbounds [6 x float], [6 x float]* %7, i64 0, i64 0
%60 = call i32 @memcpy(float* %58, float* %59, i32 24)
%61 = load i32, i32* %9
ret i32 %61
}

LLVM IR (-O2):
define i32 @nsvg__parseRotate(float* %0, i8* %1) {
%3 = alloca [3 x float]
%4 = alloca i32
%5 = alloca [6 x float]
%6 = alloca [6 x float]
%7 = bitcast [3 x float]* %3 to i8*
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = bitcast [6 x float]* %5 to i8*
%10 = bitcast [6 x float]* %6 to i8*
%11 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%12 = call i32 @nsvg__parseTransformArgs(i8* %1, float* %11, i32 3, i32* %4)
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
store float 0.000000e+00, float* %16
%17 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
store float 0.000000e+00, float* %17
br label %18
18: ; preds = %15, %2
%19 = getelementptr inbounds [6 x float], [6 x float]* %5, i64 0, i64 0
%20 = call i32 @nsvg__xformIdentity(float* %19)
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 1
br i1 %22, label %23, label %33
23: ; preds = %18
%24 = getelementptr inbounds [6 x float], [6 x float]* %6, i64 0, i64 0
%25 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
%26 = load float, float* %25
%27 = fneg float %26
%28 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
%29 = load float, float* %28
%30 = fneg float %29
%31 = call i32 @nsvg__xformSetTranslation(float* %24, float %27, float %30)
%32 = call i32 @nsvg__xformMultiply(float* %19, float* %24)
br label %33
33: ; preds = %23, %18
%34 = getelementptr inbounds [6 x float], [6 x float]* %6, i64 0, i64 0
%35 = load float, float* %11
%36 = fdiv float %35, 1.800000e+02
%37 = fmul float %36, 0x400921FB60000000
%38 = call i32 @nsvg__xformSetRotation(float* %34, float %37)
%39 = call i32 @nsvg__xformMultiply(float* %19, float* %34)
%40 = load i32, i32* %4
%41 = icmp sgt i32 %40, 1
br i1 %41, label %42, label %49
42: ; preds = %33
%43 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
%44 = load float, float* %43
%45 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
%46 = load float, float* %45
%47 = call i32 @nsvg__xformSetTranslation(float* %34, float %44, float %46)
%48 = call i32 @nsvg__xformMultiply(float* %19, float* %34)
br label %49
49: ; preds = %42, %33
%50 = call i32 @memcpy(float* %0, float* %19, i32 24)
ret i32 %12
}