#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 */
scalar_t__ calloc(int, scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *getOutPutFileName(char *inputf) {
  char *s, *c;
  s = (char *)calloc(sizeof(char), (strlen(inputf) + 3));
  strcpy(s, inputf);
  for (c = s; *c; c++)
    ;
  *c = '.';
  c++;
  *c = 's';
  c++;
  *c = '\0';
  c++;
  return s;
}


x86 assembly (clang, -O0):
<getOutPutFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
add    $0x3,%rsi
mov    $0x1,%edi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1192 <getOutPutFileName+0x62>
jmp    1181 <getOutPutFileName+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    116f <getOutPutFileName+0x3f>
mov    -0x18(%rbp),%rax
movb   $0x2e,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x73,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getOutPutFileName>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x3(%rax),%rsi
mov    $0x1,%edi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1160 <getOutPutFileName+0x30>
movw   $0x732e,-0x1(%rax)
movb   $0x0,0x1(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @getOutPutFileName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 3
%8 = call i64 @calloc(i32 1, i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
store i8* %13, i8** %4
br label %14
14: ; preds = %19, %1
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %14
br label %19
19: ; preds = %18
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %4
br label %14
22: ; preds = %14
%23 = load i8*, i8** %4
store i8 46, i8* %23
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
%26 = load i8*, i8** %4
store i8 115, i8* %26
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %4
%29 = load i8*, i8** %4
store i8 0, i8* %29
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %4
%32 = load i8*, i8** %3
ret i8* %32
}

LLVM IR (-O2):
define i8* @getOutPutFileName(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 3
%4 = tail call i64 @calloc(i32 1, i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %7
7: ; preds = %7, %1
%8 = phi i8* [ %5, %1 ], [ %11, %7 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = getelementptr inbounds i8, i8* %8, i64 1
br i1 %10, label %12, label %7
12: ; preds = %7
store i8 46, i8* %8
store i8 115, i8* %11
%13 = getelementptr inbounds i8, i8* %8, i64 2
store i8 0, i8* %13
ret i8* %5
}