#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 AnimationList {
  int dummy;
};

/* Variables and functions */
void *FindAnimation(char *, struct AnimationList *);
int /*<<< orphan*/ _GetScale(void *, double, double *);
int GetScale(struct AnimationList *al, char *name, double time,
             double Sout[3]) {
  void *a = FindAnimation(name, al);
  if (a) {
    _GetScale(a, time, Sout);
    return 1;
  }
  Sout[0] = Sout[1] = Sout[2] = 1.0;
  return 0;
}


x86 assembly (clang, -O0):
<GetScale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <FindAnimation@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1173 <GetScale+0x53>
mov    -0x30(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
mov    -0x28(%rbp),%rsi
call   1040 <_GetScale@plt>
movl   $0x1,-0x4(%rbp)
jmp    11ac <GetScale+0x8c>
mov    -0x28(%rbp),%rax
movsd  0xe81(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x28(%rbp),%rax
movsd  0xe70(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x28(%rbp),%rax
movsd  0xe5f(%rip),%xmm0
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetScale>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <FindAnimation@plt>
test   %rax,%rax
je     1159 <GetScale+0x39>
mov    %rax,%rdi
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rsi
call   1040 <_GetScale@plt>
mov    $0x1,%eax
jmp    1173 <GetScale+0x53>
movabs $0x3ff0000000000000,%rax
mov    %rax,0x10(%rbx)
movaps 0xe92(%rip),%xmm0
movups %xmm0,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.AnimationList = type { i32 }
define i32 @GetScale(%struct.AnimationList* %0, i8* %1, double %2, double* %3) {
%5 = alloca i32
%6 = alloca %struct.AnimationList*
%7 = alloca i8*
%8 = alloca double
%9 = alloca double*
%10 = alloca i8*
store %struct.AnimationList* %0, %struct.AnimationList** %6
store i8* %1, i8** %7
store double %2, double* %8
store double* %3, double** %9
%11 = load i8*, i8** %7
%12 = load %struct.AnimationList*, %struct.AnimationList** %6
%13 = call i8* @FindAnimation(i8* %11, %struct.AnimationList* %12)
store i8* %13, i8** %10
%14 = load i8*, i8** %10
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %21
16: ; preds = %4
%17 = load i8*, i8** %10
%18 = load double, double* %8
%19 = load double*, double** %9
%20 = call i32 @_GetScale(i8* %17, double %18, double* %19)
store i32 1, i32* %5
br label %28
21: ; preds = %4
%22 = load double*, double** %9
%23 = getelementptr inbounds double, double* %22, i64 2
store double 1.000000e+00, double* %23
%24 = load double*, double** %9
%25 = getelementptr inbounds double, double* %24, i64 1
store double 1.000000e+00, double* %25
%26 = load double*, double** %9
%27 = getelementptr inbounds double, double* %26, i64 0
store double 1.000000e+00, double* %27
store i32 0, i32* %5
br label %28
28: ; preds = %21, %16
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
%struct.AnimationList = type { i32 }
define i32 @GetScale(%struct.AnimationList* %0, i8* %1, double %2, double* %3) {
%5 = tail call i8* @FindAnimation(i8* %1, %struct.AnimationList* %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @_GetScale(i8* %5, double %2, double* %3)
br label %12
9: ; preds = %4
%10 = getelementptr inbounds double, double* %3, i64 2
store double 1.000000e+00, double* %10
%11 = bitcast double* %3 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %11
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ 1, %7 ], [ 0, %9 ]
ret i32 %13
}