#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 */
short TEN_satu8(short);
unsigned int _spacku4(int src1, int src2) {
  short lolo = src2;
  short lohi = src2 >> 16;
  short hilo = src1;
  short hihi = src1 >> 16;
  lolo = TEN_satu8(lolo);
  lohi = TEN_satu8(lohi);
  hilo = TEN_satu8(hilo);
  hihi = TEN_satu8(hihi);
  return (((unsigned int)hihi) << 24) | (((unsigned int)hilo) << 16) |
         (lohi << 8) | lolo;
}


x86 assembly (clang, -O0):
<_spacku4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
mov    %ax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %ax,-0xe(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %ax,-0x10(%rbp)
movswl -0xa(%rbp),%edi
call   1030 <TEN_satu8@plt>
mov    %ax,-0xa(%rbp)
movswl -0xc(%rbp),%edi
call   1030 <TEN_satu8@plt>
mov    %ax,-0xc(%rbp)
movswl -0xe(%rbp),%edi
call   1030 <TEN_satu8@plt>
mov    %ax,-0xe(%rbp)
movswl -0x10(%rbp),%edi
call   1030 <TEN_satu8@plt>
mov    %ax,-0x10(%rbp)
movswl -0x10(%rbp),%eax
shl    $0x18,%eax
movswl -0xe(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movswl -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movswl -0xa(%rbp),%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_spacku4>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
movswl %bp,%edi
call   1030 <TEN_satu8@plt>
mov    %eax,%r14d
sar    $0x10,%ebp
mov    %ebp,%edi
call   1030 <TEN_satu8@plt>
mov    %eax,%r15d
movswl %bx,%edi
call   1030 <TEN_satu8@plt>
mov    %eax,%ebp
sar    $0x10,%ebx
mov    %ebx,%edi
call   1030 <TEN_satu8@plt>
shl    $0x18,%eax
shl    $0x10,%ebp
movswl %r15w,%ecx
shl    $0x8,%ecx
movswl %r14w,%edx
or     %ebp,%edx
or     %ecx,%edx
or     %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_spacku4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i16
store i16 %10, i16* %5
%11 = load i32, i32* %4
%12 = ashr i32 %11, 16
%13 = trunc i32 %12 to i16
store i16 %13, i16* %6
%14 = load i32, i32* %3
%15 = trunc i32 %14 to i16
store i16 %15, i16* %7
%16 = load i32, i32* %3
%17 = ashr i32 %16, 16
%18 = trunc i32 %17 to i16
store i16 %18, i16* %8
%19 = load i16, i16* %5
%20 = call signext i16 @TEN_satu8(i16 signext %19)
store i16 %20, i16* %5
%21 = load i16, i16* %6
%22 = call signext i16 @TEN_satu8(i16 signext %21)
store i16 %22, i16* %6
%23 = load i16, i16* %7
%24 = call signext i16 @TEN_satu8(i16 signext %23)
store i16 %24, i16* %7
%25 = load i16, i16* %8
%26 = call signext i16 @TEN_satu8(i16 signext %25)
store i16 %26, i16* %8
%27 = load i16, i16* %8
%28 = sext i16 %27 to i32
%29 = shl i32 %28, 24
%30 = load i16, i16* %7
%31 = sext i16 %30 to i32
%32 = shl i32 %31, 16
%33 = or i32 %29, %32
%34 = load i16, i16* %6
%35 = sext i16 %34 to i32
%36 = shl i32 %35, 8
%37 = or i32 %33, %36
%38 = load i16, i16* %5
%39 = sext i16 %38 to i32
%40 = or i32 %37, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @_spacku4(i32 %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = lshr i32 %1, 16
%5 = trunc i32 %4 to i16
%6 = trunc i32 %0 to i16
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i16
%9 = tail call signext i16 @TEN_satu8(i16 signext %3)
%10 = tail call signext i16 @TEN_satu8(i16 signext %5)
%11 = tail call signext i16 @TEN_satu8(i16 signext %6)
%12 = tail call signext i16 @TEN_satu8(i16 signext %8)
%13 = zext i16 %12 to i32
%14 = shl i32 %13, 24
%15 = zext i16 %11 to i32
%16 = shl nuw i32 %15, 16
%17 = sext i16 %10 to i32
%18 = shl nsw i32 %17, 8
%19 = sext i16 %9 to i32
%20 = or i32 %18, %19
%21 = or i32 %20, %16
%22 = or i32 %21, %14
ret i32 %22
}