#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*/ printf(char *, ...);
int fn_ret_int(int i, double f, char c, char *s) {
  printf("entering funtion1\n");
  printf("%d\n", i);
  printf("%lf\n", f);
  printf("%c\n", c);
  printf("%s\n", s);
  printf("exiting function1\n");
  return i * i;
}


x86 assembly (clang, -O0):
<fn_ret_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xec2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsbl -0x11(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_ret_int>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %esi,%ebp
movsd  %xmm0,0x8(%rsp)
mov    %edi,%ebx
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
imul   %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"entering funtion1\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [5 x i8] c"%lf\0A\00"
@.str.3 = [4 x i8] c"%c\0A\00"
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [19 x i8] c"exiting function1\0A\00"
define i32 @fn_ret_int(i32 %0, double %1, i8 signext %2, i8* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i8
%8 = alloca i8*
store i32 %0, i32* %5
store double %1, double* %6
store i8 %2, i8* %7
store i8* %3, i8** %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load double, double* %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = load i8, i8* %7
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = load i8*, i8** %8
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%20 = load i32, i32* %5
%21 = load i32, i32* %5
%22 = mul nsw i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [5 x i8] c"%lf\0A\00"
@.str.3 = [4 x i8] c"%c\0A\00"
@str = [18 x i8] c"entering funtion1\00"
@str.6 = [18 x i8] c"exiting function1\00"
define i32 @fn_ret_int(i32 %0, double %1, i8 signext %2, i8* nocapture %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %1)
%8 = sext i8 %2 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = tail call i32 @puts(i8* dereferenceable(1) %3)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0))
%12 = mul nsw i32 %0, %0
ret i32 %12
}