#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__xformSetScale(float *, float, float);
int nsvg__parseScale(float *xform, const char *str) {
  float args[2];
  int na = 0;
  float t[6];
  int len = nsvg__parseTransformArgs(str, args, 2, &na);
  if (na == 1)
    args[1] = args[0];
  nsvg__xformSetScale(t, args[0], args[1]);
  memcpy(xform, t, sizeof(float) * 6);
  return len;
}


x86 assembly (clang, -O0):
<nsvg__parseScale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x2,%edx
lea    -0x1c(%rbp),%rcx
call   1050 <nsvg__parseTransformArgs@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    1174 <nsvg__parseScale+0x44>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <nsvg__xformSetScale@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x18,%edx
call   1040 <memcpy@plt>
mov    -0x44(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__parseScale>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%rax
mov    %rdi,%r14
movl   $0x0,0x4(%rsp)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rcx
mov    %rax,%rdi
mov    $0x2,%edx
call   1050 <nsvg__parseTransformArgs@plt>
mov    %eax,%ebp
cmpl   $0x1,0x4(%rsp)
movss  0x8(%rsp),%xmm0
jne    1177 <nsvg__parseScale+0x47>
movss  %xmm0,0xc(%rsp)
movaps %xmm0,%xmm1
jmp    117d <nsvg__parseScale+0x4d>
movss  0xc(%rsp),%xmm1
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <nsvg__xformSetScale@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x18,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nsvg__parseScale(float* %0, i8* %1) {
%3 = alloca float*
%4 = alloca i8*
%5 = alloca [2 x float]
%6 = alloca i32
%7 = alloca [6 x float]
%8 = alloca i32
store float* %0, float** %3
store i8* %1, i8** %4
store i32 0, i32* %6
%9 = load i8*, i8** %4
%10 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
%11 = call i32 @nsvg__parseTransformArgs(i8* %9, float* %10, i32 2, i32* %6)
store i32 %11, i32* %8
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
%16 = load float, float* %15
%17 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 1
store float %16, float* %17
br label %18
18: ; preds = %14, %2
%19 = getelementptr inbounds [6 x float], [6 x float]* %7, i64 0, i64 0
%20 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
%21 = load float, float* %20
%22 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 1
%23 = load float, float* %22
%24 = call i32 @nsvg__xformSetScale(float* %19, float %21, float %23)
%25 = load float*, float** %3
%26 = getelementptr inbounds [6 x float], [6 x float]* %7, i64 0, i64 0
%27 = call i32 @memcpy(float* %25, float* %26, i32 24)
%28 = load i32, i32* %8
ret i32 %28
}

LLVM IR (-O2):
define i32 @nsvg__parseScale(float* %0, i8* %1) {
%3 = alloca [2 x float]
%4 = alloca i32
%5 = alloca [6 x float]
%6 = bitcast [2 x float]* %3 to i8*
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = bitcast [6 x float]* %5 to i8*
%9 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
%10 = call i32 @nsvg__parseTransformArgs(i8* %1, float* %9, i32 2, i32* %4)
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 1
%13 = load float, float* %9
%14 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 1
br i1 %12, label %17, label %15
15: ; preds = %2
%16 = load float, float* %14
br label %18
17: ; preds = %2
store float %13, float* %14
br label %18
18: ; preds = %15, %17
%19 = phi float [ %16, %15 ], [ %13, %17 ]
%20 = getelementptr inbounds [6 x float], [6 x float]* %5, i64 0, i64 0
%21 = call i32 @nsvg__xformSetScale(float* %20, float %13, float %19)
%22 = call i32 @memcpy(float* %0, float* %20, i32 24)
ret i32 %10
}