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


x86 assembly (clang, -O0):
<fun_stub_base_10_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
movswl -0x6(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x6(%rbp),%ax
mov    -0xc(%rbp),%edx
movswl %ax,%esi
call   1040 <fun_stub_base_10_stub@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec2(%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_10_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_10_stub@plt>
mov    %eax,%ebx
lea    0xed9(%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 = [46 x i8] c"fun_stub_base_10_call:a = %d, b = %d, c = %d\0A\00"
@.str.1 = [33 x i8] c"fun_stub_base_10_stub return %d\0A\00"
define i32 @fun_stub_base_10_call(i32 %0, i16 signext %1, i32 %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i16, i16* %5
%10 = sext i16 %9 to i32
%11 = load i32, i32* %6
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10, i32 %11)
%13 = load i32, i32* %4
%14 = load i16, i16* %5
%15 = load i32, i32* %6
%16 = call i32 @fun_stub_base_10_stub(i32 %13, i16 signext %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %7
ret i32 %19
}

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