#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 */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
unsigned int strlen(char *);
int16_t WebRtcG722_Version(char *versionStr, short len) {
  char version[30] = "2.0.0\n";
  if (strlen(version) < (unsigned int)len) {
    strcpy(versionStr, version);
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<WebRtcG722_Version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %rdi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xeb8(%rip),%ax
mov    %ax,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
movswl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jae    1196 <WebRtcG722_Version+0x76>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
jmp    119d <WebRtcG722_Version+0x7d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WebRtcG722_Version>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
movups 0xedc(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xec2(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ebp,%ecx
jae    1162 <WebRtcG722_Version+0x42>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.WebRtcG722_Version.version = [30 x i8] c"2.0.0\0A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @WebRtcG722_Version(i8* %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i16
%6 = alloca [30 x i8]
store i8* %0, i8** %4
store i16 %1, i16* %5
%7 = bitcast [30 x i8]* %6 to i8*
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = load i16, i16* %5
%11 = sext i16 %10 to i32
%12 = icmp ult i32 %9, %11
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%16 = call i32 @strcpy(i8* %14, i8* %15)
store i32 0, i32* %3
br label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %18
18: ; preds = %17, %13
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@__const.WebRtcG722_Version.version = [30 x i8] c"2.0.0\0A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @WebRtcG722_Version(i8* %0, i16 signext %1) {
%3 = alloca [30 x i8]
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = sext i16 %1 to i32
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @strcpy(i8* %0, i8* %4)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ 0, %8 ], [ -1, %2 ]
ret i32 %11
}