#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 fun_stub_base_9_stub(short, int, short);
int /*<<< orphan*/ printf(char *, int, ...);
int fun_stub_base_9_call(short a, int b, short c) {
  printf("fun_stub_base_9_call:a = %d, b = %d, c = %d\n", a, b, c);
  int x = fun_stub_base_9_stub(a, b, c);
  printf("fun_stub_base_9_stub return %d\n", x);
  return x;
}


x86 assembly (clang, -O0):
<fun_stub_base_9_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movswl -0x2(%rbp),%esi
mov    -0x8(%rbp),%edx
movswl -0xa(%rbp),%ecx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2(%rbp),%ax
mov    -0x8(%rbp),%esi
movswl %ax,%edi
movswl -0xa(%rbp),%edx
call   1040 <fun_stub_base_9_stub@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_9_call>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xece(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <fun_stub_base_9_stub@plt>
mov    %eax,%ebx
lea    0xed8(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [45 x i8] c"fun_stub_base_9_call:a = %d, b = %d, c = %d\0A\00"
@.str.1 = [32 x i8] c"fun_stub_base_9_stub return %d\0A\00"
define i32 @fun_stub_base_9_call(i16 signext %0, i32 %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i32
%6 = alloca i16
%7 = alloca i32
store i16 %0, i16* %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%8 = load i16, i16* %4
%9 = sext i16 %8 to i32
%10 = load i32, i32* %5
%11 = load i16, i16* %6
%12 = sext i16 %11 to i32
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %12)
%14 = load i16, i16* %4
%15 = load i32, i32* %5
%16 = load i16, i16* %6
%17 = call i32 @fun_stub_base_9_stub(i16 signext %14, i32 %15, i16 signext %16)
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
@.str = [45 x i8] c"fun_stub_base_9_call:a = %d, b = %d, c = %d\0A\00"
@.str.1 = [32 x i8] c"fun_stub_base_9_stub return %d\0A\00"
define i32 @fun_stub_base_9_call(i16 signext %0, i32 %1, i16 signext %2) {
%4 = sext i16 %0 to i32
%5 = sext i16 %2 to i32
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %1, i32 %5)
%7 = tail call i32 @fun_stub_base_9_stub(i16 signext %0, i32 %1, i16 signext %2)
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 %7
}