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


x86 assembly (clang, -O0):
<nsvg__parseTranslate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x2,%edx
lea    -0x34(%rbp),%rcx
call   1050 <nsvg__parseTransformArgs@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x34(%rbp)
jne    1172 <nsvg__parseTranslate+0x42>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1040 <nsvg__xformSetTranslation@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x18,%edx
call   1030 <memcpy@plt>
mov    -0x38(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__parseTranslate>:
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)
jne    1173 <nsvg__parseTranslate+0x43>
movl   $0x0,0xc(%rsp)
xorps  %xmm1,%xmm1
jmp    1179 <nsvg__parseTranslate+0x49>
movss  0xc(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <nsvg__xformSetTranslation@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x18,%edx
call   1030 <memcpy@plt>
mov    %ebp,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nsvg__parseTranslate(float* %0, i8* %1) {
%3 = alloca float*
%4 = alloca i8*
%5 = alloca [2 x float]
%6 = alloca [6 x float]
%7 = alloca i32
%8 = alloca i32
store float* %0, float** %3
store i8* %1, i8** %4
store i32 0, i32* %7
%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* %7)
store i32 %11, i32* %8
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 1
store float 0.000000e+00, float* %15
br label %16
16: ; preds = %14, %2
%17 = getelementptr inbounds [6 x float], [6 x float]* %6, i64 0, i64 0
%18 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
%19 = load float, float* %18
%20 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 1
%21 = load float, float* %20
%22 = call i32 @nsvg__xformSetTranslation(float* %17, float %19, float %21)
%23 = load float*, float** %3
%24 = getelementptr inbounds [6 x float], [6 x float]* %6, i64 0, i64 0
%25 = call i32 @memcpy(float* %23, float* %24, i32 24)
%26 = load i32, i32* %8
ret i32 %26
}

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